1. Choose or define an application case name. For example, for our case of the North Atlantic, the name NA1_TEST_CASE would be appropriate. In the file PREP/ AN_ID.h comment out all other preprocessor #define statements with a C in the first column, so that the application name is defined by the only uncommented line in the file
2. Choose the basic model setup features appropriate to your problem, listed in PREP/ Def_prep.h, from the possible choices:
These are set in the \#ifdef block of code as shown below for the NA1 case:
#endif /* NA1_TEST_CASE */
3. Set the user defined resolution parameters in the file PREP/ Diecast.h:
I0 Number of grid cells in the east-west (X) direction, including a one grid ``ghost zone'' at each end.
J0 Number of grid cells in the north-south (Y) direction, including a one grid ``ghost zone'' at each end. The present version of the code is set up so that (block size used by the pressure solver). (See the note on IE below).
K0 Number of interfaces between the levels in vertical (Z) direction (including top and bottom). Note that there are K1 = K0-1 levels. When a bottom boundary layer is included, the number of normal cells is still K1 and the bottom boundary layer occupies the K0 level.
NB0 Number of blocks in the Y-direction for the elliptic solver used to determine the surface pressure changes. Each block should be between 5 and 8 grid cells in the Y-direction in order to minimize roundoff error.
The above parameters are set within #ifdef - #elif logical blocks of code in the Diecast.h file. The #ifdef blocks refer to the case defined in the file PREP-/ AN_ID.h. For example, to set up for the NA1_TEST_CASE with 102 grid cells in the X and Y directions (including ghost cells), 21 cells in the vertical, and 17 blocks with 6 cells in each ( J0 = 6*17 = 102) for the elliptic solver in the Y-direction, we would have the following text in Diecast.h.
Important note: IE is the array of EVP block boundaries used in the pressure solver. The present version of CANDIE determines these boundaries within prep.F. These blocks can be modified by the user, but each block should be at least three cells and should not exceed 8 cells. At present we have required that J0 be a multiple of NB0. This is not essential, but it is essential that IE( NB0) = J0-1.
The remainder of the Diecast.h file calculates resolution parameters derived from the above dimensions, defines geophysical constants for the acceleration of gravity, the earth's radius, etc., and contains preprocessor #ifdef blocks for the special preparation conditions, such as
4. Compile the preparation program using PREP/ Makefile by typing ``make'' from the PREP subdirectory. To send the output to a file you can use the command
make >& Makefile.out
This produces the executable file PREP/ prep. Note that if you change any files ending in .f, .F, or .h in PREP or its subdirectories, a new executable prep must be created by typing ``make" to recompile the Makefile. If you have created any new files to be included in prep.F, be sure to add them to the target list in the Makefile (see end of section 5.2.3). As a debugging technique, it is sometimes useful to use the command
f77 -F prep.F (on SUN workstations)
f77 -P prep.F (on SGI workstations)
which invokes the source file macro preprocessor but does not compile. A file is created that gives a listing of the code in the prep.F file with all the code inserted from the INCLUDE statements for the #ifdef options selected.