| 219 | | The structure of the operations in `PDAF_X_update` can be designed freely when implementing a new DA method. The existing methods follow the recommended structure in which `PDAF_x_update` only performes preparations for the actual analysis update and then calls `PDAF_X_analysis` for the computation of the actual update. Here, the operations are different for global and local filters. |
| 220 | | |
| | 219 | The structure of the operations in `PDAF_X_update` can be designed freely when implementing a new DA method. The existing methods follow the recommended structure in which `PDAF_x_update` only performes preparations for the actual analysis update and then calls `PDAF_X_analysis` for the computation of the actual update. Here, the operations are different for global and local methods. |
| | 220 | |
| | 221 | === Global Methods === |
| | 222 | |
| | 223 | For localized Methods, e.g. ESTKF, ETKF or NETF, the general structure of `PDAF_X_update` is: |
| | 224 | |
| | 225 | {{{ |
| | 226 | IF (fixed ensemble, i.e. subtype==2 or subtype==3) THEN |
| | 227 | Add central state for ensemble perturbations |
| | 228 | ENDIF |
| | 229 | |
| | 230 | CALL U_prepoststep # Perform pre/poststep before analysis update |
| | 231 | |
| | 232 | CALL PDAF_X_analysis # Compute global analysis update of ensemble |
| | 233 | |
| | 234 | CALL PDAF_smoother # Only for filters for which a smoother is implemented |
| | 235 | |
| | 236 | CALL U_prepoststep # Perform pre/poststep after analysis update |
| | 237 | }}} |
| | 238 | You will find this structure e.g. in `PDAF_ESTKF_update.F90`. This structure is also valid for the LEnKF. The actual implementation, e.g. in `PDAF_ESTKF_update.F90` contains additional functionality e.g. calls for timers and normal screen output or debug outputs. Also there can be different calls `PDAF_X_analysis` depending on the subtype of a filter. |
| | 239 | |
| | 240 | This general structure should be widely usable. Thus, when implementing a new global ensemble method one could copy an existing file and adapt it for the new method. The main functionality of the new DA method would then be implemented in `PDAF_X_analysis`. |
| | 241 | |
| | 242 | |
| | 243 | === Local Methods === |
| | 244 | |
| | 245 | For domain-localized Methods, e.g. LESTKF, LETKF or LNETF the general structure of `PDAF_X_update` is different from the global methods because the local analysis loop is contained in `PDAF_X_update` and only a local analysis routine is called. The general structure is: |
| | 246 | |
| | 247 | {{{ |
| | 248 | IF (fixed ensemble, i.e. subtype==2 or subtype==3) THEN |
| | 249 | Add central state for ensemble perturbations |
| | 250 | ENDIF |
| | 251 | |
| | 252 | CALL U_prepoststep # Perform pre/poststep before analysis update |
| | 253 | |
| | 254 | CALL U_init_n_domains # Determine number of local analysis domains (n_domains_p) |
| | 255 | |
| | 256 | # Perform global operations on observations |
| | 257 | CALL U_init_dim_obs # Determine number of observations (PDAF-OMI routine init_dim_obs_pdafomi) |
| | 258 | DO i = 1, dim_ens |
| | 259 | CALL U_obs_op # Apply observation operator to all ensemble state (PDAF-OMI routine obs_op_pdafomi) |
| | 260 | ENDDO |
| | 261 | Compute mean forecast state (state_p) |
| | 262 | Compute mean observed forecast state (HXbar_f) |
| | 263 | |
| | 264 | # --- Perform local analysis loop |
| | 265 | DO i = 1, n_domains_p |
| | 266 | CALL U_init_dim_l # Set size of local state vector |
| | 267 | CALL U_init_dim_obs_l # Set number of observations within radius (PDAF-OMI routine init_dim_obs_l_pdafomi) |
| | 268 | DO i = 1, dim_ens |
| | 269 | CALL U_g2l_state # Get local state vector for all ensemble states |
| | 270 | ENDDO |
| | 271 | |
| | 272 | CALL PDAF_X_analysis # Compute local analysis update of ensemble |
| | 273 | |
| | 274 | DO i = 1, dim_ens |
| | 275 | CALL U_l2g_state # Update global state vector for all ensemble states |
| | 276 | ENDDO |
| | 277 | CALL U_l2g_state # Update global state vector for ensemble mean state |
| | 278 | |
| | 279 | CALL PDAF_smoother_local # Only for filters for which a smoother is implemented |
| | 280 | ENDDO |
| | 281 | # --- End of local analysis loop |
| | 282 | |
| | 283 | CALL U_prepoststep # Perform pre/poststep after analysis update |
| | 284 | }}} |
| | 285 | You will find this structure e.g. in `PDAF_LESTKF_update.F90`. This structure is not used for the LEnKF because this filter doe snot use a local analysis loop. The actual implementation, e.g. in `PDAF_LESTKF_update.F90` contains additional functionality e.g. calls for timers and normal screen output or debug outputs. Also there can be different calls `PDAF_X_analysis` depending on the subtype of a filter. |
| | 286 | |
| | 287 | This general structure should be widely usable for DA methods that use domain localization. Accordingly, when implementing a new local ensemble method one could copy an existing file and adapt it for the new method. The main functionality of the new DA method would then be implemented in `PDAF_X_analysis`. |