8 | | In the call to PDAF_init several variables have to be provided. These are the type index of the filter algorithm, its subtype, and the initial time step. Then follows an integer array and an integer defining the size of the array. This integer array holds parameters that define filter-specific quantities, but also the ensemble size and the size of the state vector (for the current MPI process in case of parallelization with domain decomposition). The next argument is an array of reals followed by its size. This array contains floating point variables for the filter algorithm, like the forgetting factor. Apart from the first two variable of the integer array (state dimension and ensemble size) and the first variable of the real array (forgetting factor) all further variables are optional. For example, if the size parameter for the integer array is set to 2, only the first two variables are parsed by PDAF_init. This also allows to define both arrays to be of minimum size in combination with defining the size accordingly in the call to PDAF_init. In this case the default values of the optional parameters are used. |
9 | | After the arrays and their sizes, the communicator variables COMM_model, COMM_filter, and COMM_couple have to be provided by PDAF_init. This is followed by task_id, n_modeltasks, and the flag filterpe, all of which are initialized by init_parallel_pdaf. |
10 | | The following argument is the name of the user-provided routine for the initialization of the ensemble states. Defining the name of this routine in the call to PDAF_init allows to use different ensemble initialization routines in a single compiled executable. Internally to PDAF_init the routine is called generically U_ens_init. |
11 | | Finally, the integer variables 'screen' and 'status_pdaf' have to be provided. The former variable defines how much output is written to 'standard out' by PDAF. The latter variable is the error flag of PDAF. The initialization was successful if 'status_pdaf' is zero, otherwise a problem occured. For error codes are described in the routine PDAF_init. |
| 15 | == Required arguments of `PDAF_init` == |
| 16 | |
| 17 | The call to `PDAF_init` has the following structure: |
| 18 | {{{ |
| 19 | CALL PDAF_init(filtertype, subtype, step_null, & |
| 20 | filter_param_i, length_filter_param_i, & |
| 21 | filter_param_r, length_filter_param_r, & |
| 22 | COMM_model, COMM_filter, COMM_couple, & |
| 23 | task_id, n_modeltasks, filterpe, & |
| 24 | U_ensemble_init, screen, status_pdaf) |
| 25 | }}} |
| 26 | |
| 27 | The required variables are the following: |
| 28 | |
| 29 | * `filtertype`: An integer defining the type of filter algorithm. Available are |
| 30 | * 0: SEEK |
| 31 | * 1: SEIK |
| 32 | * 2: EnKF |
| 33 | * 3: LSEIK |
| 34 | * 4: ETKF |
| 35 | * 5: LETKF |
| 36 | * `subtype`: An integer defining the sub-type of the filter algorithm (see example code for choices) |
| 37 | * `step_null`: An integer defining the initial time step. For some cases it can use useful to set `step_null` larger to 0. |
| 38 | * `filter_param_i`: Integer array collecting several variables for PDAF. The first two variables are mandatory and equal for all filters. Further variables are optional (see example code). The mandatory variables are in the following order: |
| 39 | * The local state dimension for the current process. |
| 40 | * The ensemble size. |
| 41 | * `length_filter_param_i`: An Integer defining the length of the array `filter_param_i`. The entries in the array are parsed up to this index. |
| 42 | * `filter_param_r`: Array of reals collecting flowting point variables for PDAF. The first variable is mandatory and equal for all filters. Further variables are optional (see example code). The mandatory variable is: |
| 43 | * The value of the forgetting factor (required to be larger than zero) |
| 44 | * `length_filter_param_r`: An Integer defining the length of the array `filter_param_r`. The entries in the array are parsed up to this index. |
| 45 | * `COMM_model`: The communicator variable `COMM_model` as initialized by `init_parallel_pdaf`. If the model-communicator is named differently in the actual program, the name has to be adapted |
| 46 | * `COMM_filter`: The communicator variable `COMM_filter` as initialized by `init_parallel_pdaf`. |
| 47 | * `COMM_couple`: The communicator variable `COMM_couple` as initialized by `init_parallel_pdaf`. |
| 48 | * `task_id`: The index of the model tasks as initialized by `init_parallel_pdaf`. |
| 49 | * `n_modeltasks`: The number of model tasks as defined before the call to `init_parallel_pdaf`. |
| 50 | * `filterpe`: The flag showing if a process belongs to `COMM_filter` as initialized by `init_parallel_pdaf`. |
| 51 | * `U_ensemble_init`: The name of the user-supplied routine that is called by `PDAF_init` to initialize the ensemble of model states. (See '[#User-suppliedroutineU_ensemble_init User-supplied routine `U_ensemble_init`]' |
| 52 | * `screen`: An integer defining whether information output is written to the screen (i.e. standard output). The following choices are available: |
| 53 | * 0: quite mode - no information is displayed. |
| 54 | * 1: Display standard information (recommended) |
| 55 | * 2: Display detailed information for debugging |
| 56 | * `status_pdaf`: An integer used as status flag of PDAF. If `status_pdaf` is zero upon exit from `PDAF_init` the initialization was successful. An error occurred for non-zero values. (The error codes are documented in the routine PDAF_init.) |
| 57 | |
| 58 | == Other variables for the assimilation == |
| 59 | |
| 60 | The routine `init_pdaf` also initializes several variables that are not used to call `PDAF_init`. |
| 61 | |
| 62 | The are, for example the size of the ensemble and the type of filter algorithm. The example implementation explains the full set of variables. The example also initializes a few variables that are not handed over to PDAF_init, like delt_obs. This variable is the number of time steps between sucessive analysis steps. It is meaningful to define it at this central position. Of course, this definition has to be adapted to the particluar model used. |
| 63 | |
| 64 | == User-supplied routine `U_ensemble_init` == |