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 for which the reduced-range equation of state from Wright (1997) has been fitted to observations. |
|
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,private] :: The density at T=0, S=0 [kg m-3].%
drho_dt
[real,private] :: The derivative of density with temperature [kg m-3 degC-1].%
drho_ds
[real,private] :: The derivative of density with salinity [kg m-3 ppt-1].%
density_elem
[procedure,private] :: Implementation of the in-situ density as an elemental function [kg m-3].%
density_anomaly_elem
[procedure,private] :: Implementation of the in-situ density anomaly as an elemental function [kg m-3].%
spec_vol_elem
[procedure,private] :: Implementation of the in-situ specific volume as an elemental function [m3 kg-1].%
spec_vol_anomaly_elem
[procedure,private] :: Implementation of the in-situ specific volume anomaly as an elemental function [m3 kg-1].%
calculate_density_derivs_elem
[procedure,private] :: Implementation of the calculation of derivatives of density.%
calculate_density_second_derivs_elem
[procedure,private] :: Implementation of the calculation of second derivatives of density.%
calculate_specvol_derivs_elem
[procedure,private] :: Implementation of the calculation of derivatives of specific volume.%
calculate_compress_elem
[procedure,private] :: Implementation of the calculation of compressibility.%
eos_fit_range
[procedure,private] :: Implementation of the range query function.%
set_params_linear
[procedure,private] :: Instance specific function to set internal parameters.%
calculate_density_array
[procedure,private] :: Local implementation of generic calculate_density_array for efficiency.%
calculate_spec_vol_array
[procedure,private] :: Local implementation of generic calculate_spec_vol_array for efficiency.
Function/Subroutine Documentation¶
-
function
mom_eos_linear/
density_elem_linear
(this, T, S, pressure) [elemental]¶ 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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure :: [in] Pressure [Pa]
- Called from:
-
function
mom_eos_linear/
density_anomaly_elem_linear
(this, T, S, pressure, rho_ref) [elemental]¶ 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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure :: [in] Pressure [Pa]
rho_ref :: [in] A reference density [kg m-3]
- Called from:
-
function
mom_eos_linear/
spec_vol_elem_linear
(this, T, S, pressure) [elemental]¶ 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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure :: [in] Pressure [Pa].
- Called from:
-
function
mom_eos_linear/
spec_vol_anomaly_elem_linear
(this, T, S, pressure, spv_ref) [elemental]¶ 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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure :: [in] Pressure [Pa].
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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
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 :: [in] This EOS
t :: [in] Potential temperature [degC]
s :: [in] Salinity [ppt]
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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [ppt].
pressure :: [in] pressure [Pa].
rho :: [out] In situ density [kg m-3].
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)¶ Calculates the layer average specific volumes.
- Parameters:
t :: [in] Potential temperature [degC]
s :: [in] Salinity [ppt]
p_t :: [in] Pressure at the top of the layer [Pa]
dp :: [in] Pressure change in the layer [Pa]
spv_avg :: [inout] The vertical average specific volume in the layer [m3 kg-1]
start :: [in] the starting point in the arrays.
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]
-
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 for which the reduced-range equation of state from Wright (1997) has been fitted to observations. Care should be taken when applying this equation of state outside of its fit range.
- Parameters:
this :: [in] This EOS
t_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 :: [out] The minimum pressure over which this EoS is fitted [Pa]
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)¶ Set coefficients for the linear equation of state.
- Parameters:
this :: [inout] This EOS
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, in [kg m-3 ppt-1]
-
subroutine
mom_eos_linear/
int_density_dz_linear
(T, S, z_t, z_b, rho_ref, rho_0_pres, G_e, HI, Rho_T0_S0, dRho_dT, dRho_dS, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, dz_neglect, useMassWghtInterp)¶ 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 :: [in] Height at the top of the layer in depth units [Z ~> m].
z_b :: [in] Height at the top of the layer [Z ~> m].
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_pres :: [in] A density [R ~> kg m-3], used to calculate the pressure (as p~=-z*rho_0_pres*G_e) used in the equation of state. rho_0_pres is not used.
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]
dpa :: [out] The change in the pressure anomaly across the
intz_dpa :: [out] The integral through the thickness of the layer
intx_dpa :: [out] The integral in x of the difference between the
inty_dpa :: [out] The integral in y of the difference between the
bathyt :: [in] The depth of the bathymetry [Z ~> m].
dz_neglect :: [in] A miniscule thickness change [Z ~> m].
usemasswghtinterp :: [in] If true, uses mass weighting to interpolate T/S for top and bottom integrals.
-
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, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, dP_neglect, useMassWghtInterp)¶ 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 :: [in] Pressure at the top of the layer [R L2 T-2 ~> Pa]
p_b :: [in] Pressure at the top of the layer [R L2 T-2 ~> Pa]
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]
dza :: [out] The change in the geopotential anomaly across
intp_dza :: [out] The integral in pressure through the layer of the
intx_dza :: [out] The integral in x of the difference between the
inty_dza :: [out] The integral in y of the difference between the
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]
dp_neglect :: [in] A miniscule pressure change with the same units as p_t [R L2 T-2 ~> Pa]
usemasswghtinterp :: [in] If true, uses mass weighting to interpolate T/S for top and bottom 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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure :: [in] Pressure [Pa]
rho :: [out] In situ density [kg m-3]
start :: [in] The starting index for calculations
npts :: [in] The number of values to calculate
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 :: [in] This EOS
t :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [ppt]
pressure :: [in] Pressure [Pa]
specvol :: [out] In situ specific volume [m3 kg-1]
start :: [in] The starting index for calculations
npts :: [in] The number of values to calculate
spv_ref :: [in] A reference specific volume [m3 kg-1]
- Call to: