Changes between Version 2 and Version 3 of OnlineInitPdaf_PDAF3


Ignore:
Timestamp:
Sep 1, 2025, 10:24:41 AM (22 hours ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnlineInitPdaf_PDAF3

    v2 v3  
    7272PDAF 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.
    7373
    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.
     74We 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.
    7575
    7676=== Note on available options ===
     
    8484== Other variables for the assimilation ==
    8585
    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:
     86The 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:
    8787 * `delt_obs`: An integer specifying the number of time steps between two analysis steps (used later in `next_observation_pdaf`)
    8888 * `cradius`: Localization cut-off radius in grid points for the observation domain
     
    111111== User-supplied routine `init_ens_pdaf` ==
    112112
    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.
     113The 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.
    114114
    115115The interface details can be looked up in the template and tutorial codes. It is the following:
     
    119119}}}
    120120with
    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`
    123123 * `dim_ens`, `integer, intent(in)`:[[BR]]The size of the ensemble
    124124 * `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)
    125125 * `Ainv`, `real, dimension(dim_ens-1, dim_ens-1), intent(inout)`:[[BR]]A possible weight matrix (Not relevant for ensemble-based methods)
    126126 * `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.
    128128
    129129=== Defining the state vector ===
     
    145145== Setting additional options ==
    146146
    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 subroutines
     147In PDAF V3.0 we added the possibility to set options for PDAF after the call to `PDAF3_init`. For these there are the subroutines
    148148{{{
    149149   PDAF_set_iparam(id, value, status_pdaf)
     
    156156* `id`:[[BR]] The index value of a parameter
    157157* `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`.)
    159159
    160160The tutorial code uses these routines for a few settings while the template code include an extended set of calls specific for different DA methods.
     
    176176The 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.
    177177
    178 Standard output from PDAF_init looks like the following:
     178Standard output from PDAF3_init looks like the following:
    179179{{{
    180180PDAF    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     
    182182PDAF    +++       Parallel Data Assimilation Framework         +++
    183183PDAF    +++                                                    +++
    184 PDAF    +++                 Version 3.0beta                    +++
     184PDAF    +++                   Version 3.0                      +++
    185185PDAF    +++                                                    +++
    186186PDAF    +++                   Please cite                      +++