Changes between Version 42 and Version 43 of ModifyModelforEnsembleIntegration
- Timestamp:
- May 25, 2025, 5:50:58 PM (7 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ModifyModelforEnsembleIntegration
v42 v43 22 22 On the [wiki:ImplementationConceptOnline Page on the Implementation Concept of the Online Mode] we explained the modification of the model code for the ensemble integration. Here, 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`. 23 23 24 || The more complex ''flexible'' parallelization variant is described separately on the page: [ ExternalModelLoopModification of the model code for the ''flexible'' implementation variant]. ||24 || The more complex ''flexible'' parallelization variant is described separately on the page: [wiki:OnlineFlexible_PDAF3 Modification of the model code for the ''flexible'' implementation variant]. || 25 25 26 26 The extension to the model code for the ''fully parallel'' implementation is depicted in the figure below (See also the page on the [ImplementationConceptOnline 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. … … 40 40 == Calling `PDAF_init_forecast` == 41 41 42 The routine `PDAF_init_forecast` is called at the end of the routine `init_pdaf` that was discussed on the [ InitPdafpage on initializing PDAF]. The main purpose of this routine is to initialize the model fields for all model tasks from the ensemlbe of state vectors. This is done in the call-back routine `distribute_state_pdaf`. The routine also calls the call-back routine `next_observation_pdaf` to set the number of time steps for the initial forecast phase and an exit flag. These values used are internally by PDAF to control the forecast phase. Further, the routine calls the call-back-routine `prepoststep_pdaf`. This pre/postep routine provides the user access to the initial ensemble.42 The routine `PDAF_init_forecast` is called at the end of the routine `init_pdaf` that was discussed on the [wiki:OnlineInitPdaf_PDAF3 page on initializing PDAF]. The main purpose of this routine is to initialize the model fields for all model tasks from the ensemlbe of state vectors. This is done in the call-back routine `distribute_state_pdaf`. The routine also calls the call-back routine `next_observation_pdaf` to set the number of time steps for the initial forecast phase and an exit flag. These values used are internally by PDAF to control the forecast phase. Further, the routine calls the call-back-routine `prepoststep_pdaf`. This pre/postep routine provides the user access to the initial ensemble. 43 43 44 44 The interface of `PDAF_init_forecast` is: … … 66 66 The routine `assimilate_pdaf` is called at each time step of the model forecast. This allows to, e.g., apply [wiki:IncrementalAnalysisUpdates incremental analysis updates]. 67 67 68 Details on the implementations of the user-routines for the analysis step are provided in the following [wiki:ImplementationofAnalysisStep Page on implementating the analysis step].68 Details on the implementations of the user-routines for the analysis step are provided in the following [wiki:ImplementationofAnalysisStep_PDAF3 Page on implementating the analysis step]. 69 69 70 70 Relevant for the forecasting is that `PDAF3_assimilate` calls the user-supplied routine `collect_state_pdaf` which writes forecasted model fields into a state vector from PDAF's ensemble array. We recommend to implement the functionality in `collect_state_pdaf` at this point, even though we explain `PDAF3_assimilation` only later. … … 183 183 == Compiling and testing == 184 184 185 One can test the program without having implemented the actual assimilation step. In the template code `template/online` all required user-supplied routines are included, but they do not contain functionality. However, one can use them to be able to compile and run the assimilation program for testing. In particular one can check if the ensemble forecasting works correctly.185 One can test the program without having implemented the actual assimilation step. In the template code in the directory `templates/online` all required user-supplied routines are included, but they do not contain functionality. However, one can use them to be able to compile and run the assimilation program for testing. In particular one can check if the ensemble forecasting works correctly. 186 186 187 187 The flow of the modified model is now the following: `distribute_state_pdaf` provides each model task with a model state that is to be integrated. Having computed the forecast, `collect_state_pdaf` writes the propagated model fields back into a state vector from the ensemble array of PDAF. This array is then provided to `prepoststep_pdaf`. Thus, one can check if the forecasting works correctly. In `prepoststep_pdaf` one can access the ensemble. Here one can, e.g. compute the ensemble mean - thus the state estimate of the ensemble assimilation - and write this into a file.