FV3 Bundle
gsw_ct_freezing_first_derivatives_poly.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental subroutine gsw_ct_freezing_first_derivatives_poly (sa, p, &
3  saturation_fraction, ctfreezing_sa, ctfreezing_p)
4 !==========================================================================
5 !
6 ! Calculates the first derivatives of the Conservative Temperature at
7 ! which seawater freezes, with respect to Absolute Salinity SA and
8 ! pressure P (in Pa) of the comptationally efficient polynomial fit of the
9 ! freezing temperature (McDougall et al., 2014).
10 !
11 ! SA = Absolute Salinity [ g/kg ]
12 ! p = sea pressure [ dbar ]
13 ! ( i.e. absolute pressure - 10.1325 dbar )
14 ! saturation_fraction = the saturation fraction of dissolved air in
15 ! seawater
16 !
17 ! CTfreezing_SA = the derivative of the Conservative Temperature at
18 ! freezing (ITS-90) with respect to Absolute Salinity at
19 ! fixed pressure [ K/(g/kg) ] i.e. [ K kg/g ]
20 !
21 ! CTfreezing_P = the derivative of the Conservative Temperature at
22 ! freezing (ITS-90) with respect to pressure (in Pa) at
23 ! fixed Absolute Salinity [ K/Pa ]
24 !--------------------------------------------------------------------------
25 
27 
29 
30 use gsw_mod_kinds
31 
32 implicit none
33 
34 real (r8), intent(in) :: sa, p, saturation_fraction
35 real (r8), intent(out), optional :: ctfreezing_sa, ctfreezing_p
36 
37 real (r8) :: p_r, sa_r, x
38 
39 real (r8), parameter :: d = -a - a*b - 2.4_r8*b/gsw_sso
40 real (r8), parameter :: e = 2.0_r8*a*b/gsw_sso
41 
42 sa_r = sa*1e-2_r8
43 x = sqrt(sa_r)
44 p_r = p*1e-4_r8
45 
46 if (present(ctfreezing_sa)) ctfreezing_sa = &
47  (c1 + x*(1.5_r8*c2 + x*(2.0_r8*c3 + x*(2.5_r8*c4 + x*(3.0_r8*c5 &
48  + 3.5_r8*c6*x)))) + p_r*(c10 + x*(1.5_r8*c11 + x*(2.0_r8*c13 &
49  + x*(2.5_r8*c16 + x*(3.0_r8*c19 + 3.5_r8*c22*x)))) &
50  + p_r*(c12 + x*(1.5_r8*c14 + x*(2.0_r8*c17 + 2.5_r8*c20*x)) &
51  + p_r*(c15 + x*(1.5_r8*c18 + 2.0_r8*c21*x)))))*1e-2_r8 &
52  - saturation_fraction*1e-3_r8*(d - sa*e)
53 
54 if (present(ctfreezing_p)) ctfreezing_p = &
55  (c7 + sa_r*(c10 + x*(c11 + x*(c13 + x*(c16 + x*(c19 + c22*x))))) &
56  + p_r*(2.0_r8*c8 + sa_r*(2.0_r8*c12 + x*(2.0_r8*c14 + x*(2.0_r8*c17 &
57  + 2.0_r8*c20*x))) + p_r*(3.0_r8*c9 + sa_r*(3.0_r8*c15 + x*(3.0_r8*c18 &
58  + 3.0_r8*c21*x)))))*1e-8_r8
59 
60 return
61 end subroutine
62 
63 !--------------------------------------------------------------------------
elemental subroutine gsw_ct_freezing_first_derivatives_poly(sa, p, saturation_fraction, ctfreezing_sa, ctfreezing_p)