FV3 Bundle
gsw_frazil_ratios_adiabatic.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental subroutine gsw_frazil_ratios_adiabatic (sa, p, w_ih, &
3  dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil)
4 !==========================================================================
5 !
6 ! Calculates the ratios of SA, CT and P changes when frazil ice forms or
7 ! melts in response to an adiabatic change in pressure of a mixture of
8 ! seawater and frazil ice crystals.
9 !
10 ! Note that the first output, dSA_dCT_frazil, is dSA/dCT rather than
11 ! dCT/dSA. This is done so that when SA = 0, the output, dSA/dCT, is zero
12 ! whereas dCT/dSA would then be infinite.
13 !
14 ! Also note that both dSA_dP_frazil and dCT_dP_frazil are the pressure
15 ! derivatives with the pressure measured in Pa not dbar.
16 !
17 ! SA = Absolute Salinity of seawater [ g/kg ]
18 ! p = sea pressure of seawater at which melting occurs [ dbar ]
19 ! ( i.e. absolute pressure - 10.1325d0 dbar )
20 ! w_Ih = mass fraction of ice, that is the mass of ice divided by the
21 ! sum of the masses of ice and seawater. That is, the mass of
22 ! ice divided by the mass of the final mixed fluid.
23 ! w_Ih must be between 0 and 1. [ unitless ]
24 !
25 ! dSA_dCT_frazil = the ratio of the changes in Absolute Salinity
26 ! to that of Conservative Temperature [ g/(kg K) ]
27 ! dSA_dP_frazil = the ratio of the changes in Absolute Salinity
28 ! to that of pressure (in Pa) [ g/(kg Pa) ]
29 ! dCT_dP_frazil = the ratio of the changes in Conservative Temperature
30 ! to that of pressure (in Pa) [ K/Pa ]
31 !--------------------------------------------------------------------------
32 
39 
40 use gsw_mod_kinds
41 
42 implicit none
43 
44 real (r8), intent(in) :: sa, p, w_ih
45 real (r8), intent(out) :: dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil
46 
47 real (r8) :: bracket1, bracket2, cp_ih, gamma_ih, h, h_ih, part, rec_bracket3
48 real (r8) :: tf, wcp, h_hat_sa, h_hat_ct, tf_sa, tf_p, ctf, ctf_sa, ctf_p
49 
50 real (r8), parameter :: saturation_fraction = 0.0_r8
51 
52 ctf = gsw_ct_freezing_exact(sa,p,saturation_fraction)
53 tf = gsw_t_freezing_exact(sa,p,saturation_fraction)
54 h = gsw_enthalpy_ct_exact(sa,ctf,p)
55 h_ih = gsw_enthalpy_ice(tf,p)
56 cp_ih = gsw_cp_ice(tf,p)
57 gamma_ih = gsw_adiabatic_lapse_rate_ice(tf,p)
58 call gsw_enthalpy_first_derivatives_ct_exact(sa,ctf,p,h_hat_sa,h_hat_ct)
59 call gsw_t_freezing_first_derivatives(sa,p,saturation_fraction,tf_sa,tf_p)
60 call gsw_ct_freezing_first_derivatives(sa,p,saturation_fraction,ctf_sa,ctf_p)
61 
62 wcp = cp_ih*w_ih/(1.0_r8 - w_ih)
63 part = (tf_p - gamma_ih)/ctf_p
64 
65 bracket1 = h_hat_ct + wcp*part
66 bracket2 = h - h_ih - sa*(h_hat_sa + wcp*(tf_sa - part*ctf_sa))
67 rec_bracket3 = 1.0_r8/(h - h_ih - sa*(h_hat_sa + h_hat_ct*ctf_sa + wcp*tf_sa))
68 
69 dsa_dct_frazil = sa*(bracket1/bracket2)
70 dsa_dp_frazil = sa*ctf_p*bracket1*rec_bracket3
71 dct_dp_frazil = ctf_p*bracket2*rec_bracket3
72 
73 return
74 end subroutine
75 
76 !--------------------------------------------------------------------------
elemental subroutine gsw_frazil_ratios_adiabatic(sa, p, w_ih, dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil)