NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/seawater/sw_pden.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1
2 function pden = sw_pden(S,T,P,PR)
3
4 % SW_PDEN    Potential density
5 %===========================================================================
6 % SW_PDEN  $Id: sw_pden.m,v 1.1 2003/12/12 04:23:22 pen078 Exp $
7 %          Copyright (C) CSIRO, Phil Morgan  1992.
8 %
9 % USAGE:  pden = sw_pden(S,T,P,PR)
10 %
11 % DESCRIPTION:
12 %    Calculates potential density of water mass relative to the specified
13 %    reference pressure by pden = sw_dens(S,ptmp,PR).
14 %
15 % INPUT:  (all must have same dimensions)
16 %   S  = salinity    [psu      (PSS-78) ]
17 %   T  = temperature [degree C (ITS-90)]
18 %   P  = pressure    [db]
19 %   PR = Reference pressure  [db]
20 %       (P may have dims 1x1, mx1, 1xn or mxn for S(mxn) )
21 %
22 % OUTPUT:
23 %   pden = Potential denisty relative to the ref. pressure [kg/m^3]
24 %
25 % AUTHOR:  Phil Morgan 1992/04/06, Lindsay Pender (Lindsay.Pender@csiro.au)
26 %
27 % DISCLAIMER:
28 %   This software is provided "as is" without warranty of any kind.
29 %   See the file sw_copy.m for conditions of use and licence.
30 %
31 % REFERENCES:
32 %   A.E. Gill 1982. p.54
33 %   "Atmosphere-Ocean Dynamics"
34 %   Academic Press: New York.  ISBN: 0-12-283522-0
35 %=========================================================================
36
37 % Modifications
38 % 03-12-12. Lindsay Pender, Converted to ITS-90.
39
40 % CALLER:  general purpose
41 % CALLEE:  sw_ptmp.m sw_dens.m
42
43 %-------------
44 % CHECK INPUTS
45 %-------------
46 if nargin ~= 4
47    error('sw_pden.m: Must pass 4 parameters ')
48 end %if
49
50 % LET sw_ptmp.m DO DIMENSION CHECKING
51
52 %------
53 % BEGIN
54 %------
55 ptmp = sw_ptmp(S,T,P,PR);
56 pden = sw_dens(S,ptmp,PR);
57
58 return
59 %=========================================================================
60
61
Note: See TracBrowser for help on using the browser.