mom_state_initialization module reference

Initialization functions for state variables, u, v, h, T and S.

More…

Functions/Subroutines

mom_initialize_state()

Initialize temporally evolving fields, either as initial conditions or by reading them from a restart (or saves) file.

initialize_thickness_from_file()

Reads the layer thicknesses or interface heights from a file.

adjustetatofitbathymetry()

Adjust interface heights to fit the bathymetry and diagnose layer thickness.

initialize_thickness_uniform()

Initializes thickness to be uniform.

initialize_thickness_list()

Initialize thickness from a 1D list.

initialize_thickness_search()

Search density space for location of layers (not implemented!)

convert_thickness()

Converts thickness from geometric to pressure units.

depress_surface()

Depress the sea-surface based on an initial condition file.

trim_for_ice()

Adjust the layer thicknesses by cutting away the top of each model column at the depth where the hydrostatic pressure matches an imposed surface pressure read from file.

cut_off_column_top()

Adjust the layer thicknesses by removing the top of the water column above the depth where the hydrostatic pressure matches p_surf.

initialize_velocity_from_file()

Initialize horizontal velocity components from file.

initialize_velocity_zero()

Initialize horizontal velocity components to zero.

initialize_velocity_uniform()

Sets the initial velocity components to uniform.

initialize_velocity_circular()

Sets the initial velocity components to be circular with no flow at edges of domain and center.

initialize_temp_salt_from_file()

Initializes temperature and salinity from file.

initialize_temp_salt_from_profile()

Initializes temperature and salinity from a 1D profile.

initialize_temp_salt_fit()

Initializes temperature and salinity by fitting to density.

initialize_temp_salt_linear()

Initializes T and S with linear profiles according to reference surface layer salinity and temperature and a specified range.

initialize_sponges_file()

This subroutine sets the inverse restoration time (Idamp), and the values towards which the interface heights and an arbitrary number of tracers should be restored within each sponge.

initialize_oda_incupd_file()

set_velocity_depth_max()

This subroutine sets the 4 bottom depths at velocity points to be the maximum of the adjacent depths.

compute_global_grid_integrals()

Subroutine to pre-compute global integrals of grid quantities for later use in reporting diagnostics.

set_velocity_depth_min()

This subroutine sets the 4 bottom depths at velocity points to be the minimum of the adjacent depths.

mom_temp_salt_initialize_from_z()

This subroutine determines the isopycnal or other coordinate interfaces and layer potential temperatures and salinities directly from a z-space file on a latitude-longitude grid.

find_interfaces()

Find interface positions corresponding to interpolated depths in a density profile.

mom_state_init_tests()

Run simple unit tests.

Detailed Description

Initialization functions for state variables, u, v, h, T and S.

Function/Subroutine Documentation

subroutine mom_state_initialization/mom_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, restart_CS, ALE_CSp, tracer_Reg, sponge_CSp, ALE_sponge_CSp, oda_incupd_CSp, OBC, Time_in, frac_shelf_h)

Initialize temporally evolving fields, either as initial conditions or by reading them from a restart (or saves) file.

Parameters
  • g :: [inout] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • u :: [out] The zonal velocity that is being

  • v :: [out] The meridional velocity that is being

  • h :: [out] Layer thicknesses [H ~> m or kg m-2]

  • tv :: [inout] A structure pointing to various thermodynamic variables

  • time :: [inout] Time at the start of the run segment.

  • pf :: [in] A structure indicating the open file to parse for model parameter values.

  • dirs :: [in] A structure containing several relevant directory paths.

  • restart_cs :: A pointer to the restart control structure.

  • ale_csp :: The ALE control structure for remapping

  • tracer_reg :: A pointer to the tracer registry

  • sponge_csp :: The layerwise sponge control structure.

  • ale_sponge_csp :: The ALE sponge control structure.

  • obc :: The open boundary condition control structure.

  • oda_incupd_csp :: The oda_incupd control structure.

  • time_in :: [in] Time at the start of the run segment.

  • frac_shelf_h :: [in] The fraction of the grid cell covered

Call to

adjustment_initialization::adjustment_initialize_temperature_salinity baroclinic_zone_initialization::baroclinic_zone_init_temperature_salinity benchmark_initialization::benchmark_init_temperature_salinity bfb_initialization::bfb_initialize_sponges_southonly mom_error_handler::calltree_enter mom_error_handler::calltree_leave circle_obcs_initialization::circle_obcs_initialize_thickness convert_thickness dense_water_initialization::dense_water_initialize_sponges depress_surface dome2d_initialization::dome2d_initialize_sponges dome_initialization::dome_initialize_sponges dumbbell_initialization::dumbbell_initialize_sponges dyed_channel_initialization::dyed_channel_set_obc_tracer_data dyed_obcs_initialization::dyed_obcs_set_obc_data external_gwave_initialization::external_gwave_initialize_thickness initialize_oda_incupd_file initialize_sponges_file initialize_temp_salt_fit initialize_temp_salt_from_file initialize_temp_salt_from_profile initialize_temp_salt_linear initialize_thickness_from_file initialize_thickness_list initialize_thickness_search initialize_thickness_uniform initialize_velocity_circular initialize_velocity_from_file initialize_velocity_uniform initialize_velocity_zero mom_restart::is_new_run isomip_initialization::isomip_initialize_temperature_salinity lock_exchange_initialization::lock_exchange_initialize_thickness mom_string_functions::lowercase mdl mom_temp_salt_initialize_from_z neverworld_initialization::neverworld_initialize_thickness phillips_initialization::phillips_initialize_sponges mom_restart::restore_state rgc_initialization::rgc_initialize_sponges rossby_front_2d_initialization::rossby_front_initialize_velocity scm_cvmix_tests::scm_cvmix_tests_ts_init seamount_initialization::seamount_initialize_temperature_salinity sloshing_initialization::sloshing_initialize_temperature_salinity soliton_initialization::soliton_initialize_thickness supercritical_initialization::supercritical_set_obc_data trim_for_ice mom_open_boundary::update_obc_segment_data user_initialization::user_initialize_sponges

subroutine mom_state_initialization/initialize_thickness_from_file(h, depth_tot, G, GV, US, param_file, file_has_thickness, just_read)

Reads the layer thicknesses or interface heights from a file.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • h :: [out] The thickness that is being initialized [H ~> m or kg m-2].

  • depth_tot :: [in] The nominal total depth of the ocean [Z ~> m]

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • file_has_thickness :: [in] If true, this file contains layer thicknesses; otherwise it contains interface heights.

  • just_read :: [in] If true, this call will only read parameters without changing h.

Call to

adjustetatofitbathymetry mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/adjustetatofitbathymetry(G, GV, US, eta, h, dZ_ref_eta)

Adjust interface heights to fit the bathymetry and diagnose layer thickness.

If the bottom most interface is below the topography then the bottom-most layers are contracted to GVAngstrom_m. If the bottom most interface is above the topography then the entire column is dilated (expanded) to fill the void.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • eta :: [inout] Interface heights [Z ~> m].

  • h :: [inout] Layer thicknesses [H ~> m or kg m-2]

  • dz_ref_eta :: [in] The difference between the reference heights for bathyT and eta [Z ~> m], 0 by default.

Called from

initialize_thickness_from_file mom_temp_salt_initialize_from_z

subroutine mom_state_initialization/initialize_thickness_uniform(h, depth_tot, G, GV, param_file, just_read)

Initializes thickness to be uniform.

Parameters
  • g :: [in] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • h :: [out] The thickness that is being initialized [H ~> m or kg m-2].

  • depth_tot :: [in] The nominal total depth of the ocean [Z ~> m]

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing h.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_thickness_list(h, depth_tot, G, GV, US, param_file, just_read)

Initialize thickness from a 1D list.

Parameters
  • g :: [in] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • h :: [out] The thickness that is being initialized [H ~> m or kg m-2].

  • depth_tot :: [in] The nominal total depth of the ocean [Z ~> m]

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing h.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_thickness_searchNone()

Search density space for location of layers (not implemented!)

Called from

mom_initialize_state

subroutine mom_state_initialization/convert_thickness(h, G, GV, US, tv)

Converts thickness from geometric to pressure units.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • h :: [inout] Input geometric layer thicknesses being converted

  • tv :: [in] A structure pointing to various thermodynamic variables

Called from

mom_initialize_state

subroutine mom_state_initialization/depress_surface(h, G, GV, US, param_file, tv, just_read)

Depress the sea-surface based on an initial condition file.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • h :: [inout] Layer thicknesses [H ~> m or kg m-2]

  • param_file :: [in] A structure to parse for run-time parameters

  • tv :: [in] A structure pointing to various thermodynamic variables

  • just_read :: [in] If true, this call will only read parameters without changing h.

Called from

mom_initialize_state

subroutine mom_state_initialization/trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read)

Adjust the layer thicknesses by cutting away the top of each model column at the depth where the hydrostatic pressure matches an imposed surface pressure read from file.

Parameters
  • pf :: [in] Parameter file structure

  • g :: [in] Ocean grid structure

  • gv :: [in] Vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • ale_csp :: ALE control structure

  • tv :: [inout] Thermodynamics structure

  • h :: [inout] Layer thickness [H ~> m or kg m-2]

  • just_read :: [in] If true, this call will only read parameters without changing h.

Call to

cut_off_column_top mom_ale::ts_plm_edge_values

Called from

mom_initialize_state

subroutine mom_state_initialization/cut_off_column_top(nk, tv, GV, US, G_earth, depth, min_thickness, T, T_t, T_b, S, S_t, S_b, p_surf, h, remap_CS, z_tol, remap_answers_2018)

Adjust the layer thicknesses by removing the top of the water column above the depth where the hydrostatic pressure matches p_surf.

Parameters
  • nk :: [in] Number of layers

  • tv :: [in] Thermodynamics structure

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • g_earth :: [in] Gravitational acceleration [L2 Z-1 T-2 ~> m s-2]

  • depth :: [in] Depth of ocean column [Z ~> m].

  • min_thickness :: [in] Smallest thickness allowed [Z ~> m].

  • t :: [inout] Layer mean temperature [degC]

  • t_t :: [in] Temperature at top of layer [degC]

  • t_b :: [in] Temperature at bottom of layer [degC]

  • s :: [inout] Layer mean salinity [ppt]

  • s_t :: [in] Salinity at top of layer [ppt]

  • s_b :: [in] Salinity at bottom of layer [ppt]

  • p_surf :: [in] Imposed pressure on ocean at surface [R L2 T-2 ~> Pa]

  • h :: [inout] Layer thickness [H ~> m or kg m-2]

  • remap_cs :: Remapping structure for remapping T and S, if associated

  • z_tol :: [in] The tolerance with which to find the depth matching the specified pressure [Z ~> m].

  • remap_answers_2018 :: [in] If true, use the order of arithmetic and expressions that recover the answers for remapping from the end of 2018. Otherwise, use more robust forms of the same expressions.

Call to

mom_density_integrals::find_depth_of_pressure_in_cell mom_remapping::remapping_core_h

Called from

mom_state_init_tests trim_for_ice

subroutine mom_state_initialization/initialize_velocity_from_file(u, v, G, GV, US, param_file, just_read)

Initialize horizontal velocity components from file.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure.

  • u :: [out] The zonal velocity that is being initialized [L T-1 ~> m s-1]

  • v :: [out] The meridional velocity that is being initialized [L T-1 ~> m s-1]

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing u or v.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_velocity_zero(u, v, G, GV, param_file, just_read)

