mom_dyn_horgrid module reference

Contains a shareable dynamic type for describing horizontal grids and metric data and utilty routines that work on this type.

More…

Data Types

dyn_horgrid_type

Describes the horizontal ocean grid with only dynamic memory arrays.

Functions/Subroutines

create_dyn_horgrid()

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

rotate_dyn_horgrid()

Copy the rotated contents of one horizontal grid type into another.

rescale_dyn_horgrid_bathymetry()

rescale_dyn_horgrid_bathymetry permits a change in the internal units for the bathymetry on the grid, both rescaling the depths and recording the new internal depth units.

set_derived_dyn_horgrid()

set_derived_dyn_horgrid calculates metric terms that are derived from other metrics.

adcroft_reciprocal()

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

destroy_dyn_horgrid()

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

Detailed Description

Contains a shareable dynamic type for describing horizontal grids and metric data and utilty routines that work on this type.

Type Documentation

type mom_dyn_horgrid/dyn_horgrid_type

Describes the horizontal ocean grid with only dynamic memory arrays.

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.

  • % 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 (decompoistion invariant).

  • % jsd_global [integer] :: The value of isd in the global index space (decompoistion 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.

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

  • % geolatt [real(:,:),allocatable] :: The geographic latitude at q points [degrees of latitude] or [m].

  • % geolont [real(:,:),allocatable] :: The geographic longitude at q points [degrees of longitude] or [m].

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

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

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

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

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

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

  • % sin_rot [real(:,:),allocatable] :: The sine of the angular rotation between the local model grid’s northward and the true northward directions [nondim].

  • % cos_rot [real(:,:),allocatable] :: The cosine of the angular rotation between the local model grid’s northward and the true northward directions [nondim].

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • % gridlatt [real(:),pointer] :: 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 [real(:),pointer] :: 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 [real(:),pointer] :: 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 [real(:),pointer] :: 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 [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(:,:),allocatable] :: Ocean bottom depth at tracer points, in depth units [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(:,:),allocatable] :: Topographic depths at u-points at which the flow is blocked [Z ~> m].

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

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

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

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

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

  • % df_dy [real(:,:),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 [m2].

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

  • % 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 [real] :: The radius of the planet [m].

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

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

Function/Subroutine Documentation

subroutine mom_dyn_horgrid/create_dyn_horgrid(G, HI, bathymetry_at_vel)

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

Parameters:
  • g :: [inout] A pointer to the dynamic horizontal grid type

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

  • bathymetry_at_vel :: [in] If true, there are separate values for the basin depths at velocity points. Otherwise the effects of topography are entirely determined from thickness points.

Call to:

mom_error_handler::mom_error

Called from:

mom_oda_driver_mod::init_oda mom_ice_shelf::initialize_ice_shelf

subroutine mom_dyn_horgrid/rotate_dyn_horgrid(G_in, G, US, turns)

Copy the rotated contents of one horizontal grid type into another. The input and output grid type arguments can not use the same object.

Parameters:
  • g_in :: [in] The input horizontal grid type

  • g :: [inout] An output rotated horizontal grid type that has already been allocated, but whose contents are largely replaced here.

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

  • turns :: [in] Number of quarter turns

Call to:

set_derived_dyn_horgrid

Called from:

mom::initialize_mom

subroutine mom_dyn_horgrid/rescale_dyn_horgrid_bathymetry(G, m_in_new_units)

rescale_dyn_horgrid_bathymetry permits a change in the internal units for the bathymetry on the grid, both rescaling the depths and recording the new internal depth units.

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

  • m_in_new_units :: [in] The new internal representation of 1 m depth [m Z-1 ~> 1]

Call to:

mom_error_handler::mom_error

subroutine mom_dyn_horgrid/set_derived_dyn_horgrid(G, US)

set_derived_dyn_horgrid calculates metric terms that are derived from other metrics.

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

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

Call to:

adcroft_reciprocal

Called from:

rotate_dyn_horgrid mom_grid_initialize::set_grid_metrics

function mom_dyn_horgrid/adcroft_reciprocal(val) [real]

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

Parameters:

val :: [in] The value being inverted in abitrary units [A ~> a]

Return:

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

Called from:

set_derived_dyn_horgrid

subroutine mom_dyn_horgrid/destroy_dyn_horgrid(G)

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

Parameters:

g :: The dynamic horizontal grid type

Call to:

mom_error_handler::mom_error

Called from:

mom_ice_shelf::initialize_ice_shelf