Changes between Version 14 and Version 15 of ImplementAnalysis_3DEnVar
 Timestamp:
 Sep 19, 2024, 2:36:34 PM (2 weeks ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

ImplementAnalysis_3DEnVar
v14 v15 21 21 <li><a href="ImplementAnalysis_3DVar">Implementation for 3DVar</a></li> 22 22 <li>Implementation for 3D Ensemble Var</li> 23 <li><a href="ImplementAnalysis_3DEnVar_untilPDAF221">Implementation for 3D Ensemble Var without PDAFlocal</li> 23 24 <li><a href="ImplementAnalysis_Hyb3DVar">Implementation for Hybrid 3DVar</a></li> 24 25 </ol> … … 36 37 == Overview == 37 38 38 With Version 2.0 with introduced 3D variational assimilation methods to PDAF. There are genenerally three different variants: parameterized 3DVar, 3D Ensemble Var, and hybrid (parameterized + ensemble) 3DVar. 39 This page describes the recommended implementation of the analysis step of local filters with OMI using the PDAFlocal interface that was introduced with PDAF V2.3. The older approach calling PDAFomi_assimilate_local or PDAFomi_put_state_local is documented on the page on [wiki:ImplementAnalysis_3DEnVar_untilPDAF221 Implementing the Analysis Step for 3D Ensemble Var with OMI without PDAFlocal (until V2.2.1 of PDAF)]. 40 41 There are genenerally three different variants: parameterized 3DVar, 3D Ensemble Var, and hybrid (parameterized + ensemble) 3DVar. 39 42 40 43 This page describes the implementation of the analysis step for the 3D Ensemble Var using PDAFOMI. … … 53 56 There are two variants that either compute the transformataion of the ensemble transformation using the local LESTKF method, or the global ESTKF. 54 57 55 === `PDAF omi_assimilate_en3dvar_lestkf` ===58 === `PDAFlocalomi_assimilate_en3dvar_lestkf` === 56 59 57 60 This routine is called for the case of transforming the ensemble perturbations using the local LESTKF. … … 59 62 The interface is: 60 63 {{{ 61 SUBROUTINE PDAF omi_assimilate_en3dvar_lestkf(U_collect_state, U_distribute_state, &64 SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf(U_collect_state, U_distribute_state, & 62 65 U_init_dim_obs_pdafomi, U_obs_op_pdafomi, & 63 66 U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, & 64 67 U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, & 65 U_ g2l_state, U_l2g_state, U_prepoststep, U_next_observation, outflag)68 U_prepoststep, U_next_observation, outflag) 66 69 }}} 67 70 with the following arguments: … … 77 80 * [#U_init_dim_linit_dim_l_pdaf.F90 U_init_dim_l]: The name of the routine that provides the state dimension for a local analysis domain 78 81 * [#U_init_dim_obs_l_pdafomicallback_obs_pdafomi.F90 U_init_dim_obs_l_pdafomi]: The name of the routine that initializes the size of the observation vector for a local analysis domain 79 * [#U_g2l_stateg2l_state_pdaf.F90 U_g2l_state]: The name of the routine that initializes a local state vector from the global state vector80 * [#U_l2g_statel2g_state_pdaf.F90 U_l2g_state]: The name of the routine that initializes the corresponding part of the global state vector from the provided local state vector81 82 * [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep]: The name of the pre/poststep routine as in `PDAF_get_state` 82 83 * [#U_next_observationnext_observation.F90 U_next_observation]: The name of a user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`. The same routine is also used in `PDAF_get_state`. 83 84 * `status`: The integer status flag. It is zero, if the routine is exited without errors. 84 85 85 86 Note: 87 * If your code shows a call to `PDAFomi_assimilate_en3dvar_lestkf`, it uses the implementation variant without PDAFlocal. This is documented on the page on [wiki:ImplementAnalysis_3DEnVar_untilPDAF221 Implementing the Analysis Step for 3D Ensemble Var with OMI without PDAFlocal (until V2.2.1 of PDAF)]. 86 88 87 89 === `PDAFomi_assimilate_en3dvar_estkf` === … … 112 114 113 115 114 === `PDAF omi_put_state_en3dvar_lestkf` ===116 === `PDAFlocalomi_put_state_en3dvar_lestkf` === 115 117 116 118 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAFomi_put_state_*` has to be used instead of `PDAFomi_assimilate_*`. The general aspects of the filter specific routines `PDAF_put_state_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration]. The interface of the routine is identical with that of `PDAF_assimilate_*` with the exception the specification of the usersupplied routines `U_distribute_state` and `U_next_observation` are missing. … … 122 124 U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, & 123 125 U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, & 124 U_g2l_state, U_l2g_state, U_prepoststep, outflag) 125 }}} 126 U_prepoststep, outflag) 127 }}} 128 129 Note: 130 * If your code shows a call to `PDAFomi_put_state_en3dvar_lestkf`, it uses the implementation variant without PDAFlocal. This is documented on the page on [wiki:ImplementAnalysis_3DEnVar_untilPDAF221 Implementing the Analysis Step for 3D Ensemble Var with OMI without PDAFlocal (until V2.2.1 of PDAF)]. 126 131 127 132 === `PDAFomi_put_state_en3dvar_estkf` === … … 252 257 253 258 259 260 254 261 === `U_init_dim_l` (init_dim_l_pdaf.F90) === 255 262 … … 264 271 265 272 The routine is called during the loop over the local analysis domains in the analysis step. 266 It has to provide in `dim_l` the dimension of the state vector for the local analysis domain with index `domain_p`. 273 For PDAF it has to provide in `dim_l` the dimension of the state vector for the local analysis domain with index `domain_p`. 274 275 In addition, for PDAFlocal the routine has to provide the index array containing the indices of the elements of the local state vector in the global (or domaindecomposed) state vector to PDAFlocal by calling `PDAFlocal_set_indices`. (in the template files, this array is called `id_lstate_in_pstate`) 267 276 268 277 Hints: 269 * For sharing through the module 'mod_assimilation', we further initialize an array 'coords_l' containing the coordinates that describe the local domain. These coordinates have to describe one location in space that is used in the OMI observation modules to compute the distance from observations. This requires that the coordinates in 'coords_l' have the same units as those used for the observations. 270 * Any form of local domain is possible as long as it can be describe as a single location. If observations are only horizontally distributed (a common situation with satellite data in the ocean), the local analysis domain can be a single vertical column of the model grid. In this case, the size of the state in the local analysis domain will be just the number of vertical grid points at this location and the horizontal coordinates are used in 'coords_l' 271 * Further, we recommend to initialize an array containing the indices of the elements of the local state vector in the global (or domaindecomposed) state vector (`id_lstate_in_pstate` in the template files). This array is also shared through 'mod_assimilation'. 278 * For sharing through the module `mod_assimilation`, we further initialize an array `coords_l` containing the coordinates that describe the local domain. 279 * These coordinates have to describe one location in space that is used in the OMI observation modules to compute the distance from observations. 280 * The coordinates in `coords_l` have the same units as those used for the observations 281 * For geographic distance computations, the unit of the coordinates needs to be radian, thus (0, 2*pi) or (pi,pi) for longitude and (pi/2, pi/2) for latitude. 282 * Any form of local domain is possible as long as it can be describe as a single location. 283 * If the local domain is a single grid point, `dim_l` will be the number of model variables at this grid point. 284 * The local analysis domain can also be a single vertical column of the model grid if observations are only horizontally distributed (a common situation with satellite data in the ocean). 285 * In this case, `dim_l` will be the number of vertical grid points at this location times the number of model fields that exist in the vertical, plus possible variables at e.g. the surface. 286 * In this case only the horizontal coordinates are used in `coords_l`. 287 288 The index array `id_lstate_in_pstate` is an integer array in form of a onedimensional vector. One initializes this vector by determining the indices of the elements of the local state vector in the global, or domain decomposed, state vector. After initializing `id_lstate_in_pstate`, one has to provided it to PDAFlocal by calling `PDAFlocal_set_indices'. The interface interface is: 289 290 {{{ 291 SUBROUTINE PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) 292 293 INTEGER, INTENT(in) :: dim_l ! Dimension of local state vector 294 INTEGER, INTENT(in) :: id_lstate_in_pstate(dim_l) ! Index array for mapping 295 }}} 296 297 Hint for `id_lstate_in_pstate`: 298 * The initialization of the index vector `id_lstate_to_pstate` is analogous to a loop that directly performs the initialization of a local state vector. However, here only the indices are stored. 299 * See the [wiki:PDAFlocal_overview PDAFlocal overview page] for more information on the functionality of PDAFlocal. 272 300 273 301 … … 277 305 278 306 See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information. 279 280 281 === `U_g2l_state` (g2l_state_pdaf.F90) ===282 283 The interface for this routine is:284 {{{285 SUBROUTINE g2l_state(step, domain_p, dim_p, state_p, dim_l, state_l)286 287 INTEGER, INTENT(in) :: step ! Current time step288 INTEGER, INTENT(in) :: domain_p ! Current local analysis domain289 INTEGER, INTENT(in) :: dim_p ! State dimension for model subdomain290 INTEGER, INTENT(in) :: dim_l ! Local state dimension291 REAL, INTENT(in) :: state_p(dim_p) ! State vector for model subdomain292 REAL, INTENT(out) :: state_l(dim_l) ! State vector on local analysis domain293 }}}294 295 The routine is called during the loop over the local analysis domains in the analysis step. It has to provide the local state vector `state_l` that corresponds to the local analysis domain with index `domain_p`. Provided to the routine is the state vector `state_p`. With a domain decomposed model, this is the state for the local model subdomain.296 297 Hints:298 * In the simple case that a local analysis domain is a single vertical column of the model grid, the operation in this routine would be to take out of `state_p` the data for the vertical column indexed by `domain_p`.299 * Usually, one can initialize the indices of the local state vector elements in the global state vector in `U_init_dim_l` and just use these here.300 301 302 === `U_l2g_state` (l2g_state_pdaf.F90) ===303 304 The interface for this routine is:305 {{{306 SUBROUTINE l2g_state(step, domain_p, dim_l, state_l, dim_p, state_p)307 308 INTEGER, INTENT(in) :: step ! Current time step309 INTEGER, INTENT(in) :: domain_p ! Current local analysis domain310 INTEGER, INTENT(in) :: dim_p ! State dimension for model subdomain311 INTEGER, INTENT(in) :: dim_l ! Local state dimension312 REAL, INTENT(in) :: state_p(dim_p) ! State vector for model subdomain313 REAL, INTENT(out) :: state_l(dim_l) ! State vector on local analysis domain314 }}}315 316 The routine is called during the loop over the local analysis domains in the analysis step. It has to initialize the part of the global state vector `state_p` that corresponds to the local analysis domain with index `domain_p`. Provided to the routine is the state vector `state_l` for the local analysis domain.317 318 Hints:319 * In the simple case that a local analysis domain is a single vertical column of the model grid, the operation in this routine would be to write into `state_p` the data for the vertical column indexed by `domain_p`.320 * Usually, one can initialize the indices of the local state vector elements in the global state vector in `U_init_dim_l` and just use these here.321 322 307 323 308