Initialize horizontal velocity components to zero.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure.

  • u :: [out] The zonal velocity that is being initialized [L T-1 ~> m s-1]

  • v :: [out] The meridional velocity that is being initialized [L T-1 ~> m s-1]

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing h.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_velocity_uniform(u, v, G, GV, US, param_file, just_read)

Sets the initial velocity components to uniform.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure.

  • u :: [out] The zonal velocity that is being initialized [L T-1 ~> m s-1]

  • v :: [out] The meridional velocity that is being initialized [L T-1 ~> m s-1]

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing u or v.

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_velocity_circular(u, v, G, GV, US, param_file, just_read)

Sets the initial velocity components to be circular with no flow at edges of domain and center.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure.

  • u :: [out] The zonal velocity that is being initialized [L T-1 ~> m s-1]

  • v :: [out] The meridional velocity that is being initialized [L T-1 ~> m s-1]

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing u or v.

Call to

my_psi

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_temp_salt_from_file(T, S, G, GV, param_file, just_read)

Initializes temperature and salinity from file.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • t :: [out] The potential temperature that is being initialized [degC]

  • s :: [out] The salinity that is being initialized [ppt]

  • param_file :: [in] A structure to parse for run-time parameters

  • just_read :: [in] If true, this call will only read parameters without changing T or S.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_temp_salt_from_profile(T, S, G, GV, param_file, just_read)

Initializes temperature and salinity from a 1D profile.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • t :: [out] The potential temperature that is being initialized [degC]

  • s :: [out] The salinity that is being initialized [ppt]

  • param_file :: [in] A structure to parse for run-time parameters

  • just_read :: [in] If true, this call will only read parameters without changing T or S.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_temp_salt_fit(T, S, G, GV, US, param_file, eqn_of_state, P_Ref, just_read)

Initializes temperature and salinity by fitting to density.

Parameters
  • g :: [in] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • t :: [out] The potential temperature that is being initialized [degC].

  • s :: [out] The salinity that is being initialized [ppt].

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] A structure to parse for run-time parameters.

  • eqn_of_state :: Equation of state structure

  • p_ref :: [in] The coordinate-density reference pressure [R L2 T-2 ~> Pa].

  • just_read :: [in] If true, this call will only read parameters without changing T or S.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_temp_salt_linear(T, S, G, GV, param_file, just_read)

Initializes T and S with linear profiles according to reference surface layer salinity and temperature and a specified range.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • t :: [out] The potential temperature that is being initialized [degC]

  • s :: [out] The salinity that is being initialized [ppt]

  • param_file :: [in] A structure to parse for run-time parameters

  • just_read :: [in] If present and true, this call will only read parameters without changing T or S.

Call to

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_sponges_file(G, GV, US, use_temperature, tv, u, v, depth_tot, param_file, Layer_CSp, ALE_CSp, Time)

This subroutine sets the inverse restoration time (Idamp), and the values towards which the interface heights and an arbitrary number of tracers should be restored within each sponge. The interface height is always subject to damping, and must always be the first registered field.

Parameters
  • g :: [in] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • use_temperature :: [in] If true, T & S are state variables.

  • tv :: [in] A structure pointing to various thermodynamic variables.

  • u :: [in] The zonal velocity that is being

  • v :: [in] The meridional velocity that is being

  • depth_tot :: [in] The nominal total depth of the ocean [Z ~> m]

  • param_file :: [in] A structure to parse for run-time parameters.

  • layer_csp :: A pointer that is set to point to the control structure for this module (in layered mode).

  • ale_csp :: A pointer that is set to point to the control structure for this module (in ALE mode).

  • time :: [in] Time at the start of the run segment. Time_in overrides any value set for Time.

Call to

mom_io::field_size mom_sponge::initialize_sponge mdl separate_idamp_for_uv

Called from

mom_initialize_state

