The domain and resolution is constructed in MOM by calling module grids to construct a grid system. Executing MOM to design a grid is similar to using a sledge hammer to work with tacks. Instead, module grids can be executed in a much simpler environment (without the rest of MOM) by using script run_grids. This is a simple UNIX C shell script which assumes a Fortran 90 compiler. Although the script can be executed from the MOM_2 directory, it's a safer practice to use a MOM_UPDATES directory for each experiment as described in Section 3.2. Copy both run_grids and file grids.F into the MOM_UPDATES directory, and make changes to defined the grid there.
To define a grid, go to the USER INPUT section of module grids. After reading the information in this chapter and looking at the examples given in module grids, implementing a grid design should be straightforward. About the only potential problem might be that a particular specification leads to a non-integral number of T cells within a region. Recall that the number of T cells can be found by dividing the span of the region by the average resolution. Either the position of the bounding coordinates or the resolution at these coordinates may be changed to resolve the problem.
In the USER INPUT section, the bounding coordinates are specified by variables x_lon, y_lat, and z_depth. Variable x_lon is dimensioned by parameter nxlons which gives the number of bounding longitudes to define one or more regions in longitude. Units are in degrees of longitude measured at the equator and these points define the longitude of U grid points. Refer to Figs 16.2, 16.3, and 16.4 which indicate U grid points on bounding coordinates with an integral number of T cells inbetween. Similarly, variable y_lat is dimensioned by parameter nylats which gives the number of bounding latitudes to define one or more regions in latitude. These coordinates mark the position on U points in latitude. Variable z_depth is dimensioned by parameter nzdepths which gives the number of bounding depth coordinates to define one or more regions in depth. Units are in cm and mark where the position of the bases of T and U cells will be. Note that the bottoms of T and U cells define where the vertical velocity points are located.
Associated with variables x_lon, y_lat, and z_depth
are variables which define the respective
resolution dx_lon, dy_lat, and dz_depth of cells
at the bounding coordinates. Units are in degrees
for dx_lon and dy_lat but in cm for dz_depth.
Note the variable stretch_z provides additional stretching
for the last region in the vertical. When stretch_z=1.0, there
is no additional stretching. However, when
additional stretching is applied. To see how it works, set
and gradually increase it. It can be used to approximate an
exponential fall off in the vertical.
When executed, script run_grids creates a sub directory and compiles module grids using option drive_grids to activate a driver as the main program. After executing, results are copied to a file in the directory from which script run_grids was executed and the sub-directory is eliminated. View the file results_grids with an editor. When satisfied, copy size.h from the MOM_2 directory and change the parameters according to the indicated directions. Any component of MOM which accesses the updated module grids and size.h will get the new grid. All components of MOM which use module grids and size.h perform a consistency check. If there is an inconsistency, MOM will give an error message and stop.