34 real (r8),
intent(in) :: c, t, p
38 real (r8) :: sp, t68, ft68, r, rt_lc, rp, rt, rtx
39 real (r8) :: hill_ratio, x, sqrty, part1, part2, sp_hill_raw
41 character (*),
parameter :: func_name =
"gsw_sp_from_c" 44 ft68 = (t68 - 15.0_r8)/(1.0_r8 +
k*(t68 - 15.0_r8))
53 rt_lc =
c0 + (
c1 + (
c2 + (
c3 +
c4*t68)*t68)*t68)*t68
54 rp = 1.0_r8 + (p*(
e1 +
e2*p +
e3*p*p))/(1.0_r8 +
d1*t68 +
d2*t68*t68 + (
d3 +
d4*t68)*r)
57 if (rt .lt. 0.0_r8)
then 64 sp =
a0 + (
a1 + (
a2 + (
a3 + (
a4 +
a5*rtx)*rtx)*rtx)*rtx)*rtx + &
65 ft68*(
b0 + (
b1 + (
b2 + (
b3 + (
b4 +
b5*rtx)*rtx)*rtx)*rtx)*rtx)
71 if (sp .lt. 2.0_r8)
then 75 part1 = 1.0_r8 + x*(1.5_r8 + x)
76 part2 = 1.0_r8 + sqrty*(1.0_r8 + sqrty*(1.0_r8 + sqrty))
77 sp_hill_raw = sp -
a0/part1 -
b0*ft68/part2
78 sp = hill_ratio*sp_hill_raw
81 if (sp .lt. 0.0_r8)
then
real(r8), parameter, public gsw_error_limit
real(r8), parameter gsw_c3515
elemental real(r8) function gsw_sp_from_c(c, t, p)
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)