35 real (r8),
intent(in) :: t, p, saturation_fraction
40 real (r8) :: f, sa, sa_mean, sa_old, t_freezing_zero_sa, tfreezing_sa
42 integer,
parameter :: number_of_iterations = 2
46 real (r8),
parameter :: sa_cut_off = 2.5_r8
48 character (*),
parameter :: func_name =
"gsw_sa_freezing_from_t" 53 if (t .gt. t_freezing_zero_sa)
then 60 if (sa .lt. -sa_cut_off)
then 69 tfreezing_sa=tfreezing_sa)
73 if (abs(sa) .lt. sa_cut_off) sa = (t - t_freezing_zero_sa)/tfreezing_sa
79 do i_iter = 1, number_of_iterations
82 sa = sa_old - f/tfreezing_sa
83 sa_mean = 0.5_r8*(sa + sa_old)
85 tfreezing_sa=tfreezing_sa)
86 sa = sa_old - f/tfreezing_sa
real(r8), parameter, public gsw_error_limit
elemental real(r8) function gsw_sa_freezing_from_t(t, p, saturation_fraction)
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)