mom_eos_linear module reference
A simple linear equation of state for sea water with constant coefficients.
Data Types
The EOS_base implementation of a linear equation of state. |
Functions/Subroutines
Density computed as a linear function of T and S [kg m-3]. |
|
Density anomaly computed as a linear function of T and S [kg m-3]. |
|
Specific volume using a linear equation of state for density [m3 kg-1]. |
|
Specific volume anomaly using a linear equation of state for density [m3 kg-1]. |
|
This subroutine calculates the partial derivatives of density with potential temperature and salinity. |
|
This subroutine calculates the five, partial second derivatives of density w.r.t. |
|
Calculate the derivatives of specific volume with temperature and salinity. |
|
This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure. |
|
Calculates the layer average specific volumes. |
|
Return the range of temperatures, salinities and pressures permitted for linear equation of state. |
|
Set coefficients for the linear equation of state. |
|
This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model. |
|
Calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. |
|
Calculate the in-situ density for 1D arraya inputs and outputs. |
|
Calculate the in-situ specific volume for 1D array inputs and outputs. |
Detailed Description
A simple linear equation of state for sea water with constant coefficients.
Type Documentation
- type mom_eos_linear/linear_eos
The EOS_base implementation of a linear equation of state.
- Type fields:
% rho_t0_s0 ::
real, privateThe density at T=0, S=0 and p=0 [kg m-3].% drho_dt ::
real, privateThe derivative of density with temperature [kg m-3 degC-1].% drho_ds ::
real, privateThe derivative of density with salinity [kg m-3 ppt-1].% drho_dp ::
real, privateThe derivative of density with pressure [s2 m-2].% density_elem ::
procedure, privateImplementation of the in-situ density as an elemental function [kg m-3].% density_anomaly_elem ::
procedure, privateImplementation of the in-situ density anomaly as an elemental function [kg m-3].% spec_vol_elem ::
procedure, privateImplementation of the in-situ specific volume as an elemental function [m3 kg-1].% spec_vol_anomaly_elem ::
procedure, privateImplementation of the in-situ specific volume anomaly as an elemental function [m3 kg-1].% calculate_density_derivs_elem ::
procedure, privateImplementation of the calculation of derivatives of density.% calculate_density_second_derivs_elem ::
procedure, privateImplementation of the calculation of second derivatives of density.% calculate_specvol_derivs_elem ::
procedure, privateImplementation of the calculation of derivatives of specific volume.% calculate_compress_elem ::
procedure, privateImplementation of the calculation of compressibility.% eos_fit_range ::
procedure, privateImplementation of the range query function.% set_params_linear ::
procedure, privateInstance specific function to set internal parameters.% calculate_density_array ::
procedure, privateLocal implementation of generic calculate_density_array for efficiency.% calculate_spec_vol_array ::
procedure, privateLocal implementation of generic calculate_spec_vol_array for efficiency.
Function/Subroutine Documentation
- function mom_eos_linear/density_elem_linear(this, T, S, pressure)
Density computed as a linear function of T and S [kg m-3].
This is an elemental function that can be applied to any combination of scalar and array inputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure ::
pressure[in] Pressure [Pa]
- Called from:
- function mom_eos_linear/density_anomaly_elem_linear(this, T, S, pressure, rho_ref)
Density anomaly computed as a linear function of T and S [kg m-3].
This is an elemental function that can be applied to any combination of scalar and array inputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure ::
pressure[in] Pressure [Pa]rho_ref ::
rho_ref[in] A reference density [kg m-3]
- Called from:
- function mom_eos_linear/spec_vol_elem_linear(this, T, S, pressure)
Specific volume using a linear equation of state for density [m3 kg-1].
This is an elemental function that can be applied to any combination of scalar and array inputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure ::
pressure[in] Pressure [Pa].
- Called from:
- function mom_eos_linear/spec_vol_anomaly_elem_linear(this, T, S, pressure, spv_ref)
Specific volume anomaly using a linear equation of state for density [m3 kg-1].
This is an elemental function that can be applied to any combination of scalar and array inputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure ::
pressure[in] Pressure [Pa].spv_ref ::
spv_ref[in] A reference specific volume [m3 kg-1].
- Called from:
- subroutine mom_eos_linear/calculate_density_derivs_elem_linear(this, T, S, pressure, dRho_dT, dRho_dS)
This subroutine calculates the partial derivatives of density with potential temperature and salinity.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure ::
pressure[in] Pressure [Pa].drho_dt :: [out] The partial derivative of density with potential temperature [kg m-3 degC-1].
drho_ds :: [out] The partial derivative of density with salinity [kg m-3 ppt-1].
- subroutine mom_eos_linear/calculate_density_second_derivs_elem_linear(this, T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP)
This subroutine calculates the five, partial second derivatives of density w.r.t. potential temperature and salinity and pressure which for a linear equation of state should all be 0.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure ::
pressure[in] pressure [Pa].drho_ds_ds :: [inout] The second derivative of density with salinity [kg m-3 ppt-2].
drho_ds_dt :: [inout] The second derivative of density with temperature and salinity [kg m-3 ppt-1 degC-1].
drho_dt_dt :: [inout] The second derivative of density with temperature [kg m-3 degC-2].
drho_ds_dp :: [inout] The second derivative of density with salinity and pressure [kg m-3 ppt-1 Pa-1].
drho_dt_dp :: [inout] The second derivative of density with temperature and pressure [kg m-3 degC-1 Pa-1].
- subroutine mom_eos_linear/calculate_specvol_derivs_elem_linear(this, T, S, pressure, dSV_dT, dSV_dS)
Calculate the derivatives of specific volume with temperature and salinity.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature [degC]
s :: [in] Salinity [ppt]
pressure ::
pressure[in] pressure [Pa]dsv_ds :: [inout] The partial derivative of specific volume with salinity [m3 kg-1 ppt-1]
dsv_dt :: [inout] The partial derivative of specific volume with potential temperature [m3 kg-1 degC-1]
- subroutine mom_eos_linear/calculate_compress_elem_linear(this, T, S, pressure, rho, drho_dp)
This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure ::
pressure[in] pressure [Pa].rho ::
rho[out] In situ density [kg m-3].drho_dp ::
drho_dp[out] The partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2].
- subroutine mom_eos_linear/avg_spec_vol_linear(T, S, p_t, dp, SpV_avg, start, npts, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp)
Calculates the layer average specific volumes. The analytical solution is SpV_avg = 1 / (drho_dp*dp) * ln[(1+eps)/(1-eps)] and the expression here is the first five terms of its Taylor series with a trunction error of O(eps**10). |eps|<0.02 for real ocean parameters.
- Parameters:
t :: [in] Potential temperature [degC]
s :: [in] Salinity [ppt]
p_t ::
p_t[in] Pressure at the top of the layer [Pa]dp ::
dp[in] Pressure change in the layer [Pa]spv_avg :: [inout] The vertical average specific volume in the layer [m3 kg-1]
start ::
start[in] the starting point in the arrays.npts ::
npts[in] the number of values to calculate.rho_t0_s0 :: [in] The density at T=0, S=0 [kg m-3]
drho_dt :: [in] The derivative of density with temperature [kg m-3 degC-1]
drho_ds :: [in] The derivative of density with salinity [kg m-3 ppt-1]
drho_dp :: [in] The derivative of density with pressure [s2 m-2]
- subroutine mom_eos_linear/eos_fit_range_linear(this, T_min, T_max, S_min, S_max, p_min, p_max)
Return the range of temperatures, salinities and pressures permitted for linear equation of state. Care should be taken when applying this equation of state outside of its fit range.
- Parameters:
this ::
this[in] This EOSt_min :: [out] The minimum potential temperature over which this EoS is fitted [degC]
t_max :: [out] The maximum potential temperature over which this EoS is fitted [degC]
s_min :: [out] The minimum salinity over which this EoS is fitted [ppt]
s_max :: [out] The maximum salinity over which this EoS is fitted [ppt]
p_min ::
p_min[out] The minimum pressure over which this EoS is fitted [Pa]p_max ::
p_max[out] The maximum pressure over which this EoS is fitted [Pa]
- subroutine mom_eos_linear/set_params_linear(this, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp)
Set coefficients for the linear equation of state.
- Parameters:
this ::
this[inout] This EOSrho_t0_s0 :: [in] The density at T=0, S=0 [kg m-3]
drho_dt :: [in] The derivative of density with temperature, [kg m-3 degC-1]
drho_ds :: [in] The derivative of density with salinity, in [kg m-3 ppt-1]
drho_dp :: [in] The derivative of density with pressure, in [s2 m-2]
- subroutine mom_eos_linear/int_density_dz_linear(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, SSH, dz_neglect, MassWghtInterp, Z_0p)
This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model.
- Parameters:
hi :: [in] The horizontal index type for the arrays.
t :: [in] Potential temperature relative to the surface
s :: [in] Salinity [S ~> ppt].
z_t ::
z_t[in] Height at the top of the layer in depth units [Z ~> m].z_b ::
z_b[in] Height at the top of the layer [Z ~> m].rho_ref ::
rho_ref[in] A mean density [R ~> kg m-3], that is subtracted out to reduce the magnitude of each of the integrals.rho_0 ::
rho_0[in] A density [R ~> kg m-3], used to calculate the pressure (as p~=-z*rho_0*G_e) used in the equation of state.g_e :: [in] The Earth’s gravitational acceleration [L2 Z-1 T-2 ~> m s-2]
rho_t0_s0 :: [in] The density at T=0, S=0 [R ~> kg m-3]
drho_dt :: [in] The derivative of density with temperature, [R C-1 ~> kg m-3 degC-1]
drho_ds :: [in] The derivative of density with salinity, in [R S-1 ~> kg m-3 ppt-1]
drho_dp :: [in] The derivative of density with pressure, in [L-2 T2 ~> m-2 s2]
dpa ::
dpa[out] The change in the pressure anomaly across theintz_dpa ::
intz_dpa[out] The integral through the thickness of the layerintx_dpa ::
intx_dpa[out] The integral in x of the difference between theinty_dpa ::
inty_dpa[out] The integral in y of the difference between thebathyt :: [in] The depth of the bathymetry [Z ~> m].
ssh :: [in] The sea surface height [Z ~> m]
dz_neglect ::
dz_neglect[in] A miniscule thickness change [Z ~> m].masswghtinterp :: [in] A flag indicating whether and how to use mass weighting to interpolate T/S in integrals
z_0p :: [in] The height at which the pressure is 0 [Z ~> m]
- subroutine mom_eos_linear/int_spec_vol_dp_linear(T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, P_surf, dP_neglect, MassWghtInterp)
Calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. Specific volume is assumed to vary linearly between adjacent points.
- Parameters:
hi :: [in] The ocean’s horizontal index type.
t :: [in] Potential temperature relative to the surface
s :: [in] Salinity [S ~> ppt].
p_t ::
p_t[in] Pressure at the top of the layer [R L2 T-2 ~> Pa]p_b ::
p_b[in] Pressure at the top of the layer [R L2 T-2 ~> Pa]alpha_ref ::
alpha_ref[in] A mean specific volume that is subtracted out to reduce the magnitude of each of the integrals [R-1 ~> m3 kg-1]. The calculation is mathematically identical with different values of alpha_ref, but this reduces the effects of roundoff.rho_t0_s0 :: [in] The density at T=0, S=0 [R ~> kg m-3]
drho_dt :: [in] The derivative of density with temperature [R C-1 ~> kg m-3 degC-1]
drho_ds :: [in] The derivative of density with salinity, in [R S-1 ~> kg m-3 ppt-1]
drho_dp :: [in] The derivative of density with pressure, in [L-2 T2 ~> m-2 s2]
dza ::
dza[out] The change in the geopotential anomaly acrossintp_dza ::
intp_dza[out] The integral in pressure through the layer of theintx_dza ::
intx_dza[out] The integral in x of the difference between theinty_dza ::
inty_dza[out] The integral in y of the difference between thehalo_size ::
halo_size[in] The width of halo points on which to calculate dza.bathyp :: [in] The pressure at the bathymetry [R L2 T-2 ~> Pa]
p_surf :: [in] The pressure at the ocean surface [R L2 T-2 ~> Pa]
dp_neglect :: [in] A miniscule pressure change with the same units as p_t [R L2 T-2 ~> Pa]
masswghtinterp :: [in] A flag indicating whether and how to use mass weighting to interpolate T/S in integrals
- subroutine mom_eos_linear/calculate_density_array_linear(this, T, S, pressure, rho, start, npts, rho_ref)
Calculate the in-situ density for 1D arraya inputs and outputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure ::
pressure[in] Pressure [Pa]rho ::
rho[out] In situ density [kg m-3]start ::
start[in] The starting index for calculationsnpts ::
npts[in] The number of values to calculaterho_ref ::
rho_ref[in] A reference density [kg m-3]
- Call to:
- subroutine mom_eos_linear/calculate_spec_vol_array_linear(this, T, S, pressure, specvol, start, npts, spv_ref)
Calculate the in-situ specific volume for 1D array inputs and outputs.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure ::
pressure[in] Pressure [Pa]specvol ::
specvol[out] In situ specific volume [m3 kg-1]start ::
start[in] The starting index for calculationsnpts ::
npts[in] The number of values to calculatespv_ref ::
spv_ref[in] A reference specific volume [m3 kg-1]
- Call to: