-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsw_pden.f90
37 lines (27 loc) · 1003 Bytes
/
sw_pden.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function sw_pden(S,T,P,PR)
! SW_PDEN Potential density
!===========================================================================
! SW_PDEN $Id: sw_pden.m,v 1.1 2003/12/12 04:23:22 pen078 Exp $
! Copyright (C) CSIRO, Phil Morgan 1992.
!
! USAGE: pden = sw_pden(S,T,P,PR)
!
! DESCRIPTION:
! Calculates potential density of water mass relative to the specified
! reference pressure by pden = sw_dens(S,ptmp,PR).
!
! INPUT: (all must have same dimensions)
! S = salinity [psu (PSS-78) ]
! T = temperature [degree C (ITS-90)]
! P = pressure [db]
! PR = Reference pressure [db]
! (P may have dims 1x1, mx1, 1xn or mxn for S(mxn) )
!
! OUTPUT:
! pden = Potential denisty relative to the ref. pressure [kg/m^3]
implicit none
real(kind=8),intent(in) :: S,T,P,PR
real(kind=8) :: ptmp,sw_ptmp,sw_dens,sw_pden
ptmp = sw_ptmp(S,T,P,PR);
sw_pden = sw_dens(S,ptmp,PR);
end function sw_pden