mom_eos_wright_full module reference
The equation of state using the Wright 1997 expressions with full range of data.
Data Types
The EOS_base implementation of the full range Wright 1997 equation of state. |
Functions/Subroutines
In situ density of sea water using a full range fit by Wright, 1997 [kg m-3]. |
|
In situ density anomaly of sea water using a full range fit by Wright, 1997 [kg m-3]. |
|
In situ specific volume of sea water using a full range fit by Wright, 1997 [kg m-3]. |
|
In situ specific volume anomaly of sea water using a full range fit by Wright, 1997 [kg m-3]. |
|
Calculate the partial derivatives of density with potential temperature and salinity using the full range equation of state, as fit by Wright, 1997. |
|
Second derivatives of density with respect to temperature, salinity, and pressure, using the full range equation of state, as fit by Wright, 1997. |
|
Calculate the partial derivatives of specific volume with temperature and salinity using the full range equation of state, as fit by Wright, 1997. |
|
Compute the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature and pressure using the full range equation of state, as fit by Wright, 1997. |
|
Calculates analytical and nearly-analytical integrals, in pressure across layers, to determine the layer-average specific volumes. |
|
Return the range of temperatures, salinities and pressures for which full-range equation of state from Wright (1997) has been fitted to observations. |
|
Calculates analytical and nearly-analytical integrals, in geopotential across layers, of pressure anomalies, 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
Wright equation of state
Wright, 1997, provide an approximation for the in situ density as a function of potential temperature, salinity, and pressure. The formula follow the Tumlirz equation of state which are easier to evaluate and make efficient.
Two ranges are provided by Wright: a “full” range and “reduced” range. The version in this module uses the full range.
Originally coded in 2000 by R. Hallberg. Anomaly form coded in 3/18.
References
Wright, D., 1997: An Equation of State for Use in Ocean Models: Eckart’s Formula Revisited. J. Ocean. Atmosph. Tech., 14 (3), 735-740. https://journals.ametsoc.org/doi/abs/10.1175/1520-0426%281997%29014%3C0735%3AAEOSFU%3E2.0.CO%3B2
Type Documentation
- type mom_eos_wright_full/wright_full_eos
The EOS_base implementation of the full range Wright 1997 equation of state.
- Type fields:
% 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.% 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_wright_full/density_elem_wright_full(this, T, S, pressure)
In situ density of sea water using a full range fit by Wright, 1997 [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 [PSU]
pressure ::
pressure[in] Pressure [Pa]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5- Called from:
- function mom_eos_wright_full/density_anomaly_elem_wright_full(this, T, S, pressure, rho_ref)
In situ density anomaly of sea water using a full range fit by Wright, 1997 [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 [PSU]
pressure ::
pressure[in] Pressure [Pa]rho_ref ::
rho_ref[in] A reference density [kg m-3]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5- Called from:
- function mom_eos_wright_full/spec_vol_elem_wright_full(this, T, S, pressure)
In situ specific volume of sea water using a full range fit by Wright, 1997 [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 [PSU]
pressure ::
pressure[in] Pressure [Pa]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5- Called from:
- function mom_eos_wright_full/spec_vol_anomaly_elem_wright_full(this, T, S, pressure, spv_ref)
In situ specific volume anomaly of sea water using a full range fit by Wright, 1997 [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 [PSU]
pressure ::
pressure[in] Pressure [Pa]spv_ref ::
spv_ref[in] A reference specific volume [m3 kg-1]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5- Called from:
- subroutine mom_eos_wright_full/calculate_density_derivs_elem_wright_full(this, T, S, pressure, drho_dT, drho_dS)
Calculate the partial derivatives of density with potential temperature and salinity using the full range equation of state, as fit by Wright, 1997.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [PSU]
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, in [kg m-3 PSU-1]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/calculate_density_second_derivs_elem_wright_full(this, T, S, pressure, drho_ds_ds, drho_ds_dt, drho_dt_dt, drho_ds_dp, drho_dt_dp)
Second derivatives of density with respect to temperature, salinity, and pressure, using the full range equation of state, as fit by Wright, 1997.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature referenced to 0 dbar [degC]
s :: [in] Salinity [PSU]
pressure ::
pressure[in] Pressure [Pa]drho_ds_ds ::
drho_ds_ds[inout] Partial derivative of beta with respect to S [kg m-3 PSU-2]drho_ds_dt ::
drho_ds_dt[inout] Partial derivative of beta with respect to T [kg m-3 PSU-1 degC-1]drho_dt_dt ::
drho_dt_dt[inout] Partial derivative of alpha with respect to T [kg m-3 degC-2]drho_ds_dp ::
drho_ds_dp[inout] Partial derivative of beta with respect to pressure [kg m-3 PSU-1 Pa-1] = [s2 m-2 PSU-1]drho_dt_dp ::
drho_dt_dp[inout] Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] = [s2 m-2 degC-1]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/calculate_specvol_derivs_elem_wright_full(this, T, S, pressure, dSV_dT, dSV_dS)
Calculate the partial derivatives of specific volume with temperature and salinity using the full range equation of state, as fit by Wright, 1997.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature [degC]
s :: [in] Salinity [PSU]
pressure ::
pressure[in] Pressure [Pa]dsv_dt :: [inout] The partial derivative of specific volume with potential temperature [m3 kg-1 degC-1]
dsv_ds :: [inout] The partial derivative of specific volume with salinity [m3 kg-1 PSU-1]
- Call to:
a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/calculate_compress_elem_wright_full(this, T, S, pressure, rho, drho_dp)
Compute the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature and pressure using the full range equation of state, as fit by Wright, 1997.
- Parameters:
this ::
this[in] This EOSt :: [in] Potential temperature relative to the surface [degC]
s :: [in] Salinity [PSU]
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]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/avg_spec_vol_wright_full(T, S, p_t, dp, SpV_avg, start, npts)
Calculates analytical and nearly-analytical integrals, in pressure across layers, to determine the layer-average specific volumes. There are essentially no free assumptions, apart from a truncation in the series for log(1-eps/1+eps) that assumes that |eps| < 0.34.
- Parameters:
t :: [in] Potential temperature relative to the surface [degC].
s :: [in] Salinity [PSU].
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.
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/eos_fit_range_wright_full(this, T_min, T_max, S_min, S_max, p_min, p_max)
Return the range of temperatures, salinities and pressures for which full-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 ::
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 practical salinity over which this EoS is fitted [PSU]
s_max :: [out] The maximum practical salinity over which this EoS is fitted [PSU]
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_wright_full/int_density_dz_wright_full(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, SSH, dz_neglect, MassWghtInterp, rho_scale, pres_scale, temp_scale, saln_scale, Z_0p)
Calculates analytical and nearly-analytical integrals, in geopotential across layers, of pressure anomalies, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model. There are essentially no free assumptions, apart from the use of Boole’s rule rule to do the horizontal integrals, and from a truncation in the series for log(1-eps/1+eps) that assumes that |eps| < 0.34.
- Parameters:
hi :: [in] The horizontal index type for the arrays.
t :: [in] Potential temperature relative to the surface
s :: [in] Salinity [S ~> PSU].
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. (The pressure is calculated as p~=-z*rho_0*G_e.)rho_0 ::
rho_0[in] Density [R ~> kg m-3], that is 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].
dpa ::
dpa[inout] The change in the pressure anomaly across theintz_dpa ::
intz_dpa[inout] The integral through the thickness of the layerintx_dpa ::
intx_dpa[inout] The integral in x of the difference between theinty_dpa ::
inty_dpa[inout] 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
rho_scale ::
rho_scale[in] A multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1 ~> 1]pres_scale ::
pres_scale[in] A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].temp_scale ::
temp_scale[in] A multiplicative factor by which to scale temperature into degC [degC C-1 ~> 1]saln_scale ::
saln_scale[in] A multiplicative factor to convert pressure into PSU [PSU S-1 ~> 1].z_0p :: [in] The height at which the pressure is 0 [Z ~> m]
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/int_spec_vol_dp_wright_full(T, S, p_t, p_b, spv_ref, HI, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, P_surf, dP_neglect, MassWghtInterp, SV_scale, pres_scale, temp_scale, saln_scale)
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. There are essentially no free assumptions, apart from the use of Boole’s rule to do the horizontal integrals, and from a truncation in the series for log(1-eps/1+eps) that assumes that |eps| < 0.34.
- Parameters:
hi :: [in] The ocean’s horizontal index type.
t :: [in] Potential temperature relative to the surface
s :: [in] Salinity [S ~> PSU].
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]spv_ref ::
spv_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 spv_ref, but this reduces the effects of roundoff.dza ::
dza[inout] The change in the geopotential anomaly acrossintp_dza ::
intp_dza[inout] The integral in pressure through the layer ofintx_dza ::
intx_dza[inout] The integral in x of the difference between theinty_dza ::
inty_dza[inout] 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
sv_scale :: [in] A multiplicative factor by which to scale specific volume from m3 kg-1 to the desired units [kg m-3 R-1 ~> 1]
pres_scale ::
pres_scale[in] A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].temp_scale ::
temp_scale[in] A multiplicative factor by which to scale temperature into degC [degC C-1 ~> 1]saln_scale ::
saln_scale[in] A multiplicative factor to convert pressure into PSU [PSU S-1 ~> 1].
- Call to:
a0a1a2b0b1b2b3b4b5c0c1c2c3c4c5
- subroutine mom_eos_wright_full/calculate_density_array_wright_full(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 [PSU]
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_wright_full/calculate_spec_vol_array_wright_full(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 [PSU]
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: