| 1 | = PDAF_sampleens = |
| 2 | |
| 3 | This page documents the routine `PDAF_sampleens` of PDAF. |
| 4 | |
| 5 | This routine generates an ensemble of model states from a provided central state and EOF modes (singular vectors of a perturbation matrix) and singular values (EOF coefficients). The resulting ensemble is the 2nd order-exact sample covariance matrix and mean state. |
| 6 | |
| 7 | The ensemble state vectors are computed as |
| 8 | {{{ ens_i = state + sqrt(dim_ens-1) modes (Omega C)^T }}} |
| 9 | where '''C''' holds in its diagonal the singular values ('''svals''') and '''Omega''' is an orthogonal transformation matrix that preserves the mean state. |
| 10 | The generated ensemble fulfills the condition for the state error covariance matrix, i.e. the sample covariance matrix of the ensemble is the prescriped covariance matrix given by the EOF modes and coefficients. |
| 11 | |
| 12 | The routine is typically called in the call-back routine that performs the ensemble initialization ([wiki:init_ens_pdaf init_ens_pdaf]) in the case that one does a start from the covariance matrix. |
| 13 | |
| 14 | The interface is the following: |
| 15 | {{{ |
| 16 | SUBROUTINE PDAF_SampleEns(dim, dim_ens, modes, svals, state, & |
| 17 | ens, flag) |
| 18 | }}} |
| 19 | with the following arguments: |
| 20 | * `dim` : `integer, intent(in)`[[BR]] Dimension of state vector |
| 21 | * `dim_ens` : `integer, intent(in)`[[BR]] Size of ensemble |
| 22 | * `modes` : `real, intent(inout), dimension(dim, dim_ens-1)`[[BR]] Array of EOF modes (singular vectors) |
| 23 | * `svals` : `real, intent(in), dimension(dim_ens-1)`[[BR]] Vector of EOF coefficients (singular values) |
| 24 | * `state` : `real, intent(inout), dimension(dim)`[[BR]] Central state of the ensemble |
| 25 | * `ens` : `real, intent(out), dimension(dim, dim_ens)`[[BR]] Created state ensemble |
| 26 | * `flag` : `integer, intent(out)`[[BR]] Status flag |
| 27 | |
| 28 | To use the routine, one has to provide the central state (`state`) as well as the EOF modes (`modes`) and EOF coefficients (`svals`). The routine applies the 2nd order exact sampling and returns the ensemble array `ens` with the prescribed central state as its mean and the covariance matrix according to the EOFs. |
| 29 | |
| 30 | The routine can be conveniently used in combination with the routine [wiki:PDAF_eofcovar PDAF_eofcovar]. This routine computes the EOF modes and coefficients from a model trajectory. It is usually used in a separate program to preprate the EOF information. The EOFs are then stored in a file and read by the ensemble initialization routine ([wiki:init_ens_pdaf init_ens_pdaf]). |
| 31 | |
| 32 | The use of this ensemble generation is demonstrated in the Lorenz-96 model example (see testsuite/src/lorenz96/init_ens_eof.F90). It is also used in the simple 1D test case (see testsuite/src/dummymodel_1D/init_seik_pdaf.F90). |