MOM_grid module reference

Provides the ocean grid type

Data Types

ocean_grid_type

Ocean grid type. See mom_grid for details.

Functions/Subroutines

MOM_grid_init

MOM_grid_init initializes the ocean grid array sizes and grid memory.

set_derived_metrics

set_derived_metrics calculates metric terms that are derived from other metrics.

Adcroft_reciprocal

Adcroft_reciprocal(x) = 1/x for |x|>0 or 0 for x=0.

isPointInCell

Returns true if the coordinates (x,y) are within the h-cell (i,j)

set_first_direction

Store an integer indicating which direction to work on first.

get_global_grid_size

Return global shape of horizontal grid

allocate_metrics

Allocate memory used by the ocean_grid_type and related structures.

MOM_grid_end

Release memory used by the ocean_grid_type and related structures.

Detailed Description

Grid metrics and their inverses are labelled according to their staggered location on a Arakawa C (or B) grid.

  • Metrics centered on h- or T-points are labelled T, e.g. dxT is the distance across the cell in the x-direction.

  • Metrics centered on u-points are labelled Cu (C-grid u location). e.g. dyCu is the y-distance between two corners of a T-cell.

  • Metrics centered on v-points are labelled Cv (C-grid v location). e.g. dyCv is the y-distance between two -points.

  • Metrics centered on q-points are labelled Bu (B-grid u,v location). e.g. areaBu is the area centered on a q-point.

_images/Grid_metrics.png

The labelling of distances (grid metrics) at various staggered

location on an T-cell and around a q-point."

Areas centered at T-, u-, v- and q- points are areaT, areaCu, areaCv and areaBu respectively.

The reciprocal of metrics are pre-calculated and also stored in the ocean_grid_type with a I prepended to the name. For example, 1./areaT is called IareaT, and 1./dyCv is IdyCv.

Geographic latitude and longitude (or model coordinates if not on a sphere) are stored in geoLatT, geoLonT for T-points. u-, v- and q- point coordinates are follow same pattern of replacing T with Cu, Cv and Bu respectively.

Each location also has a 2D mask indicating whether the entire column is land or ocean. mask2dT is 1 if the column is wet or 0 if the T-cell is land. mask2dCu is 1 if both neighboring columns are ocean, and 0 if either is land. OBCmasku is 1 if both neighboring columns are ocean, and 0 if either is land of if this is OBC point.

Type Documentation

type, public :: ocean_grid_type

Ocean grid type. See mom_grid for details.

