25 real (r8),
intent(in) :: t, p
29 integer :: number_of_iterations
30 real (r8) :: dentropy, dentropy_dt, pt0_ice
31 real (r8) :: pt0_ice_old, ptm_ice, true_entropy
34 real (r8),
parameter :: s1 = -2.256611570832386e-4_r8
35 real (r8),
parameter :: s2 = -6.045305921314694e-7_r8
36 real (r8),
parameter :: s3 = 5.546699019612661e-9_r8
37 real (r8),
parameter :: s4 = 1.795030639186685e-11_r8
38 real (r8),
parameter :: s5 = 1.292346094030742e-9_r8
40 real (r8),
parameter :: p1 = -2.259745637898635e-4_r8
41 real (r8),
parameter :: p2 = 1.486236778150360e-9_r8
42 real (r8),
parameter :: p3 = 6.257869607978536e-12_r8
43 real (r8),
parameter :: p4 = -5.253795281359302e-7_r8
44 real (r8),
parameter :: p5 = 6.752596995671330e-9_r8
45 real (r8),
parameter :: p6 = 2.082992190070936e-11_r8
47 real (r8),
parameter :: q1 = -5.849191185294459e-15_r8
48 real (r8),
parameter :: q2 = 9.330347971181604e-11_r8
49 real (r8),
parameter :: q3 = 3.415888886921213e-13_r8
50 real (r8),
parameter :: q4 = 1.064901553161811e-12_r8
51 real (r8),
parameter :: q5 = -1.454060359158787e-10_r8
52 real (r8),
parameter :: q6 = -5.323461372791532e-13_r8
56 if (t.lt.-45.0_r8 .and. t.gt.-273.0_r8)
then 58 pt0_ice = t + p*(p1 + p*(p2 + p3*t) + t*(p4 + t*(p5 + p6*t)))
64 if (pt0_ice.lt.-273.0_r8) pt0_ice = pt0_ice + 0.05_r8
68 do number_of_iterations = 1, 3
71 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
72 ptm_ice = 0.5_r8*(pt0_ice + pt0_ice_old)
74 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
79 pt0_ice = t + p*(s1 + t*(s2 + t*(s3 + t*s4)) + s5*p)
85 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
86 ptm_ice = 0.5_r8*(pt0_ice + pt0_ice_old)
88 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
92 if (pt0_ice.lt.-273.0_r8)
then 94 pt0_ice = t + p*(q1 + p*(q2 + q3*t) + t*(q4 + t*(q5 + q6*t)))
101 do number_of_iterations = 1, 3
102 pt0_ice_old = pt0_ice
104 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
105 ptm_ice = 0.5_r8*(pt0_ice + pt0_ice_old)
111 ptm_ice = ptm_ice + 0.01_r8
113 pt0_ice = pt0_ice_old - dentropy/dentropy_dt
elemental real(r8) function gsw_pt0_from_t_ice(t, p)
real(r8), parameter gsw_t0