3 rho_sa_ct, rho_ct_ct, rho_sa_p, rho_ct_p)
34 real (r8),
intent(in) :: sa, ct, p
35 real (r8),
intent(out),
optional :: rho_sa_sa, rho_sa_ct, rho_ct_ct
36 real (r8),
intent(out),
optional :: rho_sa_p, rho_ct_p
38 integer :: iflag1, iflag2
39 real (r8) :: rec_v, rec_v2, rec_v3, v_ct, v_ct_ct, v_ct_p, v_p, v_sa, v_sa_ct
40 real (r8) :: v_sa_p, v_sa_sa
43 if (
present(rho_sa_sa) .or.
present(rho_sa_ct) &
44 .or.
present(rho_sa_p)) iflag1 = ibset(iflag1,1)
45 if (
present(rho_sa_ct) .or.
present(rho_ct_ct) &
46 .or.
present(rho_ct_p)) iflag1 = ibset(iflag1,2)
47 if (
present(rho_sa_p) .or.
present(rho_ct_p)) iflag1 = ibset(iflag1,3)
52 if (
present(rho_sa_sa)) iflag2 = ibset(iflag2,1)
53 if (
present(rho_sa_ct)) iflag2 = ibset(iflag2,2)
54 if (
present(rho_ct_ct)) iflag2 = ibset(iflag2,3)
55 if (
present(rho_sa_p)) iflag2 = ibset(iflag2,4)
56 if (
present(rho_ct_p)) iflag2 = ibset(iflag2,5)
59 v_sa_p,v_ct_p,iflag=iflag2)
65 if (
present(rho_sa_sa)) rho_sa_sa = -v_sa_sa*rec_v2 + 2.0_r8*v_sa*v_sa*rec_v3
67 if (
present(rho_sa_ct)) rho_sa_ct = -v_sa_ct*rec_v2 + 2.0_r8*v_sa*v_ct*rec_v3
69 if (
present(rho_ct_ct)) rho_ct_ct = -v_ct_ct*rec_v2 + 2.0_r8*v_ct*v_ct*rec_v3
71 if (
present(rho_sa_p)) rho_sa_p = -v_sa_p*rec_v2 + 2.0_r8*v_sa*v_p*rec_v3
73 if (
present(rho_ct_p)) rho_ct_p = -v_ct_p*rec_v2 + 2.0_r8*v_ct*v_p*rec_v3
elemental subroutine gsw_rho_second_derivatives(sa, ct, p, rho_sa_sa, rho_sa_ct, rho_ct_ct, rho_sa_p, rho_ct_p)