Changes between Version 24 and Version 25 of ImplementAnalysisenkf


Ignore:
Timestamp:
Jun 4, 2025, 10:57:41 AM (2 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisenkf

    v24 v25  
    4848The EnKF implemented in PDAF follows the original EnKF by Evensen (1994) including the correction for perturbed observations (Burgers et al. 1998). The EnKF implemented in PDAF is reviewed by Nerger et al (2005) and described in more detail by Nerger (2004). (See the [PublicationsandPresentations page on publications and presentations] for publications and presenations involving and about PDAF)
    4949
    50 With verison 1.12 a [wiki:ImplementAnalysislenkf localized variant of the EnKF] was added to PDAF. However, in our studies (Nerger et al. 2005, Nerger et al. 2007), the EnKF showed performance deficiencies compared to the SEIK filter. Due to this, we focused more on the SEIK filter and the ETKF and ESTKF after these comparison studies. For real applications, we generally recommend using ESTKF or ETKF, or their local variants LESTKF or LETKF.
     50With version 1.12 a [wiki:ImplementAnalysislenkf localized variant of the EnKF] was added to PDAF. However, in our studies (Nerger et al. 2005, Nerger et al. 2007), the EnKF showed performance deficiencies compared to the SEIK filter. Due to this, we focused more on the SEIK filter and the ETKF and ESTKF after these comparison studies. For real applications, we generally recommend using ESTKF or ETKF, or their local variants LESTKF or LETKF.
    5151
    5252== `PDAF_assimilate_enkf` ==
    5353
    54 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_enkf` is explained.
    55 
    56 The interface when using the EnKF is the following:
    57 {{{
    58   SUBROUTINE PDAF_assimilate_enkf(U_collect_state, U_distribute_state, U_init_dim_obs, &
    59                                  U_obs_op, U_init_obs, U_prepoststep, U_add_obs_err, &
    60                                  U_init_obscovar, 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_enkf(U_collect_state, U_distribute_state, &
     61                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     62                                 U_add_obs_err, U_init_obscovar, U_next_observation, status)
    6163}}}
    6264with the following arguments:
     
    7274 * `status`: The integer status flag. It is zero, if `PDAF_assimilate_enkf` is exited without errors.
    7375
     76
     77== `PDAF_assim_offline_enkf ` ==
     78
     79This routine is used to perform the analysis step for the offline mode of PDAF.
     80The 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.
     81
     82The 'assim_offline' routines were introduced with PDAF V3.0 to simplify the [wiki:OfflineImplementationGuide_PDAF3 implementation of the offline mode].
     83
     84The interface is:
     85{{{
     86  SUBROUTINE PDAF_assim_offline_enkf( &
     87                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     88                                 U_add_obs_err, U_init_obscovar, status)
     89}}}
     90
    7491== `PDAF_put_state_enkf` ==
    7592
    76 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAF_put_state_enkf` has to be used instead of `PDAF_assimilate_enkf`. 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_enkf` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
    77 
    78 The interface when using the EnKF is the following:
    79 {{{
    80   SUBROUTINE PDAF_put_state_enkf(U_collect_state, U_init_dim_obs, U_obs_op, &
    81                                  U_init_obs, U_prepoststep, U_add_obs_err, U_init_obscovar, status)
     93his 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.
     94The 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.
     95
     96The interface is:
     97{{{
     98  SUBROUTINE PDAF_put_state_enkf(U_collect_state, &
     99                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     100                                 U_add_obs_err, U_init_obscovar, status)
    82101}}}
    83102
     
    85104== User-supplied routines ==
    86105
    87 Here all user-supplied routines are described that are required in the call to `PDAF_assimilate_enkf`. For some of the generic routines, we link to the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 modifying the model code for the ensemble integration].
     106Here all user-supplied routines are described that are required in the call to the 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].
    88107
    89108To 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.
     
    95114
    96115This routine is independent of the filter algorithm used.
    97 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_collect_statecollect_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     116See 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.
    98117
    99118
     
    101120
    102121This routine is independent of the filter algorithm used.
    103 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine.
    104 
     122See 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.
    105123
    106124=== `U_init_dim_obs` (init_dim_obs_pdaf.F90) ===
     
    166184=== `U_prepoststep` (prepoststep_ens_pdaf.F90) ===
    167185
    168 The general aspects of this routines have already been described on the [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_prepoststepprepoststep_ens_pdaf.F90 page on modifying the model code for the ensemble integration] for the SEIK filter. For completeness, the description is repeated specifically for the EnKF:
    169 
    170 The interface of the routine is identical for all filters, but sizes can vary. Also, the particular operations that are performed in the routine can be specific for each filter algorithm.
    171 
    172 The interface for this routine is for the EnKF
    173 {{{
    174 SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, &
    175                        state_p, Uinv, ens_p, flag)
    176 
    177   INTEGER, INTENT(in) :: step        ! Current time step
    178                          ! (When the routine is called before the analysis -step is provided.)
    179   INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
    180   INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
    181   INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
    182   INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
    183   REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
    184                                      ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF.
    185                                      ! It can be used freely in this routine.
    186   REAL, INTENT(inout) :: Uinv(1, 1)  ! Not used not EnKF
    187   REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)      ! PE-local state ensemble
    188   INTEGER, INTENT(in) :: flag        ! PDAF status flag
    189 }}}
    190 
    191 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`).
    192 
    193 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.
    194 
    195 Hint:
    196  * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
    197  * 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`.
    198  * The array `Uinv` is not used in the EnKF. Internally to PDAF, it is allocated to be of size (1,1).
    199  * Apart from the size of the array `Uinv`, the interface is identical for all ensemble filters (SEIK/ETKF/EnKF/LSEIK/LETKF). In general it should be possible to use an identical pre/poststep routine for all these filters.
    200  * 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])
     186The routine has already been described for modifying the model for the ensemble integration and for inserting the analysis step.
     187
     188See 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.
    201189
    202190
     
    252240
    253241This routine is independent of the filter algorithm used.
    254 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
     242See 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.
     243
    255244
    256245