5.4.2  Determining Runtime Parameter Values

Next, we set the parameters that are read in from files at execution time. Changes to such parameters do not require re-compilation.

1. Set the nametags for the model run in the file main.in. When the file main is executed, it takes input from the file main.in. (If an input file is not used the model will take its input interactively from the terminal.) The file main.in contains three nametags of less than 20 characters, each on a separate line. An example of main.in is

TAG name for present model run.

TAG_ROOT name for preparation run (same as in prep.in).

TAG_READ for restart file if LRSTRT=1 is set. (If LRSTRT=0 this third line of the file is not read, and can be omitted.)

It is possible to make more than one model run simultaneously. Give another nametag to each run on the first line of the input file. Be sure to have a Runtime_parm file with that nametag (see 2 below). Also, change the name of the executable file, standard out, and standard error files after recompilation (if recompilation is necessary) and before execution (see 3 below).

2. Set the runtime parameters in the file you create from a standard Runtime_parm.tag file. Give the file the name MAIN/Runtime_parm.NA1.0 where NA1.0 is the tag name on the first line of the main.in file. This file is read by main.F at execution, so you may change any of these parameters in the file without recompiling with the ``make" command.

Number of time steps per day. For example, a time step of 216 s would be DAODT = 400 (86400/216 = 400).

Horizontal T and S diffusivity coefficient in cm2 s-1. Note that the typical value KHM = KHH = 104 cm2 s-1 is equivalent to 1 m2 s-1.

Horizontal momentum viscosity coefficient in cm2 s-1.

Vertical T and S diffusivity coefficient in cm2s-1. Note that the typical value KVM0 = KVH0 = 0.1 cm2s-1 is equivalent to 10-5 m2s-1.

Vertical momentum viscosity coefficient in cm2 s-1.

Number of total time steps in model run. For example, to run for 15 days with DAODT = 400, set MXIT = 6000.

Flag to initialize from restart file. If LRSTRT = 0, the program is started from the initialization (as opposed to a restart file). Initial velocity set to zero (but not necessarily boundary values). If LRSTRT = 1, the program is started from a restart file. The program main will request the name tag of the restart file, so give this name tag on the third line of file main.in.

Interval in time steps at which restart file is written.

Interval in days at which data is written to file for movies.

Flag to control deep convection in MAIN/SUBS/ convect.F. This scheme searches for denser water over lighter water and mixes. Setting ICONV = 0 suppresses convection and setting ICONV = 1 gives the basic convection scheme that instantaneously eliminates static instabilities by mixing down from the top.

Number of times the deep convection scheme is implemented at each time step to search for denser water over lighter water and mix, typically ISWEEP = 1-3.

Drag coefficient for bottom stress, typically 2.5 x 10-3.

Bottom friction coefficient if linear bottom friction is used. A strong value is 20 s-1.

Nondimensional number (typically 0.0 - 0.1) set to increase vertical mixing coefficient by additional amount RZFAC*ABS( W(I,J,K)).

3. The program main is run in background with the command

nohup main < main.in >& main.out &

or, to obtain information on the simulation runtime, with

(timex nohup main < main.in > main.out) >& main.err &

This is the unix separation of standard out from standard error. The standard out (fortran 06)output is written to file main.out, and the results of the time command (user, system, and real time of model run) and any error messages are written to file main.err. Note that on a unix system, you can view the main.out file as the program is being run using the more or tail -f commands, for example:

main < main.in | more
main < main.in | tail -f

4. The model output created by a simulation is placed in the subdirectory OUTPUT.TAG_ROOT/TAG. Recall that the subdirectory OUTPUT.TAG_ROOT was created by running the executable prep, and the subdirectory OUTPUT.TAG_ROOT/TAG is created by running the executable main. A new subdirectory OUTPUT.TAG_ROOT/TAG is created each time a new identifier tag name is given on the first line of the main.in file, and the simulation restart file is written there

For our example above, the restart file would be OUTPUT.NA1/NA1.0/ RESTART.NA1.0.

A subdirectory SETUP is created and the files that are copied to it are


You should use the #define OUTPUT_ML C-preprocessor directive to create files for output. This takes advantage of the routines that Frazer Davidson(?) wrote at Memorial University of Newfoundland. These can be used for matlab plots. To control what is plotted when OUTPUT_ML is defined, you should look at the Output.h file in MAIN. For greater detail, look at output.F in MAIN/SUBS.

To get movie files, you need to define OUTPUT_DD (DD stands for David Dietrich). The interval at which plots are produced with this option is controlled by the parameter MVI in the Runtime_parm.tag file. Note that MVI is given in days. Also note that this just gives sections at constant Z levels or at the bottom level. OUTPUT_ML allows you to get vertical sections.

It is also possible to use restart files to make plots at the time that a restart is done. These files contains a complete dump at a single time and hence can be quite useful for plotting purposes, but only for a snapshot.

The CANDIE model generates a lot of output data for each model TAG simulation, particularly when the data is output frequently to make movies, or when a restart file is written. This data is placed in subdirectories and sub-subdirectories so that it may not be immediately apparent how much data is generated. A word of caution is in order: disk space can fill up quickley if a number of simulations are made with different runtime TAGnames, and a conscious effort should be made to delete files from simulations that are no longer of use. Check the OUTPUT.TAG_ROOT directories and their OUTPUT.TAG_ROOT/ TAG subdirectories for each case periodically to see what data files are no longer necessary.

5. Running from a restart file

Restarts can be done without difficulty with the CANDIE model. First, a run should be made from the initialization (or a previous restart) so that restart files are available. In the file MAIN/ Runtime_parm.tag, set LRSTRT = 1. When the executable program main is run, the model will ask for the present identifier tag and preparation tag_root names as usual, but also ask for the identifier tag name corresponding to the run from which you want to restart. This will be the tag_read name on the third line of file main.in. This should give a ``seamless'' restart. The parameters MXIT and ISAV will be the additional number of time steps that the model will be run, and at which the next restart file will be written, respectively.

CANDIE Home User Guide Contents Previous Section Top of Page Next Section