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 | |
| 192 | To 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 | |
| 194 | Having 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 | |
| 198 | The interface for this routine is |
| 199 | {{{ |
| 200 | SUBROUTINE 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 | |
| 206 | This 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 | |
| 208 | When 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 | |
| 210 | Hint: |
| 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 | |