FV3 Bundle
gsw_ct_from_pt.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_ct_from_pt (sa, pt)
3 !==========================================================================
4 !
5 ! Calculates Conservative Temperature from potential temperature of seawater
6 !
7 ! sa : Absolute Salinity [g/kg]
8 ! pt : potential temperature with [deg C]
9 ! reference pressure of 0 dbar
10 !
11 ! gsw_ct_from_pt : Conservative Temperature [deg C]
12 !--------------------------------------------------------------------------
13 
15 
16 use gsw_mod_kinds
17 
18 implicit none
19 
20 real (r8), intent(in) :: sa, pt
21 
22 real (r8) :: gsw_ct_from_pt
23 
24 real (r8) :: pot_enthalpy, x2, x, y
25 
26 x2 = gsw_sfac*sa
27 x = sqrt(x2)
28 y = pt*0.025_r8 ! normalize for F03 and F08
29 
30 pot_enthalpy = 61.01362420681071_r8 + y*(168776.46138048015_r8 + &
31  y*(-2735.2785605119625_r8 + y*(2574.2164453821433_r8 + &
32  y*(-1536.6644434977543_r8 + y*(545.7340497931629_r8 + &
33  (-50.91091728474331_r8 - 18.30489878927802_r8*y)*y))))) + &
34  x2*(268.5520265845071_r8 + y*(-12019.028203559312_r8 + &
35  y*(3734.858026725145_r8 + y*(-2046.7671145057618_r8 + &
36  y*(465.28655623826234_r8 + (-0.6370820302376359_r8 - &
37  10.650848542359153_r8*y)*y)))) + &
38  x*(937.2099110620707_r8 + y*(588.1802812170108_r8 + &
39  y*(248.39476522971285_r8 + (-3.871557904936333_r8 - &
40  2.6268019854268356_r8*y)*y)) + &
41  x*(-1687.914374187449_r8 + x*(246.9598888781377_r8 + &
42  x*(123.59576582457964_r8 - 48.5891069025409_r8*x)) + &
43  y*(936.3206544460336_r8 + &
44  y*(-942.7827304544439_r8 + y*(369.4389437509002_r8 + &
45  (-33.83664947895248_r8 - 9.987880382780322_r8*y)*y))))))
46 
47 gsw_ct_from_pt = pot_enthalpy/gsw_cp0
48 
49 return
50 end function
51 
52 !--------------------------------------------------------------------------
elemental real(r8) function gsw_ct_from_pt(sa, pt)