FV3 Bundle
gsw_t_freezing_first_derivatives.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental subroutine gsw_t_freezing_first_derivatives (sa, p, &
3  saturation_fraction, tfreezing_sa, tfreezing_p)
4 !==========================================================================
5 !
6 ! Calculates the frist derivatives of the in-situ temperature at which
7 ! seawater freezes with respect to Absolute Salinity SA and pressure P (in
8 ! Pa). These expressions come from differentiating the expression that
9 ! defines the freezing temperature, namely the equality between the
10 ! chemical potentials of water in seawater and in ice.
11 !
12 ! SA = Absolute Salinity [ g/kg ]
13 ! p = sea pressure [ dbar ]
14 ! ( i.e. absolute pressure - 10.1325 dbar )
15 ! saturation_fraction = the saturation fraction of dissolved air in
16 ! seawater
17 !
18 ! tfreezing_SA = the derivative of the in-situ freezing temperature
19 ! (ITS-90) with respect to Absolute Salinity at fixed
20 ! pressure [ K/(g/kg) ] i.e. [ K kg/g ]
21 !
22 ! tfreezing_P = the derivative of the in-situ freezing temperature
23 ! (ITS-90) with respect to pressure (in Pa) at fixed
24 ! Absolute Salinity [ K/Pa ]
25 !--------------------------------------------------------------------------
26 
31 
33 
34 use gsw_mod_kinds
35 
36 implicit none
37 
38 real (r8), intent(in) :: sa, p, saturation_fraction
39 real (r8), intent(out), optional :: tfreezing_sa, tfreezing_p
40 
41 real (r8) :: rec_denom, tf
42 
43 real (r8), parameter :: g_per_kg = 1000.0_r8
44 
45 tf = gsw_t_freezing_exact(sa,p,saturation_fraction)
46 rec_denom = 1.0_r8/(g_per_kg*gsw_t_deriv_chem_potential_water_t_exact(sa,tf,p) &
47  + gsw_entropy_ice(tf,p))
48 
49 if (present(tfreezing_sa)) tfreezing_sa = &
50  gsw_dilution_coefficient_t_exact(sa,tf,p)*rec_denom &
51  + saturation_fraction*(1e-3_r8)/(2.0_r8*gsw_sso)
52 
53 if (present(tfreezing_p)) tfreezing_p = &
54  -(gsw_specvol_t_exact(sa,tf,p) - sa*gsw_gibbs(1,0,1,sa,tf,p) &
55  - gsw_specvol_ice(tf,p))*rec_denom
56 
57 return
58 end subroutine
59 
60 !--------------------------------------------------------------------------
elemental subroutine gsw_t_freezing_first_derivatives(sa, p, saturation_fraction, tfreezing_sa, tfreezing_p)