62 | 65 | U_init_dim_obs_pdafomi, U_obs_op_pdafomi, & |
63 | 66 | U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, & |
64 | 67 | U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, & |
65 | 68 | U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, & |
127 | 131 | U_init_dim_obs_pdafomi, U_obs_op_pdafomi, & |
128 | 132 | U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, & |
129 | 133 | U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, & |
130 | 134 | U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, & |
317 | | * 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. |
318 | | * 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' |
319 | | * Further, we recommend to initialize an array containing the indices of the elements of the local state vector in the global (or domain-decomposed) state vector (`id_lstate_in_pstate` in the template files). This array is also shared through 'mod_assimilation'. |
| 328 | * For sharing through the module `mod_assimilation`, we further initialize an array `coords_l` containing the coordinates that describe the local domain. |
| 329 | * These coordinates have to describe one location in space that is used in the OMI observation modules to compute the distance from observations. |
| 330 | * The coordinates in `coords_l` have the same units as those used for the observations |
| 331 | * 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. |
| 332 | * Any form of local domain is possible as long as it can be describe as a single location. |
| 333 | * If the local domain is a single grid point, `dim_l` will be the number of model variables at this grid point. |
| 334 | * 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). |
| 335 | * 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. |
| 336 | * In this case only the horizontal coordinates are used in `coords_l`. |
| 337 | |
| 338 | The index array `id_lstate_in_pstate` is an integer array in form of a one-dimensional 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: |
| 339 | |
| 340 | {{{ |
| 341 | SUBROUTINE PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) |
| 342 | |
| 343 | INTEGER, INTENT(in) :: dim_l ! Dimension of local state vector |
| 344 | INTEGER, INTENT(in) :: id_lstate_in_pstate(dim_l) ! Index array for mapping |
| 345 | }}} |
| 346 | |
| 347 | Hint for `id_lstate_in_pstate`: |
| 348 | * 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. |
| 349 | * See the [wiki:PDAFlocal_overview PDAFlocal overview page] for more information on the functionality of PDAFlocal. |
327 | | |
328 | | |
329 | | === `U_g2l_state` (g2l_state_pdaf.F90) === |
330 | | |
331 | | The interface for this routine is: |
332 | | {{{ |
333 | | SUBROUTINE g2l_state(step, domain_p, dim_p, state_p, dim_l, state_l) |
334 | | |
335 | | INTEGER, INTENT(in) :: step ! Current time step |
336 | | INTEGER, INTENT(in) :: domain_p ! Current local analysis domain |
337 | | INTEGER, INTENT(in) :: dim_p ! State dimension for model sub-domain |
338 | | INTEGER, INTENT(in) :: dim_l ! Local state dimension |
339 | | REAL, INTENT(in) :: state_p(dim_p) ! State vector for model sub-domain |
340 | | REAL, INTENT(out) :: state_l(dim_l) ! State vector on local analysis domain |
341 | | }}} |
342 | | |
343 | | 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 sub-domain. |
344 | | |
345 | | Hints: |
346 | | * 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`. |
347 | | * 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. |
348 | | |
349 | | |
350 | | === `U_l2g_state` (l2g_state_pdaf.F90) === |
351 | | |
352 | | The interface for this routine is: |
353 | | {{{ |
354 | | SUBROUTINE l2g_state(step, domain_p, dim_l, state_l, dim_p, state_p) |
355 | | |
356 | | INTEGER, INTENT(in) :: step ! Current time step |
357 | | INTEGER, INTENT(in) :: domain_p ! Current local analysis domain |
358 | | INTEGER, INTENT(in) :: dim_p ! State dimension for model sub-domain |
359 | | INTEGER, INTENT(in) :: dim_l ! Local state dimension |
360 | | REAL, INTENT(in) :: state_p(dim_p) ! State vector for model sub-domain |
361 | | REAL, INTENT(out) :: state_l(dim_l) ! State vector on local analysis domain |
362 | | }}} |
363 | | |
364 | | 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. |
365 | | |
366 | | Hints: |
367 | | * 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`. |
368 | | * 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. |
369 | | |