= Offline Mode: Implementation Guide =
{{{
#!html
}}}
== The implementation of PDAF in offline mode ==
For the offline mode of data assimilation, the ensemble integrations by the numerical model are executed separately from the assimilation program, which computes the filter analysis step. Thus, the model code can remain unchanged in the offline mode. The calls to functions of PDAF are only contained in the assimilation program.
The implementation of the assimilation program for PDAF in offline mode can be performed in several steps. A possible sequence is the following:
1. [OfflineAdaptParallelization Adaptation of the parallelization]
2. [OfflineInitPdaf Initialization of PDAF and the ensemble by PDAF_init]
3. [OfflineImplementationofAnalysisStep Implementation of the analysis step]
4. [OfflineAddingMemoryandTimingInformation Adding memory and timing information]
The implementation steps are described on the pages linked above. An example of the implementation is given in the test suite provided with PDAF with the routines in `testsuite/main/` and `testsuite/offline_1D/`. This example implementation can also be used as the starting point for your own implementation.
Several routines that contain model and observation specific operations are called by PDAF through its defined interface. These routines need to be implemented by the user. The operations in all these routines 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 example mentioned above also includes examples for these routines. In addition, the directory `templates/` contains template implementations of the routines that can be used as a basis for new implementations.