mom_grid module reference

Provides the ocean grid type.

More…

Data Types

ocean_grid_type

Ocean grid type.

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, 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  mom_grid/ocean_grid_type

Ocean grid type. See mom_grid() for details. for details.

Type fields:
  • % domain :: type(mom_domain_type), pointer Ocean model domain.

  • % domain_aux :: type(mom_domain_type), pointer A non-symmetric auxiliary domain type.

  • % hi :: type(hor_index_type) Horizontal index ranges.

  • % hid2 :: type(hor_index_type) Horizontal index ranges for level-2-downsampling.

  • % isc :: integer The start i-index of cell centers within the computational domain.

  • % iec :: integer The end i-index of cell centers within the computational domain.

  • % jsc :: integer The start j-index of cell centers within the computational domain.

  • % jec :: integer The end j-index of cell centers within the computational domain.

  • % isd :: integer The start i-index of cell centers within the data domain.

  • % ied :: integer The end i-index of cell centers within the data domain.

  • % jsd :: integer The start j-index of cell centers within the data domain.

  • % jed :: integer The end j-index of cell centers within the data domain.

  • % isg :: integer The start i-index of cell centers within the global domain.

  • % ieg :: integer The end i-index of cell centers within the global domain.

  • % jsg :: integer The start j-index of cell centers within the global domain.

  • % jeg :: integer The end j-index of cell centers within the global domain.

  • % iscb :: integer The start i-index of cell vertices within the computational domain.

  • % iecb :: integer The end i-index of cell vertices within the computational domain.

  • % jscb :: integer The start j-index of cell vertices within the computational domain.

  • % jecb :: integer The end j-index of cell vertices within the computational domain.

  • % isdb :: integer The start i-index of cell vertices within the data domain.

  • % iedb :: integer The end i-index of cell vertices within the data domain.

  • % jsdb :: integer The start j-index of cell vertices within the data domain.

  • % jedb :: integer The end j-index of cell vertices within the data domain.

  • % isgb :: integer The start i-index of cell vertices within the global domain.

  • % iegb :: integer The end i-index of cell vertices within the global domain.

  • % jsgb :: integer The start j-index of cell vertices within the global domain.

  • % jegb :: integer The end j-index of cell vertices within the global domain.

  • % isd_global :: integer The value of isd in the global index space (decomposition invariant).

  • % jsd_global :: integer The value of isd in the global index space (decomposition invariant).

  • % idg_offset :: integer The offset between the corresponding global and local i-indices.

  • % jdg_offset :: integer The offset between the corresponding global and local j-indices.

  • % ke :: integer The number of layers in the vertical.

  • % symmetric :: logical True if symmetric memory is used.

  • % nonblocking_updates :: logical If true, non-blocking halo updates are allowed. The default is .false. (for now).

  • % first_direction :: integer 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 :: real, dimension(:, :), allocatable 0 for land points and 1 for ocean points on the h-grid [nondim].

  • % geolatt :: real, dimension(:, :), allocatable The geographic latitude at tracer (h) points [degrees_N] or [km] or [m].

  • % geolont :: real, dimension(:, :), allocatable The geographic longitude at tracer (h) points [degrees_E] or [km] or [m].

  • % dxt :: real, dimension(:, :), allocatable dxT is delta x at h points [L ~> m].

  • % idxt :: real, dimension(:, :), allocatable 1/dxT [L-1 ~> m-1].

  • % dyt :: real, dimension(:, :), allocatable dyT is delta y at h points [L ~> m].

  • % idyt :: real, dimension(:, :), allocatable IdyT is 1/dyT [L-1 ~> m-1].

  • % areat :: real, dimension(:, :), allocatable The area of an h-cell [L2 ~> m2].

  • % iareat :: real, dimension(:, :), allocatable 1/areaT [L-2 ~> m-2].

  • % sin_rot :: real, dimension(:, :), allocatable The sine of the angular rotation between the local model grid’s northward.

  • % cos_rot :: real, dimension(:, :), allocatable The cosine of the angular rotation between the local model grid’s northward.

  • % mask2dcu :: real, dimension(:, :), allocatable 0 for boundary points and 1 for ocean points on the u grid [nondim].

  • % obcmaskcu :: real, dimension(:, :), allocatable 0 for boundary or OBC points and 1 for ocean points on the u grid [nondim].

  • % geolatcu :: real, dimension(:, :), allocatable The geographic latitude at u points [degrees_N] or [km] or [m].

  • % geoloncu :: real, dimension(:, :), allocatable The geographic longitude at u points [degrees_E] or [km] or [m].

  • % dxcu :: real, dimension(:, :), allocatable dxCu is delta x at u points [L ~> m].

  • % idxcu :: real, dimension(:, :), allocatable 1/dxCu [L-1 ~> m-1].

  • % idxcu_obcmask :: real, dimension(:, :), allocatable 1/dxCu or 0 at boundary or OBC points [L-1 ~> m-1].

  • % dycu :: real, dimension(:, :), allocatable dyCu is delta y at u points [L ~> m].

  • % idycu :: real, dimension(:, :), allocatable 1/dyCu [L-1 ~> m-1].

  • % dy_cu :: real, dimension(:, :), allocatable The unblocked lengths of the u-faces of the h-cell [L ~> m].

  • % iareacu :: real, dimension(:, :), allocatable The masked inverse areas of u-grid cells [L-2 ~> m-2].

  • % areacu :: real, dimension(:, :), allocatable The areas of the u-grid cells [L2 ~> m2].

  • % mask2dcv :: real, dimension(:, :), allocatable 0 for boundary points and 1 for ocean points on the v grid [nondim].

  • % obcmaskcv :: real, dimension(:, :), allocatable 0 for boundary or OBC points and 1 for ocean points on the v grid [nondim].

  • % geolatcv :: real, dimension(:, :), allocatable The geographic latitude at v points [degrees_N] or [km] or [m].

  • % geoloncv :: real, dimension(:, :), allocatable The geographic longitude at v points [degrees_E] or [km] or [m].

  • % dxcv :: real, dimension(:, :), allocatable dxCv is delta x at v points [L ~> m].

  • % idxcv :: real, dimension(:, :), allocatable 1/dxCv [L-1 ~> m-1].

  • % dycv :: real, dimension(:, :), allocatable dyCv is delta y at v points [L ~> m].

  • % idycv :: real, dimension(:, :), allocatable 1/dyCv [L-1 ~> m-1].

  • % idycv_obcmask :: real, dimension(:, :), allocatable 1/dxCv or 0 at boundary or OBC points [L-1 ~> m-1].

  • % dx_cv :: real, dimension(:, :), allocatable The unblocked lengths of the v-faces of the h-cell [L ~> m].

  • % iareacv :: real, dimension(:, :), allocatable The masked inverse areas of v-grid cells [L-2 ~> m-2].

  • % areacv :: real, dimension(:, :), allocatable The areas of the v-grid cells [L2 ~> m2].

  • % porous_dminu :: real, dimension(:, :), allocatable minimum topographic height (deepest) of U-face [Z ~> m]

  • % porous_dmaxu :: real, dimension(:, :), allocatable maximum topographic height (shallowest) of U-face [Z ~> m]

  • % porous_davgu :: real, dimension(:, :), allocatable average topographic height of U-face [Z ~> m]

  • % porous_dminv :: real, dimension(:, :), allocatable minimum topographic height (deepest) of V-face [Z ~> m]

  • % porous_dmaxv :: real, dimension(:, :), allocatable maximum topographic height (shallowest) of V-face [Z ~> m]

  • % porous_davgv :: real, dimension(:, :), allocatable average topographic height of V-face [Z ~> m]

  • % mask2dbu :: real, dimension(:, :), allocatable 0 for boundary points and 1 for ocean points on the q grid [nondim].

  • % geolatbu :: real, dimension(:, :), allocatable The geographic latitude at q points [degrees_N] or [km] or [m].

  • % geolonbu :: real, dimension(:, :), allocatable The geographic longitude at q points [degrees_E] or [km] or [m].

  • % dxbu :: real, dimension(:, :), allocatable dxBu is delta x at q points [L ~> m].

  • % idxbu :: real, dimension(:, :), allocatable 1/dxBu [L-1 ~> m-1].

  • % dybu :: real, dimension(:, :), allocatable dyBu is delta y at q points [L ~> m].

  • % idybu :: real, dimension(:, :), allocatable 1/dyBu [L-1 ~> m-1].

  • % areabu :: real, dimension(:, :), allocatable areaBu is the area of a q-cell [L2 ~> m2]

  • % iareabu :: real, dimension(:, :), allocatable IareaBu = 1/areaBu [L-2 ~> m-2].

  • % gridlatt :: real, dimension(:), pointer The latitude of T points for the purpose of labeling the output axes,.

  • % gridlatb :: real, dimension(:), pointer The latitude of B points for the purpose of labeling the output axes,.

  • % gridlont :: real, dimension(:), pointer The longitude of T points for the purpose of labeling the output axes,.

  • % gridlonb :: real, dimension(:), pointer The longitude of B points for the purpose of labeling the output axes,.

  • % x_axis_units :: character(len=40) The units that are used in labeling the x coordinate axes.

  • % y_axis_units :: character(len=40) The units that are used in labeling the y coordinate axes.

  • % x_ax_unit_short :: character(len=40) A short description of the x-axis units for documenting parameter units.

  • % y_ax_unit_short :: character(len=40) A short description of the y-axis units for documenting parameter units.

  • % bathyt :: real, dimension(:, :), allocatable Ocean bottom depth, referenced to Z_ref at tracer points. bathyT is in.

  • % meansl :: real, dimension(:, :), allocatable Spatially varying time mean sea level, referenced to Z_ref at tracer points.

  • % z_ref :: real A reference value for all geometric height fields, such as bathyT [Z ~> m].

  • % bathymetry_at_vel :: logical 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 :: real, dimension(:, :), allocatable Topographic depths at u-points at which the flow is blocked [Z ~> m].

  • % dopen_u :: real, dimension(:, :), allocatable Topographic depths at u-points at which the flow is open at width dy_Cu [Z ~> m].

  • % dblock_v :: real, dimension(:, :), allocatable Topographic depths at v-points at which the flow is blocked [Z ~> m].

  • % dopen_v :: real, dimension(:, :), allocatable Topographic depths at v-points at which the flow is open at width dx_Cv [Z ~> m].

  • % coriolisbu :: real, dimension(:, :), allocatable The Coriolis parameter at corner points [T-1 ~> s-1].

  • % coriolis2bu :: real, dimension(:, :), allocatable The square of the Coriolis parameter at corner points [T-2 ~> s-2].

  • % df_dx :: real, dimension(:, :), allocatable Derivative d/dx f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].

  • % df_dy :: real, dimension(:, :), allocatable Derivative d/dy f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].

  • % areat_global :: real Global sum of h-cell area [L2 ~> m2].

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

  • % us :: type(unit_scale_type), pointer A dimensional unit scaling type.

  • % nblocks :: integer The number of sub-PE blocks on this PE.

  • % block :: type(hor_index_type), dimension(:), pointer Index ranges for each block.

  • % grid_unit_to_l :: real 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 :: real The latitude (or y-coordinate) of the first v-line [degrees_N] or [km] or [m].

  • % west_lon :: real The longitude (or x-coordinate) of the first u-line [degrees_E] or [km] or [m].

  • % len_lat :: real The latitudinal (or y-coord) extent of physical domain [degrees_N] or [km] or [m].

  • % len_lon :: real The longitudinal (or x-coord) extent of physical domain [degrees_E] or [km] or [m].

  • % rad_earth_l :: real The radius of the planet in rescaled units [L ~> m].

  • % max_depth :: real The maximum depth of the ocean in depth units [Z ~> m].

