53 | | The ESTKF [Error Subspace Transform Kalman Filter] algorithm was introcued with PDAF V1.8.. The user-supplied routines required for the ESTKF are identical to those required for the SEIK filter and amost identical to those required for the ETKF method. |
54 | | |
55 | | For the analysis step of the ESTKF different operations related to the observations are needed. These operations are requested by PDAF by call-back routines supplied by the user. Intentionally, the operations are split into separate routines in order to keep the operations rather elementary and efficient. This procedure should simplify the implementation. The names of the required routines are specified in the call to the routine `PDAF_assimilate_estkf` in the fully-parallel implementation (or `PDAF_put_state_estkf` for the 'flexible' implementation) that was discussed before. With regard to the parallelization, all these routines are executed by the filter processes (`filterpe=.true.`) only. |
56 | | |
57 | | For completeness we discuss here all user-supplied routines that are specified in the interface to PDAF_assimilate_estkf. Thus, some of the user-supplied routines that are explained on the page describing the modification of the model code for the ensemble integration are repeated here. |
| 53 | The ESTKF [Error Subspace Transform Kalman Filter] algorithm was introcued with PDAF V1.8. The user-supplied routines required for the ESTKF are identical to those required for the SEIK filter and amost identical to those required for the ETKF method. |
| 54 | |
| 55 | For the analysis step of the ESTKF, different operations related to the observations are needed. These operations are requested by PDAF by call-back routines supplied by the user. Intentionally, the operations are split into separate routines in order to keep the operations rather elementary and efficient. This procedure should simplify the implementation. The names of the required routines are specified in the call to the routine `PDAF_assimilate_estkf` in the ''fully-parallel'' and ''flexible'' implementation (or `PDAF_put_state_estkf` for the offlie mode and the ''flexible'' implementation in PDAF2) that was discussed before. For the offline mode in PDAF3, the routine `PDAF_assim_offline_estkf` is used. With regard to the parallelization, all these routines are executed by the filter processes (`filterpe=.true.`) only. |
| 56 | |
| 57 | For completeness we discuss here all user-supplied routines that are specified in the interface to `PDAF_assimilate_estkf`. Thus, some of the user-supplied routines that are explained on the page describing the modification of the model code for the ensemble integration are repeated here. |
82 | | |
| 84 | where all arguments, except the last one, are names of used-supplied routines. |
| 85 | |
| 86 | |
| 87 | === `PDAF_assim_offline_estkf ` === |
| 88 | |
| 89 | For the offline mode of PDAF, the routine `PDAF3_assim_offline` is used to perform the analysis step. |
| 90 | The interface of the routine is identical with that of `PDAF_assimilate_estkf`, except that the user-supplied routines `U_distribute_state`, `U_collect_state` and `U_next_observation` are missing. |
| 91 | |
| 92 | The interface is: |
| 93 | {{{ |
| 94 | SUBROUTINE PDAF_assim_offline_estkf(U_init_dim_obs, & |
| 95 | U_obs_op, U_init_obs, U_prepoststep, U_prodRinvA, & |
| 96 | U_init_obsvar, status) |
| 97 | }}} |
177 | | The routine has already been described on the [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#prepoststep_pdafprepoststep_ens_pdaf.F90 page on modifying the model code for the ensemble integration]. For completeness, the description is repeated: |
178 | | |
179 | | The interface of the routine is identical for all filters. However, the particular operations that are performed in the routine can be specific for each filter algorithm. |
180 | | |
181 | | The interface for this routine is |
182 | | {{{ |
183 | | SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, & |
184 | | state_p, Uinv, ens_p, flag) |
185 | | |
186 | | INTEGER, INTENT(in) :: step ! Current time step |
187 | | ! (When the routine is called before the analysis -step is provided.) |
188 | | INTEGER, INTENT(in) :: dim_p ! PE-local state dimension |
189 | | INTEGER, INTENT(in) :: dim_ens ! Size of state ensemble |
190 | | INTEGER, INTENT(in) :: dim_ens_p ! PE-local size of ensemble |
191 | | INTEGER, INTENT(in) :: dim_obs_p ! PE-local dimension of observation vector |
192 | | REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state |
193 | | ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF/ESTKF. |
194 | | ! It can be used freely in this routine. |
195 | | REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U |
196 | | REAL, INTENT(inout) :: ens_p(dim_p, dim_ens) ! PE-local state ensemble |
197 | | INTEGER, INTENT(in) :: flag ! PDAF status flag |
198 | | }}} |
199 | | |
200 | | The routine `U_prepoststep` is called once at the beginning of the assimilation process. In addition, it is called during the assimilation cycles before the analysis step and after the ensemble transformation. The routine is called by all filter processes (that is `filterpe=1`). |
201 | | |
202 | | The routine provides for the user the full access to the ensemble of model states. Thus, user-controlled pre- and post-step operations can be performed. For example the forecast and the analysis states and ensemble covariance matrix can be analyzed, e.g. by computing the estimated variances. In addition, the estimates can be written to disk. |
203 | | |
204 | | Hint: |
205 | | * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it. |
206 | | * Only for the SEEK filter the state vector (`state_p`) is initialized. For all other filters, the array is allocated, but it can be used freely during the execution of `U_prepoststep`. |
207 | | * The interface has a difference for ETKF and ESTKF: For the ETKF, the array `Uinv` has size `dim_ens` x `dim_ens`. In contrast it has size `dim_ens-1` x `dim_ens-1` for the ESTKF. (For most cases, this will be irrelevant, because most usually the ensemble array `ens_p` is used for computations, rather than `Uinv`. Only for the SEIK filter with fixed covariance matrix, `Uinv` is required to compute the estimate analysis error. The fixed covariance matrix mode is not available for the ETKF or ESTKF.) |
208 | | * The interface through which `U_prepoststep` is called does not include the array of smoothed ensembles. In order to access the smoother ensemble array one has to set a pointer to it using a call to the routine `PDAF_get_smootherens` (see page on [AuxiliaryRoutines auxiliary routines]) |
| 194 | The routine has already been described for modifying the model for the ensemble integration and for inserting the analysis step. |
| 195 | |
| 196 | See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#distribute_state_pdafdistribute_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine. |