| 87 | |
| 88 | === `PDAF_X_alloc` === |
| 89 | |
| 90 | The routine `PDAF_X_alloc` allocates arrays for the data assimilation, like the ensemble array and a state vector. The success of the allocation is checked. |
| 91 | |
| 92 | The interface is as follows: |
| 93 | {{{ |
| 94 | SUBROUTINE PDAF_X_alloc(subtype, outflag) |
| 95 | }}} |
| 96 | with the following arguments: |
| 97 | * `subtype`: The subtype index of the filter algorithm [integer, input]. |
| 98 | * `outflag`: Error flag [integer, input/output] |
| 99 | |
| 100 | All arrays that need to be allocated are declared in the Fortran module `PDAF_mod_filter`. Here, also the dimensions of the arrays are declared. For the allocation of arrays, one has to distinguish between processes that compute the analysis step and those that only participate in the ensemble forecast. For the processes that compute the analysis (those with `filterpe=.true.`) it is mandatory to allocate the following two arrays: |
| 101 | * `state`: The state vector of size `dim_p`. |
| 102 | * `eofV`: This is the ensemble matrix in all ensemble-based filters. For SEEK it is the matrix holding eigenvectors. `eofV` has size (`dim_p`, `dim_ens`). |
| 103 | Depending on the filter algorithm some of the following arrays also need to be allocated: |
| 104 | * `eofU`: This is the eigenvalue matrix '''U''' used in the SEIK and SEEK filters (here, its size is (`rank`,`rank`)). For ETKF, it is the matrix '''A''' of size (`dim_ens`,`dim_ens`). The array only needs to be allocated if the algorithm uses such a matrix. (For EnKF, which does not use this matrix, it is allocated with size (1,1).) |
| 105 | * `state_inc`: The increment to the state vector computed in the analysis step. It only needs to be allocated in this routine, if incremental analysis updating is implemented. Otherwise, it is sufficient to allocate and deallocate `state_inc` in the routine performing the analysis step. The size of `state_inc` is `dim_p`. |
| 106 | * `bias`: If the filter algorithm is implemented with bias correction, the vector `bias` with size `dim_bias_p` is allocated. |
| 107 | |
| 108 | Processes that only participate in the computation of the ensemble forecast, but are not involved in computing the analysis step, operate only on a sub-ensemble. Accordingly, an ensemble array for this sub-ensemble has to be allocated. This is: |
| 109 | * `eofV`: This is the ensemble matrix in all ensemble-based filters. For SEEK it is the matrix holding eigenvectors. For the processes with `filterpe=.false.`, `eofV` has size (`dim_p`, `dim_ens_l`). |