next up previous
Next: An example of a Up: OASIS4 Model Interface library, Previous: prism_put_restart


The Restart Mechanism

With OASIS4, a coupling restart file is required for the prism_get performed at the beginning the run when the user wants the time stamp of the prism_put to lag behing the time stamp of the corresponding prism_get. In OASIS4, this is realised by specifying a lag for the corresponding output field in the source component SMIOC XML file (see 6.5.4). This lag specifies the number of prism_put periods to be added to the prism_put date and date_bounds to match the corresponding prism_get date and date_bounds in the target component. A prism_put period is defined as the time between the upper and lower date_bounds of a prism_put; i.e. for a lag of 1, the time added to the prism_putdate and date_bounds arguments will be once the time difference between the associated date_bounds.

If a lag is specified in the SMIOC file, two restart files are opened by the source PSMILe library under the prism_enddef , one for reading at the beginning of the run and one for writing at the end of the run. For the first run of an experiment, a restart file has to be created externally by the user and provided at run time (see prism_put_restart 5.6.4) . In the same fashion, the new restart that is written at run time at the end of the run has to be provided as the input to the subsequent run.

The name of the netCDF restart file must be
<field name>_<component name>_<application name>_rst.<date>.nc, where
<date> is the run start_date.

Inside the prism_enddef (and therefore hidden from the user), the respective source PSMILe processes automatically read the local partitions of their output coupling fields defined with a lag from the coupling restart files. The field in the restart file must have a shape equal to the valid shape of the global grid (i.e. the sum of the local valid_shape over all source processes - see 5.3.1). Each process then automatically sends its local restart information to the Transformer which performs the interpolation and sends the interpolated fields to the target component (if no interpolation is required, the data is sent directly to the target component).

Figure 5.7: Schematic calling sequence for handling of restart files.
\includegraphics[width=5cm]{figures/restart}

On the receiving side, the prism_get of a coupling field defined with a lag in the source SMIOC XML file, which date_bounds include the run start_date, will receive the data coming from the restart file. The time information in the restart file (variable time(time)) must be the run start_date indicated in the SCC XML file with a tolerance of $\pm$ 2 seconds in the current implementation. For the subsequent echanges, thanks to the lag, the prism_put called by the source component with arguments (source) date_bounds will match the prism_get called in the target component at at date = (source) date_bounds + lag. At the end of the run, a restart file will automatically be written below a prism_put call which date_bounds(2) + lag exceeds the run end_date12. The time information written to the restart file will correspond to the end_date of the run. This restart file has to be made available for the next run.



Footnotes

... end_date12
When the duration of the run does not equal a finite number of coupling period, the field is written to the restart file if date_bounds(2)+lag > last_date where last_date is the first coupling time $\ge$ run end_date.


Subsections
next up previous
Next: An example of a Up: OASIS4 Model Interface library, Previous: prism_put_restart
Laure Coquart 2011-12-01