33 real (r8),
intent(in) :: ct, p, saturation_fraction
38 real (r8) :: ct_freezing_zero_sa, f, ctfreezing_sa
39 real (r8) :: sa, sa_mean, sa_old
41 integer,
parameter :: number_of_iterations = 3
45 real (r8),
parameter :: sa_cut_off = 2.5_r8
47 character (*),
parameter :: func_name =
"gsw_sa_freezing_from_ct" 52 if (ct .gt. ct_freezing_zero_sa)
then 59 if (sa .lt. -sa_cut_off)
then 68 ctfreezing_sa=ctfreezing_sa)
72 if (abs(sa) .lt. sa_cut_off) sa = (ct - ct_freezing_zero_sa)/ctfreezing_sa
78 do i_iter = 1, number_of_iterations
81 sa = sa_old - f/ctfreezing_sa
82 sa_mean = 0.5_r8*(sa + sa_old)
84 ctfreezing_sa=ctfreezing_sa)
85 sa = sa_old - f/ctfreezing_sa
real(r8), parameter, public gsw_error_limit
elemental real(r8) function gsw_sa_freezing_from_ct(ct, p, saturation_fraction)
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)