3 t_ih, sa_freeze, ct_freeze, w_ih)
45 real (r8),
intent(in) :: sa, ct, p, t_ih
46 real (r8),
intent(out) :: sa_freeze, ct_freeze, w_ih
49 real (r8) :: ctf, ctf_mean, ctf_old, ctf_plus1, ctf_zero
50 real (r8) :: dfunc_dsaf, func, func_plus1, func_zero, h, h_ih
51 real (r8) :: saf, saf_mean, saf_old, tf, h_hat_sa, h_hat_ct, ctf_sa
53 real (r8),
parameter :: sa0 = 0.0_r8, saturation_fraction = 0.0_r8
55 character (*),
parameter :: func_name =
"gsw_ice_fraction_to_freeze_seawater" 67 if (t_ih .gt. tf)
then 84 saf = -(sa+1.0_r8)*func_zero/(func_plus1 - func_zero)
89 dfunc_dsaf = sa*(h_hat_sa + h_hat_ct*ctf_sa) - (h - h_ih)
95 - (saf_old - sa)*(h - h_ih)
96 saf = saf_old - func/dfunc_dsaf
97 saf_mean = 0.5_r8*(saf + saf_old)
102 ctfreezing_sa=ctf_sa)
103 dfunc_dsaf = sa*(h_hat_sa + h_hat_ct*ctf_sa) - (h - h_ih)
104 saf = saf_old - func/dfunc_dsaf
real(r8), parameter, public gsw_error_limit
elemental subroutine gsw_ice_fraction_to_freeze_seawater(sa, ct, p, t_ih, sa_freeze, ct_freeze, w_ih)
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)