namespace mom_grid_initialize

Overview

Initializes horizontal grid. More…

namespace mom_grid_initialize {

// global functions

subroutine, public set_grid_metrics(G G, param_file param_file, US US);
real function, public adcroft_reciprocal(val val);
subroutine, public initialize_masks(G G, PF PF, US US);

} // namespace mom_grid_initialize

Detailed Documentation

Initializes horizontal grid.

The metric terms have the form Dzp, IDzp, or DXDYp, where z can be X or Y, and p can be q, u, v, or h. z describes the direction of the metric, while p describes the location. IDzp is the inverse of Dzp, while DXDYp is the product of DXp and DYp except that areaT is calculated analytically from the latitudes and longitudes of the surrounding q points.

On a sphere, a variety of grids can be implemented by defining analytic expressions for dx_di, dy_dj (where x and y are latitude and longitude, and i and j are grid indices) and the expressions for the integrals of their inverses in the four subroutines dy_dj, Int_dj_dy, dx_di, and Int_di_dx.

initialize_masks sets up land masks based on the depth field. The one argument is the minimum ocean depth. Depths that are less than this are interpreted as land points.

Global Functions

subroutine, public set_grid_metrics(G G, param_file param_file, US US)

set_grid_metrics is used to set the primary values in the model’s horizontal grid. The bathymetry, land-sea mask and any restricted channel widths are not known yet, so these are set later.

Parameters:

g

The dynamic horizontal grid type

param_file

Parameter file structure

us

A dimensional unit scaling type

real function, public adcroft_reciprocal(val val)

This function implements Adcroft’s rule for reciprocals, namely that Adcroft_Inv(x) = 1/x for |x|>0 or 0 for x=0.

Parameters:

val

The value being inverted.

Returns:

The Adcroft reciprocal of val.

subroutine, public initialize_masks(G G, PF PF, US US)

Initializes the grid masks and any metrics that come with masks already applied.

Initialize_masks sets mask2dT, mask2dCu, mask2dCv, and mask2dBu to mask out flow over any points which are shallower than Dmin and permit an appropriate treatment of the boundary conditions. mask2dCu and mask2dCv are 0.0 at any points adjacent to a land point. mask2dBu is 0.0 at any land or boundary point. For points in the interior, mask2dCu, mask2dCv, and mask2dBu are all 1.0.

Parameters:

g

The dynamic horizontal grid type

pf

Parameter file structure

us

A dimensional unit scaling type