Changes between Version 8 and Version 9 of ExternalModelLoop


Ignore:
Timestamp:
May 24, 2025, 11:38:27 AM (8 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExternalModelLoop

    v8 v9  
    2727== External ensemble loop ==
    2828
    29 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.
     29Figure 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.
    3030
    3131[[Image(//pics/DAextension_flexible_PDAF3.png)]]
     
    188188
    189189
    190 == Compilation and testing ==
    191 
    192 One can test the program without hacing implemented the actual assimilation step. In the template code `template/online` all required user-supplied routines are included, but they don't 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.
    193 
    194 However, one can only check this in the model code at this point because the forecasted model fields are not yet written back into the state vectors.
     190== Compiling and testing ==
     191
     192To be able to test the ensemble forecasting, we need also need the user-supplied routine `collect_state_pdaf`. This routine writes the model fields after a forecast into the state vectors. This will be done in the call to `PDAF3_assimilate` in `assimilate_pdaf`. While we explain `assimilate_pdaf` on the following page, we include `collect_state_pdaf` here.
     193
     194Having implemented also `collect_state_pdaf`, 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 don't 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.
     195
     196== `collect_state_pdaf` (collect_state_pdaf.F90) ==
     197
     198The interface for this routine is
     199{{{
     200SUBROUTINE collect_state(dim_p, state_p)
     201
     202  INTEGER, INTENT(in) :: dim_p           ! State dimension for process-local model sub-domain
     203  REAL, INTENT(inout) :: state_p(dim_p)  ! State vector for process-local model sub-domain
     204}}}
     205
     206This routine is called during the forecast phase as many times as there are states to be integrated by a model task. It is called at the end of the integration of a state from the ensemble. The routine is executed by all processes that belong to model tasks.
     207
     208When the routine is called, a state vector `state_p` and its size `dim_p` are provided. The operation to be performed in this routine is inverse to that of the routine `distribute_state_pdaf`. That is, the state vector `state_p` has to be filled from the model fields.
     209
     210Hint:
     211* If the model is not parallelized, `state_p` will contain a full state vector. If the model is parallelized using domain decomposition, `state_p` will contain the part of the state vector that corresponds to the model sub-domain for the calling process.
     212