NWPconf  Version1.0
Functions
nwptime.sh File Reference

Module with functions for managing the reference time of NWP runs. More...

Functions

 nwptime_init ()
 Initialise the time-related environment for a NWP run. More...
 
 nwpbctimeloop_init ()
 Initialise a loop on the model runs providing input boundary conditions for a NWP run. More...
 
 nwpbctimeloop_loop ()
 Advance a loop on the model runs providing input boundary conditions for a NWP run. More...
 

Detailed Description

Module with functions for managing the reference time of NWP runs.

This module provides functions for performing various types of computations related to the reference and forecast time of a NWP model run and of the driving model data. Assimilation and forecast modes are supported, as well analysed and forecast boundary conditions with a desired reference time shift. The terms input model and driving model are used interchangeably hereafter.

The following environmental variables should be set in order to describe the model reference timing:

It is an optional module and it has to be sourced after the main nwpconf.sh module.

Function Documentation

nwptime_init ( )

Initialise the time-related environment for a NWP run.

This function is implicitly called when the module is sourced, it sets the following variables:

  • $DATES and $TIMES absolute date and time of start of model run, either assimilation or forecast, based on $DATE, $TIME and $MODEL_BACK
  • $DATEE and $TIMEE absolute date and time of end of model run, either assimilation or forecast, based on $DATE, $TIME, $MODEL_BACK and $MODEL_STOP
  • $PARENTMODEL_FREQ interval in h between available boundary conditions regardless of them being analysis or forecast
nwpbctimeloop_init ( )

Initialise a loop on the model runs providing input boundary conditions for a NWP run.

This function has to be called for initialising a loop over the input model runs (called "slices") that provide the boundary conditions to an assimilation run. The most common cases are taken into account, like using analysed or forecast BC's, possibly with a shift in time and with specified frequency of availability. For the correct use see nwpbctimeloop_loop().

nwpbctimeloop_loop ( )

Advance a loop on the model runs providing input boundary conditions for a NWP run.

This function has to be called for advancing a loop over the model runs (called "slices") that provide the boundary conditions to an assimilation or forecast run. The function sets the variables:

  • $DATES_SLICE and $TIMES_SLICE date and time of start of current slice of input model providing BCs
  • $MODEL_START_SLICE and $MODEL_STOP_SLICE indicate the first and the last instants, in h starting from $DATES and $TIMES, for which BCs are taken from current slice
  • $MODEL_FREQ_SLICE interval in h between available instants (boundary conditions) for current slice (actually equal for every slice and equal to $PARENTMODEL_FREQ)
  • $MODEL_DELTABD_SLICE difference in h between start of assimilation and start of current slice of input model providing BCs
  • $MODEL_INI_SLICE whether current slice of input model may provide also initial data (.TRUE.) or only boundary data (.FALSE.).

The return value is 1 (true) if the loop is not terminated, or 0 (false) if the loop is terminated, thus it should be used in the following way:

nwpbctimeloop_init
while nwpbctimeloop_loop; do
    performoperationsintheloop
done