| 1 | = U_prodRinvA_l = |
| 2 | |
| 3 | The page document the user-supplied call-back routine `U_prodRinvA_l`. |
| 4 | |
| 5 | The routine `U_prodRinvA_l` is a call-back routine that has to be provided by the user. In the simplified interface the predefined name of the routine is `prodRinvA_l_pdaf`, but in the full interface, the user can choose the name of the routine. |
| 6 | The routine is called during the loop over the local analysis domains. In the algorithm, the product of the inverse of the observation error covariance matrix with some matrix has to be computed. For the SEIK filter this matrix holds the observed part of the ensemble perturbations for the specified local analysis domain. The matrix is provided as input argument `A_l` and the product has to be given in the output array `C_l`. |
| 7 | |
| 8 | This routine is also the place to perform observation localization. To initialize a vector of weights, the routine `PDAF_local_weight` can be called. The procedure is used in the example implementation and also demonstrated in the template routine. |
| 9 | |
| 10 | The interface is the following: |
| 11 | {{{ |
| 12 | SUBROUTINE prodRinvA_l(domain_p, step, dim_obs_l, rank, obs_l, A_l, C_l) |
| 13 | }}} |
| 14 | with |
| 15 | * `domain_p` : `integer, intent(in)`[[BR]] Index of current local analysis domain |
| 16 | * `step` : `integer, intent(in)`[[BR]] Current time step |
| 17 | * `dim_obs_l` : `integer, intent(in)`[[BR]] Number of local observations at current time step (i.e. the size of the local observation vector) |
| 18 | * `rank` : `integer, intent(in)`[[BR]] Number of the columns in the matrix processes here. This is usually the ensemble size minus one (or the rank of the initial covariance matrix) |
| 19 | * `obs_l` : `real, intent(in), dimension(dim_obs_l)`[[BR]] Local vector of observations |
| 20 | * `A_l` : `real, intent(in), dimension(dim_obs_l, rank)`[[BR]] Input matrix provided by PDAF |
| 21 | * `C_l` : `real, intent(out), dimension(dim_obs_l, rank)`[[BR]] Output matrix |
| 22 | |
| 23 | Hints: |
| 24 | * The routine is a local variant of the routine `U_prodRinvA`. Thus if that routine has been implemented before, it can be adapted here for the local filter. |
| 25 | * The routine does not require that the product is implemented as a real matrix-matrix product. Rather, the product can be implemented in its most efficient form. For example, if the observation error covariance matrix is diagonal, only the multiplication of the diagonal with matrix `A_l` has to be implemented. |
| 26 | * The observation vector `obs_l` is provided through the interface for cases where the observation error variance is relative to the actual value of the observations. |
| 27 | * The interface has a difference for LSEIK/LESTKF and LETKF: For LETKF the third argument is the ensemble size (`dim_ens`), while for LSEIK it is the rank (`rank`) of the covariance matrix (usually ensemble size minus one). In addition, the second dimension of `A_l` and `C_l` has size `dim_ens` for LETKF, while it is `rank` for the LSEIK filter. (Practically, one can usually ignore this difference as the fourth argument of the interface can be named arbitrarily in the routine.) |
| 28 | * To perform observation localization (i.e. observation weighting by modifying the inverse observation error covariance matrix) one computes for each observations the distance of it from the local analysis domain and then computes a weight for each observation according to this distance. For the computation of the weight, the routine `PDAF_local_weight` can be used. |