127 | | The interface for this routine is |
128 | | {{{ |
129 | | SUBROUTINE collect_state(dim_p, state_p) |
130 | | |
131 | | INTEGER, INTENT(in) :: dim_p ! State dimension for PE-local model sub-domain |
132 | | REAL, INTENT(inout) :: state_p(dim_p) ! State vector for PE-local model sub-domain |
133 | | }}} |
134 | | |
135 | | 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 member state of the ensemble. The routine is executed by all processes that belong to model tasks. |
136 | | |
137 | | 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 `U_distribute_state`. That is, the state vector `state_p` has to be initialized from the model fields. 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. |
138 | | |
139 | | Some hints: |
140 | | * If the state vector does not include all model fields, it can be useful to keep a separate array to store those additional fields. This array has to be kept separate from PDAF, but can be defined using a module like `mod_assimilation`. |
| 127 | This routine is independent of the filter algorithm used. |
| 128 | |
| 129 | See the page on [ModifyModelforEnsembleIntegration#collect_state_pdafcollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine. |