subroutine mom_state_initialization/initialize_oda_incupd_file(G, GV, US, use_temperature, tv, h, u, v, param_file, oda_incupd_CSp, restart_CS, Time)
Parameters
  • g :: [inout] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • use_temperature :: [in] If true, T & S are state variables.

  • tv :: [in] A structure pointing to various thermodynamic variables.

  • h :: [inout] Layer thickness [H ~> m or kg m-2] (in)

  • u :: [in] The zonal velocity that is being

  • v :: [in] The meridional velocity that is being

  • param_file :: [in] A structure to parse for run-time parameters.

  • oda_incupd_csp :: A pointer that is set to point to the control structure for this module.

  • restart_cs :: A pointer to the restart control structure.

  • time :: [in] Time at the start of the run segment. Time_in overrides any value set for

Call to

mom_error_handler::mom_error mom_error_handler::mom_mesg

Called from

mom_initialize_state

subroutine mom_state_initialization/set_velocity_depth_max(G)

This subroutine sets the 4 bottom depths at velocity points to be the maximum of the adjacent depths.

Parameters

g :: [inout] The ocean’s grid structure

subroutine mom_state_initialization/compute_global_grid_integrals(G, US)

Subroutine to pre-compute global integrals of grid quantities for later use in reporting diagnostics.

Parameters
  • g :: [inout] The ocean’s grid structure

  • us :: [in] A dimensional unit scaling type

subroutine mom_state_initialization/set_velocity_depth_min(G)

This subroutine sets the 4 bottom depths at velocity points to be the minimum of the adjacent depths.

Parameters

g :: [inout] The ocean’s grid structure

subroutine mom_state_initialization/mom_temp_salt_initialize_from_z(h, tv, depth_tot, G, GV, US, PF, just_read, frac_shelf_h)

This subroutine determines the isopycnal or other coordinate interfaces and layer potential temperatures and salinities directly from a z-space file on a latitude-longitude grid.

Parameters
  • g :: [inout] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • h :: [out] Layer thicknesses being initialized [H ~> m or kg m-2]

  • tv :: [inout] A structure pointing to various thermodynamic variables including temperature and salinity

  • depth_tot :: [in] The nominal total depth of the ocean [Z ~> m]

  • us :: [in] A dimensional unit scaling type

  • pf :: [in] A structure indicating the open file to parse for model parameter values.

  • just_read :: [in] If true, this call will only read parameters without changing T or S.

  • frac_shelf_h :: [in] The fraction of the grid cell covered

Call to

adjustetatofitbathymetry find_interfaces mom_error_handler::mom_error

Called from

mom_initialize_state

subroutine mom_state_initialization/find_interfaces(rho, zin, nk_data, Rb, Z_bot, zi, G, GV, US, nlevs, nkml, hml, eps_z, eps_rho, density_extrap_bug)

Find interface positions corresponding to interpolated depths in a density profile.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • nk_data :: [in] The number of levels in the input data

  • rho :: [in] Potential density in z-space [R ~> kg m-3]

  • zin :: [in] Input data levels [Z ~> m].

  • rb :: [in] target interface densities [R ~> kg m-3]

  • z_bot :: [in] The (usually negative) height of the seafloor

  • zi :: [out] The returned interface heights [Z ~> m]

  • us :: [in] A dimensional unit scaling type

  • nlevs :: [in] number of valid points in each column

  • nkml :: [in] number of mixed layer pieces to distribute over a depth of hml.

  • hml :: [in] mixed layer depth [Z ~> m].

  • eps_z :: [in] A negligibly small layer thickness [Z ~> m].

  • eps_rho :: [in] A negligibly small density difference [R ~> kg m-3].

  • density_extrap_bug :: [in] If true use an expression with an indexing bug for projecting the densities at the bottom of unstable profiles from data when finding the initial interface locations in layered mode from a dataset of T and S.

Called from

mom_temp_salt_initialize_from_z

subroutine mom_state_initialization/mom_state_init_tests(G, GV, US, tv)

Run simple unit tests.

Parameters
  • g :: [inout] The ocean’s grid structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • us :: [in] A dimensional unit scaling type

  • tv :: [in] Thermodynamics structure.

Call to

cut_off_column_top