Changes between Initial Version and Version 1 of PDAFlocal_overview


Ignore:
Timestamp:
Sep 9, 2024, 3:20:01 PM (10 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PDAFlocal_overview

    v1 v1  
     1= PDAFlocal - the localization module of PDAF =
     2
     3== Overview ==
     4
     5PDAFlocal is optional functionality and was introduced with PDAF V2.3.
     6
     7PDAFlocal provides an improved handling of the localization of state vectors as used in the loca filters LESTKF, LETKF, LNETF, LSEIK, and LKNETF. A leading motivation to implement PDAFlocal was that it leads to much better performance when the Python interface pyPDAF is used. However, it is also useful for native implementations in e.g. Fortran because it also provides additional functionality for e.g. vertical localization or weakly coupled assimilation.
     8
     9Compared to not using PDAFlocal removes the need to implement the routines `g2l_state_pdaf` and 'l2g_state_pdaf' (see e.g. [wiki:ImplementAnalysisLocal]). For this, PDAFlocal provides three initialization routines and a set of alternative routines that are called for the analysis step.
     10
     11Please note that if you have an existing implementation there is no direct need to switch to using PDAFlocal. If might be useful if you plan to use the additional functionality of `PDAFlocal_set_increment_weights` (see below).
     12
     13PDAFlocal provides the initialization routines
     14 * `PDAFlocal_set indices` : This routine stores the index array that describes the indices of the element of a local state vector in the global state vector. It is used for mapping between both the local and global vectors.
     15 * `PDAFlocal_set_increment_weights` : This routine allows to provide PDAFlocal with a vector of local increment weights. When the local state vector is written back to the global state vector after a local analysis update, this allows to prescribe increment weights for each element of the local state vector. With this, one can e.g. implement a vertical localization if the local state vector is a column of the model grid.
     16 * `PDAFlocal_clear_increment_weights` : This routine clears and deallocates increment weights which have been set before with `PDAFlocal_set_increment_weights`. After executing this routine, the weights are reset to one for all elements of the local state vector (i.e. unweighted increment)
     17These routines are called in `init_dim_l_pdaf`.
     18
     19== Initialization routines ==
     20
     21Here we provide an overview of the interfaces of the 3 initialization routines.
     22
     23=== PDAFlocal_set_indices ===
     24
     25This routine is called in `init_dim_l_pdaf` when the dimension of the local state vector has to be determined. In addition to this dimension, the implementation guide recommends to also initialize the coordinates of the local analysis domain and the indices of the elements ofthe local state vector in the non-localized (global or domain-decomposed) state vector `state_p`. Thise indices are then used in the mapping from the global to the local state vector before the analysis and back after the analysis update in the local analysis loop. With PDAFlocal, one uses `PDAFlocal_set_indices` to pass the vector of indices to PDAFlocal, which later performs the mapping for all ensemble states.
     26
     27The interface is:
     28{{{
     29SUBROUTINE PDAFlocal_set_indices(dim_l, map)
     30
     31  INTEGER, INTENT(in) :: dim_l          ! Dimension of local state vector
     32  INTEGER, INTENT(in) :: map(dim_l)     ! Index array for mapping
     33}}}
     34
     35Hints:
     36 * For complex cases it might feel more intuitive to perform the mapping between the global and local state vectors in an explicit loop. However, this might lead to repeated computation of the indices and can hence be less efficient than computing the indices before.
     37 * The initialization of hthe index vector `map` is analogous to a loop that directly performs the initialization of a local state vector. However, here only the indices are stored.
     38
     39
     40=== PDAFlocal_set_increment_weights ===
     41
     42This routine provides the optional functionality to prescribe the assimilation increment of each element of the local state vector a different weight. This can be used, e.g. to implement a vertical localization in the case that the local state vector is a full vertical column of the model grid. In this case, one can make the increment weight depending on the height (or depth) of a grid point. Another application is to implement weakly-coupled assimilation in which the local state vector contains all variables, but only a subset of them is updated. This is achieved by givening those element that should not be updated the weight 0.
     43
     44The routine can be called in `init_dim_l_pdaf` when the dimension of the local state vector has to be determined. In addition to this dimension, the implementation guide recommends to also initialize the coordinates of the local analysis domain and the indices of the elements ofthe local state vector in the non-localized (global or domain-decomposed) state vector `state_p`. In addition one can initialize a vector of increment weights and provide it to PDAFlocal by calling this routine.
     45
     46The interface is:
     47{{{
     48SUBROUTINE PDAFlocal_set_increment_weights(dim_l, weights)
     49
     50  INTEGER, INTENT(in) :: dim_l          ! Dimension of local state vector
     51  REAL, INTENT(in) :: weights(dim_l)    ! Weights array
     52}}}
     53
     54Hints:
     55 * The loop to initialize `weights` can be analogous to the loop that initializes the index array for mapping between the global and local state vector.
     56 * It is possible to clear the weights array by calling `PDAFlocal_clear_increment_weights` (see below). Afterwards, unit weights are used.
     57 * One can call this routine again to change the weights. One does not need to call `PDAFlocal_clear_increment_weights` before. In any case, one has to be careful to ensure that the size of `weights` remains consistent when the size of the local state vector changes.
     58
     59
     60=== PDAFlocal_clear_increment_weights ===
     61
     62If `PDAFlocal_set_increment_weights` was used to prescribe the assimilation increment of each element of the local state vector a different weight this routine can be used to clear and deallocate the weights array. Afterwards a weight of one is used for the increment of all elements of the local state vector when initializing the global state vector after the analysis update in the local analysis loop.
     63
     64The interface is  without arguments:
     65{{{
     66SUBROUTINE PDAFlocal_clear_increment_weights()
     67}}}
     68
     69Hint:
     70 * After calling this routine, the local increment weights are one until one calls `PDAFlocal_set_increment_weights` with prescribed weights again.