mom_shared_initialization module reference

Code that initializes fixed aspects of the model grid, such as horizontal grid metrics, topography and Coriolis, and can be shared between components.

More…

Functions/Subroutines

mom_shared_init_init()

MOM_shared_init_init just writes the code version.

mom_initialize_rotation()

MOM_initialize_rotation makes the appropriate call to set up the Coriolis parameter.

mom_calculate_grad_coriolis()

Calculates the components of grad f (Coriolis parameter)

diagnosemaximumdepth()

Return the global maximum ocean bottom depth in the same units as the input depth.

initialize_topography_from_file()

Read gridded depths from file.

apply_topography_edits_from_file()

Applies a list of topography overrides read from a netcdf file.

initialize_topography_named()

initialize the bathymetry based on one of several named idealized configurations

limit_topography()

limit_topography ensures that min_depth < D(x,y) < max_depth

set_rotation_planetary()

This subroutine sets up the Coriolis parameter for a sphere.

set_rotation_beta_plane()

This subroutine sets up the Coriolis parameter for a beta-plane or f-plane.

initialize_grid_rotation_angle()

initialize_grid_rotation_angle initializes the arrays with the sine and cosine of the angle between logical north on the grid and true north.

modulo_around_point()

Return the modulo value of x in an interval [xc-(Lx/2) xc+(Lx/2)] If Lx<=0, then it returns x without applying modulo arithmetic.

reset_face_lengths_named()

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths based on a named set of sizes.

reset_face_lengths_file()

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a arrays read from a file.

reset_face_lengths_list()

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a list read from a file.

read_face_length_list()

This subroutine reads and counts the non-blank lines in the face length list file, after removing comments.

set_subgrid_topo_at_vel_from_file()

Read from a file the maximum, minimum and average bathymetry at velocity points, for the use of porous barrier.

set_velocity_depth_max()

Set the bathymetry at velocity points to be the maximum of the depths at the neighoring tracer points.

set_velocity_depth_min()

Set the bathymetry at velocity points to be the minimum of the depths at the neighoring tracer points.

compute_global_grid_integrals()

Pre-compute global integrals of grid quantities (like masked ocean area) for later use in reporting diagnostics.

write_ocean_geometry_file()

Write out a file describing the topography, Coriolis parameter, grid locations and various other fixed fields from the grid.

Detailed Description

Code that initializes fixed aspects of the model grid, such as horizontal grid metrics, topography and Coriolis, and can be shared between components.

Function/Subroutine Documentation

subroutine mom_shared_initialization/mom_shared_init_init(PF)

MOM_shared_init_init just writes the code version.

Parameters:

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

subroutine mom_shared_initialization/mom_initialize_rotation(f, G, PF, US)

MOM_initialize_rotation makes the appropriate call to set up the Coriolis parameter.

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

  • f :: [out] The Coriolis parameter [T-1 ~> s-1]

  • pf :: [in] Parameter file structure

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave set_rotation_beta_plane set_rotation_planetary

subroutine mom_shared_initialization/mom_calculate_grad_coriolis(dF_dx, dF_dy, G, US)

Calculates the components of grad f (Coriolis parameter)

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

  • df_dx :: [out] x-component of grad f [T-1 L-1 ~> s-1 m-1]

  • df_dy :: [out] y-component of grad f [T-1 L-1 ~> s-1 m-1]

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

function mom_shared_initialization/diagnosemaximumdepth(D, G) [real]

Return the global maximum ocean bottom depth in the same units as the input depth.

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

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

Return:

undefined :: The global maximum ocean bottom depth in [m] or [Z ~> m]

subroutine mom_shared_initialization/initialize_topography_from_file(D, G, param_file, US)

Read gridded depths from file.

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

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

  • param_file :: [in] Parameter file structure

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

Call to:

apply_topography_edits_from_file mom_error_handler::calltree_enter mom_error_handler::calltree_leave

subroutine mom_shared_initialization/apply_topography_edits_from_file(D, G, param_file, US)

Applies a list of topography overrides read from a netcdf file.

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

  • d :: [inout] Ocean bottom depth [m] or [Z ~> m] if

  • param_file :: [in] Parameter file structure

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from:

initialize_topography_from_file

subroutine mom_shared_initialization/initialize_topography_named(D, G, param_file, topog_config, max_depth, US)

initialize the bathymetry based on one of several named idealized configurations

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

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

  • param_file :: [in] Parameter file structure

  • topog_config :: [in] The name of an idealized topographic configuration

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

subroutine mom_shared_initialization/limit_topography(D, G, param_file, max_depth, US)

limit_topography ensures that min_depth < D(x,y) < max_depth

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

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

  • param_file :: [in] Parameter file structure

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

subroutine mom_shared_initialization/set_rotation_planetary(f, G, param_file, US)

