FV3 Bundle
gsw_melting_seaice_sa_ct_ratio_poly.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_melting_seaice_sa_ct_ratio_poly (sa, ct, p, &
3  sa_seaice, t_seaice)
4 !==========================================================================
5 !
6 ! Calculates the ratio of SA to CT changes when sea ice melts into seawater.
7 ! It is assumed that a small mass of sea ice melts into an infinite mass of
8 ! seawater. Because of the infinite mass of seawater, the sea ice will
9 ! always melt.
10 !
11 ! Ice formed at the sea surface (sea ice) typically contains between 2 g/kg
12 ! and 12 g/kg of salt (defined as the mass of salt divided by the mass of
13 ! ice Ih plus brine) and this programme returns NaN's if the input
14 ! SA_seaice is greater than 15 g/kg. If the SA_seaice input is not zero,
15 ! usually this would imply that the pressure p should be zero, as sea ice
16 ! only occurs near the sea surface. The code does not impose that p = 0 if
17 ! SA_seaice is non-zero. Rather, this is left to the user.
18 !
19 ! The Absolute Salinity, SA_brine, of the brine trapped in little pockets
20 ! in the sea ice, is in thermodynamic equilibrium with the ice Ih that
21 ! surrounds these pockets. As the seaice temperature, t_seaice, may be
22 ! less than the freezing temperature, SA_brine is usually greater than the
23 ! Absolute Salinity of the seawater at the time and place when and where
24 ! the sea ice was formed. So usually SA_brine will be larger than SA.
25 !
26 ! The output, melting_seaice_SA_CT_ratio, is dSA/dCT rather than dCT/dSA.
27 ! This is done so that when (SA - seaice_SA) = 0, the output, dSA/dCT is
28 ! zero whereas dCT/dSA would be infinite.
29 !
30 ! SA = Absolute Salinity of seawater [ g/kg ]
31 ! CT = Conservative Temperature of seawater (ITS-90) [ deg C ]
32 ! p = sea pressure at which the melting occurs [ dbar ]
33 ! ( i.e. absolute pressure - 10.1325 dbar )
34 ! SA_seaice = Absolute Salinity of sea ice, that is, the mass fraction
35 ! of salt in sea ice expressed in g of salt per kg of
36 ! sea ice [ g/kg ]
37 ! t_seaice = the in-situ temperature of the sea ice (ITS-90) [ deg C ]
38 !
39 ! melting_seaice_SA_CT_ratio = the ratio dSA/dCT of SA to CT changes when
40 ! sea ice melts into a large mass of seawater [ g/(kg K) ]
41 !--------------------------------------------------------------------------
42 
47 
49 
50 use gsw_mod_kinds
51 
52 implicit none
53 
54 real (r8), intent(in) :: sa, ct, p, sa_seaice, t_seaice
55 
57 
58 real (r8) :: ctf, delsa, h, h_brine, h_ih, sa_brine, ct_brine
59 real (r8) :: tf_sa_seaice, h_hat_sa, h_hat_ct
60 
61 real (r8), parameter :: saturation_fraction = 0.0_r8
62 
63 character (*), parameter :: func_name = "gsw_melting_seaice_sa_ct_ratio_poly"
64 
65 if (sa_seaice .lt. 0.0_r8 .or. sa_seaice .gt. 15.0_r8) then
67  return
68 end if
69 
70 ctf = gsw_ct_freezing_poly(sa,p,saturation_fraction)
71 if (ct .lt. ctf) then ! the seawater ct input is below the freezing temp
73  return
74 end if
75 
76 !--------------------------------------------------------------------------
77 tf_sa_seaice = gsw_t_freezing_poly(sa_seaice,p,saturation_fraction) - 1e-6_r8
78 if (t_seaice .gt. tf_sa_seaice) then ! t_seaice exceeds the freezing sa
80  return
81 end if
82 !
83 ! The 1e-6 C buffer in the allowable t_seaice is to ensure that there is
84 ! some ice Ih in the sea ice. Without this buffer, that is if t_seaice
85 ! is allowed to be exactly equal to tf_sa_seaice, the sea ice is actually
86 ! 100% brine at Absolute Salinity of SA_seaice.
87 !--------------------------------------------------------------------------
88 
89 h = gsw_enthalpy(sa,ct,p)
90 h_ih = gsw_enthalpy_ice(t_seaice,p)
91 call gsw_enthalpy_first_derivatives(sa,ct,p,h_hat_sa,h_hat_ct)
92 
93 sa_brine = gsw_sa_freezing_from_t_poly(t_seaice,p,saturation_fraction)
94 if (sa_brine .gt. gsw_error_limit) then
96  return
97 end if
98 ct_brine = gsw_ct_from_t(sa_brine,t_seaice,p)
99 h_brine = gsw_enthalpy(sa_brine,ct_brine,p)
100 delsa = sa - sa_seaice
101 
102 gsw_melting_seaice_sa_ct_ratio_poly = h_hat_ct*delsa / &
103  (h - h_ih - delsa*h_hat_sa - sa_seaice*(h_brine - h_ih)/sa_brine)
104 
105 return
106 end function
real(r8), parameter, public gsw_error_limit
elemental real(r8) function gsw_melting_seaice_sa_ct_ratio_poly(sa, ct, p, sa_seaice, t_seaice)
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)