| 1 | = `prodRinvA_pdaf` = |
| 2 | |
| 3 | The page document the user-supplied call-back routine `prodRinvA_pdaf`. |
| 4 | |
| 5 | The routine `prodRinvA_pdaf` (called `U_prodRinvA` inside the PDAF core routines) is a call-back routine that has to be provided by the user. The routine is used with all global filters and called during the analysis step. The purpose of the routine is to compute the product of the inverse of the observation error covariance matrix with some matrix '''A''' (as '''R^-1^''' x '''A'''). The matrix '''A''' holds an intermediate computing result of the filter analysis step. For the ESTKF this matrix holds the observed part of the ensemble perturbations. The matrix is provided as `A_p`. The product has to be returned in the array `C_p`. |
| 6 | |
| 7 | The interface is the following: |
| 8 | {{{ |
| 9 | SUBROUTINE prodRinvA(step, dim_obs_p, rank, observation_p, A_p, C_p) |
| 10 | }}} |
| 11 | with |
| 12 | * `step` : `integer, intent(in)`[[BR]] Current time step |
| 13 | * `dim_obs_p` : `integer, intent(in)`[[BR]] Number of observations at current time step (i.e. the size of the observation vector) |
| 14 | * `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) |
| 15 | * `obs_p` : `real, intent(in), dimension(dim_obs_p)`[[BR]] Vector of observations |
| 16 | * `A_p` : `real, intent(in), dimension(dim_obs_p, rank)`[[BR]] Input matrix provided by PDAF |
| 17 | * `C_p` : `real, intent(out), dimension(dim_obs_p, rank)`[[BR]] Output matrix |
| 18 | |
| 19 | |
| 20 | Notes: |
| 21 | * In case of a parallelization with domain decomposition, `A_p` contains the part of the matrix that resides on the model sub-domain of the calling process. The product has to be computed for this sub-domain, too. |
| 22 | |
| 23 | Hints: |
| 24 | * The information about the inverse observation error covariance matrix has to be provided by the user. Possibilities are to read this information from a file, or to use a Fortran module that holds this information, which one could already prepare in init_pdaf. |
| 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 inverse diagonal with the matrix `A_p` has to be implemented. |
| 26 | * The observation vector `obs_p` 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 ESTKF and ETKF: For ETKF the value of third argument is the ensemble size (`dim_ens`), while for the ESTKF it is `dim_ens-1` (according to the usual rank (`rank`) of the covariance matrix. However, the value is given when the routine is called. Thus, the routine just needs to be able to work with the provided value. |
| 28 | |
| 29 | |