FV3 Bundle
gsw_t_deriv_chem_potential_water_t_exact.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_t_deriv_chem_potential_water_t_exact (sa, t, p)
3 !==========================================================================
4 !
5 ! Calculates the temperature derivative of the chemical potential of water
6 ! in seawater so that it is valid at exactly SA = 0.
7 !
8 ! SA = Absolute Salinity [ g/kg ]
9 ! t = in-situ temperature (ITS-90) [ deg C ]
10 ! p = sea pressure [ dbar ]
11 ! ( i.e. absolute pressure - 10.1325 dbar )
12 !
13 ! chem_potential_water_dt = temperature derivative of the chemical
14 ! potential of water in seawater [ J g^-1 K^-1 ]
15 !--------------------------------------------------------------------------
16 
18 
19 use gsw_mod_kinds
20 
21 implicit none
22 
23 real (r8), intent(in) :: sa, t, p
24 
26 
27 real (r8) :: g03_t, g08_sa_t, x, x2, y, z, g08_t
28 
29 real (r8), parameter :: kg2g = 1e-3_r8
30 
31 ! Note. The kg2g, a factor of 1e-3, is needed to convert the output of this
32 ! function into units of J/g. See section (2.9) of the TEOS-10 Manual.
33 
34 x2 = gsw_sfac*sa
35 x = sqrt(x2)
36 y = t*0.025_r8
37 z = p*rec_db2pa ! the input pressure (p) is sea pressure in units of dbar.
38 
39 g03_t = 5.90578347909402_r8 + z*(-270.983805184062_r8 + &
40  z*(776.153611613101_r8 + z*(-196.51255088122_r8 + (28.9796526294175_r8 - &
41  2.13290083518327_r8*z)*z))) + &
42  y*(-24715.571866078_r8 + z*(2910.0729080936_r8 + &
43  z*(-1513.116771538718_r8 + z*(546.959324647056_r8 + &
44  z*(-111.1208127634436_r8 + 8.68841343834394_r8*z)))) + &
45  y*(2210.2236124548363_r8 + z*(-2017.52334943521_r8 + &
46  z*(1498.081172457456_r8 + z*(-718.6359919632359_r8 + &
47  (146.4037555781616_r8 - 4.9892131862671505_r8*z)*z))) + &
48  y*(-592.743745734632_r8 + z*(1591.873781627888_r8 + &
49  z*(-1207.261522487504_r8 + (608.785486935364_r8 - &
50  105.4993508931208_r8*z)*z)) + &
51  y*(290.12956292128547_r8 + z*(-973.091553087975_r8 + &
52  z*(602.603274510125_r8 + z*(-276.361526170076_r8 + &
53  32.40953340386105_r8*z))) + &
54  y*(-113.90630790850321_r8 + y*(21.35571525415769_r8 - &
55  67.41756835751434_r8*z) + &
56  z*(381.06836198507096_r8 + z*(-133.7383902842754_r8 + &
57  49.023632509086724_r8*z)))))))
58 
59 g08_t = x2*(168.072408311545_r8 + &
60  x*(-493.407510141682_r8 + x*(543.835333000098_r8 + &
61  x*(-196.028306689776_r8 + 36.7571622995805_r8*x) + &
62  y*(-137.1145018408982_r8 + y*(148.10030845687618_r8 + &
63  y*(-68.5590309679152_r8 + 12.4848504784754_r8*y))) - &
64  22.6683558512829_r8*z) + z*(-175.292041186547_r8 + &
65  (83.1923927801819_r8 - 29.483064349429_r8*z)*z) + &
66  y*(-86.1329351956084_r8 + z*(766.116132004952_r8 + &
67  z*(-108.3834525034224_r8 + 51.2796974779828_r8*z)) + &
68  y*(-30.0682112585625_r8 - 1380.9597954037708_r8*z + &
69  y*(3.50240264723578_r8 + 938.26075044542_r8*z)))))
70 
71 g08_sa_t = 1187.3715515697959_r8 + &
72  x*(-1480.222530425046_r8 + x*(2175.341332000392_r8 + &
73  x*(-980.14153344888_r8 + 220.542973797483_r8*x) + &
74  y*(-548.4580073635929_r8 + y*(592.4012338275047_r8 + &
75  y*(-274.2361238716608_r8 + 49.9394019139016_r8*y))) - &
76  90.6734234051316_r8*z) + z*(-525.876123559641_r8 + &
77  (249.57717834054571_r8 - 88.449193048287_r8*z)*z) + &
78  y*(-258.3988055868252_r8 + z*(2298.348396014856_r8 + &
79  z*(-325.1503575102672_r8 + 153.8390924339484_r8*z)) + &
80  y*(-90.2046337756875_r8 - 4142.8793862113125_r8*z + &
81  y*(10.50720794170734_r8 + 2814.78225133626_r8*z))))
82 
83 gsw_t_deriv_chem_potential_water_t_exact = kg2g*((g03_t + g08_t)*0.025_r8 - &
84  0.5_r8*gsw_sfac*0.025_r8*sa*g08_sa_t)
85 return
86 end function
87 
88 !--------------------------------------------------------------------------
elemental real(r8) function gsw_t_deriv_chem_potential_water_t_exact(sa, t, p)