Parameters
  • Domain

    Ocean model domain

  • Domain_aux

    A non-symmetric auxiliary domain type.

  • HI

    Horizontal index ranges

  • HId

    Horizontal index ranges for downsampling

  • isc

    The start i-index of cell centers within the computational domain

  • iec

    The end i-index of cell centers within the computational domain

  • jsc

    The start j-index of cell centers within the computational domain

  • jec

    The end j-index of cell centers within the computational domain

  • isd

    The start i-index of cell centers within the data domain

  • ied

    The end i-index of cell centers within the data domain

  • jsd

    The start j-index of cell centers within the data domain

  • jed

    The end j-index of cell centers within the data domain

  • isg

    The start i-index of cell centers within the global domain

  • ieg

    The end i-index of cell centers within the global domain

  • jsg

    The start j-index of cell centers within the global domain

  • jeg

    The end j-index of cell centers within the global domain

  • IscB

    The start i-index of cell vertices within the computational domain

  • IecB

    The end i-index of cell vertices within the computational domain

  • JscB

    The start j-index of cell vertices within the computational domain

  • JecB

    The end j-index of cell vertices within the computational domain

  • IsdB

    The start i-index of cell vertices within the data domain

  • IedB

    The end i-index of cell vertices within the data domain

  • JsdB

    The start j-index of cell vertices within the data domain

  • JedB

    The end j-index of cell vertices within the data domain

  • IsgB

    The start i-index of cell vertices within the global domain

  • IegB

    The end i-index of cell vertices within the global domain

  • JsgB

    The start j-index of cell vertices within the global domain

  • JegB

    The end j-index of cell vertices within the global domain

  • isd_global

    The value of isd in the global index space (decomposition invariant).

  • jsd_global

    The value of isd in the global index space (decomposition invariant).

  • idg_offset

    The offset between the corresponding global and local i-indices.

  • jdg_offset

    The offset between the corresponding global and local j-indices.

  • ke

    The number of layers in the vertical.

  • symmetric

    True if symmetric memory is used.

  • nonblocking_updates

    If true, non-blocking halo updates are allowed. The default is .false. (for now).

  • first_direction

    An integer that indicates which direction is to be updated first in directionally split parts of the calculation. This can be altered during the course of the run via calls to set_first_direction.

  • mask2dT

    0 for land points and 1 for ocean points on the h-grid [nondim].

  • geoLatT

    The geographic latitude at tracer (h) points [degrees_N] or [km] or [m]

  • geoLonT

    The geographic longitude at tracer (h) points [degrees_E] or [km] or [m]

  • dxT

    dxT is delta x at h points [L ~> m].

  • IdxT

    1/dxT [L-1 ~> m-1].

  • dyT

    dyT is delta y at h points [L ~> m].

  • IdyT

    IdyT is 1/dyT [L-1 ~> m-1].

  • areaT

    The area of an h-cell [L2 ~> m2].

  • IareaT

    1/areaT [L-2 ~> m-2].

  • sin_rot

    The sine of the angular rotation between the local model grid's northward and the true northward directions [nondim].

  • cos_rot

    The cosine of the angular rotation between the local model grid's northward and the true northward directions [nondim].

  • mask2dCu

    0 for boundary points and 1 for ocean points on the u grid [nondim].

  • OBCmaskCu

    0 for boundary or OBC points and 1 for ocean points on the u grid [nondim].

  • geoLatCu

    The geographic latitude at u points [degrees_N] or [km] or [m]

  • geoLonCu

    The geographic longitude at u points [degrees_E] or [km] or [m].

  • dxCu

    dxCu is delta x at u points [L ~> m].

  • IdxCu

    1/dxCu [L-1 ~> m-1].

  • IdxCu_OBCmask

    1/dxCu or 0 at boundary or OBC points [L-1 ~> m-1].

  • dyCu

    dyCu is delta y at u points [L ~> m].

  • IdyCu

    1/dyCu [L-1 ~> m-1].

  • dy_Cu

    The unblocked lengths of the u-faces of the h-cell [L ~> m].

  • IareaCu

    The masked inverse areas of u-grid cells [L-2 ~> m-2].

  • areaCu

    The areas of the u-grid cells [L2 ~> m2].

  • mask2dCv

    0 for boundary points and 1 for ocean points on the v grid [nondim].

  • OBCmaskCv

    0 for boundary or OBC points and 1 for ocean points on the v grid [nondim].

  • geoLatCv

    The geographic latitude at v points [degrees_N] or [km] or [m]

  • geoLonCv

    The geographic longitude at v points [degrees_E] or [km] or [m].

  • dxCv

    dxCv is delta x at v points [L ~> m].

  • IdxCv

    1/dxCv [L-1 ~> m-1].

  • dyCv

    dyCv is delta y at v points [L ~> m].

  • IdyCv

    1/dyCv [L-1 ~> m-1].

  • IdyCv_OBCmask

    1/dxCv or 0 at boundary or OBC points [L-1 ~> m-1].

  • dx_Cv

    The unblocked lengths of the v-faces of the h-cell [L ~> m].

  • IareaCv

    The masked inverse areas of v-grid cells [L-2 ~> m-2].

  • areaCv

    The areas of the v-grid cells [L2 ~> m2].

  • porous_DminU

    minimum topographic height (deepest) of U-face [Z ~> m]

  • porous_DmaxU

    maximum topographic height (shallowest) of U-face [Z ~> m]

  • porous_DavgU

    average topographic height of U-face [Z ~> m]

  • porous_DminV

    minimum topographic height (deepest) of V-face [Z ~> m]

  • porous_DmaxV

    maximum topographic height (shallowest) of V-face [Z ~> m]

  • porous_DavgV

    average topographic height of V-face [Z ~> m]

  • mask2dBu

    0 for boundary points and 1 for ocean points on the q grid [nondim].

  • geoLatBu

    The geographic latitude at q points [degrees_N] or [km] or [m]

  • geoLonBu

    The geographic longitude at q points [degrees_E] or [km] or [m].

  • dxBu

    dxBu is delta x at q points [L ~> m].

  • IdxBu

    1/dxBu [L-1 ~> m-1].

  • dyBu

    dyBu is delta y at q points [L ~> m].

  • IdyBu

    1/dyBu [L-1 ~> m-1].

  • areaBu

    areaBu is the area of a q-cell [L2 ~> m2]

  • IareaBu

    IareaBu = 1/areaBu [L-2 ~> m-2].

  • gridLatT

    The latitude of T points for the purpose of labeling the output axes, often in units of [degrees_N] or [km] or [m] or [gridpoints]. On many grids this is the same as geoLatT.

  • gridLatB

    The latitude of B points for the purpose of labeling the output axes, often in units of [degrees_N] or [km] or [m] or [gridpoints]. On many grids this is the same as geoLatBu.

  • gridLonT

    The longitude of T points for the purpose of labeling the output axes, often in units of [degrees_E] or [km] or [m] or [gridpoints]. On many grids this is the same as geoLonT.

  • gridLonB

    The longitude of B points for the purpose of labeling the output axes, often in units of [degrees_E] or [km] or [m] or [gridpoints]. On many grids this is the same as geoLonBu.

  • x_axis_units

    The units that are used in labeling the x coordinate axes.

  • y_axis_units

    The units that are used in labeling the y coordinate axes.

  • x_ax_unit_short

    A short description of the x-axis units for documenting parameter units

  • y_ax_unit_short

    A short description of the y-axis units for documenting parameter units

  • bathyT

    Ocean bottom depth, referenced to Z_ref at tracer points. bathyT is in depth units and positive below Z_ref [Z ~> m].

  • meanSL

    Spatially varying time mean sea level, referenced to Z_ref at tracer points. meanSL is in height units and positive above Z_ref. It is used a) as the height where p = p_atm or zero; b) to calculate time mean thickness of the water column, where mean thickness = max(meanSL + bathyT, 0.0). meanSL is 2D for the consideration of a domain with spatically varying mean height, e.g. the Great Lakes system [Z ~> m].

  • Z_ref

    A reference value for all geometric height fields, such as bathyT [Z ~> m].

  • bathymetry_at_vel

    If true, there are separate values for the basin depths at velocity points. Otherwise the effects of of topography are entirely determined from thickness points.

  • Dblock_u

    Topographic depths at u-points at which the flow is blocked [Z ~> m].

  • Dopen_u

    Topographic depths at u-points at which the flow is open at width dy_Cu [Z ~> m].

  • Dblock_v

    Topographic depths at v-points at which the flow is blocked [Z ~> m].

  • Dopen_v

    Topographic depths at v-points at which the flow is open at width dx_Cv [Z ~> m].

  • CoriolisBu

    The Coriolis parameter at corner points [T-1 ~> s-1].

  • Coriolis2Bu

    The square of the Coriolis parameter at corner points [T-2 ~> s-2].

  • df_dx

    Derivative d/dx f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].

  • df_dy

    Derivative d/dy f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].

  • areaT_global

    Global sum of h-cell area [L2 ~> m2]

  • IareaT_global

    Global sum of inverse h-cell area (1/areaT_global) [L-2 ~> m-2].

  • US

    A dimensional unit scaling type

  • nblocks

    The number of sub-PE blocks on this PE

  • Block

    Index ranges for each block

  • grid_unit_to_L

    A factor that converts a the geoLat and geoLon variables and related variables like len_lat and len_lon into rescaled horizontal distance units on a Cartesian grid, in [L km ~> 1000] or [L m-1 ~> 1] or is 0 for a non-Cartesian grid.

  • south_lat

    The latitude (or y-coordinate) of the first v-line [degrees_N] or [km] or [m]

  • west_lon

    The longitude (or x-coordinate) of the first u-line [degrees_E] or [km] or [m]

  • len_lat

    The latitudinal (or y-coord) extent of physical domain [degrees_N] or [km] or [m]

  • len_lon

    The longitudinal (or x-coord) extent of physical domain [degrees_E] or [km] or [m]

  • Rad_Earth_L

    The radius of the planet in rescaled units [L ~> m]

  • max_depth

    The maximum depth of the ocean in depth units [Z ~> m]

