A schematic view of the data structure defining u3, v3, t3, and q3 is shown in Figure 3.4. This storage arrangement accomplishes two important goals. The contiguity of fields u3, v3, and t3 results in a more efficient Fourier transform for the same reasons mentioned earlier for surface pressure, vorticity, and divergence in the main model buffer. Additionally, the SLT algorithm takes advantage of the contiguity of u3 and v3 to produce more efficient code.
Figure 3.4 The /com3d/ storage arrangement.
If pcnst+pnats is greater than 1 (that is, at least one user-defined constituent is declared), the longitude-level cross sections of the additional constituents are stored adjacent to water vapor. Access to the constituent array at a high level in the calling tree is of the form q3(i1+i-1,k,m,j1+lat-1,n3), where m is the constituent index, lat is the south-to-north latitude index, and n3 is the time level index. m=1 refers to the moisture field, with additional constituents stored in locations m=2,pcnst+pnats. Variables i1 and j1 are the longitudinal and latitudinal offsets of the first "real" data elements, with the data values outside the domain used by the SLT code and the FFT package. Much of the complexity of this data structure can be hidden by passing array offsets to lower level routines.
Since u3, v3, and t3 are a part of this same data structure, a dimensioning construct was employed to avoid having to include a constituent index on these fields. Defining the Fortran parameter plevd, as plev*p3d (where p3d=3+pcnst+pnats), allows u3, v3, and t3 to be dimensioned as (plond,plevd,platd,2). To see how this is used we examine the (/com3d/) common block :
common/com3d/n3m1,n3
common/com3d/ps(plond,plat,2),x(plond,plev,p3d,platd,2)
C
real u3(plond,plevd,platd,2),
! u-wind component
$ v3(plond,plevd,platd,2),
! v-wind component
$ t3(plond,plevd,platd,2),
! temperature
$ q3(plond,plev,p3d,platd,2)
! specific humidity
! and constituents
equivalence (u3,x(1,1,1,1,1)),
$
(v3,x(1,1,2,1,1)),
$
(t3,x(1,1,3,1,1)),
$
(q3,x(1,1,4,1,1))
C
integer n3m1,n3 ! time index pointers
real ps, ! surface pressure
$ x ! contiguous
u,v,t,q
The 3 in the 3+pcnst+pnats dimension accounts for prognostic variables u3,v3, and t3. "n3" and "n3m1" are time level indices used as the last subscript in the prognostic arrays. Each holds the value 1 or 2, with the values toggled after each timestep to avoid a memory transfer of time n-1 data. Equivalenced array "x" allows reference to all four three-dimensional prognostic arrays as a single entity.
In addition to the prognostics, SLT three-dimensional fields lammp, phimp, sigmp, and qfcst are held in-core and given global scope by keeping them in a common block (/comslt/). These arrays are held in common rather than kept local to scanslt because they need to be written to the restart dataset and they are required in other scan loops.
Other three-dimensional arrays held in memory, but which are not written
to the restart dataset are local scanslt arrays uxl ,
uxr , qxl , and qxr . The SLT scheme may transport
an arbitrary number of constituents. It is important to realize that in-core
arrays q3 , qfcst , qxl , and qxr have
a constituent dimension, so transporting a large number of constituents
can lead to rapid growth in memory use.
Questions on these pages can be sent to... erik@ucar.edu .