Changes between Version 3 and Version 4 of OfflineInitPdaf


Ignore:
Timestamp:
Feb 21, 2023, 4:29:33 PM (15 months ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OfflineInitPdaf

    v3 v4  
    1818== Overview ==
    1919
    20 After the initialization of the parallelization for the assimilation program, the initialization of PDAF has to be implemented. Internally to PDAF, the initialization is performed by the routine `PDAF_init`. Typically, the initialization of all variables required for the call to `PDAF_init` can be collected into a single subroutine. This implementation strategy is useful, as only a single additional subroutine call has to be added to the model source code. In the example in `testsuite/src/offline_1D` the routine in the file `init_pdaf_offline_D.F90` shows this strategy. The file `init_pdaf.F90` in `templates/` provides a commented template for this routine, which can be used as the basis of the implementation.
     20After the initialization of the parallelization for the assimilation program, the initialization of PDAF has to be implemented. Internally to PDAF, the initialization is performed by the routine `PDAF_init`. Typically, we collect the initialization of all variables required for the call to `PDAF_init`  into a single subroutine, which yields a clean code In the example in `tutorial/offline_2D_serial` the routine in the file `init_pdaf_offline.F90` shows this strategy. The file `init_pdaf.F90` in `templates/offline_omi` provides a commented template for this routine, which can be used as the basis of the implementation.
    2121
    22 `PDAF_init` itself calls a user-supplied routine to initialize the ensemble of model states through its interface. In the example there are separate routines for the different filters. They are in the files `init_seik_offline_D.F90` (for SEIK, LSEIK, ETKF, LETKF, ESTKF, LESTKF), `init_enkf_offline_D.F90` (for EnKF), and `init_seek_offline_D.F90` (for SEEK).
     22`PDAF_init` itself calls a user-supplied routine to initialize the ensemble of model states through its interface. In the example, this is the routine in the file `init_ens_offline.F90`.
    2323
    2424== Using `init_pdaf` ==
    2525
    26 In the offline mode, the routine `init_pdaf` is executed after the initialization of the parallelization. (Note: In the main program of example implementation (`main/main_offine.F90`) we added a call to a routine `initialize` in between for clarity of the implementation. As no real model initialization is conducted, this routine simply initializes the size of the model state. This initialization could also be performed in `init_pdaf`.)
     26In 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. As no real model initialization is conducted, this routine simply initializes the size of the model state. This initialization could also be performed in `init_pdaf_offline`.)
    2727
    28 In the routine `init_pdaf` a number of variables are defined that are used in the call to `PDAF_init` as described below in '[#RequiredargumentsforPDAF_init Required arguments for `PDAF_init`]'. (Please note: All names of subroutines that start with `PDAF_` are core routines of PDAF, while subroutines whose name end with `_pdaf` are generally user-supplied call-back routines) There are also a few variables that are initialized in `init_pdaf` 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 example case, these variables are described below in the section '[#Othervariablesfortheassimilation Other variables for the assimilation]'
     28In the routine `init_pdaf_offline` a number of variables are defined that are used in the call to `PDAF_init` as described below in '[#RequiredargumentsforPDAF_init Required arguments for `PDAF_init`]'. (Please note: All names of subroutines that start with `PDAF_` are core routines of PDAF, while subroutines whose name end with `_pdaf` are generally user-supplied call-back routines) 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]'
    2929
    30 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 as `testsuite/src/main/parser_mpi.F90`
     30The 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_omi/parser_mpi.F90`
    3131
    3232== Required arguments for `PDAF_init` ==
     
    5353  * 6: ESTKF
    5454  * 7: LESTKF
     55  * 8: LEnKF
     56  * 9: NETF
     57  * 10: LNETF
     58  * 11: LKNETF
     59  * 12: PF
     60  * 100: GENOBS
     61  * 200: 3DVAR
    5562 * `subtype`: An integer defining the sub-type of the filter algorithm (always 5 for the offline mode)
    5663 * `step_null`: Always 0 for the offline mode.
     
    7380  * 1: Display standard information (recommended)
    7481  * 2: as 1 plus display of timing information during the assimilation process
    75   * 3: Display detailed information for debugging
    7682 * `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.)
    7783
     
    8490The 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:
    8591 * `rms_obs`: Assumed observation error
    86  * `local_range`: Localization radius in grid points for the observation domain in LSEIK and LETKF
    87  * `srange`: support radius, if a 5th order polynomial is used to weigh the observation errors
     92 * `cradius`: Localization cut-off radius (here in grid points) for the local observation domain
     93 * `sradius`: support radius, if the observation errors are weighted with distance (for `locweight>0`)
    8894 * `locweight`: Type of localizing weight
    89 It is useful to define variables lke these at this central position. Of course, this definition has to be adapted to the particular model used.
     95It is useful to define variables like these at this central position. Of course, this definition has to be adapted to the particular model used.
    9096
    9197== User-supplied routine `U_init_ens` ==
     
    111117=== Initialization for ensemble-based filters ===
    112118
    113 Generally, the filters SEIK, LSEIK, EnKF, ETKF, LETKF, ESTKF, and LESTKF are ensemble-based filters. For these filters only the array `ens_p` needs to be initialized by the ensemble of model states. If a model with domain decomposition is used, the full ensemble for the local sub-domain of the MPI process has to be initialized.
     119Generally, we work with ensemble-based filters (an exception is only the SEEK filter and the parameterized 3D-Var). For these filters only the array `ens_p` needs to be initialized by the ensemble of model states. If a model with domain decomposition is used, the full ensemble for the local sub-domain of the MPI process has to be initialized.
    114120
    115121The arrays `state_p` and `Uinv` are allocated to their correct sizes because they are used during the assimilation cycles. They are not yet initialized and it is allowed to use these arrays in the initialization. An exception from this is EnKF for which `Uinv` is allocated only with size (`1`,`1`), because `Uinv` is not using for EnKF.
    116122
    117 For the offline mode, one will usually read the ensemble states from output files of the model used to the ensemble integrations. Thus, one has to implement a reading routine for the model files.
     123For the offline mode, one will usually read the ensemble states from output files of the model used to perform the ensemble integrations separately (i.e. 'offline'). Thus, one has to implement a reading routine for the model files.
    118124
    119125
    120 === Initialization for mode-based filters ===
     126=== Initialization for mode-based filters (deprecated in PDAF V2.x) ===
    121127
    122128The only mode-based filter supplied with PDAF is currenly the SEEK filter. For this filter the initialization bases on the decomposition of the state error covariance matrix in the form '''P''' = '''VUV^T^'''. According to this decomposition, the array `ens_p` has to be initialized to hold the modes from matrix '''V''' and `Uinv` holds the inverse of matrix '''U'''. In addition `state_p` has to be initialized with the initial state estimate.  If a model with domain decomposition is used, the part of all modes for the local sub-domain of the MPI process and the corresponding part of the state vector has to be initialized.
     
    129135Standard output from PDAF_init should look like the following:
    130136{{{
    131         ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    132         +++                      PDAF                      +++
    133         +++      Parallel Data Assimilation Framework      +++
    134         +++                                                +++
    135         +++                  Version 1.8                   +++
    136         ++++++++++++++++++++++++++++++++++++++++++++++++++++++
     137PDAF    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
     138PDAF    +++                      PDAF                      +++
     139PDAF    +++      Parallel Data Assimilation Framework      +++
     140PDAF    +++                                                +++
     141PDAF    +++                 Version 2.1                    +++
     142PDAF    +++                                                +++
     143PDAF    +++                 Please cite                    +++
     144PDAF    +++     L. Nerger and W. Hiller, Computers and     +++
     145PDAF    +++         Geosciences, 2013, 55, 110-118,        +++
     146PDAF    +++         doi:10.1016/j.cageo.2012.03.026        +++
     147PDAF    +++ when publishing work resulting from using PDAF +++
     148PDAF    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    137149
    138150
    139   PDAF: Initialize filter
     151PDAF: Initialize filter
    140152
    141         ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    142         +++                  SEEK Filter                   +++
    143         +++                                                +++
    144         +++    Pham et al., J. Mar. Syst. 16 (1998) 323    +++
    145         +++          This implementation follows           +++
    146         +++      Nerger et al., Tellus 57A (2005) 715      +++
    147         ++++++++++++++++++++++++++++++++++++++++++++++++++++++
     153PDAF    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
     154PDAF    +++ Error Subspace Transform Kalman Filter (ESTKF) +++
     155PDAF    +++                                                +++
     156PDAF    +++  Nerger et al., Mon. Wea. Rev. 140 (2012) 2335 +++
     157PDAF    +++           doi:10.1175/MWR-D-11-00102.1         +++
     158PDAF    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    148159
    149          SEEK configuration
    150                filter sub-type = 5
    151                  --> offline mode
    152                  --> Use fixed forgetting factor: 1.00
    153                  --> number of EOFs:   49
    154           Perform re-diagonalization
     160PDAF    ESTKF configuration
     161PDAF          filter sub-type = 5
     162PDAF            --> offline mode
     163PDAF            --> Deterministic ensemble transformation
     164PDAF            --> Use fixed forgetting factor: 1.00
     165PDAF            --> ensemble size:   40
    155166
    156   PDAF: Initialize Parallelization
    157 
    158          Parallelization - Filter on model PEs:
    159                       Total number of PEs:    1
    160            Number of parallel model tasks:    1
    161                            PEs for Filter:    1
    162      # PEs per ensemble task and local ensemble sizes:
    163            Task   1
    164            #PEs   1
    165               N  49
    166           Evolve central state on task:   1
     167PDAF: Initialize Parallelization
     168PDAF     Parallelization - Filter on model PEs:
     169PDAF                 Total number of PEs:      1
     170PDAF      Number of parallel model tasks:      1
     171PDAF                      PEs for Filter:      1
     172PDAF     # PEs per ensemble task and local ensemble sizes:
     173PDAF     Task     1
     174PDAF     #PEs     1
     175PDAF        N    40
    167176}}}
    168177