Changes between Version 11 and Version 12 of OfflineInitPdaf


Ignore:
Timestamp:
May 19, 2025, 9:57:00 AM (13 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OfflineInitPdaf

    v11 v12  
    2020The PDAF release provides example code for the offline mode in `tutorial/offline_2D_parallel`. We refer to this code to use it as a basis.
    2121
    22 The routine `PDAF_init` is called to initialize PDAF. This call sets parameters for the data assimilation, chooses the data assimilation method and initializes the ensemble. In the tutorial code in `tutorial/offline_2D_parallel`, we collect the initialization of all variables required for the call to `PDAF_init` into the single subroutine `init_pdaf_offline`, which yields a clean code. The file `init_pdaf_offline.F90` in `templates/offline` provides a commented template for this routine, which can be used as the basis of the implementation.
     22The routine `PDAF_init` is called to initialize PDAF. This call sets parameters for the data assimilation, chooses the data assimilation method and initializes the ensemble. In the tutorial and template codes we collect the initialization of all variables required for the call to `PDAF_init` into the single subroutine `init_pdaf_offline`, which yields a clean code. The file `templates/offline/init_pdaf_offline.F90` provides a commented template for this routine, which can be used as the basis of the implementation.
    2323
    2424`PDAF_init` itself calls a user-supplied call-back routine to initialize the ensemble of model states. In the example, this is the routine in the file `init_ens_offline.F90`.
    2525
    26 == Using `init_pdaf` ==
     26== Using `init_pdaf_offline` ==
    2727
    28 In the offline mode, the routine `init_pdaf_offline` is executed after the initialization of the parallelization. (Note: In the main program of the example implementation (`main_offine.F90`) we added a call to a routine `initialize` in between for clarity of the implementation. This routine simply initializes the size of the 2-dimensional model grid and then the size of the model state.)
     28In the offline mode, the routine `init_pdaf_offline` is executed after the initialization of the parallelization.
    2929
    30 In the routine `init_pdaf_offline` a number of variables are defined that are used in the call to `PDAF_init` as described below.  There are also a few variables that are initialized in `init_pdaf_offline` but not used in the call to `PDAF_init`. These are variables that are specific for the data assimilation system, but only shared in between the user-supplied routines. For the tutorial example, these variables are described below in the section '[#Othervariablesfortheassimilation Other variables for the assimilation]'.
     30In `init_pdaf_offline` a number of variables are defined that are used in the call to `PDAF_init` as described below.  There are also a few variables that are initialized in `init_pdaf_offline` but not used in the call to `PDAF_init`. These are variables that are specific for the data assimilation system, but only shared in between the user-supplied routines. For the tutorial example, these variables are described below in the section '[#Othervariablesfortheassimilation Other variables for the assimilation]'.
    3131
    32 The example implementation and the template version allow to parse all variables through a command line parser. This method provides a convenient way to define an experiment and could also be used for other models. The parser module is provided by the file `tutorial/offline_2D_serial/parser_mpi.F90`
     32The example implementation and the template code allow to specify all options at run time using a command line parser. These options are specified as the combination `-VARIABLE VALUE`. This method provides a convenient way to define an experiment and could also be used for other models. The parser module is provided by the file `tutorial/offline_2D_serial/parser_mpi.F90`
    3333
    34 == Required arguments for `PDAF_init` ==
     34== Arguments of `PDAF_init` ==
    3535
    3636The call to `PDAF_init` has the following structure:
     
    4141               COMM_model, COMM_filter, COMM_couple, &
    4242               task_id, n_modeltasks, filterpe, &
    43                init_ens_pdaf, screen, status_pdaf)
     43               init_ens_offline, screen, status_pdaf)
    4444}}}
    4545
    4646The required variables are the following:
    4747
    48  * `filtertype`: An integer defining the type of filter algorithm. Available are
    49   * 1: SEIK
    50   * 2: EnKF
    51   * 3: LSEIK
    52   * 4: ETKF
    53   * 5: LETKF
    54   * 6: ESTKF
    55   * 7: LESTKF
    56   * 8: LEnKF
    57   * 9: NETF
    58   * 10: LNETF
    59   * 11: LKNETF
    60   * 12: PF
    61   * 13: ENSRF/EAKF
    62   * 100: GENOBS
    63   * 200: 3DVAR
    64  * `subtype`:[[BR]] An integer defining the sub-type of the filter algorithm
     48 * `filtertype`: An integer defining the type of the DA method. Available values are listed on the[wiki:AvailableOptionsforInitPDAF Page on available options] and can also be displayed runnign the assimialtion program with the option `-subtype -1`.
     49 * `subtype`:[[BR]] An integer defining the sub-type of the filter algorithm. Available values are listed on the[wiki:AvailableOptionsforInitPDAF Page on available options] and can also be displayed runnign the assimialtion program with the option `-subtype -1`.
    6550 * `step_null`:[[BR]] Always 0 for the offline mode.
    6651 * `filter_param_i`:[[BR]] Integer array collecting options 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:
     
    7762 * `n_modeltasks`:[[BR]] The number of model tasks as defined before the call to `init_parallel_pdaf`.
    7863 * `filterpe`:[[BR]] The flag showing if a process belongs to `COMM_filter` as initialized by `init_parallel_pdaf`.
    79  * `init_ens_pdaf`:[[BR]] The name of the user-supplied routine that is called by `PDAF_init` to initialize the ensemble of model states. (See below: '[#User-suppliedroutineU_init_ens User-supplied routine U_init_ens]'
     64 * `init_ens_offline`:[[BR]] The name of the user-supplied routine that is called by `PDAF_init` to initialize the ensemble of model states. (See below: '[#User-suppliedroutineinit_ens_offline User-supplied routine init_ens_offline]'
    8065 * `screen`:[[BR]] An integer defining whether information output is written to the screen (i.e. standard output). The following choices are available:
    8166  * 0: quite mode - no information is displayed.
     
    8671PDAF 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 option (forgetting factor for inflation) 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.
    8772
    88 An overview of available integer and real-valued options for each DA method can be found on the page[wiki:AvailableOptionsforInitPDAF Available options for the different DA methods]. The available options for a specific DA method can also be displayed by running the assimilation program for the selected DA method setting `subtype = -1`. (In the tutorial and template codes one can set `-subtype -1` on the command line).
     73An overview of available integer and real-valued options for each DA method can be found on the page [wiki:AvailableOptionsforInitPDAF Available options for the different DA methods]. The available options for a specific DA method can also be displayed by running the assimilation program for the selected DA method setting `subtype = -1`. (In the tutorial and template codes one can set `-subtype -1` on the command line). Generally, available options and valid settings are also listed in `mod_assimilation.F90` of the tutorials and template codes.
    8974
    90 It is 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.
     75We 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.
    9176
    9277
    9378== Other variables for the assimilation ==
    9479
    95 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 `mod_assimilation`. These variables are for example:
     80The routine `init_pdaf_offline` 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 `mod_assimilation`. These variables are for example:
    9681 * `cradius`: Localization cut-off radius (here in grid points) for the local observation domain
    9782 * `sradius`: support radius, if the observation errors are weighted with distance (for `locweight>0`)
     
    9984It is useful to define variables like these at this central position. Of course, this definition has to be adapted to the particular model used.
    10085
    101 Apart from the generic variables for loclaization, we also specify variables that are specific for each obseration type, for example
     86Apart from the generic variables for localization, we also specify variables that are specific for each obseration type, for example
    10287 * `assim_A`: Flag whether to assimialtion observations of type A
    10388 * `rms_obs_A`: Assumed observation error standard deviation of observation type A
    10489
    105 == User-supplied routine `init_ens_pdaf` ==
     90== User-supplied routine `init_ens_offline` ==
    10691
    107 The user-supplied routine the we named `init_ens_pdaf` here, is the call-back routine that 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.
     92The user-supplied routine that we named `init_ens_ofline` here, is the call-back routine that 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.
    10893
    10994The interface can be looked up in the template and tutorial codes. It is the following:
    11095{{{
    111 SUBROUTINE init_ens_pdaf(filtertype, dim_p, dim_ens, &
     96SUBROUTINE init_ens_offline(filtertype, dim_p, dim_ens, &
    11297                           state_p, Uinv, ens_p, flag)
    11398}}}
     
    199184}}}
    200185
    201 The correctness of the ensemble initialization in `U_init_ens` should be checked by the user.
     186The correctness of the ensemble initialization in `init_ens_offline` should be checked by the user.