Changes between Version 5 and Version 6 of ImplementAnalysis_Hyb3DVar


Ignore:
Timestamp:
Sep 19, 2024, 2:49:41 PM (2 weeks ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysis_Hyb3DVar

    v5 v6  
    2222<li><a href="ImplementAnalysis_3DEnVar">Implementation for 3D Ensemble Var</a></li>
    2323<li>Implementation for Hybrid 3D-Var</li>
     24<li><a href="ImplementAnalysis_Hyb3DVar">Implementation for Hybrid 3D-Var without PDAFlocal</a></li>
    2425</ol>
    2526<li><a href="PDAF_OMI_Overview">PDAF-OMI Overview</a></li>
     
    3637== Overview ==
    3738
    38 With Version 2.0 with introduced 3D variational assimilation methods to PDAF. There are genenerally three different variants: parameterized 3D-Var, 3D Ensemble Var, and hybrid (parameterized + ensemble) 3D-Var.
     39This 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
     41There are genenerally three different variants: parameterized 3D-Var, 3D Ensemble Var, and hybrid (parameterized + ensemble) 3D-Var.
    3942
    4043This page describes the implementation of the analysis step for the Hybrid 3D-Var using PDAF-OMI.
     
    5356There are two variants that either compute the transformataion of the ensemble transformation using the local LESTKF method, or the global ESTKF.
    5457
    55 === `PDAFomi_assimilate_hyb3dvar_lestkf` ===
     58=== `PDAFlocalomi_assimilate_hyb3dvar_lestkf` ===
    5659
    5760This routine is called for the case of transforming the ensemble perturbations using the local LESTKF.
     
    5962The interface is:
    6063{{{
    61 SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf(U_collect_state, U_distribute_state, &
     64SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf(U_collect_state, U_distribute_state, &
    6265                                 U_init_dim_obs_pdafomi, U_obs_op_pdafomi, &
    6366                                 U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, &
    6467                                 U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, &
    6568                                 U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, &
    66                                  U_g2l_state, U_l2g_state, U_prepoststep, U_next_observation, outflag)
     69                                 U_prepoststep, U_next_observation, outflag)
    6770}}}
    6871with the following arguments:
     
    115118 * `status`: The integer status flag. It is zero, if the routine is exited without errors.
    116119
    117 Note that the interface of `PDAFomi_assimilate_en3dvar_estkf` is identical to that of `PDAFomi_assimilate_3dvar` apart from using the routines `U_cvt_ens` and `U_cvt_adj_ens` in case of the ensemble variational method.
    118 
    119 
    120 === `PDAFomi_put_state_hyb3dvar_lestkf` ===
     120Notes:
     121 * The interface of `PDAFomi_assimilate_en3dvar_estkf` is identical to that of `PDAFomi_assimilate_3dvar` apart from using the routines `U_cvt_ens` and `U_cvt_adj_ens` in case of the ensemble variational method.
     122 * If your code shows a call to `PDAFomi_assimilate_hyb3dvar_lestkf`, it uses the implementation variant without PDAFlocal. This is documented on the page on [wiki:ImplementAnalysis_Hyb3DVar_untilPDAF221 Implementing the Analysis Step for hybrid 3D Var with OMI without PDAFlocal (until V2.2.1 of PDAF)].
     123
     124=== `PDAFlocalomi_put_state_hyb3dvar_lestkf` ===
    121125
    122126When 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 user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
     
    124128The interface when using one of the global filters is the following:
    125129{{{
    126   SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf(U_collect_state, &
     130  SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf(U_collect_state, &
    127131                                 U_init_dim_obs_pdafomi, U_obs_op_pdafomi, &
    128132                                 U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, &
    129133                                 U_obs_op_lin_pdafomi, U_obs_op_adj_pdafomi, &
    130134                                 U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l_pdafomi, &
    131                                  U_g2l_state, U_l2g_state, U_prepoststep, outflag)
    132 }}}
     135                                 U_prepoststep, outflag)
     136}}}
     137
     138Note:
     139 * If your code shows a call to `PDAFomi_put_state_hyb3dvar_lestkf`, it uses the implementation variant without PDAFlocal. This is documented on the page on [wiki:ImplementAnalysis_Hyb3DVar_untilPDAF221 Implementing the Analysis Step for hybrid 3D Var with OMI without PDAFlocal (until V2.2.1 of PDAF)].
    133140
    134141=== `PDAFomi_put_state_hyb3dvar_estkf` ===
     
    300307
    301308
     309
     310
    302311=== `U_init_dim_l` (init_dim_l_pdaf.F90) ===
    303312
     
    312321
    313322The routine is called during the loop over the local analysis domains in the analysis step.
    314 It has to provide in `dim_l` the dimension of the state vector for the local analysis domain with index `domain_p`.
     323For PDAF it has to provide in `dim_l` the dimension of the state vector for the local analysis domain with index `domain_p`.
     324
     325In 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 domain-decomposed) state vector to PDAFlocal by calling `PDAFlocal_set_indices`. (in the template files, this array is called `id_lstate_in_pstate`)
    315326
    316327Hints:
    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
     338The 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{{{
     341SUBROUTINE 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
     347Hint 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.
    320350
    321351
     
    325355
    326356See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information.
    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 
    370357
    371358