[source]

Function/Subroutine Documentation

subroutine mom_grid/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 :: param_file [in] Parameter file handle

  • us :: A dimensional unit scaling type

  • hi :: [in] A hor_index_type for array extents

  • global_indexing :: global_indexing [in] If true use global index values instead of having the data domain on each processor start at 1.

  • bathymetry_at_vel :: 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.

Call to:

allocate_metrics mom_hor_index::hor_index_init mom_error_handler::mom_error mom_error_handler::mom_mesg

Called from:

mom_oda_driver_mod::init_oda mom_ice_shelf::initialize_ice_shelf

[source]

subroutine mom_grid/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

Call to:

adcroft_reciprocal

Called from:

mom_transcribe_grid::copy_dyngrid_to_mom_grid

[source]

function  mom_grid/adcroft_reciprocal(val)

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

Parameters:

val :: val [in] The value being inverted [A].

Return:

undefined :: The Adcroft reciprocal of val [A-1].

Called from:

set_derived_metrics

[source]

function  mom_grid/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 :: i [in] i index of cell to test

  • j :: j [in] j index of cell to test

  • x :: x [in] x coordinate of point [degrees_E]

  • y :: y [in] y coordinate of point [degrees_N]

[source]

subroutine mom_grid/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 :: y_first [in] The first direction to store

Called from:

mom::initialize_mom mom::step_mom_dynamics

[source]

subroutine mom_grid/get_global_grid_size(G, niglobal, njglobal)

Return global shape of horizontal grid.

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

  • niglobal :: niglobal [out] i-index global size of grid

  • njglobal :: njglobal [out] j-index global size of grid

[source]

subroutine mom_grid/allocate_metrics(G)

Allocate memory used by the ocean_grid_type() and related structures. and related structures.

Parameters:

g :: [inout] The horizontal grid type

Called from:

mom_grid_init

[source]

subroutine mom_grid/mom_grid_end(G)

Release memory used by the ocean_grid_type() and related structures. and related structures.

Parameters:

g :: [inout] The horizontal grid type

[source]

[source]