roquet_spv_ts_coeffs Subroutine

public pure subroutine roquet_spv_ts_coeffs(T_pt, S_sp, sv0, sv1, sv2, sv3)

The (T, S)-dependent coefficients of the Roquet et al. (2015) SpV polynomial viewed as a polynomial in PRESSURE, in model variables (potential temperature T_pt degC, practical salinity S_sp PSU):

SV(p) = (sv0 + p(sv1 + p(sv2 + psv3))) + SV00p(p), SV00p(p) = p(ROQ_V00 + p(ROQ_V01 + … + pROQ_V05)),

with SV00p the (T, S)-independent reference profile. This is the value half of roquet_spv_point, term for term (same SR / CT conversion, same Horner nesting), with none of the derivative work: evaluating the expression above reproduces roquet_spv_point’s sv exactly.

WHY SPLIT. Everything expensive in the Roquet EOS – two sqrt, the degree-7 PT->CT polynomial and the ~50-term (zs, zt) sums – depends on T and S only. A caller that evaluates ONE parcel at several pressures (the FV-MOM6 in-situ PGF’s 5-point vertical Boole rule over a constant-T/S layer) calls this once and then pays only the degree-6 pressure Horner per point.

The body is rdb_roq_ts_coeffs (rdb_roquet_spv.inc, included here): kernel modules include the same file for a local, inlinable copy rather than calling this out-of-line entry point.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: T_pt

Potential temperature (degC).

real(kind=wp), intent(in) :: S_sp

Practical salinity (PSU).

real(kind=wp), intent(out) :: sv0

Pressure-independent part, sv_ts0 + sv_0s0 (m^3/kg).

real(kind=wp), intent(out) :: sv1

Coefficients of p, p^2, p^3 (Pa-powers folded in).

real(kind=wp), intent(out) :: sv2

Coefficients of p, p^2, p^3 (Pa-powers folded in).

real(kind=wp), intent(out) :: sv3

Coefficients of p, p^2, p^3 (Pa-powers folded in).


Calls

proc~~roquet_spv_ts_coeffs~~CallsGraph proc~roquet_spv_ts_coeffs roquet_spv_ts_coeffs rdb_roq_ts_coeffs rdb_roq_ts_coeffs proc~roquet_spv_ts_coeffs->rdb_roq_ts_coeffs

Source Code

   pure subroutine roquet_spv_ts_coeffs(T_pt, S_sp, sv0, sv1, sv2, sv3)
      !! The (T, S)-dependent coefficients of the Roquet et al. (2015) SpV
      !! polynomial viewed as a polynomial in PRESSURE, in model variables
      !! (potential temperature `T_pt` degC, practical salinity `S_sp` PSU):
      !!
      !!   SV(p) = (sv0 + p*(sv1 + p*(sv2 + p*sv3))) + SV00p(p),
      !!   SV00p(p) = p*(ROQ_V00 + p*(ROQ_V01 + ... + p*ROQ_V05)),
      !!
      !! with `SV00p` the (T, S)-independent reference profile.  This is
      !! the value half of `roquet_spv_point`, term for term (same SR / CT
      !! conversion, same Horner nesting), with none of the derivative
      !! work: evaluating the expression above reproduces
      !! `roquet_spv_point`'s `sv` exactly.
      !!
      !! WHY SPLIT.  Everything expensive in the Roquet EOS -- two sqrt, the
      !! degree-7 PT->CT polynomial and the ~50-term (zs, zt) sums -- depends
      !! on T and S only.  A caller that evaluates ONE parcel at several
      !! pressures (the FV-MOM6 in-situ PGF's 5-point vertical Boole rule
      !! over a constant-T/S layer) calls this once and then pays only the
      !! degree-6 pressure Horner per point.
      !!
      !! The body is `rdb_roq_ts_coeffs` (`rdb_roquet_spv.inc`, included
      !! here): kernel modules include the same file for a local, inlinable
      !! copy rather than calling this out-of-line entry point.
      !$acc routine seq
      real(wp), intent(in)  :: T_pt
         !! Potential temperature (degC).
      real(wp), intent(in)  :: S_sp
         !! Practical salinity (PSU).
      real(wp), intent(out) :: sv0
         !! Pressure-independent part, `sv_ts0 + sv_0s0` (m^3/kg).
      real(wp), intent(out) :: sv1, sv2, sv3
         !! Coefficients of `p`, `p^2`, `p^3` (Pa-powers folded in).

      call rdb_roq_ts_coeffs(T_pt, S_sp, sv0, sv1, sv2, sv3)
   end subroutine roquet_spv_ts_coeffs