42 real (r8),
intent(in) :: sa, pt
43 real (r8),
intent(out),
optional :: ct_sa_sa, ct_sa_pt, ct_pt_pt
45 real (r8) :: ct_pt_l, ct_pt_u, ct_sa_l, ct_sa_u, pt_l, pt_u, sa_l, sa_u
47 real (r8),
parameter :: dsa = 1e-3_r8, dpt = 1e-2_r8
49 if (
present(ct_sa_sa))
then 51 sa_l =
max(sa - dsa, 0.0_r8)
57 ct_sa_sa = (ct_sa_u - ct_sa_l)/(sa_u - sa_l)
61 if (
present(ct_sa_pt) .or.
present(ct_pt_pt))
then 66 if (
present(ct_sa_pt) .and.
present(ct_pt_pt))
then 71 ct_sa_pt = (ct_sa_u - ct_sa_l)/(pt_u - pt_l)
72 ct_pt_pt = (ct_pt_u - ct_pt_l)/(pt_u - pt_l)
74 else if (
present(ct_sa_pt) .and. .not.
present(ct_pt_pt))
then 79 ct_sa_pt = (ct_sa_u - ct_sa_l)/(pt_u - pt_l)
81 else if (.not.
present(ct_sa_pt) .and.
present(ct_pt_pt))
then 86 ct_pt_pt = (ct_pt_u - ct_pt_l)/(pt_u - pt_l)
elemental subroutine gsw_ct_second_derivatives(sa, pt, ct_sa_sa, ct_sa_pt, ct_pt_pt)