Density sensitivities ∂ρ/∂T and ∂ρ/∂S of the ACTIVE equation
of state at a point — the signed twin of eos_buoyancy_coeffs,
which is where the per-variant closed forms live:
∂ρ/∂T = −alpha_T (kg/m³ per degC; < 0 in the usual regime) ∂ρ/∂S = +beta_S (kg/m³ per PSU; > 0)
Negation is exact in IEEE-754, so this is the same number with
the opposite sign bit — never a second evaluation of the EOS.
Prefer this spelling where the consumer wants a density GRADIENT
(∇ρ = ∂ρ/∂T·∇T + ∂ρ/∂S·∇S) and eos_buoyancy_coeffs where it
wants the (α, β) pair in the eos_t member convention.
eos_specvol_derivs remains the right entry point for a consumer
that genuinely works in SPECIFIC VOLUME (EPBL’s PE weights,
kappa-shear’s dbuoy = g·ρ₀·dSV/dX); this routine is the density
form, not a duplicate of it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(eos_t), | intent(in) | :: | eos | |||
| real(kind=wp), | intent(in) | :: | T | |||
| real(kind=wp), | intent(in) | :: | S | |||
| real(kind=wp), | intent(in) | :: | p | |||
| real(kind=wp), | intent(out) | :: | drho_dt |
∂ρ/∂T (kg/m³ per degC). |
||
| real(kind=wp), | intent(out) | :: | drho_ds |
∂ρ/∂S (kg/m³ per PSU). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | alpha_T | ||||
| real(kind=wp), | private | :: | beta_S |
pure elemental subroutine eos_density_derivs(eos, T, S, p, drho_dt, drho_ds) !! Density sensitivities `∂ρ/∂T` and `∂ρ/∂S` of the ACTIVE equation !! of state at a point — the signed twin of `eos_buoyancy_coeffs`, !! which is where the per-variant closed forms live: !! !! ∂ρ/∂T = −alpha_T (kg/m³ per degC; < 0 in the usual regime) !! ∂ρ/∂S = +beta_S (kg/m³ per PSU; > 0) !! !! Negation is exact in IEEE-754, so this is the same number with !! the opposite sign bit — never a second evaluation of the EOS. !! Prefer this spelling where the consumer wants a density GRADIENT !! (`∇ρ = ∂ρ/∂T·∇T + ∂ρ/∂S·∇S`) and `eos_buoyancy_coeffs` where it !! wants the (α, β) pair in the `eos_t` member convention. !! !! `eos_specvol_derivs` remains the right entry point for a consumer !! that genuinely works in SPECIFIC VOLUME (EPBL's PE weights, !! kappa-shear's `dbuoy = g·ρ₀·dSV/dX`); this routine is the density !! form, not a duplicate of it. !$acc routine seq type(eos_t), intent(in) :: eos real(wp), intent(in) :: T, S real(wp), intent(in) :: p real(wp), intent(out) :: drho_dt !! ∂ρ/∂T (kg/m³ per degC). real(wp), intent(out) :: drho_ds !! ∂ρ/∂S (kg/m³ per PSU). real(wp) :: alpha_T, beta_S call eos_buoyancy_coeffs(eos, T, S, p, alpha_T, beta_S) drho_dt = -alpha_T drho_ds = beta_S end subroutine eos_density_derivs