3 p, v_sa_sa, v_sa_h, v_h_h, iflag)
33 real (r8),
intent(in) :: sa, ct, p
34 integer,
intent(in),
optional :: iflag
35 real (r8),
intent(out),
optional :: v_sa_sa, v_sa_h, v_h_h
38 real (r8) :: h_ct, h_ct_ct, h_sa, h_sa_ct, h_sa_sa, rec_h_ct, v_h_h_part
39 real (r8) :: rec_h_ct2, v_ct, vct_ct_ct, vct_sa_ct, vct_sa_sa, v_sa_h_part
41 if (
present(iflag))
then 42 flags(1) =
present(v_sa_sa) .and. btest(iflag,1)
43 flags(2) =
present(v_sa_h) .and. btest(iflag,2)
44 flags(3) =
present(v_h_h) .and. btest(iflag,3)
46 flags(1) =
present(v_sa_sa)
47 flags(2) =
present(v_sa_h)
48 flags(3) =
present(v_h_h)
53 if (flags(1) .or. flags(2))
then 61 else if (flags(2))
then 70 else if (flags(2))
then 76 rec_h_ct = 1.0_r8/h_ct
77 rec_h_ct2 = rec_h_ct**2.0_r8
79 v_h_h_part = (vct_ct_ct*h_ct - h_ct_ct*v_ct)*(rec_h_ct2*rec_h_ct)
81 if (flags(3)) v_h_h = v_h_h_part
83 if (flags(1) .or. flags(2))
then 85 v_sa_h_part = (vct_sa_ct*h_ct - v_ct*h_sa_ct)*rec_h_ct2 - h_sa*v_h_h_part
87 if (flags(2)) v_sa_h = v_sa_h_part
89 if (flags(1)) v_sa_sa = vct_sa_sa - (h_ct*(vct_sa_ct*h_sa &
90 - v_ct*h_sa_sa) + v_ct*h_sa*h_sa_ct)*rec_h_ct2 - h_sa*v_sa_h_part
elemental subroutine gsw_specvol_second_derivatives_wrt_enthalpy(sa, ct, p, v_sa_sa, v_sa_h, v_h_h, iflag)