This subroutine sets up the Coriolis parameter for a sphere.

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

  • f :: [out] Coriolis parameter (vertical component) [T-1 ~> s-1]

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from:

mom_initialize_rotation

subroutine mom_shared_initialization/set_rotation_beta_plane(f, G, param_file, US)

This subroutine sets up the Coriolis parameter for a beta-plane or f-plane.

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

  • f :: [out] Coriolis parameter (vertical component) [T-1 ~> s-1]

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

Called from:

mom_initialize_rotation

subroutine mom_shared_initialization/initialize_grid_rotation_angle(G, PF)

initialize_grid_rotation_angle initializes the arrays with the sine and cosine of the angle between logical north on the grid and true north.

Parameters:
  • g :: [inout] The dynamic horizontal grid

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

Call to:

modulo_around_point

function mom_shared_initialization/modulo_around_point(x, xc, Lx) [real]

Return the modulo value of x in an interval [xc-(Lx/2) xc+(Lx/2)] If Lx<=0, then it returns x without applying modulo arithmetic.

Parameters:
  • x :: [in] Value to which to apply modulo arithmetic [A]

  • xc :: [in] Center of modulo range [A]

  • lx :: [in] Modulo range width [A]

Return:

undefined :: x shifted by an integer multiple of Lx to be close to xc [A].

Called from:

initialize_grid_rotation_angle

subroutine mom_shared_initialization/reset_face_lengths_named(G, param_file, name, US)

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths based on a named set of sizes.

Parameters:
  • g :: [inout] The dynamic horizontal grid

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

  • name :: [in] The name for the set of face lengths. Only “global_1deg” is currently implemented.

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

subroutine mom_shared_initialization/reset_face_lengths_file(G, param_file, US)

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a arrays read from a file.

Parameters:
  • g :: [inout] The dynamic horizontal grid

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave

subroutine mom_shared_initialization/reset_face_lengths_list(G, param_file, US)

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a list read from a file.

Parameters:
  • g :: [inout] The dynamic horizontal grid

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

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

Call to:

mom_error_handler::calltree_enter mom_error_handler::calltree_leave read_face_length_list mom_string_functions::uppercase

subroutine mom_shared_initialization/read_face_length_list(iounit, filename, num_lines, lines)

This subroutine reads and counts the non-blank lines in the face length list file, after removing comments.

Parameters:
  • iounit :: [in] An open I/O unit number for the file

  • filename :: [in] The name of the face-length file to read

  • num_lines :: [out] The number of non-blank lines in the file

  • lines :: The non-blank lines, after removing comments

Call to:

mom_string_functions::uppercase

Called from:

reset_face_lengths_list

subroutine mom_shared_initialization/set_subgrid_topo_at_vel_from_file(G, param_file, US)

Read from a file the maximum, minimum and average bathymetry at velocity points, for the use of porous barrier. Note that we assume the depth values in the sub-grid bathymetry file of the same convention as in-cell bathymetry file, i.e. positive below the sea surface and increasing downward; while in subroutine reset_face_lengths_list, it is implied that read-in fields min_bathy, max_bathy and avg_bathy from the input file CHANNEL_LIST_FILE all have negative values below the surface. Therefore, to ensure backward compatibility, all signs of the variable are inverted here. And porous_Dmax[UV] = shallowest point, porous_Dmin[UV] = deepest point.

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

  • param_file :: [in] Parameter file structure

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

subroutine mom_shared_initialization/set_velocity_depth_max(G)

Set the bathymetry at velocity points to be the maximum of the depths at the neighoring tracer points.

Parameters:

g :: [inout] The dynamic horizontal grid

subroutine mom_shared_initialization/set_velocity_depth_min(G)

Set the bathymetry at velocity points to be the minimum of the depths at the neighoring tracer points.

Parameters:

g :: [inout] The dynamic horizontal grid

subroutine mom_shared_initialization/compute_global_grid_integrals(G, US)

Pre-compute global integrals of grid quantities (like masked ocean area) for later use in reporting diagnostics.

Parameters:
  • g :: [inout] The dynamic horizontal grid

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

Called from:

mom_fixed_initialization::mom_initialize_fixed

subroutine mom_shared_initialization/write_ocean_geometry_file(G, param_file, directory, US, geom_file)

Write out a file describing the topography, Coriolis parameter, grid locations and various other fixed fields from the grid.

Parameters:
  • g :: [inout] The dynamic horizontal grid

  • param_file :: [in] Parameter file structure

  • directory :: [in] The directory into which to place the geometry file.

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

  • geom_file :: [in] If present, the name of the geometry file (otherwise the file is “ocean_geometry”)

Called from:

mom::initialize_mom mom_fixed_initialization::mom_initialize_fixed