Changes between Version 32 and Version 33 of ImplementAnalysisetkf


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

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisetkf

    v32 v33  
    5050== `PDAF_assimilate_etkf` ==
    5151
    52 The general espects 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. Subsequently, the full set of user-supplied routines specified in the call to `PDAF_assimilate_etkf` is explained.
    53 
    54 The interface when using the ETKF method is the following:
    55 {{{
    56   SUBROUTINE PDAF_assimilate_etkf(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)
     52This 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)
     53
     54Here, we list the full interface of the routine. Subsequently, the user-supplied routines specified in the call are explained.
     55
     56
     57The interface is:
     58{{{
     59  SUBROUTINE PDAF_assimilate_etkf(U_collect_state, U_distribute_state, &
     60                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     61                                 U_prodRinvA, U_init_obsvar, U_next_observation, status)
    5962}}}
    6063with the following arguments:
     
    7174
    7275
     76== `PDAF_assim_offline_estkf ` ==
     77
     78This routine is used to perform the analysis step for the offline mode of PDAF.
     79The 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.
     80
     81The 'assim_offline' routines were introduced with PDAF V3.0 to simplify the [wiki:OfflineImplementationGuide_PDAF3 implementation of the offline mode].
     82
     83The interface is:
     84{{{
     85  SUBROUTINE PDAF_assim_offline_etkf(&
     86                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     87                                 U_prodRinvA, U_init_obsvar, status)
     88}}}
     89
    7390== `PDAF_put_state_etkf` ==
    7491
    75 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAF_put_state_etkf` has to be used instead of `PDAF_assimilate_etkf`. 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_etkf` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
     92This 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.
     93The 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.
    7694
    7795The interface when using the ETKF method is the following:
    7896{{{
    79   SUBROUTINE PDAF_put_state_etkf(U_collect_state, U_init_dim_obs, U_obs_op, &
    80                                  U_init_obs, U_prepoststep, U_prodRinvA, U_init_obsvar, status)
     97  SUBROUTINE PDAF_put_state_etkf(U_collect_state, &
     98                                 U_init_dim_obs, U_obs_op, U_init_obs, U_prepoststep, &
     99                                 U_prodRinvA, U_init_obsvar, status)
    81100}}}
    82101
     
    94113
    95114This routine is independent of the filter algorithm used.
    96 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_collect_statecollect_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     115See 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.
    97116
    98117
     
    100119
    101120This routine is independent of the filter algorithm used.
    102 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     121See 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.
    103122
    104123
     
    164183
    165184=== `U_prepoststep` (prepoststep_ens_pdaf.F90) ===
    166  
    167 The routine has 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 the ETKF, the interface is generally identical. For completeness, we repeat the description here.
    168 
    169 The interface for this routine is
    170 {{{
    171 SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, &
    172                        state_p, Uinv, ens_p, flag)
    173 
    174   INTEGER, INTENT(in) :: step        ! Current time step
    175                          ! (When the routine is called before the analysis -step is provided.)
    176   INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
    177   INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
    178   INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
    179   INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
    180   REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
    181                                      ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF.
    182                                      ! It can be used freely in this routine.
    183   REAL, INTENT(inout) :: Uinv(dim_ens, dim_ens) ! Inverse of matrix U
    184   REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)  ! PE-local state ensemble
    185   INTEGER, INTENT(in) :: flag        ! PDAF status flag
    186 }}}
    187 
    188 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`).
    189 
    190 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.
    191 
    192 Hint:
    193  * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
    194  * The vector (`state_p`) is allocated but not initialized with the ensemble mean. It can be used freely during the execution of `U_prepoststep`, for example to compute the ensemble mean state.
    195  * 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)
    196  * 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 [wiki:AuxiliaryRoutines auxiliary routines])
     185
     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.
     189
    197190
    198191
     
    250243
    251244This routine is independent of the filter algorithm used.
    252 See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
     245See 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.
    253246
    254247