Changes between Version 2 and Version 3 of OnlineInitPdaf_PDAF3
- Timestamp:
- Sep 1, 2025, 10:24:41 AM (22 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OnlineInitPdaf_PDAF3
v2 v3 72 72 PDAF uses two arrays **filter_param_i** and **filter_param_r** to respectively specify integer and real-valued options for PDAF. As described above, 2 integer values (state vector size, ensemble size) and 1 real value (forgetting factor) are mandatory. Additional options can be set by specifying a larger array and setting the corresponding size value (`length_filter_param_i`, `length_filter_param_r`). However, with PDAF V3.0 it can be more convenient to use the subroutines `PDAF_set_iparam` and `PDAF_set_rparam`, which are explained further below. 73 73 74 We recommended to check the value of `status_pdaf` in the program after PDAF_init (and potentially `PDAF_set_iparam and `PDAF_set_rparam`) are executed. Only if its value is 0, the initialization was successful.74 We recommended to check the value of `status_pdaf` in the program after `PDAF3_init`, and potentially `PDAF_set_iparam and `PDAF_set_rparam` are executed. Only if its value is 0, the initialization was successful. One test after the set of calls is sufficient. 75 75 76 76 === Note on available options === … … 84 84 == Other variables for the assimilation == 85 85 86 The routine `init_pdaf` in the example also initializes several variables that are not used to call `PDAF _init`. These variables control some functionality of the user-supplied routines for the data assimilation system and are shared with these routines through the Fortran module `mod_assimilation`. These variables are for example:86 The routine `init_pdaf` in the example also initializes several variables that are not used to call `PDAF3_init`. These variables control some functionality of the user-supplied routines for the data assimilation system and are shared with these routines through the Fortran module `mod_assimilation`. These variables are for example: 87 87 * `delt_obs`: An integer specifying the number of time steps between two analysis steps (used later in `next_observation_pdaf`) 88 88 * `cradius`: Localization cut-off radius in grid points for the observation domain … … 111 111 == User-supplied routine `init_ens_pdaf` == 112 112 113 The user-supplied routine that we named `init_ens_pdaf` here, is the call-back routine that is called by PDAF through the defined interface described below. 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.) `init_ens_pdaf` is only called by `PDAF _init` if no error occurred before; thus the status flag is zero.113 The user-supplied routine that we named `init_ens_pdaf` here, is the call-back routine that is called by PDAF through the defined interface described below. 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.) `init_ens_pdaf` is only called by `PDAF3_init` if no error occurred before; thus the status flag is zero. 114 114 115 115 The interface details can be looked up in the template and tutorial codes. It is the following: … … 119 119 }}} 120 120 with 121 * `filtertype`, `integer, intent(in)`:[[BR]]The type of filter algorithm as given in the call to `PDAF _init`122 * `dim_p`, `integer, intent(in)`:[[BR]] The size of the state dimension for the calling process as specified in the call to `PDAF _init`121 * `filtertype`, `integer, intent(in)`:[[BR]]The type of filter algorithm as given in the call to `PDAF3_init` 122 * `dim_p`, `integer, intent(in)`:[[BR]] The size of the state dimension for the calling process as specified in the call to `PDAF3_init` 123 123 * `dim_ens`, `integer, intent(in)`:[[BR]]The size of the ensemble 124 124 * `state_p`, `real, dimension(dim_p), intent(inout)`:[[BR]]Array for the local model state of the calling process (can be used freely for ensemble-based methods) 125 125 * `Ainv`, `real, dimension(dim_ens-1, dim_ens-1), intent(inout)`:[[BR]]A possible weight matrix (Not relevant for ensemble-based methods) 126 126 * `ens_p`, `real, dimension(dim_p, dim_ens), intent(inout)`:[[BR]] The ensemble array, which has to be filled with the ensemble of model states. 127 * `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.127 * `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 PDAF3_init. 128 128 129 129 === Defining the state vector === … … 145 145 == Setting additional options == 146 146 147 In PDAF V3.0 we added the possibility to set options for PDAF after the call to `PDAF _init`. For these there are the subroutines147 In PDAF V3.0 we added the possibility to set options for PDAF after the call to `PDAF3_init`. For these there are the subroutines 148 148 {{{ 149 149 PDAF_set_iparam(id, value, status_pdaf) … … 156 156 * `id`:[[BR]] The index value of a parameter 157 157 * `value`:[[BR]] The value of the parameter with index `id` 158 * `status_pdaf`:[[BR]] Status flag for PDAF. Both routines increment in the input value. The increment is 0 for no error (this allows to check `flag` once after all calls to `PDAF _init`, `PDAF_set_iparam`, and `PDAF_set_rparam`.)158 * `status_pdaf`:[[BR]] Status flag for PDAF. Both routines increment in the input value. The increment is 0 for no error (this allows to check `flag` once after all calls to `PDAF3_init`, `PDAF_set_iparam`, and `PDAF_set_rparam`.) 159 159 160 160 The tutorial code uses these routines for a few settings while the template code include an extended set of calls specific for different DA methods. … … 176 176 The PDAF initialization can be tested by compiling the assimilation program (one can out-comment the call to `PDAF3_assim_offline` if one likes to focus on the initialization) and executing it. 177 177 178 Standard output from PDAF _init looks like the following:178 Standard output from PDAF3_init looks like the following: 179 179 {{{ 180 180 PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 182 182 PDAF +++ Parallel Data Assimilation Framework +++ 183 183 PDAF +++ +++ 184 PDAF +++ Version 3.0beta+++184 PDAF +++ Version 3.0 +++ 185 185 PDAF +++ +++ 186 186 PDAF +++ Please cite +++