Changes between Version 3 and Version 4 of OnlineFlexible_PDAF3


Ignore:
Timestamp:
Apr 17, 2026, 11:58:16 AM (9 hours ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnlineFlexible_PDAF3

    v3 v4  
    3030== External ensemble loop ==
    3131
    32 Figure 1 compares the code structure of the ''fully parallel'' and ''flexible'' implementation variants. While for the ''fully parallel'' variant only the routine `assimilate_pdaf` has to be added in the model time stepping loop, the additional ensemble loop, a call to `PDAF_get_fcst_info`, and a check of the exit flag have to be added.
    33 
    34 [[Image(//pics/DAextension_flexible_PDAF3.png)]]
     32Figure 1 compares the code structure of the ''fully parallel'' and ''flexible'' implementation variants. While for the ''fully parallel'' variant only the routine `assimilate_pdaf` has to be added in the model time stepping loop, the additional ensemble loop, a call to `PDAF3_get_fcst_info`, and a check of the exit flag have to be added.
     33
     34[[Image(//pics/DAextension_flexible_PDAF3.1.png)]]
    3535[[BR]]**Figure 1:** Comparison of the code structure for the ''fully parallel'' and ''flexible'' implementation variants. The ''flexible'' variant required more changes to the code to enable that each model task can integrate more than one ensemble state. Note that the ''fully parallel'' variant defines the number of time steps as `isteps`, which is the total number of steps in the program, while the ''flexible'' variant uses `nsteps`, which is the number of steps in one forecast phase.
    3636
     
    5656  END DO pdaf_modelloop
    5757}}}
    58 This example is taken from the template implementation in `templates/online_flexible/`. The unconditional DO loop (while loop) allows for an arbirary number of repetitions. The exit of the loop is controlled by the exit flag `doexit`, which is obtained from `PDAF_get_fcst_info`. The variable `nsteps`, also obtained from PDAF_get_fcst_info, defines the number of time steps to be computed during the current forecast phase. This value has to be used in the model time stepping loop.
     58This example is taken from the template implementation in `templates/online_flexible/`. The unconditional DO loop (while loop) allows for an arbirary number of repetitions. The exit of the loop is controlled by the exit flag `doexit`, which is obtained from `PDAF3_get_fcst_info`. The variable `nsteps`, also obtained from `PDAF3_get_fcst_info`, defines the number of time steps to be computed during the current forecast phase. This value has to be used in the model time stepping loop.
    5959
    6060To complete the forecasting there are four further steps required:
    61611. We need to initialize the ensemble forecasting. Thus, we need to set how many time steps need to be done until the first observations are assimilated. In addition, we need to write the ensemble state vector values into the model fields. For these operations, we call the routine `PDAF3_init_forecast` in the routine `init_pdaf`.
    62 1. We need to adapt for model code for the additional ensemble loop and related control structure with calling `PDAF_get_fcst_info` as described above.
     621. We need to adapt the model code for the additional ensemble loop and related control structure with calling `PDAF3_get_fcst_info` as described above.
    63631. To enable that the analysis can be performed, we then have to insert the routine `assimilate_pdaf` into the model code.
    64641. To be able to test whether the forecasting works correctly we also recommend to implement the routine `collect_state_pdaf` at this point. The routine is used in `assimilate_pdaf` to write the forecasted model fields into a state vector.
     
    7171The call to `PDAF3_init_forecast` is identical for the ''fully parallel'' and ''flexible'' implementation variants.
    7272
    73 The routine is called at the end of the routine `init_pdaf` that was discussed on the [InitPdaf 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.
     73The routine is called at the end of the routine `init_pdaf` that was discussed on the [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.
    7474
    7575The interface of `PDAF3_init_forecast` is: