user_initialization module reference

A template of a user to code up customized initial conditions.

More…

Functions/Subroutines

user_set_coord()

Set vertical coordinates.

user_initialize_topography()

Initialize topography.

user_initialize_thickness()

Initialize thicknesses in depth units.

user_initialize_velocity()

initialize velocities.

user_init_temperature_salinity()

This function puts the initial layer temperatures and salinities into T(:,:,:) and S(:,:,:).

user_initialize_sponges()

Set up the sponges.

user_set_obc_data()

This subroutine sets the properties of flow at open boundary conditions.

user_set_rotation()

write_user_log()

Write output about the parameter values being used.

Detailed Description

This subroutine initializes the fields for the simulations. The one argument passed to initialize, Time, is set to the current time of the simulation. The fields which might be initialized here are:

  • u - Zonal velocity [Z T-1 ~> m s-1].

  • v - Meridional velocity [Z T-1 ~> m s-1].

  • h - Layer thickness [H ~> m or kg m-2]. (Must be positive.)

  • GbathyT - Basin depth [Z ~> m].

  • GCoriolisBu - The Coriolis parameter [T-1 ~> s-1].

  • GVg_prime - The reduced gravity at each interface [L2 Z-1 T-2 ~> m s-2].

  • GVRlay - Layer potential density (coordinate variable) [R ~> kg m-3]. If ENABLE_THERMODYNAMICS is defined:

  • T - Temperature [C ~> degC].

  • S - Salinity [S ~> ppt]. If BULKMIXEDLAYER is defined:

  • Rml - Mixed layer and buffer layer potential densities [R ~> kg m-3]. If SPONGE is defined:

  • A series of subroutine calls are made to set up the damping rates and reference profiles for all variables that are damped in the sponge.

Any user provided tracer code is also first linked through this subroutine.

These variables are all set in the set of subroutines (in this file) USER_initialize_bottom_depth, USER_initialize_thickness, USER_initialize_velocity, USER_initialize_temperature_salinity, USER_initialize_mixed_layer_density, USER_initialize_sponges, USER_set_coord, and USER_set_ref_profile.

The names of these subroutines should be self-explanatory. They start with “USER_” to indicate that they will likely have to be modified for each simulation to set the initial conditions and boundary conditions. Most of these take two arguments: an integer argument specifying whether the fields are to be calculated internally or read from a NetCDF file; and a string giving the path to that file. If the field is initialized internally, the path is ignored.

Function/Subroutine Documentation

subroutine user_initialization/user_set_coord(Rlay, g_prime, GV, US, param_file)

Set vertical coordinates.

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

  • rlay :: [out] Layer potential density [R ~> kg m-3].

  • g_prime :: [out] The reduced gravity at each interface [L2 Z-1 T-2 ~> m s-2].

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

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

Call to:

first_call mom_error_handler::mom_error write_user_log

Called from:

mom_coord_initialization::mom_initialize_coord

subroutine user_initialization/user_initialize_topography(D, G, param_file, max_depth, US)

Initialize topography.

Parameters:
  • g :: [in] The dynamic horizontal grid type

  • d :: [out] Ocean bottom depth [Z ~> m]

  • param_file :: [in] Parameter file structure

  • max_depth :: [in] Maximum model depth [Z ~> m]

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

Call to:

first_call mom_error_handler::mom_error write_user_log

Called from:

mom_fixed_initialization::mom_initialize_topography

subroutine user_initialization/user_initialize_thickness(h, G, GV, param_file, just_read)

Initialize thicknesses in depth units. These will be converted to thickness units later.

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

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

  • h :: [out] The thicknesses being initialized [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:

first_call mom_error_handler::mom_error write_user_log

subroutine user_initialization/user_initialize_velocity(u, v, G, GV, US, param_file, just_read)

initialize velocities.

Parameters:
  • g :: [in] Ocean grid structure.

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

  • u :: [out] i-component of velocity [L T-1 ~> m s-1]

  • v :: [out] j-component of velocity [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 & v.

Call to:

first_call mom_error_handler::mom_error write_user_log

subroutine user_initialization/user_init_temperature_salinity(T, S, G, GV, param_file, just_read)

This function puts the initial layer temperatures and salinities into T(:,:,:) and S(:,:,:).

Parameters:
  • g :: [in] Ocean grid structure.

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

  • t :: [out] Potential temperature [C ~> degC].

  • s :: [out] Salinity [S ~> ppt].

  • 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 T & S.

Call to:

first_call mom_error_handler::mom_error write_user_log

subroutine user_initialization/user_initialize_sponges(G, GV, use_temp, tv, param_file, CSp, h)

Set up the sponges.

Parameters:
  • g :: [in] Ocean grid structure.

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

  • use_temp :: [in] If true, temperature and salinity are state variables.

  • tv :: [in] A structure containing pointers to any available thermodynamic fields, potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.

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

  • csp :: A pointer to the sponge control structure.

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

Call to:

first_call mom_error_handler::mom_error write_user_log

Called from:

mom_state_initialization::mom_initialize_state

subroutine user_initialization/user_set_obc_data(OBC, tv, G, GV, param_file, tr_Reg)

This subroutine sets the properties of flow at open boundary conditions.

Parameters:
  • obc :: This open boundary condition type specifies whether, where, and what open boundary conditions are used.

  • tv :: [in] A structure containing pointers to any available thermodynamic fields, including potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.

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

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

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

  • tr_reg :: Tracer registry.

Call to:

first_call write_user_log

subroutine user_initialization/user_set_rotation(G, param_file)
Parameters:
  • g :: [inout] The ocean’s grid structure

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

Call to:

first_call mom_error_handler::mom_error write_user_log

subroutine user_initialization/write_user_log(param_file)

Write output about the parameter values being used.

Parameters:

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

Call to:

first_call

Called from:

user_init_temperature_salinity user_initialize_sponges user_initialize_thickness user_initialize_topography user_initialize_velocity user_set_coord user_set_obc_data user_set_rotation