37 | | 1. [AdaptParallelization Adaptation of the parallelization] |
38 | | 2. [InitPdaf Initialization of PDAF and the ensemble by PDAF_init] |
| 36 | Examples of the implementation are given in tutorial code provided with PDAF in `tutorial/online_2D_serialmodel` and `tutorial/online_2D_parallelmodel`. These examples base on the template code at `templates/online`. Several subroutines that contain specific operations for the model and observations are called by PDAF through its defined interface as call-back routines. These subroutines need to be implemented by the user. The operations in all these subroutines are rather elementary like filling the array of the ensemble of model states from model output files and the initialization of the vector of observations. The tutorial code includes examples for these routines for a simple case. |
| 37 | |
| 38 | We recommend to base your own implementation on the template by utilizing the provided PDAF-specific routines and inserting them to your model. |
| 39 | |
| 40 | Figure 1 provides an overview of the call structure of the offline code. |
| 41 | |
| 42 | [[Image(//pics/PDAFstructure_online_V3.png)]] |
| 43 | [[BR]]'''Figure 1:''' Overall call structure in PDAF's online mode. Boxes with orange frame show subroutines that are specific for the online mode and not not in the offline mode. |
| 44 | |
| 45 | The code structure is as follows from left to right |
| 46 | * **column 1 'User code'**: The model code calls the four routines shown in this column. These are interface routines, which define variables for PDAF and then call core-subroutines of PDAF. An exception is `init_parallel_pdaf` which does not call PDAF. |
| 47 | * **column 2 'PDAF'**: These are the PDAF core routines which are called by the routines in column 1 to the left. |
| 48 | * **column 3 'Call-back routines'**: This column shows the call-back routines, which are called by the PDAF routines in column 2 to the left. The routines in the purple box `callback_obs_pdafomi.F90` are the subroutines that handle observations. The 3 routines in red are used only for localized ensemble filters. |
| 49 | * **column 4 'OMI observation modules'**: This column shows observation modules that are used for the specific handling of each observation type. This handling is arranged by the PDAF Observation Module Interface (OMI). The observation-related call-back routines in column 3 to the left call routines in each of the observation modules. |
| 50 | * **column 5 'PDAF'**: Some of the call-back routines and the routines in the observation modules call PDAF core routines, e.g. for diagnostics, localization, and to intialize OMI. |
| 51 | |
| 52 | The implementation of the assimilation program for PDAF in offline mode can be performed in following the four routines in the leftmost column: |
| 53 | |
| 54 | 1. **init_parallel_pdaf**: [AdaptParallelization Adaptation of the parallelization] |
| 55 | 2. **init_pdaf**: [InitPdaf Initialization of PDAF and the ensemble by PDAF_init] |
43 | | In Steps 1 to 3, PDAF is attached to the numerical model to allow it to perform ensemble integrations. Step 4 completes the data assimilation program with the analysis step. Finally, step 5 is optional to obtain information on the computing time and required memory. |
44 | | The implementation steps are described on the pages linked above. Examples of the implementation are given in tutorial code provided with PDAF in `tutorial/online_2D_serialmodel/` and `tutorial/online_2D_parallelmodel/`. (The [PdafTutorial tutorial] also provides detail explanations of the implementation steps). |
45 | | |
46 | | Several subroutines that contain specific operations for the model and observations are called as call-back routines by PDAF. For this, PDAF defines interfaces for all routines. These routines need to be implemented by the user. The operations in all these routines are rather elementary like the initialization of the model's physical fields from a state vector provided by PDAF and the initialization of the vector of observations. The examples mentioned above also include example implementations for these routines. In addition, the directory `templates/` contains template implementations of the routines that can be used as a basis for new implementations. |
47 | | |
| 60 | The name of PDAF core routines always starts with `PDAF`. The subroutines with name ending `_pdaf` are generally user-supplied routines in the tutorial codes. |