Changes between Version 53 and Version 54 of ImplementAnalysisseik


Ignore:
Timestamp:
Jun 4, 2025, 10:37:53 AM (3 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisseik

    v53 v54  
    4242== Overview ==
    4343
     44The SEIK filter (Pham, 2001) is an efficient ensemble-based error-subspace filter. We generally recommend to avoid using it, since the ensemble representation can be suboptimal as was described by Nerger et al., 2012. We recommend to use instead the [wiki:ImplementAnalysisestkf ESTKF (Error subspace transform Kalman filter)] or [wiki:ImplementAnalysisetkf ESTKF (Ensemble transform Kalman filter)].
     45
    4446For the analysis step of the SEIK filter different operations related to the observations are needed. These operations are requested by PDAF by calling user-supplied routines. Intentionally, the operations are split into separate routines in order to keep the operations rather elementary. This procedure should simplify the implementation. The names of the required routines are specified in the call to the routine `PDAF_assimilate_seik` (or `PDAF_put_state_seik`) that was discussed before. With regard to the parallelization, all these routines are executed by the filter processes (`filterpe=.true.`) only.
    4547
     
    5052== `PDAF_assimilate_seik` ==
    5153
    52 The general aspects of the filter specific routines `PDAF_assimilate_*` have been described on the page [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration]. The routine is used in the fully-parallel implementation variant of the data assimilation system. When the 'flexible' implementation variant is used, the routines `PDAF_put_state_*' is used as described further below. Here, we list once more the full interface of the routine. Subsequently, the full set of user-supplied routines specified in the call to `PDAF_assimilate_seik` is explained.
    53 
    54 The interface when using the SEIK filter is the following:
    55 {{{
    56   SUBROUTINE PDAF_assimilate_seik(U_collect_state, U_distribute_state, U_init_dim_obs, &
    57                                  U_obs_op, U_init_obs, U_prepoststep, U_prodRinvA, &
    58                                  U_init_obsvar, U_next_observation, status)
     54This routine is used both in the ''fully-parallel'' and the ''flexible'' implementation variants of the data assimilation system. (See the page [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration] for these variants)
     55
     56Here, we list the full interface of the routine. Subsequently, the user-supplied routines specified in the call are explained.
     57
     58The interface is:
     59{{{
     60  SUBROUTINE PDAF_assimilate_seik(U_collect_state, U_distribute_state, &
     61                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     62                                 U_prodRinvA, U_init_obsvar, U_next_observation, status)
    5963}}}
    6064with the following arguments:
     
    7074 * `status`: The integer status flag. It is zero, if `PDAF_assimilate_seik` is exited without errors.
    7175
     76
     77
     78== `PDAF_assim_offline_seik ` ==
     79
     80This routine is used to perform the analysis step for the offline mode of PDAF.
     81The interface of the routine is identical with that of the 'assimilate'-routine, except that the user-supplied routines `U_distribute_state`, `U_collect_state` and `U_next_observation` are missing.
     82
     83The 'assim_offline' routines were introduced with PDAF V3.0 to simplify the [wiki:OfflineImplementationGuide_PDAF3 implementation of the offline mode].
     84
     85The interface is:
     86{{{
     87  SUBROUTINE PDAF_assim_offline_seik(&
     88                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     89                                 U_prodRinvA, U_init_obsvar, status)
     90}}}
     91
     92
    7293== `PDAF_put_state_seik` ==
    7394
    74 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAF_put_state_seik` has to be used instead of `PDAF_assimilate_seik`. The general aspects of the filter specific routines `PDAF_put_state_*` have been described on the page [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration]. The interface of the routine is identical with that of `PDAF_assimilate_seik` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
    75 
    76 The interface when using the SEIK filter is the following:
    77 {{{
    78   SUBROUTINE PDAF_put_state_seik(U_collect_state, U_init_dim_obs, U_obs_op, &
    79                                  U_init_obs, U_prepoststep, U_prodRinvA, U_init_obsvar, status)
     95This routine exists for backward-compatibility. In implementations that were done for PDAF V2.3.1 and before, a 'put_state' routine was used for the [wiki:OnlineFlexible_PDAF3 'flexible' parallelization variant] and for the [wiki:OfflineImplementationGuide_PDAF3 offline mode].  This routine allows to continue using the previous implementation structure.
     96The interface of the routine is identical with that of the 'assimilate'-routine, except that the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
     97
     98The interface is:
     99{{{
     100  SUBROUTINE PDAF_put_state_seik(U_collect_state, &
     101                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     102                                 U_prodRinvA, U_init_obsvar, status)
    80103}}}
    81104
     
    83106== User-supplied routines ==
    84107
    85 Here all user-supplied routines are described that are required in the call to `PDAF_assimilate_seik`. For some of the generic routines, we link to the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 modifying the model code for the ensemble integration].
     108Here all user-supplied routines are described that are required in the call tothe analysis routine. For some of the generic routines, we link to the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 modifying the model code for the ensemble integration].
    86109
    87110To indicate user-supplied routines we use the prefix `U_`. In the tutorials in `tutorial/` and in the template directory `templates/` these routines exist without the prefix, but with the extension `_pdaf`. The files are named correspondingly. In the section titles below we provide the name of the template file in parentheses.
     
    93116
    94117This routine is independent of the filter algorithm used.
    95 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_collect_statecollect_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     118See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#collect_state_pdafcollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
    96119
    97120
     
    99122
    100123This routine is independent of the filter algorithm used.
    101 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     124See 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.
    102125
    103126
     
    164187=== `U_prepoststep` (prepoststep_ens_pdaf.F90) ===
    165188
    166 The routine has already been described on the [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_prepoststepprepoststep_ens_pdaf.F90 page on modifying the model code for the ensemble integration]. For completeness, the description is repeated:
    167 
    168 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. Here, we exemplify the interface on the example of the SEIK filter.
    169 
    170 The interface for this routine is
    171 {{{
    172 SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, &
    173                        state_p, Uinv, ens_p, flag)
    174 
    175   INTEGER, INTENT(in) :: step        ! Current time step
    176                          ! (When the routine is called before the analysis -step is provided.)
    177   INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
    178   INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
    179   INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
    180   INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
    181   REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
    182                                      ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF.
    183                                      ! It can be used freely in this routine.
    184   REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U
    185   REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)      ! PE-local state ensemble
    186   INTEGER, INTENT(in) :: flag        ! PDAF status flag
    187 }}}
    188 
    189 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`).
    190 
    191 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.
    192 
    193 Hint:
    194  * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
    195  * 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`.
    196  * The interface has a difference for ETKF and SEIK: 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 SEIK filter. (For most cases, this will be irrelevant, because most usually the ensemble array `ens_p` is used for computations, rather than `Uinv`. However, 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)
     189The routine has already been described for modifying the model for the ensemble integration and for inserting the analysis step.
     190
     191See 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.
     192
    197193
    198194
     
    249245
    250246This routine is independent of the filter algorithm used.
    251 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
     247See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#next_observation_pdafnext_observation_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     248
    252249
    253250