Functions/Subroutine Documentation

subroutine MOM_grid_init(G, param_file, US, HI, global_indexing, bathymetry_at_vel)

MOM_grid_init initializes the ocean grid array sizes and grid memory.

Parameters
  • G [inout]

    The horizontal grid type

  • param_file [in]

    Parameter file handle

  • US

    A dimensional unit scaling type

  • HI [in]

    A hor_index_type for array extents

  • global_indexing [in]

    If true use global index values instead of having the data domain on each processor start at 1.

  • bathymetry_at_vel [in]

    If true, there are separate values for the ocean bottom depths at velocity points. Otherwise the effects of topography are entirely determined from thickness points.

Callees call graph
Callees of mom_grid::mom_grid_init calls cluster_mom_domain_infra MOM_domain_infra cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_mom_grid MOM_grid cluster_mom_hor_index MOM_hor_index mom_domain_infra::compute_block_extent compute_block_extent mom_domain_infra::interface::get_domain_extent get_domain_extent (interface) mom_error_handler::mom_error MOM_error mom_error_handler::mom_mesg MOM_mesg mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_version log_version (interface) mom_grid::allocate_metrics allocate_metrics [private/internal] mom_grid::mom_grid_init MOM_grid_init mom_grid::mom_grid_init->mom_domain_infra::compute_block_extent mom_grid::mom_grid_init->mom_domain_infra::interface::get_domain_extent mom_grid::mom_grid_init->mom_error_handler::mom_error mom_grid::mom_grid_init->mom_error_handler::mom_mesg mom_grid::mom_grid_init->mom_file_parser::interface::get_param mom_grid::mom_grid_init->mom_file_parser::interface::log_version mom_grid::mom_grid_init->mom_grid::allocate_metrics mom_hor_index::hor_index_init hor_index_init mom_grid::mom_grid_init->mom_hor_index::hor_index_init
Text view
Callers call graph
Callers of mom_grid::mom_grid_init calls cluster_mom MOM cluster_mom_grid MOM_grid cluster_mom_ice_shelf MOM_ice_shelf cluster_mom_oda_driver_mod MOM_oda_driver_mod mom::initialize_mom initialize_MOM mom_grid::mom_grid_init MOM_grid_init mom::initialize_mom->mom_grid::mom_grid_init mom_ice_shelf::initialize_ice_shelf initialize_ice_shelf mom_ice_shelf::initialize_ice_shelf->mom_grid::mom_grid_init mom_oda_driver_mod::init_oda init_oda mom_oda_driver_mod::init_oda->mom_grid::mom_grid_init
Text view
subroutine set_derived_metrics(G, US)

