Version 2 (modified by 20 months ago) (diff) | ,
---|

# U_prodRinvA_hyb_l

The page document the user-supplied call-back routine `U_prodRinvA_hyb_l`

.

The routine `U_prodRinvA_hyb_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_hyb_l_pdaf`

, but in the full interface, the user can choose the name of the routine.

This routine is a variant of U_prodRinvA_l including the hybrid weight used for the hybrid Kalman-nonlinear ensemble transform filter LKNETF. If you already implemented U_prodRinvA_l you can implement the hybrid variant by adding the hybrid weight `gamma`

to the interface and add a multiplication with this value in the loop where `C_l`

is computed.

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. 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`

.

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.

**Difference to U_prodRinvA_l:** The routine also has to apply the hybrid weight gamma. This is a simple multiplication with the input value in the loop where C_l is initialized.

The interface is the following:

SUBROUTINE U_prodRinvA_hyb_l(domain_p, step, dim_obs_l, rank, obs_l, gamma, A_l, C_l)

with

`domain_p`

:`integer, intent(in)`

Index of current local analysis domain`step`

:`integer, intent(in)`

Current time step`dim_obs_l`

:`integer, intent(in)`

Number of local observations at current time step (i.e. the size of the local observation vector)`rank`

:`integer, intent(in)`

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)`obs_l`

:`real, intent(in), dimension(dim_obs_l)`

Local vector of observations`gamma`

:`real, intent(in)`

Hybrid weight provided by PDAF`A_l`

:`real, intent(in), dimension(dim_obs_l, rank)`

Input matrix provided by PDAF`C_l`

:`real, intent(out), dimension(dim_obs_l, rank)`

Output matrix

Hints:

- 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. - 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. - 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.