| 1 | = U_init_ens = |
| 2 | |
| 3 | The page document the user-supplied call-back routine `U_init_ens`. |
| 4 | |
| 5 | The routine `U_init_ens` is a call-back routine that has to be provided by the user. In the simplified interface the predefined name of the routine is `init_ens_pdaf`, but in the full interface, the user can choose the name of the routine. `U_init_ens` is called by `PDAF_init` at the initialization stage of a data assimilation program. The purpose of the routine is to fill the ensemble array that is provided by PDAF with an initial ensemble of model states. |
| 6 | |
| 7 | The interface is the following: |
| 8 | {{{ |
| 9 | SUBROUTINE U_init_ens(filtertype, dim_p, dim_ens, & |
| 10 | state_p, Uinv, ens_p, flag) |
| 11 | }}} |
| 12 | with |
| 13 | * `filtertype` : `integer, intent(in)`[[BR]] The integer defining the type of filter algorithm as given in the call to `PDAF_init` |
| 14 | * `dim_p` : `integer, intent(in)`[[BR]] An integer holding the size of the state dimension for the calling process as specified in the call to `PDAF_init` |
| 15 | * `dim_ens` : `integer, intent(in)`[[BR]] An integer holding the size of the ensemble (or the rank of the state covariance matrix for SEEK) |
| 16 | * `state_p` : `real, intent(inout), dimension(dim_p)`[[BR]] A real array for the model state part of the calling process (Only relevant for mode-based filters like SEEK; does not need to be filled for ensemble-based filters) |
| 17 | * `Uinv` : `real, intent(inout), dimension(dim_ens-1, dim_ens-1)`[[BR]] A real array for the inverse of matrix '''U''' from the decomposition of the state error covariance matrix '''P''' = '''VUV^T^''' (Only relevant for mode-based filters like SEEK.) |
| 18 | * `ens_p` : `real, intent(out), dimension(dim_p, dim_ens)`[[BR]] A real array that has tobe filled with the ensemble of model states. (In case of a mode-based filter (SEEK), the array has to be fillex with the modes of the covariance matrix) |
| 19 | * `flag` : `integer, intent(inout)`[[BR]] Status flag for PDAF. It is 0 upon entry and can be set by in the user-supplied routine, depending on the success of the ensemble initialization. Preferably, values above 102 should be used for failures to avoid conflicts with the error codes defined within PDAF_init. |
| 20 | |
| 21 | Notes: |
| 22 | * The routine is called by all MPI processes that compute the filter analysis step (i.e. those for which 'filterpe' is set to true. In the standard configuration of `init_parallel_pdaf` these are all processes of the first model task, i.e. task_id=1.) |
| 23 | * `U_init_ens` is only called by `PDAF_init` if no error occurred before; thus the status flag is zero. |