Because of the large number of options in RAMS, the structuring of the code needs to be carefully considered. This section will discuss various aspects of the code structure of the system.
The code of RAMS is written in as close to the FORTRAN 77 standard as possible. However, with a program as large as this, the FORTRAN standard is lacking in several features such as global PARAMETER and COMMON statements and conditional compilation. To remedy these insufficiencies, the RAMS code takes advantage of a pre-processor written as part of the RAMS package. This pre-processor itself is written in the 77 standard so that the package as a whole is highly portable. It takes full advantage of the character features of FORTRAN and has executed successfully on a number of machines including a VAX, CRAY-1, CRAY-X-MP, and CYBER 205 without modification. Some of the features of the pre-processor are described below:
The use of grid nesting allows a wider range of motion scales to be modeled simultaneously and interactively. It can greatly ease the limitations of unnested simulations in which a compromise must be reached between covering an adequately large spatial domain and obtaining sufficient resolution of a particular local phenomenon. With nesting, RAMS can now feasibly model mesoscale circulations in a large domain where low resolution is adequate, and at the same time resolve the large eddy structure within a cumulus cloud in a subdomain of the simulation.
Nesting in RAMS is set up such that the same model code for each physical process such as advection is used for each grid. This makes it easy for any desired number of grids to be used without having to duplicate code for each one. Also, it is easy to add or remove a nested grid in time, and to change its size or location. There is still the flexibility of choosing many model options independently for different grids.
RAMS has adopted the two-way interactive nesting procedure described in Clark and Farley (1979). This algorithm is the means by which the different nested grids communicate with each other. The process of advancing coarse grid A and fine nested grid B forward in time one step begins with advancing grid A alone as if it contained no nest within. The computed fields from A are then interpolated tri-quadratically to the boundary points of B. The interior of B is then updated under the influence of its interpolated boundary values. Finally, the field values of A in the region where B exists are replaced by local averages from the fields of B. An increase in efficiency over the Clark and Farley method was implemented by allowing a coarse grid to be run at a longer timestep than a fine grid.
The following options are available with nesting in RAMS:
For those machines with limited central memory and a non-virtual operating system or for efficiency on virtual systems, RAMS is constructed with a disk I/O scheme. When the scheme is operating, a subset of the model's three-dimensional variables will reside in central memory at any one time. Computations then can be performed with this subset. When these computations are finished, a new subset of three-dimensional variables are requested and computations performed with these. The RAMS structure, thus, is dependent on this I/O scheme and consists of a series of calls to the I/O scheme and to the routines which do the calculations.
For flexibility, RAMS is written as modular as possible. Each individual physical parameterization or numerical process is put in a separate subroutine so that the routines can easily be replaced for different options or with new developments.
The routines that do the actual computations for the model are written so that the implementor of a new or replacement routine does not need to be concerned with most of the details of the rest of the model computations. All three-dimensional variables are ``passed" to the subroutines through the call statement with other variables passed through COMMON. The implementor then has the flexibility to structure his routine in whatever manner he wishes to produce the desired result. This concept will also make the implementation of routines from other models and programs easier with less modification required.
A set of subroutines has been developed for analyzing and plotting a variety of quantities from fields output from RAMS. This greatly facilitates the interpretation and understanding of modeled atmospheric phenomena. The quantities diagnosed by these routines include vorticity, divergence, streamfunction, energy, momentum flux, most variances and covariances, and layer averaged quantities.