95 | | * `locweight`: Type of localizing weight |
96 | | It is useful to define variables like these at this central position. Of course, their definition has to be adapted to the particular model used. The example codes describe the options for `locweight`. |
97 | | |
98 | | The setting of `locweight` influences the weight function for the localization. If PDAF-OMI is used, the choices are standardized as follows |
| 94 | * `locweight`: Type of localizing weight (see further below) |
| 95 | The latter three variables are localization parameters that are used later in the subroutines called by `init_dim_obs_l_pdafomi`. |
| 96 | |
| 97 | We recommend to define such configuration variables at this central position, so that all configuration is done at one place. Of course, their definition should be adapted to the particular model used. |
| 98 | |
| 99 | The setting of `locweight` influences the weight function for the localization. With the PDAF3 interface (and generally with PDAF-OMI), the choices are standardized as follows |
109 | | == User-supplied routine `U_init_ens` (init_ens_pdaf.F90) == |
110 | | |
111 | | The user-supplied routine the we named `U_init_ens` in the interface description above, is called by PDAF through the defined interface described below (Here, `U_` marks the variable to describe a user-supplied routine while in the actual code we use the name `init_ens_pdaf`). The routine is called by all MPI processes that compute the filter analysis step (i.e. those for which 'filterpe' is set to true. In the standard configuration of `init_parallel_pdaf` these are all processes of the first model task, i.e. task_id=1.) `init_ens_pdaf` is only called by `PDAF_init` if no error occurred before; thus the status flag is zero. |
112 | | |
113 | | The interface is the following: |
114 | | {{{ |
115 | | SUBROUTINE U_init_ens(filtertype, dim_p, dim_ens, & |
116 | | state_p, Uinv, ens_p, flag) |
| 110 | Apart from the generic variables for localization, we also specify variables that are specific for each observation type, for example in the tutorial code, we specify |
| 111 | * `assim_A`: Flag whether to assimialtion observations of type A |
| 112 | * `rms_obs_A`: Assumed observation error standard deviation of observation type A |
| 113 | |
| 114 | |
| 115 | == User-supplied routine `init_ens_pdaf` == |
| 116 | |
| 117 | The user-supplied routine that we named `init_ens_pdaf` here, is the call-back routine that is called by PDAF through the defined interface described below. The routine is called by all MPI processes that compute the filter analysis step (i.e. those for which 'filterpe' is set to true. In the standard configuration of `init_parallel_pdaf` these are all processes of the first model task, i.e. task_id=1.) `init_ens_pdaf` is only called by `PDAF_init` if no error occurred before; thus the status flag is zero. |
| 118 | |
| 119 | The interface details can be looked up in the template and tutorial codes. It is the following: |
| 120 | {{{ |
| 121 | SUBROUTINE init_ens_pdaf(filtertype, dim_p, dim_ens, & |
| 122 | state_p, Ainv, ens_p, flag) |
121 | | * `dim_ens`, `integer, intent(in)`:[[BR]]The size of the ensemble (or the rank of the state covariance matrix for SEEK) |
122 | | * `state_p`, `real, dimension(dim_p), intent(inout)`:[[BR]]Array for the local model state of the calling process (Only relevant for mode-based filters) |
123 | | * `Uinv`, `real, dimension(dim_ens-1, dim_ens-1), intent(inout)`:[[BR]]A real array for the inverse of matrix '''U''' from the decomposition of the state error covariance matrix '''P''' = '''VUV^T^''' (Only relevant for the SEEK filter.) |
124 | | * `ens_p`, `real, dimension(dim_p, dim_ens), intent(inout)`:[[BR]]The ensemble array. It has to hold upon exit the ensemble of model states. |
| 127 | * `dim_ens`, `integer, intent(in)`:[[BR]]The size of the ensemble |
| 128 | * `state_p`, `real, dimension(dim_p), intent(inout)`:[[BR]]Array for the local model state of the calling process (can be used freely for ensemble-based methods) |
| 129 | * `Ainv`, `real, dimension(dim_ens-1, dim_ens-1), intent(inout)`:[[BR]]A possible weight matrix (Not relevant for ensemble-based methods) |
| 130 | * `ens_p`, `real, dimension(dim_p, dim_ens), intent(inout)`:[[BR]] The ensemble array, which has to be filled with the ensemble of model states. |
136 | | For the ensemble-based filters and the ensembel/hybrid 3D-Var methods only the array `ens_p` needs to be initialized by the ensemble of model states. If a parallel model with domain decomposition is used, the full ensemble for the local sub-domain has to be initialized. |
137 | | |
138 | | The arrays `state_p` and `Uinv` are allocated to their correct sizes because they are used during the assimilation cycles. They are not yet initialized and it is allowed to use these arrays in the initialization. An exception from this is EnKF for which `Uinv` is allocated only with size (1,1), because `Uinv` is not used for EnKF. |
139 | | |
140 | | |
141 | | === Initialization for mode-based filters === |
142 | | |
143 | | The only mode-based filter supplied with PDAF is currenly the SEEK filter. For this filter, the initialization bases on the decomposition of the state error covariance matrix in the form '''P''' = '''VUV^T^'''. According to this decomposition, the array `ens_p` has to be initialized to hold the modes from matrix '''V''' and `Uinv` holds the inverse of matrix '''U'''. In addition `state_p` has to be initialized with the initial state estimate. If a parallel model with domain decomposition is used, the part of all modes for the local sub-domain of the MPI process and the corresponding part of the state vector has to be initialized. '''Uinv''' will be identical for all MPI processes. |
| 144 | For the ensemble-based filters and the ensemble/hybrid 3D-Var methods, only the array `ens_p` needs to be initialized by the ensemble of model states. If a parallel model with domain decomposition is used, the full ensemble for the local sub-domain has to be initialized. |
| 145 | |
| 146 | The arrays `state_p` and `Ainv` are allocated to their correct sizes because they are used during the assimilation cycles. They are not yet initialized and it is allowed to use these arrays in the initialization. An exception from this is EnKF for which `Ainv` is allocated only with size (1,1), because `Ainv` is not used for EnKF. |
| 147 | |
| 148 | |
| 149 | == Setting additional options == |
| 150 | |
| 151 | In PDAF V3.0 we added the possibility to set options for PDAF after the call to `PDAF_init`. For these there are the subroutines |
| 152 | {{{ |
| 153 | PDAF_set_iparam(id, value, status_pdaf) |
| 154 | }}} |
| 155 | to set interger parameters and |
| 156 | {{{ |
| 157 | PDAF_set_rparam(id, value, status_pdaf) |
| 158 | }}} |
| 159 | to set REAL (floating point) parameters. The arguments are |
| 160 | * `id`:[[BR]] The index value of a parameter |
| 161 | * `value`:[[BR]] The value of the parameter with index `id` |
| 162 | * `status_pdaf`:[[BR]] Status flag for PDAF. Both routines increment in the input value. The increment is 0 for no error (this allows to check `flag` once after all calls to `PDAF_init`, `PDAF_set_iparam`, and `PDAF_set_rparam`.) |
| 163 | |
| 164 | The tutorial code uses these routines for a few settings while the template code include an extended set of calls specific for different DA methods. |
| 165 | |
| 166 | An overview of available integer and real-valued options for each DA method can be found on the page [wiki:AvailableOptionsforInitPDAF Available options for the different DA methods]. The available options for a specific DA method can also be displayed by running the assimilation program for the selected DA method setting `subtype = -1`. (In the tutorial and template codes one can set `-subtype -1` on the command line). |
| 167 | |
147 | | The PDAF initialization can be tested by compiling the program and executing it. The Makefile of the model has to be extended to include the additional files. The core part of PDAF can be compiled separately as a library and can then simply be linked to the model code. This is the strategy followed in the PDAF-package. |
148 | | |
149 | | '''Remark:''' For the compilation with a real MPI library, one has to ensure that MPI-module (`USE MPI`) of the MPI-library is USED for both the model and PDAF. (Thus in the include file for make in `make.arch`, one might have set `MPI_INC` to the directory holding the module.) |
150 | | |
151 | | At this stage it will not be meaningful to perform an actual model time stepping. However, one can test whether the initialization in PDAF_init is successful and whether the ensemble array is correctly initialized. For this one can also [wiki:PDAF_debugging activate the PDAF debugging output]. |
152 | | |
153 | | Standard output from PDAF_init should look like the following: |
154 | | |
155 | | {{{ |
| 171 | The PDAF initialization can be tested by compiling the assimilation program (one can out-comment the call to `PDAF3_assim_offline` if one likes to focus on the initialization) and executing it. |
| 172 | |
| 173 | Standard output from PDAF_init looks like the following: |
| 174 | {{{ |
| 175 | PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 176 | PDAF +++ PDAF +++ |
| 177 | PDAF +++ Parallel Data Assimilation Framework +++ |
| 178 | PDAF +++ +++ |
| 179 | PDAF +++ Version 3.0beta +++ |
| 180 | PDAF +++ +++ |
| 181 | PDAF +++ Please cite +++ |
| 182 | PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ |
| 183 | PDAF +++ 2013, 55, 110-118, doi:10.1016/j.cageo.2012.03.026 +++ |
| 184 | PDAF +++ when publishing work resulting from using PDAF +++ |
| 185 | PDAF +++ +++ |
| 186 | PDAF +++ PDAF itself can also be cited as +++ |
| 187 | PDAF +++ L. Nerger. Parallel Data Assimilation Framework +++ |
| 188 | PDAF +++ (PDAF). Zenodo. 2024. doi:10.5281/zenodo.7861812 +++ |
| 189 | PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 190 | |
| 191 | |
| 192 | PDAF: Initialize filter |
| 193 | |
160 | | PDAF +++ Version 2.1 +++ |
161 | | PDAF +++ +++ |
162 | | PDAF +++ Please cite +++ |
163 | | PDAF +++ L. Nerger and W. Hiller, Computers and +++ |
164 | | PDAF +++ Geosciences, 2013, 55, 110-118, +++ |
165 | | PDAF +++ doi:10.1016/j.cageo.2012.03.026 +++ |
166 | | PDAF +++ when publishing work resulting from using PDAF +++ |
| 197 | PDAF +++ Nerger et al., Mon. Wea. Rev. 140 (2012) 2335 +++ |
| 198 | PDAF +++ doi:10.1175/MWR-D-11-00102.1 +++ |
168 | | |
169 | | |
170 | | PDAF: Initialize filter |
171 | | |
172 | | PDAF +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
173 | | PDAF +++ Local Error Subspace Transform Kalman Filter +++ |
174 | | PDAF +++ (LESTKF) +++ |
175 | | PDAF +++ +++ |
176 | | PDAF +++ Domain-localized implementation of the ESTKF by +++ |
177 | | PDAF +++ Nerger et al., Mon. Wea. Rev. 140 (2012) 2335 +++ |
178 | | PDAF +++ doi:10.1175/MWR-D-11-00102.1 +++ |
179 | | PDAF +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
180 | | |
181 | | PDAF LESTKF configuration |
182 | | PDAF filter sub-type = 0 |
183 | | PDAF --> Standard LESTKF |
184 | | PDAF --> Transform ensemble with deterministic Omega |
185 | | PDAF --> Use fixed forgetting factor: 1.00 |
186 | | PDAF --> ensemble size: 50 |