source: (poseidon.restarts.f90)
| Subroutines | Variables |
Provide restart writing ( SAVE_RESTART) and reading (INIT).
The poseidon restart file contains everything that is needed to provide transparent restart, and we hope that it contains not much else. It is arranged as a ZDF file (see ZDF_MODULE) which means that it is a collection of "groups", each group having one 100-word header and many "fields", where a field is a 2-dimensional array. The writing of the header and the fields are done with Fortran write statements so the file is blocked as in Fortran.
One property of ZDF files that is of use is that any concatenation of ZDF files is a ZDF file itself. All fields within a group must have the same dimensions, but different groups may have different dimensions. This is important here because the first group of a Poseidon restart file has dimensions that may be different from all the rest. The first group contains misc. parameters and a number of 2-d arrays. If the misc parameters are too big, all the 2-d arrays will be written out padded to the size required by the misc parameters.
Later goups are written at the size of the model object.
The header for each group contains 100 default real words header words 1 through 20 are reserved for ZDF information. words 21 through 100 are user-defined. The Poseidon restart file makes use of header 21 through 100 of the first group to store many of the model parameters. Those parameters which can not be stored entirely within the first header are bumped to the first field of the first group. (Some are put here because they are arrays).
The size of the arrays contained in the fields is determined from header words 9 and 10
im = header(9)+0.01
jm = header(10)+0.01
The number of fields contained in the group is given in word 7:
nrecs = header(7)+0.01
The number of layers that a group represents is given in word 11:
km = header(11)+0.01
(note that nrecs may be different from km if more than one
variable is present in the group, or more than one time level)
To determine the size of the model, use EXTRACT_DIMS, which reads the second group's header information.
The overall organization is:
Group 1:
Misc parameter data as an array
Topography array
Mixed layer entrainment velocity
Mixed layer Monin-Obukhov depth
Mixed layer buoyancy accumulator
Mixed layer penetrating radiation flux accumulator
External mode data (fields 7-32) May not be present
Group 2:
Layer "thickness" for 2 time levels
Group 3:
"Zonal" velocity for 2 time levels
Group 4:
"Meridonal" velocity for 2 time levels
Group 5:
Temperature (This group may have an extra layer if
the model is reduced gravity) for 2 time levels
Group 6:
Salinity (This group may have an extra layer if
the model is reduced gravity) for 2 time levels
Group 7:
Mass filter bolus fluxes in "zonal" direction
Group 8:
Mass filter bolus fluxes in "meridional" direction
Group 9+:
Additional tracers for 2 time levels, one group for each
tracer.
If only one time level is present, the model will still be able to start, but it will assume that time level 2 data is the same as time level 1. This helps in creating a restart file from scratch, as long as you are happy with the differencing that results. If groups 7 or 8 are missing, they are assumed to be zero. (These fluxes are computed under alarm control, and the model is set up to compute them as the very first thing if the alarm is ringing. We try to set this alarm to ring on the first second of the day, and the end-of-run alarm to ring at midnight. In this way, the normal sequence at startup is to read the restart, compute the fluxes, and then go on to all the rest of hydrodynamics. BUT, if the alarm for filtering is set to midnight, then the fluxes will be computed at the beginning of the LAST step of the day, the hydrodynamics will be done, and then the restart will be written. In this case, the fluxes MUST be stored in the restart file. Since we do not trust anyone, we put the fluxes in the restart anyway).
| Subroutines | Use |