next up previous contents
Next: 3.3 The MOM Test Up: 3. Getting Started Previous: 3.1 How to find

   
3.2 Directory Structure

First, refer to Figure 3.1 for a schematic view of how the directory structure of MOM_3 is organized at GFDL. The structure is divided between two file systems: the CRAY file system contains the data part and the workstation file system contains all code and run_scripts. This structure is arbitrary but not without reason; especially the flat file structure used for the code which is described below. The recommendation is that this structure be retained as much as possible. Doing so will make things easy.

On the CRAY file system, there is an ARCHIVE/MOM_3/DATABASE directory. The DATABASE contains Hellerman and Rosenstein (1983) monthly climatological wind stress on a $2^\circ$ grid, Oort (1983) Monthly Surface air temperature on a $5^\circ$ grid, Levitus (1982) monthly temperature and salinity on a $1^\circ$ grid, and Scripps topography on a $1^\circ$ grid3.1. There is also an ARCHIVE/MOM_3/EXP directory where interpolated data from the DATABASE and results3.2 from various experiments are stored, each under their own sub-directory3.3. The only sub-directory included is ..EXP/TEST_CASE which (after executing run scripts described below) will contain an interpolated version3.4 of the DATABASE appropriate for the domain and resolution of the test case which is described below.

On the workstation file system, there is also a MOM_3 directory containing code,  run_scripts, and four sub-directories: MOM_3/PREP_DATA for preparing surface boundary conditions and initial conditions, MOM_3/SBC for handling various types of surface boundary conditions, MOM_3/NETCDF3.5 containing routines to interface to the netcdf library, and MOM_3/EXP which in general contains a sub-directory for each experiment.

Note that as far as the actual fortran code, the file structure is basically flat with all code relating to the model proper being lumped into one place (in the MOM_3 directory). An alternative is to impose some structure by dividing the code up and placing related routines into sub-directories under MOM_3. For instance, vertical diffusion routines could be placed under sub-directory MOM_3/VERT_DIFFUSION, etc. With such a segmented file structure, finding and editing source code becomes a chore. However, with the aid of UNIX, any file structure can be easily sifted out of the flat file structure. For instance, suppose, it is necessary to look at all routines having anything to do with biharmonic mixing. The following UNIX call


 grep -l biharmonic *


will list the subset of filenames. The files are all in one place and immediately available for editing. For the future, this method can be made even more effective by embedding keywords in the comments of routines. For instance, placing a comment with the phrase "SGS parameterization" in each routine that is a sub-grid scale parameterization will allow all such routines to be easily listed.

Details of the sub-directories under MOM_3 are given below:


next up previous contents
Next: 3.3 The MOM Test Up: 3. Getting Started Previous: 3.1 How to find
RC Pacanowski and SM Griffies, GFDL, Jan 2000