FV3 Bundle
gsw_dynamic_enthalpy.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_dynamic_enthalpy (sa, ct, p)
3 !==========================================================================
4 !
5 ! Calculates dynamic enthalpy of seawater using the computationally-
6 ! efficient expression for specific volume in terms of SA, CT and p
7 ! (Roquet et al., 2014). Dynamic enthalpy is defined as enthalpy minus
8 ! potential enthalpy (Young, 2010).
9 !
10 ! SA = Absolute Salinity [ g/kg ]
11 ! CT = Conservative Temperature (ITS-90) [ deg C ]
12 ! p = sea pressure [ dbar ]
13 ! ( i.e. absolute pressure - 10.1325 dbar )
14 !
15 ! dynamic_enthalpy = dynamic enthalpy [ J/kg ]
16 !--------------------------------------------------------------------------
17 
19 
21 
22 use gsw_mod_kinds
23 
24 implicit none
25 
26 real (r8), intent(in) :: sa, ct, p
27 
28 real (r8) :: gsw_dynamic_enthalpy
29 
30 real (r8) :: dynamic_enthalpy_part, xs, ys, z
31 
32 xs = sqrt(gsw_sfac*sa + offset)
33 ys = ct*0.025_r8
34 z = p*1e-4_r8
35 
36 dynamic_enthalpy_part = z*(h001 + xs*(h101 + xs*(h201 + xs*(h301 + xs*(h401 &
37  + xs*(h501 + h601*xs))))) + ys*(h011 + xs*(h111 + xs*(h211 + xs*(h311 &
38  + xs*(h411 + h511*xs)))) + ys*(h021 + xs*(h121 + xs*(h221 + xs*(h321 &
39  + h421*xs))) + ys*(h031 + xs*(h131 + xs*(h231 + h331*xs)) + ys*(h041 &
40  + xs*(h141 + h241*xs) + ys*(h051 + h151*xs + h061*ys))))) + z*(h002 &
41  + xs*(h102 + xs*(h202 + xs*(h302 + xs*(h402 + h502*xs)))) + ys*(h012 &
42  + xs*(h112 + xs*(h212 + xs*(h312 + h412*xs))) + ys*(h022 + xs*(h122 &
43  + xs*(h222 + h322*xs)) + ys*(h032 + xs*(h132 + h232*xs) + ys*(h042 &
44  + h142*xs + h052*ys)))) + z*(h003 + xs*(h103 + xs*(h203 + xs*(h303 &
45  + h403*xs))) + ys*(h013 + xs*(h113 + xs*(h213 + h313*xs)) + ys*(h023 &
46  + xs*(h123 + h223*xs) + ys*(h033 + h133*xs + h043*ys))) + z*(h004 &
47  + xs*(h104 + h204*xs) + ys*(h014 + h114*xs + h024*ys) + z*(h005 &
48  + h105*xs + h015*ys + z*(h006 + h007*z))))))
49 
50 gsw_dynamic_enthalpy = dynamic_enthalpy_part*db2pa*1e4_r8
51 
52 return
53 end function
54 
55 !--------------------------------------------------------------------------
elemental real(r8) function gsw_dynamic_enthalpy(sa, ct, p)