The inner workings of the memory window will now be exposed so it will
become clear how the window is used for multi-tasking. The memory
window is a chunk of memory dimensioned to hold a few latitude rows of
3-D prognostic data plus some workspace. A detailed schematic of the
minimum sized MW appropriate for second order numerics (i.e.. numerics
which requires access to nearest neighboring cells) is given in Figure
11.2a. Arrays are dimensioned within the MW to hold two
prognostic variables (velocity and tracer) plus a workspace area. Each
prognostic variable is an array subscripted by 5
indices11.7. The first three i,k,j are used to denote
longitude, depth, and latitude. The fourth denotes prognostic component
(e.g. for velocity, a 1 pertains to the zonal component of velocity
and a 2 pertains to the meridional component. For tracers, a 1
pertains to temperature and a 2 pertains to salinity) and the fifth
index which denotes time level (e.g. typically, this index takes on
values of
to represent discrete time levels
,
,
or
}.). The latitude rows for which 3-D prognostic
equations are solved (updated to time level
)
are indicated in
red. The remaining latitude rows indicated in blue are used as buffer
rows for boundary conditions on the computed row.
A work area is also indicated as part of the memory window. The storage required for this area varies depending on which options are enabled and may be comparable to the storage required for prognostic arrays. In general, space is needed to hold diffusive and advective fluxes of prognostic quantities defined on the faces of each cell. Arrays for these fluxes are also subscripted by indices i,k,j but without a fourth or fifth index since they are recalculated for each prognostic variable to conserve memory. Additionally, some options require diffusive coefficients with spatial dependence. In this case, three dimensional arrays are used for diffusive coefficients which are also defined on cell faces.
A simplified schematic of the MW is given on the right side of Figure
11.2a by collapsing all indices except for the local
latitude index ``j''. Two important characteristics are indicated: the
MW contains jmw=3 latitude rows and prognostic equations are
integrated to update prognostic variables to time level
starting on local row j=2 and ending on local row j=2. Rows on
which prognostic equations are solved are indicated by an ```x'' and
buffer rows which hold data one row away are indicated by a ``circle''
in the simplified schematic. An example of a larger MW is given in
Figure 11.2b. In this example, the window holds jmw=6rows and prognostic equations are solved for local rows j=2 through
j=5. In both windows, local rows given by j=1 and j=jmw are
needed as boundaries for the second order numerics. Note that the MW is
always symmetrical in that there are as many boundary rows to the north
of the computed rows as to the south. Why aren't prognostic equations
solved on rows j=1 and j=jmw? Because indexing into arrays required
by the 2nd order numerics would reach outside the MW (i.e. j<1 or
j>jmw).
In general, the number of rows for which prognostic equations are solved within a MW is given by the size of the MW minus the number of northern and southern boundary or buffer rows ``jbuf''. Equations for intermediate quantities such as density or fluxes on cell faces are solved on these extra rows. However, details about which quantities are solved and where they are defined on the grid system within the MW are not needed here and are covered more thoroughly in Section 22.2.4. The important point for now is that the number of computed rows ``ncrows'' where prognostic equations are solved within the MW is given by
| ncrows = jmw - 2*jbuf | (11.1) |
and prognostic equations are solved on every row within the MW from j=js_calc through j=je_calc where
| = | 1+jbuf | (11.2) | |
| = | jmw-jbuf | (11.3) |
In the case of second order numerics, jbuf=1, the minimum
sized window is jmw=3, and there is only one row on which prognostic
equations are solved:
.
For a larger window
where jmw > 3, prognostic equations are solved from MW rows
through
.
For third and fourth order numerics, nearest neighbors of nearest
neighbor cells are required which means a larger minimum sized MW is
needed. An example is given in Figure 11.3a which is the
minimum size required when executing with third or fourth order
numerics. In this case, jbuf=2, the window holds jmw=5 rows, and
prognostic equations are solved from rows
through
.
As with the 2nd order MW, equations for intermediate
quantities are solved on the buffer rows as long as the indexing does
not reach outside of the MW.