FV3 Bundle
gsw_entropy_first_derivatives.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental subroutine gsw_entropy_first_derivatives (sa, ct, eta_sa, eta_ct)
3 ! =========================================================================
4 !
5 ! Calculates the following two partial derivatives of specific entropy
6 ! (eta)
7 ! (1) eta_SA, the derivative with respect to Absolute Salinity at
8 ! constant Conservative Temperature, and
9 ! (2) eta_CT, the derivative with respect to Conservative Temperature at
10 ! constant Absolute Salinity.
11 !
12 ! SA = Absolute Salinity [ g/kg ]
13 ! CT = Conservative Temperature (ITS-90) [ deg C ]
14 !
15 ! eta_SA = The derivative of specific entropy with respect to
16 ! Absolute Salinity (in units of g kg^-1) at constant
17 ! Conservative Temperature.
18 ! eta_SA has units of: [ J/(kg K(g/kg))] or [ J/(g K) ]
19 ! eta_CT = The derivative of specific entropy with respect to
20 ! Conservative Temperature at constant Absolute Salinity.
21 ! eta_CT has units of: [ J/(kg K^2) ]
22 !--------------------------------------------------------------------------
23 
25 
27 
28 use gsw_mod_kinds
29 
30 implicit none
31 
32 real (r8), intent(in) :: sa, ct
33 real (r8), intent(out), optional :: eta_sa, eta_ct
34 
35 real (r8) :: pt
36 
37 integer, parameter :: n0=0, n1=1
38 real (r8), parameter :: pr0 = 0.0_r8
39 
40 pt = gsw_pt_from_ct(sa,ct)
41 
42 if (present(eta_sa)) eta_sa = -(gsw_gibbs(n1,n0,n0,sa,pt,pr0))/(gsw_t0 + pt)
43 
44 if (present(eta_ct)) eta_ct = gsw_cp0/(gsw_t0 + pt)
45 
46 return
47 end subroutine
48 
49 !--------------------------------------------------------------------------
elemental subroutine gsw_entropy_first_derivatives(sa, ct, eta_sa, eta_ct)