set_derived_metrics calculates metric terms that are derived from other metrics.

Parameters
  • G [inout]

    The horizontal grid structure

  • US [in]

    A dimensional unit scaling type

Callees call graph
Callees of mom_grid::set_derived_metrics calls cluster_mom_grid MOM_grid mom_grid::adcroft_reciprocal Adcroft_reciprocal [private/internal] mom_grid::set_derived_metrics set_derived_metrics mom_grid::set_derived_metrics->mom_grid::adcroft_reciprocal
Text view
Callers call graph
Callers of mom_grid::set_derived_metrics calls cluster_mom_grid MOM_grid cluster_mom_transcribe_grid MOM_transcribe_grid mom_grid::set_derived_metrics set_derived_metrics mom_transcribe_grid::copy_dyngrid_to_mom_grid copy_dyngrid_to_MOM_grid mom_transcribe_grid::copy_dyngrid_to_mom_grid->mom_grid::set_derived_metrics
Text view
function Adcroft_reciprocal(val) result(I_val)

Adcroft_reciprocal(x) = 1/x for |x|>0 or 0 for x=0.

Parameters
  • val [in]

    The value being inverted [A].

  • I_val

    The Adcroft reciprocal of val [A-1].

Callers call graph
Callers of mom_grid::adcroft_reciprocal calls cluster_mom_grid MOM_grid mom_grid::adcroft_reciprocal Adcroft_reciprocal [private/internal] mom_grid::set_derived_metrics set_derived_metrics mom_grid::set_derived_metrics->mom_grid::adcroft_reciprocal
Text view
logical function isPointInCell(G, i, j, x, y)

