| 75 | |
| 76 | == `PDAF_get_state_si` == |
| 77 | |
| 78 | The routine `PDAF_get_state_si` has the purpose to initialize the information, whether further model integrations have to be computed and how many time steps have to be performed. In addition, the model fields to be propagated are initialized from the array holding the ensemble states. |
| 79 | |
| 80 | The interface of `PDAF_get_state_si` is the following: |
| 81 | {{{ |
| 82 | SUBROUTINE PDAF_get_state_si(nsteps, timenow, doexit, status) |
| 83 | }}} |
| 84 | with the following arguments: |
| 85 | * `nsteps`: An integer specifying upon exit the number of time steps to be performed |
| 86 | * `timenow`: A real specifying upon exit the current model time. |
| 87 | * `doexit`: An integer variable defining whether the assimilation process is completed and the program should exit the while loop. For compatibility 1 should be used for exit, 0 for continuing in the loop. |
| 88 | * `status`: The integer status flag. It is zero, if `PDAF_get_state` is exited without errors. |
| 89 | |
| 90 | The routine `PDAF_get_state_si` calls three user-supplied routines with the pre-defined names: |
| 91 | * next_observation_pdaf |
| 92 | * distribute_state_pdaf |
| 93 | * prepoststep_pdaf |
| 94 | The interfaces of these routines are described on the [#U_next_observationnext_observation_pdaf.F90 page on the implementation with the full interface]. |
| 95 | |
| 96 | |
| 97 | == `PDAF_put_state_X_si` == |
| 98 | |
| 99 | There is a separate routine `PDAF_put_state_X_si` for each of the filter algorithms. The name of the routine includes the name of the filter (instead of `X`). The purpose of the `PDAF_put_state_X_si` routines is to write back the forecast model fields into the array holding the ensemble of model state vectors. In addition, the routine checks if the current forecast phase is completed. If not, the routine is exited and the next cycle of the ensemble loop is performed. If the current forecast phase is completed, the routine executes the analysis step of the chosen filter algorithm. Each filter algorithm has its own put-state routine, because the distinct names of several user-supplied routines. The different names do not appear in the simplified interrfaces but are defined internally to PDAF. At the stage of implementing the ensemble integration only the first and last arguments of the routines are relevant. |
| 100 | |
| 101 | The interface for all filters is the following: |
| 102 | {{{ |
| 103 | SUBROUTINE PDAF_put_state_X_si(status) |
| 104 | }}} |
| 105 | At this state of the implementation only these arguments are relevant: |
| 106 | * `status`: The integer status flag. It is zero, if PDAF_get_state is exited without errors. |
| 107 | |
| 108 | At the stage of [ModifyModelforEnsembleIntegration implementing the ensemble integration], one user-supplied routine is relevant: |
| 109 | * `collect_state_pdaf` |
| 110 | The interface of this routine is described on the page on [ModifyModelforEnsembleIntegration#U_collect_statecollect_state.F90 implementing the ensemble integration with the full interface]. |
| 111 | |
| 112 | |
| 113 | The other arguments are names of user-supplied subroutines that are only executed if the analysis step is executed (See the section [#Compilationandtesting 'Compilation and testing'] for how to provide these routines for compilation at this stage). These routines are explained in the section of the implementation guide on ([ImplementationofAnalysisStep Implementation of the Analysis step]) separately for each available filter algorithm. |