MOM_EOS module reference
Provides subroutines for quantities specific to the equation of state
Data Types
A control structure for the equation of state |
Generic Interfaces
Calculates density of sea water from T, S and P |
|
Calculates specific volume of sea water from T, S and P |
|
Calculate the derivatives of density with temperature and salinity from T, S, and P |
|
Calculate the derivatives of specific volume with temperature and salinity from T, S, and P |
|
Calculates the second derivatives of density with various combinations of temperature, salinity, and pressure from T, S and P |
|
Calculates the freezing point of sea water from T, S and P |
|
Calculates the compressibility of water from T, S, and P |
Functions/Subroutines
Density of sea water (in-situ if pressure is local) [R ~> kg m-3] |
|
Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned. The pressure and density can be rescaled with the values stored in EOS. If the scale argument is present the density scaling uses the product of the two scaling factors. |
|
Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T-S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned. The density can be rescaled using rho_ref. |
|
Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on. If rho_ref is present, the anomaly with respect to rho_ref is returned. |
|
Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S, potentially limiting the domain of indices that are worked on. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned. |
|
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs. |
|
Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs. |
|
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on. |
|
Calls the appropriate subroutine to calculate the freezing point for scalar inputs. |
|
Calls the appropriate subroutine to calculate the freezing point for a 1-D array. |
|
Calls the appropriate subroutine to calculate the freezing point for a 1-D array, taking dimensionally rescaled arguments with factors stored in EOS. |
|
Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs. |
|
Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs. |
|
Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array |
|
Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs. |
|
Calls the appropriate subroutine to calculate density second derivatives for scalar inputs. |
|
Calls the appropriate subroutine to calculate specific volume derivatives for an array. |
|
Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on. |
|
Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. The inputs and outputs use dimensionally rescaled units. |
|
Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate_compress_1d. The inputs and outputs use dimensionally rescaled units. |
|
Calls the appropriate subroutine to calculate the layer averaged specific volume either using Boole's rule quadrature or analytical and nearly-analytical averages in pressure. |
|
Return the range of temperatures, salinities and pressures for which the equation of state that is being used has been fitted to observations. Care should be taken when applying this equation of state outside of its fit range. |
|
This subroutine returns a two point integer array indicating the domain of i-indices to work on in EOS calls based on information from a hor_index type |
|
Calls the appropriate subroutine to calculate 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. |
|
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. |
|
Returns true if the equation of state is compressible (i.e. has pressure dependence) |
|
Returns the string identifying the equation of state with enumeration "id" |
|
Initializes EOS_type by allocating and reading parameters. The scaling factors in US are stored in EOS for later use. |
|
Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS) |
|
Convert T&S to Absolute Salinity and Conservative Temperature if using TEOS10 |
|
Converts an array of conservative temperatures to potential temperatures. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale. |
|
Converts an array of potential temperatures to conservative temperatures. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale. |
|
Converts an array of absolute salinity to practical salinity. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale. |
|
Converts an array of absolute salinity to practical salinity. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale. |
|
Return value of EOS_quadrature |
|
Runs unit tests for consistency on the equations of state. This should only be called from a single/root thread. It returns True if any test fails, otherwise it returns False. |
|
Write a message indicating how well a value matches its check value. |
|
Test an equation of state for self-consistency and consistency with check values, returning false if it is consistent by all tests, and true if it fails any test. |
Type Documentation
- type, public :: EOS_type
A control structure for the equation of state
- Parameters
form_of_EOS
The equation of state to use.
form_of_TFreeze
The expression for the potential temperature of the freezing point.
EOS_quadrature
If true, always use the generic (quadrature) code for the integrals of density.
Compressible
If true, in situ density is a function of pressure.
Rho_T0_S0
The density at T=0, S=0 [kg m-3]
dRho_dT
The partial derivative of density with temperature [kg m-3 degC-1]
dRho_dS
The partial derivative of density with salinity [kg m-3 ppt-1]
dRho_dp
The partial derivative of density with pressure [s2 m-2]
TFr_S0_P0
The freezing potential temperature at S=0, P=0 [degC]
dTFr_dS
The derivative of freezing point with salinity [degC ppt-1]
dTFr_dp
The derivative of freezing point with pressure [degC Pa-1]
use_conT_absS
True if the model internal temperature is the conservative temperature and the salinity is absolute salinity. These could be separated into two flags, but right now it is controlled by one input parameter and there is no known need to have one True and one False.
TFreeze_S_is_pracS
True if the freezing point expression is formulated from practical salinity
TFreeze_T_is_potT
True if the freezing point expression yields a potential temperature
use_Wright_2nd_deriv_bug
If true, use a separate subroutine that retains a buggy version of the calculations of the second derivative of density with temperature and with temperature and pressure. This bug is corrected in the default version.
m_to_Z
A constant that translates distances in meters to the units of depth [Z m-1 ~> 1]
kg_m3_to_R
A constant that translates kilograms per meter cubed to the units of density [R m3 kg-1 ~> 1]
R_to_kg_m3
A constant that translates the units of density to kilograms per meter cubed [kg m-3 R-1 ~> 1]
RL2_T2_to_Pa
Convert pressures from R L2 T-2 to Pa [Pa T2 R-1 L-2 ~> 1]
L_T_to_m_s
Convert lateral velocities from L T-1 to m s-1 [m T s-1 L-1 ~> 1]
degC_to_C
A constant that translates degrees Celsius to the units of temperature [C degC-1 ~> 1]
C_to_degC
A constant that translates the units of temperature to degrees Celsius [degC C-1 ~> 1]
ppt_to_S
A constant that translates parts per thousand to the units of salinity [S ppt-1 ~> 1]
S_to_ppt
A constant that translates the units of salinity to parts per thousand [ppt S-1 ~> 1]
The instance of the actual equation of state
Generic Interface Documentation
- interface calculate_density
Calculates density of sea water from T, S and P
Callers call graph
Text view
benchmark_initialization::benchmark_init_temperature_salinity → mom_eos::interface::calculate_density
benchmark_initialization::benchmark_initialize_thickness → mom_eos::interface::calculate_density
coord_hycom::build_hycom1_column → mom_eos::interface::calculate_density
coord_hycom::build_hycom1_target_anomaly → mom_eos::interface::calculate_density
coord_rho::build_rho_column → mom_eos::interface::calculate_density
coord_rho::build_rho_column_iteratively → mom_eos::interface::calculate_density
dome_initialization::dome_set_obc_data → mom_eos::interface::calculate_density
isomip_initialization::isomip_initialize_sponges → mom_eos::interface::calculate_density
isomip_initialization::isomip_initialize_temperature_salinity → mom_eos::interface::calculate_density
isomip_initialization::isomip_initialize_thickness → mom_eos::interface::calculate_density
mom::adjust_ssh_for_p_atm → mom_eos::interface::calculate_density
mom_bulk_mixed_layer::bulkmixedlayer → mom_eos::interface::calculate_density
mom_coord_initialization::set_coord_from_ts_profile → mom_eos::interface::calculate_density
mom_coord_initialization::set_coord_from_ts_range → mom_eos::interface::calculate_density
mom_coord_initialization::set_coord_from_ts_ref → mom_eos::interface::calculate_density
mom_cvmix_conv::calculate_cvmix_conv → mom_eos::interface::calculate_density
mom_cvmix_kpp::kpp_compute_bld → mom_eos::interface::calculate_density
mom_cvmix_shear::calculate_cvmix_shear → mom_eos::interface::calculate_density
mom_density_integrals::frac_dp_at_pos → mom_eos::interface::calculate_density
mom_density_integrals::int_density_dz_generic_pcm → mom_eos::interface::calculate_density
mom_density_integrals::int_density_dz_generic_plm → mom_eos::interface::calculate_density
mom_density_integrals::int_density_dz_generic_ppm → mom_eos::interface::calculate_density
mom_diabatic_driver::layered_diabatic → mom_eos::interface::calculate_density
mom_diagnose_mld::diagnosemldbydensitydifference → mom_eos::interface::calculate_density
mom_diagnose_mld::diagnosemldbyenergy → mom_eos::interface::calculate_density
mom_diagnostics::calculate_diagnostic_fields → mom_eos::interface::calculate_density
mom_diapyc_energy_req::diapyc_energy_req_calc → mom_eos::interface::calculate_density
mom_entrain_diffusive::entrainment_diffusive → mom_eos::interface::calculate_density
mom_entrain_diffusive::set_ent_bl → mom_eos::interface::calculate_density
mom_eos::test_eos_consistency → mom_eos::interface::calculate_density
mom_geothermal::geothermal_entraining → mom_eos::interface::calculate_density
mom_hybgen_regrid::hybgen_regrid → mom_eos::interface::calculate_density
mom_hybgen_unmix::hybgen_column_unmix → mom_eos::interface::calculate_density
mom_hybgen_unmix::hybgen_unmix → mom_eos::interface::calculate_density
mom_ice_shelf::shelf_calc_flux → mom_eos::interface::calculate_density
mom_interface_heights::dz_to_thickness_eos → mom_eos::interface::calculate_density
mom_kappa_shear::kappa_shear_column → mom_eos::interface::calculate_density
mom_mixed_layer_restrat::detect_mld → mom_eos::interface::calculate_density
mom_mixed_layer_restrat::mixedlayer_restrat_bml → mom_eos::interface::calculate_density
mom_mixed_layer_restrat::mixedlayer_restrat_bodner → mom_eos::interface::calculate_density
mom_mixed_layer_restrat::mixedlayer_restrat_om4 → mom_eos::interface::calculate_density
mom_neutral_diffusion::calc_delta_rho_and_derivs → mom_eos::interface::calculate_density
mom_pressureforce_fv::pressureforce_fv_bouss → mom_eos::interface::calculate_density
mom_pressureforce_fv::pressureforce_fv_nonbouss → mom_eos::interface::calculate_density
mom_pressureforce_mont::pressureforce_mont_bouss → mom_eos::interface::calculate_density
mom_pressureforce_mont::pressureforce_mont_nonbouss → mom_eos::interface::calculate_density
mom_pressureforce_mont::set_pbce_bouss → mom_eos::interface::calculate_density
mom_pressureforce_mont::set_pbce_nonbouss → mom_eos::interface::calculate_density
mom_regridding::convective_adjustment → mom_eos::interface::calculate_density
mom_regularize_layers::regularize_surface → mom_eos::interface::calculate_density
mom_set_diffusivity::find_tke_to_kd → mom_eos::interface::calculate_density
mom_set_diffusivity::set_density_ratios → mom_eos::interface::calculate_density
mom_set_visc::set_viscous_bbl → mom_eos::interface::calculate_density
mom_state_initialization::calc_sfc_displacement → mom_eos::interface::calculate_density
mom_state_initialization::initialize_sponges_file → mom_eos::interface::calculate_density
mom_state_initialization::initialize_temp_salt_fit → mom_eos::interface::calculate_density
mom_state_initialization::mom_state_init_tests → mom_eos::interface::calculate_density
mom_state_initialization::mom_temp_salt_initialize_from_z → mom_eos::interface::calculate_density
mom_tracer_hor_diff::tracer_epipycnal_ml_diff → mom_eos::interface::calculate_density
mom_tracer_z_init::determine_temperature → mom_eos::interface::calculate_density
rgc_initialization::rgc_initialize_sponges → mom_eos::interface::calculate_density
user_change_diffusivity::user_change_diff → mom_eos::interface::calculate_density
- interface calculate_spec_vol
Calculates specific volume of sea water from T, S and P
Callers call graph
Text view
mom_bulk_mixed_layer::bulkmixedlayer → mom_eos::interface::calculate_spec_vol
mom_density_integrals::int_spec_vol_dp_generic_pcm → mom_eos::interface::calculate_spec_vol
mom_density_integrals::int_spec_vol_dp_generic_plm → mom_eos::interface::calculate_spec_vol
mom_eos::average_specific_vol → mom_eos::interface::calculate_spec_vol
mom_eos::test_eos_consistency → mom_eos::interface::calculate_spec_vol
mom_mixed_layer_restrat::mixedlayer_restrat_bml → mom_eos::interface::calculate_spec_vol
mom_mixed_layer_restrat::mixedlayer_restrat_bodner → mom_eos::interface::calculate_spec_vol
mom_mixed_layer_restrat::mixedlayer_restrat_om4 → mom_eos::interface::calculate_spec_vol
mom_pressureforce_fv::pressureforce_fv_nonbouss → mom_eos::interface::calculate_spec_vol
- interface calculate_density_derivs
Calculate the derivatives of density with temperature and salinity from T, S, and P
Callers call graph
Text view
benchmark_initialization::benchmark_init_temperature_salinity → mom_eos::interface::calculate_density_derivs
benchmark_initialization::benchmark_initialize_thickness → mom_eos::interface::calculate_density_derivs
coord_adapt::build_adapt_column → mom_eos::interface::calculate_density_derivs
dome_initialization::dome_set_obc_data → mom_eos::interface::calculate_density_derivs
isomip_initialization::isomip_initialize_temperature_salinity → mom_eos::interface::calculate_density_derivs
mom_bulk_mixed_layer::bulkmixedlayer → mom_eos::interface::calculate_density_derivs
mom_cvmix_ddiff::compute_ddiff_coeffs → mom_eos::interface::calculate_density_derivs
mom_diabatic_aux::applyboundaryfluxesinout → mom_eos::interface::calculate_density_derivs
mom_diabatic_driver::diabatic_ale → mom_eos::interface::calculate_density_derivs
mom_diabatic_driver::diabatic_ale_legacy → mom_eos::interface::calculate_density_derivs
mom_diagnostics::calculate_diagnostic_fields → mom_eos::interface::calculate_density_derivs
mom_entrain_diffusive::entrainment_diffusive → mom_eos::interface::calculate_density_derivs
mom_eos::test_eos_consistency → mom_eos::interface::calculate_density_derivs
mom_forcing_type::calculatebuoyancyflux1d → mom_eos::interface::calculate_density_derivs
mom_full_convection::smoothed_drdt_drds → mom_eos::interface::calculate_density_derivs
mom_geothermal::geothermal_entraining → mom_eos::interface::calculate_density_derivs
mom_geothermal::geothermal_in_place → mom_eos::interface::calculate_density_derivs
mom_hybgen_unmix::hybgen_column_unmix → mom_eos::interface::calculate_density_derivs
mom_ice_shelf::shelf_calc_flux → mom_eos::interface::calculate_density_derivs
mom_int_tide_input::find_n2_bottom → mom_eos::interface::calculate_density_derivs
mom_isopycnal_slopes::calc_isoneutral_slopes → mom_eos::interface::calculate_density_derivs
mom_kappa_shear::kappa_shear_column → mom_eos::interface::calculate_density_derivs
mom_lateral_mixing_coeffs::calc_sqg_struct → mom_eos::interface::calculate_density_derivs
mom_neutral_diffusion::calc_delta_rho_and_derivs → mom_eos::interface::calculate_density_derivs
mom_neutral_diffusion::neutral_diffusion_calc_coeffs → mom_eos::interface::calculate_density_derivs
mom_pressureforce_mont::set_pbce_bouss → mom_eos::interface::calculate_density_derivs
mom_pressureforce_mont::set_pbce_nonbouss → mom_eos::interface::calculate_density_derivs
mom_set_diffusivity::double_diffusion → mom_eos::interface::calculate_density_derivs
mom_set_diffusivity::find_n2 → mom_eos::interface::calculate_density_derivs
mom_set_visc::set_viscous_bbl → mom_eos::interface::calculate_density_derivs
mom_set_visc::set_viscous_ml → mom_eos::interface::calculate_density_derivs
mom_state_initialization::initialize_temp_salt_fit → mom_eos::interface::calculate_density_derivs
mom_thickness_diffuse::thickness_diffuse_full → mom_eos::interface::calculate_density_derivs
mom_tracer_z_init::determine_temperature → mom_eos::interface::calculate_density_derivs
mom_wave_speed::wave_speed → mom_eos::interface::calculate_density_derivs
mom_wave_speed::wave_speeds → mom_eos::interface::calculate_density_derivs
- interface calculate_specific_vol_derivs
Calculate the derivatives of specific volume with temperature and salinity from T, S, and P
Callers call graph
Text view
mom_bulk_mixed_layer::bulkmixedlayer → mom_eos::interface::calculate_specific_vol_derivs
mom_diabatic_aux::applyboundaryfluxesinout → mom_eos::interface::calculate_specific_vol_derivs
mom_diabatic_driver::diabatic_ale → mom_eos::interface::calculate_specific_vol_derivs
mom_diabatic_driver::diabatic_ale_legacy → mom_eos::interface::calculate_specific_vol_derivs
mom_diapyc_energy_req::diapyc_energy_req_calc → mom_eos::interface::calculate_specific_vol_derivs
mom_entrain_diffusive::entrainment_diffusive → mom_eos::interface::calculate_specific_vol_derivs
mom_eos::test_eos_consistency → mom_eos::interface::calculate_specific_vol_derivs
mom_forcing_type::calculatebuoyancyflux1d → mom_eos::interface::calculate_specific_vol_derivs
mom_geothermal::geothermal_in_place → mom_eos::interface::calculate_specific_vol_derivs
mom_kappa_shear::kappa_shear_column → mom_eos::interface::calculate_specific_vol_derivs
mom_set_visc::set_viscous_ml → mom_eos::interface::calculate_specific_vol_derivs
mom_wave_speed::wave_speed → mom_eos::interface::calculate_specific_vol_derivs
mom_wave_speed::wave_speeds → mom_eos::interface::calculate_specific_vol_derivs
- interface calculate_density_second_derivs
Calculates the second derivatives of density with various combinations of temperature, salinity, and pressure from T, S and P
Callers call graph
- interface calculate_TFreeze
Calculates the freezing point of sea water from T, S and P
Callers call graph
Text view
mom::extract_surface_state → mom_eos::interface::calculate_tfreeze
mom_diabatic_aux::make_frazil → mom_eos::interface::calculate_tfreeze
mom_diabatic_driver::diabatic → mom_eos::interface::calculate_tfreeze
mom_eos::test_tfr_consistency → mom_eos::interface::calculate_tfreeze
mom_ice_shelf::shelf_calc_flux → mom_eos::interface::calculate_tfreeze
- interface calculate_compress
Calculates the compressibility of water from T, S, and P
Functions/Subroutine Documentation
- real elemental function calculate_density_elem(EOS, T, S, pressure, rho_ref, scale)
Density of sea water (in-situ if pressure is local) [R ~> kg m-3]
If rho_ref is present, the anomaly with respect to rho_ref is returned. The pressure and density can be rescaled with the values stored in EOS. If the scale argument is present the density scaling uses the product of the two scaling factors.
- Parameters
EOS [in]
Equation of state structure
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho_ref [in]
A reference density [R ~> kg m-3]
scale [in]
A multiplicative factor by which to scale output density in combination with scaling stored in EOS [various]
- subroutine calculate_density_scalar(T, S, pressure, rho, EOS, rho_ref, scale)
Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned. The pressure and density can be rescaled with the values stored in EOS. If the scale argument is present the density scaling uses the product of the two scaling factors.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho [out]
Density (in-situ if pressure is local) [R ~> kg m-3]
EOS [in]
Equation of state structure
rho_ref [in]
A reference density [R ~> kg m-3]
scale [in]
A multiplicative factor by which to scale output density in combination with scaling stored in EOS [various]
Callers call graph
- subroutine calculate_stanley_density_scalar(T, S, pressure, Tvar, TScov, Svar, rho, EOS, rho_ref, scale)
Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T-S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned. The density can be rescaled using rho_ref.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
Tvar [in]
Variance of potential temperature referenced to the surface [C2 ~> degC2]
TScov [in]
Covariance of potential temperature and salinity [C S ~> degC ppt]
Svar [in]
Variance of salinity [S2 ~> ppt2]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho [out]
Density (in-situ if pressure is local) [R ~> kg m-3]
EOS [in]
Equation of state structure
rho_ref [in]
A reference density [R ~> kg m-3].
scale [in]
A multiplicative factor by which to scale output density in combination with scaling stored in EOS [various]
- subroutine calculate_density_1d(T, S, pressure, rho, EOS, dom, rho_ref, scale)
Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on. If rho_ref is present, the anomaly with respect to rho_ref is returned.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho [inout]
Density (in-situ if pressure is local) [R ~> kg m-3]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
rho_ref [in]
A reference density [R ~> kg m-3]
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
- subroutine calculate_stanley_density_1d(T, S, pressure, Tvar, TScov, Svar, rho, EOS, dom, rho_ref, scale)
Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S, potentially limiting the domain of indices that are worked on. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
Tvar [in]
Variance of potential temperature [C2 ~> degC2]
TScov [in]
Covariance of potential temperature and salinity [C S ~> degC ppt]
Svar [in]
Variance of salinity [S2 ~> ppt2]
rho [inout]
Density (in-situ if pressure is local) [R ~> kg m-3]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
rho_ref [in]
A reference density [R ~> kg m-3]
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
- subroutine calculate_spec_vol_array(T, S, pressure, specvol, start, npts, EOS, spv_ref, scale)
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs.
- Parameters
T [in]
potential temperature relative to the surface [degC]
S [in]
salinity [ppt]
pressure [in]
pressure [Pa]
specvol [inout]
in situ specific volume [kg m-3]
start [in]
the starting point in the arrays.
npts [in]
the number of values to calculate.
EOS [in]
Equation of state structure
spv_ref [in]
A reference specific volume [m3 kg-1]
scale [in]
A multiplicative factor by which to scale specific volume in combination with scaling stored in EOS [various]
Callers call graph
- subroutine calc_spec_vol_scalar(T, S, pressure, specvol, EOS, spv_ref, scale)
Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
specvol [out]
In situ or potential specific volume [R-1 ~> m3 kg-1] or other units determined by the scale argument
EOS [in]
Equation of state structure
spv_ref [in]
A reference specific volume [R-1 ~> m3 kg-1]
scale [in]
A multiplicative factor by which to scale specific volume in combination with scaling stored in EOS [various]
- subroutine calc_spec_vol_1d(T, S, pressure, specvol, EOS, dom, spv_ref, scale)
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
specvol [inout]
In situ specific volume [R-1 ~> m3 kg-1]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
spv_ref [in]
A reference specific volume [R-1 ~> m3 kg-1]
scale [in]
A multiplicative factor by which to scale output specific volume in combination with scaling stored in EOS [various]
- subroutine calculate_TFreeze_scalar(S, pressure, T_fr, EOS, pres_scale, scale_from_EOS)
Calls the appropriate subroutine to calculate the freezing point for scalar inputs.
- Parameters
S [in]
Salinity, [ppt] or [S ~> ppt] depending on scale_from_EOS
pressure [in]
Pressure, in [Pa] or [R L2 T-2 ~> Pa] depending on pres_scale or scale_from_EOS
T_fr [out]
Freezing point potential temperature referenced to the surface [degC] or [C ~> degC] depending on scale_from_EOS
EOS [in]
Equation of state structure
pres_scale [in]
A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].
scale_from_EOS [in]
If present true use the dimensional scaling factors stored in EOS. Omission is the same .false.
Callees call graph
Text view
mom_eos::calculate_tfreeze_scalar → mom_error_handler::mom_error
mom_eos::calculate_tfreeze_scalar → mom_tfreeze::interface::calculate_tfreeze_linear
mom_eos::calculate_tfreeze_scalar → mom_tfreeze::interface::calculate_tfreeze_millero
mom_eos::calculate_tfreeze_scalar → mom_tfreeze::interface::calculate_tfreeze_teos10
mom_eos::calculate_tfreeze_scalar → mom_tfreeze::interface::calculate_tfreeze_teos_poly
External calls
- gsw_mod_toolbox
gsw_ct_from_pt (gsw_mod_toolbox::gsw_ct_from_pt)
gsw_sp_from_sr (gsw_mod_toolbox::gsw_sp_from_sr)
- subroutine calculate_TFreeze_array(S, pressure, T_fr, start, npts, EOS, pres_scale)
Calls the appropriate subroutine to calculate the freezing point for a 1-D array.
- Parameters
S [in]
Salinity [ppt]
pressure [in]
Pressure, in [Pa] or [R L2 T-2 ~> Pa] depending on pres_scale
T_fr [inout]
Freezing point, either potential temperature referenced to the surface or conservative temperature depending on settings [degC]
start [in]
Starting index within the array
npts [in]
The number of values to calculate
EOS [in]
Equation of state structure
pres_scale [in]
A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].
Callees call graph
Text view
mom_eos::calculate_tfreeze_array → mom_error_handler::mom_error
mom_eos::calculate_tfreeze_array → mom_tfreeze::interface::calculate_tfreeze_linear
mom_eos::calculate_tfreeze_array → mom_tfreeze::interface::calculate_tfreeze_millero
mom_eos::calculate_tfreeze_array → mom_tfreeze::interface::calculate_tfreeze_teos10
mom_eos::calculate_tfreeze_array → mom_tfreeze::interface::calculate_tfreeze_teos_poly
External calls
- gsw_mod_toolbox
gsw_ct_from_pt (gsw_mod_toolbox::gsw_ct_from_pt)
gsw_sp_from_sr (gsw_mod_toolbox::gsw_sp_from_sr)
- subroutine calculate_TFreeze_1d(S, pressure, T_fr, EOS, dom)
Calls the appropriate subroutine to calculate the freezing point for a 1-D array, taking dimensionally rescaled arguments with factors stored in EOS.
- Parameters
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
T_fr [inout]
Freezing point, either potential temperature referenced to the surface or conservative temperature depending on settings [C ~> degC]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
Callees call graph
Text view
mom_eos::calculate_tfreeze_1d → mom_error_handler::mom_error
mom_eos::calculate_tfreeze_1d → mom_tfreeze::interface::calculate_tfreeze_linear
mom_eos::calculate_tfreeze_1d → mom_tfreeze::interface::calculate_tfreeze_millero
mom_eos::calculate_tfreeze_1d → mom_tfreeze::interface::calculate_tfreeze_teos10
mom_eos::calculate_tfreeze_1d → mom_tfreeze::interface::calculate_tfreeze_teos_poly
External calls
- gsw_mod_toolbox
gsw_ct_from_pt (gsw_mod_toolbox::gsw_ct_from_pt)
gsw_sp_from_sr (gsw_mod_toolbox::gsw_sp_from_sr)
- subroutine calculate_density_derivs_array(T, S, pressure, drho_dT, drho_dS, start, npts, EOS, scale)
Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.
- Parameters
T [in]
Potential temperature referenced to the surface [degC]
S [in]
Salinity [ppt]
pressure [in]
Pressure [Pa]
drho_dT [inout]
The partial derivative of density with potential temperature [kg m-3 degC-1] or other units determined by the optional scale argument
drho_dS [inout]
The partial derivative of density with salinity, in [kg m-3 ppt-1] or other units determined by the optional scale argument
start [in]
Starting index within the array
npts [in]
The number of values to calculate
EOS [in]
Equation of state structure
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
Callers call graph
- subroutine calculate_density_derivs_1d(T, S, pressure, drho_dT, drho_dS, EOS, dom, scale)
Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
drho_dT [inout]
The partial derivative of density with potential temperature [R C-1 ~> kg m-3 degC-1]
drho_dS [inout]
The partial derivative of density with salinity [R S-1 ~> kg m-3 ppt-1]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
Callees call graph
- subroutine calculate_density_derivs_scalar(T, S, pressure, drho_dT, drho_dS, EOS, scale)
Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
drho_dT [out]
The partial derivative of density with potential temperature [R C-1 ~> kg m-3 degC-1] or other units determined by the optional scale argument
drho_dS [out]
The partial derivative of density with salinity, in [R S-1 ~> kg m-3 ppt-1] or other units determined by the optional scale argument
EOS [in]
Equation of state structure
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
- subroutine calculate_density_second_derivs_1d(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, EOS, dom, scale)
Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
drho_dS_dS [inout]
Partial derivative of beta with respect to S [R S-2 ~> kg m-3 ppt-2]
drho_dS_dT [inout]
Partial derivative of beta with respect to T [R S-1 C-1 ~> kg m-3 ppt-1 degC-1]
drho_dT_dT [inout]
Partial derivative of alpha with respect to T [R C-2 ~> kg m-3 degC-2]
drho_dS_dP [inout]
Partial derivative of beta with respect to pressure [T2 S-1 L-2 ~> kg m-3 ppt-1 Pa-1]
drho_dT_dP [inout]
Partial derivative of alpha with respect to pressure [T2 C-1 L-2 ~> kg m-3 degC-1 Pa-1]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
Callees call graph
Callers call graph
- subroutine calculate_density_second_derivs_scalar(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, EOS, scale)
Calls the appropriate subroutine to calculate density second derivatives for scalar inputs.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
drho_dS_dS [out]
Partial derivative of beta with respect to S [R S-2 ~> kg m-3 ppt-2]
drho_dS_dT [out]
Partial derivative of beta with respect to T [R S-1 C-1 ~> kg m-3 ppt-1 degC-1]
drho_dT_dT [out]
Partial derivative of alpha with respect to T [R C-2 ~> kg m-3 degC-2]
drho_dS_dP [out]
Partial derivative of beta with respect to pressure [T2 S-1 L-2 ~> kg m-3 ppt-1 Pa-1]
drho_dT_dP [out]
Partial derivative of alpha with respect to pressure [T2 C-1 L-2 ~> kg m-3 degC-1 Pa-1]
EOS [in]
Equation of state structure
scale [in]
A multiplicative factor by which to scale density in combination with scaling stored in EOS [various]
Callees call graph
Callers call graph
- subroutine calculate_spec_vol_derivs_array(T, S, pressure, dSV_dT, dSV_dS, start, npts, EOS)
Calls the appropriate subroutine to calculate specific volume derivatives for an array.
- Parameters
T [in]
Potential temperature referenced to the surface [degC]
S [in]
Salinity [ppt]
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 ppt-1]
start [in]
Starting index within the array
npts [in]
The number of values to calculate
EOS [in]
Equation of state structure
Callees call graph
Callers call graph
- subroutine calc_spec_vol_derivs_1d(T, S, pressure, dSV_dT, dSV_dS, EOS, dom, scale)
Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
dSV_dT [inout]
The partial derivative of specific volume with potential temperature [R-1 C-1 ~> m3 kg-1 degC-1]
dSV_dS [inout]
The partial derivative of specific volume with salinity [R-1 S-1 ~> m3 kg-1 ppt-1]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale specific volume in combination with scaling stored in EOS [various]
Callees call graph
- subroutine calculate_compress_1d(T, S, pressure, rho, drho_dp, EOS, dom)
Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. The inputs and outputs use dimensionally rescaled units.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho [inout]
In situ density [R ~> kg m-3]
drho_dp [inout]
The partial derivative of density with pressure (also the inverse of the square of sound speed) [T2 L-2 ~> s2 m-2]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
- subroutine calculate_compress_scalar(T, S, pressure, rho, drho_dp, EOS)
Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate_compress_1d. The inputs and outputs use dimensionally rescaled units.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
pressure [in]
Pressure [R L2 T-2 ~> Pa]
rho [out]
In situ density [R ~> kg m-3]
drho_dp [out]
The partial derivative of density with pressure (also the inverse of the square of sound speed) [T2 L-2 ~> s2 m-2]
EOS [in]
Equation of state structure
- subroutine average_specific_vol(T, S, p_t, dp, SpV_avg, EOS, dom, scale)
Calls the appropriate subroutine to calculate the layer averaged specific volume either using Boole's rule quadrature or analytical and nearly-analytical averages in pressure.
- Parameters
T [in]
Potential temperature referenced to the surface [C ~> degC]
S [in]
Salinity [S ~> ppt]
p_t [in]
Pressure at the top of the layer [R L2 T-2 ~> Pa]
dp [in]
Pressure change in the layer [R L2 T-2 ~> Pa]
SpV_avg [inout]
The vertical average specific volume in the layer [R-1 ~> m3 kg-1]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale output specific volume in combination with scaling stored in EOS [various]
Callees call graph
Text view
mom_eos::average_specific_vol → mom_eos::interface::calculate_spec_vol
mom_eos::average_specific_vol → mom_eos_linear::avg_spec_vol_linear
mom_eos::average_specific_vol → mom_eos_wright::avg_spec_vol_buggy_wright
mom_eos::average_specific_vol → mom_eos_wright_full::avg_spec_vol_wright_full
mom_eos::average_specific_vol → mom_eos_wright_red::avg_spec_vol_wright_red
mom_eos::average_specific_vol → mom_error_handler::mom_error
Callers call graph
- subroutine EoS_fit_range(EOS, T_min, T_max, S_min, S_max, p_min, p_max)
Return the range of temperatures, salinities and pressures for which the equation of state that is being used has been fitted to observations. Care should be taken when applying this equation of state outside of its fit range.
- Parameters
EOS [in]
Equation of state structure
T_min [out]
The minimum temperature over which this EoS is fitted [degC]
T_max [out]
The maximum 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]
- function EOS_domain(HI, halo) result(EOSdom)
This subroutine returns a two point integer array indicating the domain of i-indices to work on in EOS calls based on information from a hor_index type
- Parameters
HI [in]
The horizontal index structure
halo [in]
The halo size to work on; missing is equivalent to 0.
EOSdom
The index domain that the EOS will work on, taking into account that the arrays inside the EOS routines will start at 1.
Callers call graph
Text view
mom_density_integrals::avg_specific_vol → mom_eos::eos_domain
mom_diabatic_aux::applyboundaryfluxesinout → mom_eos::eos_domain
mom_diabatic_driver::diabatic_ale_legacy → mom_eos::eos_domain
mom_diagnose_mld::diagnosemldbydensitydifference → mom_eos::eos_domain
mom_diagnostics::calculate_diagnostic_fields → mom_eos::eos_domain
mom_diagnostics::calculate_vertical_integrals → mom_eos::eos_domain
mom_diagnostics::post_surface_thermo_diags → mom_eos::eos_domain
mom_entrain_diffusive::entrainment_diffusive → mom_eos::eos_domain
mom_forcing_type::calculatebuoyancyflux1d → mom_eos::eos_domain
mom_full_convection::smoothed_drdt_drds → mom_eos::eos_domain
mom_interface_heights::dz_to_thickness_eos → mom_eos::eos_domain
mom_interface_heights::find_rho_bottom → mom_eos::eos_domain
mom_isopycnal_slopes::calc_isoneutral_slopes → mom_eos::eos_domain
mom_lateral_mixing_coeffs::calc_sqg_struct → mom_eos::eos_domain
mom_mixed_layer_restrat::mixedlayer_restrat_bml → mom_eos::eos_domain
mom_mixed_layer_restrat::mixedlayer_restrat_bodner → mom_eos::eos_domain
mom_mixed_layer_restrat::mixedlayer_restrat_om4 → mom_eos::eos_domain
mom_neutral_diffusion::neutral_diffusion_calc_coeffs → mom_eos::eos_domain
mom_pressureforce_fv::pressureforce_fv_bouss → mom_eos::eos_domain
mom_regularize_layers::regularize_surface → mom_eos::eos_domain
mom_set_diffusivity::set_density_ratios → mom_eos::eos_domain
mom_state_initialization::initialize_sponges_file → mom_eos::eos_domain
mom_state_initialization::mom_temp_salt_initialize_from_z → mom_eos::eos_domain
mom_thickness_diffuse::thickness_diffuse_full → mom_eos::eos_domain
mom_tracer_hor_diff::tracer_epipycnal_ml_diff → mom_eos::eos_domain
mom_tracer_z_init::determine_temperature → mom_eos::eos_domain
rgc_initialization::rgc_initialize_sponges → mom_eos::eos_domain
user_change_diffusivity::user_change_diff → mom_eos::eos_domain
- subroutine analytic_int_specific_vol_dp(T, S, p_t, p_b, alpha_ref, HI, EOS, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, P_surf, dP_tiny, MassWghtInterp)
Calls the appropriate subroutine to calculate 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 horizontal index structure
T [in]
Potential temperature referenced to the surface [C ~> degC]
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 bottom 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.
EOS [in]
Equation of state structure
dza [inout]
The change in the geopotential anomaly across the layer [L2 T-2 ~> m2 s-2]
intp_dza [inout]
The integral in pressure through the layer of the geopotential anomaly relative to the anomaly at the bottom of the layer [R L4 T-4 ~> Pa m2 s-2]
intx_dza [inout]
The integral in x of the difference between the geopotential anomaly at the top and bottom of the layer divided by the x grid spacing [L2 T-2 ~> m2 s-2]
inty_dza [inout]
The integral in y of the difference between the geopotential anomaly at the top and bottom of the layer divided by the y grid spacing [L2 T-2 ~> m2 s-2]
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_tiny [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
Callees call graph
Text view
mom_eos::analytic_int_specific_vol_dp → mom_eos_linear::int_spec_vol_dp_linear
mom_eos::analytic_int_specific_vol_dp → mom_eos_wright::int_spec_vol_dp_wright
mom_eos::analytic_int_specific_vol_dp → mom_eos_wright_full::int_spec_vol_dp_wright_full
mom_eos::analytic_int_specific_vol_dp → mom_eos_wright_red::int_spec_vol_dp_wright_red
mom_eos::analytic_int_specific_vol_dp → mom_error_handler::mom_error
Callers call graph
- subroutine analytic_int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, EOS, 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]
Ocean horizontal index structure
T [in]
Potential temperature referenced to the surface [C ~> degC]
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 bottom 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 [in]
A 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]
EOS [in]
Equation of state structure
dpa [inout]
The change in the pressure anomaly across the layer [R L2 T-2 ~> Pa]
intz_dpa [inout]
The integral through the thickness of the layer of the pressure anomaly relative to the anomaly at the top of the layer [R L2 Z T-2 ~> Pa m]
intx_dpa [inout]
The integral in x of the difference between the pressure anomaly at the top and bottom of the layer divided by the x grid spacing [R L2 T-2 ~> Pa]
inty_dpa [inout]
The integral in y of the difference between the pressure anomaly at the top and bottom of the layer divided by the y grid spacing [R L2 T-2 ~> Pa]
bathyT [in]
The depth of the bathymetry [Z ~> m]
SSH [in]
The sea surface height [Z ~> m]
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]
Callees call graph
Text view
mom_eos::analytic_int_density_dz → mom_eos_linear::int_density_dz_linear
mom_eos::analytic_int_density_dz → mom_eos_wright::int_density_dz_wright
mom_eos::analytic_int_density_dz → mom_eos_wright_full::int_density_dz_wright_full
mom_eos::analytic_int_density_dz → mom_eos_wright_red::int_density_dz_wright_red
mom_eos::analytic_int_density_dz → mom_error_handler::mom_error
Callers call graph
- logical function query_compressible(EOS)
Returns true if the equation of state is compressible (i.e. has pressure dependence)
- Parameters
EOS [in]
Equation of state structure
- function get_EOS_name(id) result(eos_name)
Returns the string identifying the equation of state with enumeration "id"
- Parameters
id [in]
Enumerated ID
eos_name
The name of the EOS
- subroutine EOS_init(param_file, EOS, US, use_conT_absS)
Initializes EOS_type by allocating and reading parameters. The scaling factors in US are stored in EOS for later use.
- Parameters
param_file [in]
Parameter file structure
EOS [inout]
Equation of state structure
US [in]
A dimensional unit scaling type
use_conT_absS [in]
True if the model is formulated for conservative temp and absolute salinity
Callees call graph
Text view
Callers call graph
- subroutine EOS_manual_init(EOS, form_of_EOS, form_of_TFreeze, EOS_quadrature, Compressible, Rho_T0_S0, drho_dT, dRho_dS, dRho_dp, TFr_S0_P0, dTFr_dS, dTFr_dp, use_Wright_2nd_deriv_bug)
Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS)
- Parameters
EOS [inout]
Equation of state structure
form_of_EOS [in]
A coded integer indicating the equation of state to use.
form_of_TFreeze [in]
A coded integer indicating the expression for the potential temperature of the freezing point.
EOS_quadrature [in]
If true, always use the generic (quadrature) code for the integrals of density.
Compressible [in]
If true, in situ density is a function of pressure.
Rho_T0_S0 [in]
Density at T=0 degC and S=0 ppt [kg m-3]
drho_dT [in]
Partial derivative of density with temperature in [kg m-3 degC-1]
dRho_dS [in]
Partial derivative of density with salinity in [kg m-3 ppt-1]
dRho_dp [in]
Partial derivative of density with pressure in [s2 m-2]
TFr_S0_P0 [in]
The freezing potential temperature at S=0, P=0 [degC]
dTFr_dS [in]
The derivative of freezing point with salinity in [degC ppt-1]
dTFr_dp [in]
The derivative of freezing point with pressure in [degC Pa-1]
use_Wright_2nd_deriv_bug [in]
Allow the Wright 2nd deriv bug
- subroutine convert_temp_salt_for_TEOS10(T, S, HI, kd, mask_z, EOS)
Convert T&S to Absolute Salinity and Conservative Temperature if using TEOS10
- Parameters
kd [in]
The number of layers to work on
HI [in]
The horizontal index structure
T [inout]
Potential temperature referenced to the surface [C ~> degC]
S [inout]
Salinity [S ~> ppt]
mask_z [in]
3d mask regulating which points to convert [nondim]
EOS [in]
Equation of state structure
Callees call graph
Callers call graph
- subroutine cons_temp_to_pot_temp(T, S, poTemp, EOS, dom, scale)
Converts an array of conservative temperatures to potential temperatures. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale.
- Parameters
T [in]
Conservative temperature [C ~> degC]
S [in]
Absolute salinity [S ~> ppt]
poTemp [inout]
The potential temperature with a reference pressure of 0 Pa, [C ~> degC]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale the output potential temperature in place of with scaling stored in EOS. A value of 1.0 returns temperatures in [degC], while the default is equivalent to EOS%degC_to_C.
Callees call graph
Callers call graph
Text view
mom_diagnostics::calculate_diagnostic_fields → mom_eos::cons_temp_to_pot_temp
mom_diagnostics::calculate_vertical_integrals → mom_eos::cons_temp_to_pot_temp
mom_diagnostics::post_surface_thermo_diags → mom_eos::cons_temp_to_pot_temp
mom_eos::test_ts_conversion_consistency → mom_eos::cons_temp_to_pot_temp
- subroutine pot_temp_to_cons_temp(T, S, consTemp, EOS, dom, scale)
Converts an array of potential temperatures to conservative temperatures. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale.
- Parameters
T [in]
Potential temperature [C ~> degC]
S [in]
Absolute salinity [S ~> ppt]
consTemp [inout]
The conservative temperature [C ~> degC]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale the output potential temperature in place of with scaling stored in EOS. A value of 1.0 returns temperatures in [degC], while the default is equivalent to EOS%degC_to_C.
Callees call graph
Callers call graph
- subroutine abs_saln_to_prac_saln(S, prSaln, EOS, dom, scale)
Converts an array of absolute salinity to practical salinity. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale.
- Parameters
S [in]
Absolute salinity [S ~> ppt]
prSaln [inout]
Practical salinity [S ~> PSU]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale the output practical salinities in place of with scaling stored in EOS. A value of 1.0 returns salinities in [PSU], while the default is equivalent to EOS%ppt_to_S.
Callers call graph
Text view
mom_diagnostics::calculate_diagnostic_fields → mom_eos::abs_saln_to_prac_saln
mom_diagnostics::calculate_vertical_integrals → mom_eos::abs_saln_to_prac_saln
mom_diagnostics::post_surface_thermo_diags → mom_eos::abs_saln_to_prac_saln
mom_eos::test_ts_conversion_consistency → mom_eos::abs_saln_to_prac_saln
- subroutine prac_saln_to_abs_saln(S, absSaln, EOS, dom, scale)
Converts an array of absolute salinity to practical salinity. The input arguments use the dimensionally rescaling as specified within the EOS type. The output potential temperature uses this same scaling, but this can be replaced by the factor given by scale.
- Parameters
S [in]
Practical salinity [S ~> PSU]
absSaln [inout]
Absolute salinity [S ~> ppt]
EOS [in]
Equation of state structure
dom [in]
The domain of indices to work on, taking into account that arrays start at 1.
scale [in]
A multiplicative factor by which to scale the output absolute salnities in place of with scaling stored in EOS. A value of 1.0 returns salinities in [ppt], while the default is equivalent to EOS%ppt_to_S.
Callers call graph
- logical function EOS_quadrature(EOS)
Return value of EOS_quadrature
- Parameters
EOS [in]
Equation of state structure
Callers call graph
- logical function EOS_unit_tests(verbose)
Runs unit tests for consistency on the equations of state. This should only be called from a single/root thread. It returns True if any test fails, otherwise it returns False.
- Parameters
verbose [in]
If true, write results to stdout
logical function test_TS_conversion_consistency(T_cons, S_abs, T_pot, S_prac, EOS, verbose) result(inconsistent)
- Parameters
T_cons [in]
Conservative temperature [degC]
S_abs [in]
Absolute salinity [g kg-1]
T_pot [in]
Potential temperature [degC]
S_prac [in]
Practical salinity [PSU]
EOS [in]
Equation of state structure
verbose [in]
If true, write results to stdout
Callees call graph
Text view
mom_eos::test_ts_conversion_consistency → mom_eos::abs_saln_to_prac_saln
mom_eos::test_ts_conversion_consistency → mom_eos::cons_temp_to_pot_temp
mom_eos::test_ts_conversion_consistency → mom_eos::pot_temp_to_cons_temp
mom_eos::test_ts_conversion_consistency → mom_eos::prac_saln_to_abs_saln
mom_eos::test_ts_conversion_consistency → mom_eos::write_check_msg
logical function test_TFr_consistency(S_test, p_test, EOS, verbose, EOS_name, TFr_check) result(inconsistent)
- Parameters
S_test [in]
Salinity or absolute salinity [S ~> ppt]
p_test [in]
Pressure [R L2 T-2 ~> Pa]
EOS [in]
Equation of state structure
verbose [in]
If true, write results to stdout
EOS_name [in]
A name used in error messages to describe the EoS
TFr_check [in]
A check value for the Freezing point [C ~> degC]
Callees call graph
- subroutine write_check_msg(var_name, val, val_chk, val_tol, test_OK)
Write a message indicating how well a value matches its check value.
- Parameters
var_name [in]
The name of the variable being tested.
val [in]
The value being checked [various]
val_chk [in]
The value being checked [various]
val_tol [in]
The value being checked [various]
test_OK [in]
True if the values are within their tolerance
- logical function test_EOS_consistency(T_test, S_test, p_test, EOS, verbose, EOS_name, rho_check, spv_check, skip_2nd, avg_Sv_check) result(inconsistent)
Test an equation of state for self-consistency and consistency with check values, returning false if it is consistent by all tests, and true if it fails any test.
- Parameters
T_test [in]
Potential temperature or conservative temperature [C ~> degC]
S_test [in]
Salinity or absolute salinity [S ~> ppt]
p_test [in]
Pressure [R L2 T-2 ~> Pa]
EOS [in]
Equation of state structure
verbose [in]
If true, write results to stdout
EOS_name [in]
A name used in error messages to describe the EoS
rho_check [in]
A check value for the density [R ~> kg m-3]
spv_check [in]
A check value for the specific volume [R-1 ~> m3 kg-1]
skip_2nd [in]
If present and true, do not check the 2nd derivatives.
avg_Sv_check [in]
If present and true, compare analytical and numerical quadrature estimates of the layer-averaged specific volume.
Callees call graph
Text view
mom_eos::test_eos_consistency → mom_eos::average_specific_vol
mom_eos::test_eos_consistency → mom_eos::interface::calculate_compress
mom_eos::test_eos_consistency → mom_eos::interface::calculate_density
mom_eos::test_eos_consistency → mom_eos::interface::calculate_density_derivs
mom_eos::test_eos_consistency → mom_eos::interface::calculate_density_second_derivs
mom_eos::test_eos_consistency → mom_eos::interface::calculate_spec_vol
mom_eos::test_eos_consistency → mom_eos::interface::calculate_specific_vol_derivs
mom_eos::test_eos_consistency → mom_eos::test_eos_consistency::check_fd
mom_eos::test_eos_consistency → mom_eos::test_eos_consistency::derivs_2d
mom_eos::test_eos_consistency → mom_eos::test_eos_consistency::first_deriv
mom_eos::test_eos_consistency → mom_eos::test_eos_consistency::second_deriv
mom_eos::test_eos_consistency → mom_error_handler::mom_error
- real function first_deriv(R, dx, order)
Return a finite difference estimate of the first derivative of a field in arbitrary units [A B-1]
- Parameters
R [in]
The field whose derivative is being taken, in arbitrary units [A]
dx [in]
The spacing in parameter space, in different arbitrary units [B]
order [in]
The order of accuracy of the centered finite difference estimates (2, 4 or 6)
- real function second_deriv(R, dx, order)
Return a finite difference estimate of the second derivative of a field in arbitrary units [A B-2]
- Parameters
R [in]
The field whose derivative is being taken, in arbitrary units [A]
dx [in]
The spacing in parameter space, in different arbitrary units [B]
order [in]
The order of accuracy of the centered finite difference estimates (2, 4 or 6)
Callers call graph
- real function derivs_2d(R, dxdy, order)
Return a finite difference estimate of the second derivative with respect to two different parameters of a field in arbitrary units [A B-1 C-1]
- Parameters
R [in]
The field whose derivative is being taken in arbitrary units [A]
dxdy [in]
The spacing in two directions in parameter space in different arbitrary units [B C]
order [in]
The order of accuracy of the centered finite difference estimates (2, 4 or 6)
Callees call graph
Callers call graph
- logical function check_FD(val, val_fd, tol, verbose, field_name, order)
Check for the rate of convergence expected with a finite difference discretization with a 20% margin of error and a tolerance for contributions from roundoff.
- Parameters
val [in]
The derivative being checked, in arbitrary units [arbitrary]
val_fd [in]
Two finite difference estimates of val taken with a spacing in parameter space and twice this spacing, in the same arbitrary units as val [arbitrary]
tol [in]
An estimated fractional tolerance due to roundoff [arbitrary]
verbose [in]
If true, write results to stdout
field_name [in]
A name used to describe the field in error messages
order [in]
The order of accuracy of the centered finite difference estimates (2, 4 or 6)
Callers call graph