39 real (r8),
intent(in) :: sa, ct
40 real (r8),
intent(out),
optional :: pt_sa_sa, pt_sa_ct, pt_ct_ct
42 real (r8) :: ct_l, ct_u, pt_ct_l, pt_ct_u, pt_sa_l, pt_sa_u, sa_l, sa_u
44 real (r8),
parameter :: dct = 1e-2_r8, dsa = 1e-3_r8
46 if (
present(pt_sa_sa))
then 48 sa_l =
max(sa - dsa, 0.0_r8)
54 pt_sa_sa = (pt_sa_u - pt_sa_l)/(sa_u - sa_l)
58 if (
present(pt_sa_ct) .or.
present(pt_ct_ct))
then 63 if (
present(pt_sa_ct) .and.
present(pt_ct_ct))
then 68 pt_sa_ct = (pt_sa_u - pt_sa_l)/(ct_u - ct_l)
69 pt_ct_ct = (pt_ct_u - pt_ct_l)/(ct_u - ct_l)
71 else if (
present(pt_sa_ct) .and. .not.
present(pt_ct_ct))
then 76 pt_sa_ct = (pt_sa_u - pt_sa_l)/(ct_u - ct_l)
78 else if (.not.
present(pt_sa_ct) .and.
present(pt_ct_ct))
then 83 pt_ct_ct = (pt_ct_u - pt_ct_l)/(ct_u - ct_l)
elemental subroutine gsw_pt_second_derivatives(sa, ct, pt_sa_sa, pt_sa_ct, pt_ct_ct)