Returns true if the coordinates (x,y) are within the h-cell (i,j)

Parameters
  • G [in]

    Grid type

  • i [in]

    i index of cell to test

  • j [in]

    j index of cell to test

  • x [in]

    x coordinate of point [degrees_E]

  • y [in]

    y coordinate of point [degrees_N]

subroutine set_first_direction(G, y_first)

Store an integer indicating which direction to work on first.

Parameters
  • G [inout]

    The ocean's grid structure

  • y_first [in]

    The first direction to store

Callers call graph
Callers of mom_grid::set_first_direction calls cluster_mom MOM cluster_mom_grid MOM_grid mom::initialize_mom initialize_MOM mom_grid::set_first_direction set_first_direction mom::initialize_mom->mom_grid::set_first_direction mom::step_mom_dynamics step_MOM_dynamics [private/internal] mom::step_mom_dynamics->mom_grid::set_first_direction
Text view
subroutine get_global_grid_size(G, niglobal, njglobal)

Return global shape of horizontal grid

Parameters
  • G [inout]

    The horizontal grid type

  • niglobal [out]

    i-index global size of grid

  • njglobal [out]

    j-index global size of grid

Callees call graph
Callees of mom_grid::get_global_grid_size calls cluster_mom_domain_infra MOM_domain_infra cluster_mom_grid MOM_grid mom_domain_infra::get_global_shape get_global_shape mom_grid::get_global_grid_size get_global_grid_size mom_grid::get_global_grid_size->mom_domain_infra::get_global_shape
Text view
subroutine allocate_metrics(G)

Allocate memory used by the ocean_grid_type and related structures.

Parameters
  • G [inout]

    The horizontal grid type

Callers call graph
Callers of mom_grid::allocate_metrics calls cluster_mom_grid MOM_grid mom_grid::allocate_metrics allocate_metrics [private/internal] mom_grid::mom_grid_init MOM_grid_init mom_grid::mom_grid_init->mom_grid::allocate_metrics
Text view
subroutine MOM_grid_end(G)

Release memory used by the ocean_grid_type and related structures.

Parameters
  • G [inout]

    The horizontal grid type

Callees call graph
Callees of mom_grid::mom_grid_end calls cluster_mom_domain_infra MOM_domain_infra cluster_mom_grid MOM_grid mom_domain_infra::deallocate_mom_domain deallocate_MOM_domain mom_grid::mom_grid_end MOM_grid_end mom_grid::mom_grid_end->mom_domain_infra::deallocate_mom_domain
Text view
Callers call graph
Callers of mom_grid::mom_grid_end calls cluster_mom MOM cluster_mom_grid MOM_grid mom::initialize_mom initialize_MOM mom_grid::mom_grid_end MOM_grid_end mom::initialize_mom->mom_grid::mom_grid_end mom::mom_end MOM_end mom::mom_end->mom_grid::mom_grid_end
Text view
API generated with Flint · Rendered from reStructuredText