Changes between Version 5 and Version 6 of ModifyModelforEnsembleIntegration


Ignore:
Timestamp:
Aug 24, 2010, 4:51:01 PM (14 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModifyModelforEnsembleIntegration

    v5 v6  
    99== External ensemble loop ==
    1010
    11 The external loop for the ensemble integration has to enclose the time stepping loop of the model. Next to the external loop, two calls to subroutines of PDAF have to be added. These are the calls to `PDAF_get_state` and a filter-specific routine like `PDAF_put_state_seik` for the SEIK filter. Both routines are described in sections below.
     11The external loop for the ensemble integration has to enclose the time stepping loop of the model. Next to the external loop, a control structure for exiting the external loop as well as two calls to subroutines of PDAF have to be added. These are the calls to `PDAF_get_state` and a filter-specific routine like `PDAF_put_state_seik` for the SEIK filter. Both routines are described in sections below.
    1212
     13The extended model code can look like this for the SEIK filter:
    1314 {{{
    1415  pdaf_modelloop: DO 
    1516
    16      CALL PDAF_get_state(nsteps, timenow, doexit, ..., status)
     17     CALL PDAF_get_state(nsteps, ..., doexit, ...)
    1718
    1819     ! Check whether forecast has to be performed
     
    2526        END IF
    2627
    27         CALL PDAF_put_state_seik(collect_state, ..., status)
     28        CALL PDAF_put_state_seik(...)
    2829
    2930     ELSE ifcontrol
    3031
     32        ! No more assimilation work; exit loop
    3133        EXIT pdaf_modelloop
    3234
     
    3537  END DO pdaf_modelloop
    3638}}}
     39In this example, which is taken from the example implementation in `testsuite/src/dummymodel_1D`, we use an unconditional DO loop (while loop). The exit flag `doexit` for this loop is set within `PDAF_get_state`. In addition, the variable `nsteps` is initialized, which defines the number of time steps to be performed during the current forecast phase. Thus, we only execute the time stepping code if `nsteps>0`. (If this has to be implemented using an IF-clause as in the example should be checked for the particular code).
     40
     41== PDAF_get_state ==
     42
     43The routine `PDAF_get_state` has the purpose to initialize the information, whether further model integrations have to be computed and how many time steps have to be performed. In addition, the model fields to be propagated are initialized from the array holding the ensemble states.
     44
     45The interface of `PDAF_get_state` is the following:
     46{{{
     47  SUBROUTINE PDAF_get_state(nsteps, timenow, doexit, U_next_obs, U_distribute_state, &
     48                            U_prepoststep, status)
     49}}}
     50with the following arguments:
     51 * `nsteps`: An integer specifying upon exit the number of time steps to be performed
     52 * `timenow`: A real specifying upon exit the current model time. 
     53 * `doexit`: An integer variable defining whether the assimilation process is completed and the program should exit the while loop. For compatibility 1 should be used for exit, 0 for continuing in the loop.
     54 * `U_next_obs`: A user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`
     55 * `U_distributed_state`: A user supplied routine that initializes the model fields from the array holding the ensemble of moel state vectors
     56 * `U_prepoststep`: A user supplied routine that is called before and after the analysis step. Here the user has the possibility to access the state ensemble and can e.g. compute estimated variances or can write the ensemble states the state estimate into files.
     57 * `status`: An integer status flag