Changes between Version 22 and Version 23 of ImplementAnalysisseik
- Timestamp:
- May 17, 2011, 9:55:08 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ImplementAnalysisseik
v22 v23 26 26 For completeness we discuss here all user-supplied routines that are specified in the interface to PDAF_put_state_seik. Thus, some of the user-supplied that are explained on the page explaining the modification of the model code for the ensemble integration are repeated here. 27 27 28 The SEIK filter and the ETKF (Ensemble Transform Kalman Filter) are very similar. For this reason, the interface to the user-supplied routines is almost identical. Depending on the implementation it can be possible to use identical routines for the SEIK filter and the ETKF. Differences are marked in the text below. 29 28 30 == `PDAF_put_state_seik` == 29 31 30 The general espects of the filter specific routines `PDAF_put_state_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model co re for the ensemble integration]. Here, we list once more the full interface. Subsequently, the full set of user-supplied routines specified in the call to `PDAF_put_state_seik` is explained.32 The general espects of the filter specific routines `PDAF_put_state_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration]. Here, we list once more the full interface. Subsequently, the full set of user-supplied routines specified in the call to `PDAF_put_state_seik` is explained. 31 33 32 34 The interface when using the SEIK filter is the following: … … 50 52 Here all user-supplied routines are described that are required in the call to `PDAF_put_state_seik`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration]. 51 53 52 To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routines name without this prefix. In the example implementation in `testsuite/src/dummymodel_1D` the routines exist without the prefix, but with the extension `_dummy_D.F90`. In the section titles below we provide the name of the template file in parentheses. In the subroutine interfaces some variables appear with the suffix `_p`. This suffix indicates that the variable is particular to a model sub-domain, if a domain decomposed model is used. Thus, the value(s) in the variable will be different for different model sub-domains. 54 To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routine's name without this prefix. In the example implementation in `testsuite/src/dummymodel_1D`, the routines exist without the prefix, but with the extension `_dummy_D.F90`. In the section titles below we provide the name of the template file in parentheses. 55 56 In the subroutine interfaces some variables appear with the suffix `_p`. This suffix indicates that the variable is particular to a model sub-domain, if a domain decomposed model is used. Thus, the value(s) in the variable will be different for different model sub-domains. 53 57 54 58 55 59 === `U_collect_state` (collect_state.F90) === 56 60 57 This routine is independent fromthe filter algorithm used.58 See [ModifyModelforEnsembleIntegration#U_collect_statecollect_state.F90 here] for the description of this routine.61 This routine is independent of the filter algorithm used. 62 See the page [ModifyModelforEnsembleIntegration#U_collect_statecollect_state.F90 modifying the model code for the ensemble integration] for the description of this routine. 59 63 60 64 … … 74 78 75 79 Some hints: 76 * It can be useful to not only determine the size of the observation vector at this point. One can also already gather information about the locations of the observations, which will be used later, e.g. to implement the observation operator. An array for the locations can be defined in a module like `mod_assimilation` .80 * It can be useful to not only determine the size of the observation vector at this point. One can also already gather information about the locations of the observations, which will be used later, e.g. to implement the observation operator. An array for the locations can be defined in a module like `mod_assimilation` of the example implementation. 77 81 78 82 … … 120 124 121 125 === `U_prepoststep` (prepoststep_seik.F90) === 122 123 See [ModifyModelforEnsembleIntegration#U_prepoststepprepoststep_seik.F90 here] for the description of this routine. 126 127 The routine has already been described on the [ModifyModelforEnsembleIntegration#U_prepoststepprepoststep_seik.F90 page on modifying the model code for the ensemble integration]. For completeness, the description is repeated: 128 129 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. 130 131 The interface for this routine is 132 {{{ 133 SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, & 134 state_p, Uinv, ens_p, flag) 135 136 INTEGER, INTENT(in) :: step ! Current time step 137 ! (When the routine is called before the analysis -step is provided.) 138 INTEGER, INTENT(in) :: dim_p ! PE-local state dimension 139 INTEGER, INTENT(in) :: dim_ens ! Size of state ensemble 140 INTEGER, INTENT(in) :: dim_ens_p ! PE-local size of ensemble 141 INTEGER, INTENT(in) :: dim_obs_p ! PE-local dimension of observation vector 142 REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state 143 ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF. 144 ! It can be used freely in this routine. 145 REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U 146 REAL, INTENT(inout) :: ens_p(dim_p, dim_ens) ! PE-local state ensemble 147 INTEGER, INTENT(in) :: flag ! PDAF status flag 148 }}} 149 150 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`). 151 152 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. 153 154 Hint: 155 * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it. 156 * 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`. 157 * 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. 124 158 125 159 126 160 === `U_prodRinvA` (prodrinva.F90) === 127 161 128 This routine is used by all filter s whose algorithm usesthe inverse of the observation error covariance matrix (SEEK, SEIK, and ETKF).162 This routine is used by all filter algorithms that use the inverse of the observation error covariance matrix (SEEK, SEIK, and ETKF). 129 163 130 164 The interface for this routine is: … … 145 179 146 180 Hints: 147 * the routine does not require that the product is implemented as a real matrix-matrix product. Rather, the product can be implemented in its most efficient form. For example, if the observation error covariance matrix is diagonal, only the multiplication of the diagonal with matrix `A_p` has to be implemented.181 * The routine does not require that the product is implemented as a real matrix-matrix product. Rather, the product can be implemented in its most efficient form. For example, if the observation error covariance matrix is diagonal, only the multiplication of the diagonal with matrix `A_p` has to be implemented. 148 182 * The observation vector `obs_p` is provided through the interface for cases where the observation error variance is relative to the actual value of the observations. 149 183 * The interface has a difference for SEIK and ETKF: For ETKF the third argument is the ensemble size (`dim_ens`), while for SEIK it is the rank (`rank`) of the covariance matrix (usually ensemble size minus one). In addition, the second dimension of `A_p` and `C_p` has size `dim_ens` for ETKF, while it is `rank` 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) 150 184 151 185 === `U_init_obsvar` (init_obsvar.F90) === … … 177 211 For the SEIK filter, the user-supplied routines are essentially executed in the order they are listed in the interface to `PDAF_put_state_seik`. The order can be important as some routines can perform preparatory work for later routines. For example, `U_init_dim_obs` can prepare an index array that provides the information for executing the observation operator in `PDAF_obs_op`. 178 212 179 Before the analysis step is called the following is executed:213 Before the analysis step is called the following routine is executed: 180 214 1. [#U_collect_statecollect_state.F90 U_collect_state] 181 215 182 When the ensemble integration of the forecast is completed the analysis step is executed. During the analysis step the following routines are executed in the given order:216 The analysis step is executed when the ensemble integration of the forecast is completed. During the analysis step the following routines are executed in the given order: 183 217 1. [#U_prepoststepprepoststep_seik.F90 U_prepoststep] (call to handle the forecast, called with negative value of the time step) 184 218 1. [#U_init_dim_obsinit_dim_obs.F90 U_init_dim_obs] 185 1. [#U_obs_opobs_op.F90 U_obs_op] ( One call to operate on the ensemble mean state)219 1. [#U_obs_opobs_op.F90 U_obs_op] (A single call to operate on the ensemble mean state) 186 220 1. [#U_init_obsinit_obs.F90 U_init_obs] 187 221 1. [#U_obs_opobs_op.F90 U_obs_op] (`dim_ens` calls; one call for each ensemble member)