Version 33 (modified by 10 days ago) ( diff ) | ,
---|
Modifying the model code for the ensemble integration
Implementation Guide
- Main page
- Adaptating the parallelization
- Initializing of PDAF
- Modifications for ensemble integration
- Flexible implementation variant
- Implementing the analysis step
- Memory and timing information
Contents of this page
Overview
On the Page on the Implementation Concept of the Online Mode we explained the modification of the model code for the ensemble integration. On this page, we focus on the fully parallel implementation variant, which only needs minor code changes. In this case, the number of model tasks is equal to the ensemble size such that each model task integrates exactly one model state. In this case, the model always moves forward in time. As before, we refer to the example code for the online mode in tutorial/online_2D_parallelmodel
and tutorial/online_2D_serialmodel
.
The more complex flexible parallelization variant is described separately on the page: Modification of the model code for the ''flexible'' implementation variant. |
The extension to the model code for the fully parallel implementation is depicted in the figure below (See also the page on the implementation concept of the online mode.) As at this stage of the implementation the calls to init_parallel_pdaf
and init_pdaf
are already inserted into the code, the difference is in the addition of routines for the time stepping. The parallel ensemble integration is enabled by the configuration of the parallelization that was done by init_parallel_pdaf
in the first step of the implementation. This does not require further code changes.
Figure 1: (left) Generic structure of a model code, (right) modified structure for fully-parallel data assimilation system with PDAF. The figures assumes that the model is parallelized, such that it initializes its parallelization in the step initial parallelization
. If the model is not parallelized this step does not exist.
To enable that the analysis can be performed, we next have to insert the routine assimilate_pdaf
into the model code.
Inserting assimilate_pdaf
into the model code
The right place to insert the routine assimilate_pdaf
into the model code is at the end of the model time stepping loop, thus when the model completed the computation of a single time step. In most cases, this is just before the 'END DO' in the model source code. However, there might be special cases, where the model does some additional operations so that the call to assimialte_pdaf
should be insered somewhat earlier.
Using assimilate_pdaf
The purpose of assimilate_pdaf
is to call the universal PDAF-core routine PDAF3_assimilate
(or a more specific varant of this routine). The arguments of PDAF3_assimilate
are mainly the names of user-supplied call-back routines, except from an argument for the status flag. These names are specified in assimilate_pdaf
as 'external'.
The routine assimilate_pdaf
is called at each time step of the model forecast. This allows to, e.g., apply incremental analysis updates.
Details on the implementations of the user-routines for the analysis step ar provided in the following Page on implementating the analysis step.