wiki:U_next_observation

Version 2 (modified by lnerger, 9 years ago) (diff)

--

U_next_observation

The page document the user-supplied call-back routine U_next_observation.

The routine U_next_observation is a call-back routine that has to be provided by the user. In the simplified interface the predefined name of the routine is next_observation_pdaf, but in the full interface, the user can choose the name of the routine. At the beginning of a forecast phase, U_next_observation is called once by either PDAF_get_state or PDAF_assimilate_X (with X being the name of a filter algorithm) to get the number of time steps to be computed in the forecast phase.

The interface is the following:

SUBROUTINE U_next_observation(stepnow, nsteps, doexit, timenow)

with

  • stepnow : integer, intent(in)
    Number of the current time step
  • nsteps : integer, intent(out)
    Number of time steps until next observations are available
  • doexit : integer, intent(out)
    Whether to exit forecasting (1 for exit); only relevant for the 'flexible' implementation variant.
  • timenow : real, intent(out)
    Current model (physical) time at the beginning of the current forecast phase; only relevant for the 'flexible' implementation variant.

Notes:

  • The routine is called by all processes in a parallel program
  • The variable timenow is only passed through PDAF to other user-supplied routines. It can be useful, e.g. to reset model forcing, which is time-specific

Some hints:

  • If the time interval between successive observations is known, nsteps can be simply initialized by dividing the time interval by the size of the time step
  • At the first call to U_next_observation the variable timenow can be initialized with the current model time. At the next call a forecast phase has been completed. Thus, the new value of timenow follows from the time interval for the previous forecast phase.