Changes between Version 3 and Version 4 of OfflineInitPdaf
- Timestamp:
- Feb 21, 2023, 4:29:33 PM (22 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OfflineInitPdaf
v3 v4 18 18 == Overview == 19 19 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.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, 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. 21 21 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`. 23 23 24 24 == Using `init_pdaf` == 25 25 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`.)26 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. 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`.) 27 27 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]'28 In 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]' 29 29 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`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 by the file `tutorial/offline_omi/parser_mpi.F90` 31 31 32 32 == Required arguments for `PDAF_init` == … … 53 53 * 6: ESTKF 54 54 * 7: LESTKF 55 * 8: LEnKF 56 * 9: NETF 57 * 10: LNETF 58 * 11: LKNETF 59 * 12: PF 60 * 100: GENOBS 61 * 200: 3DVAR 55 62 * `subtype`: An integer defining the sub-type of the filter algorithm (always 5 for the offline mode) 56 63 * `step_null`: Always 0 for the offline mode. … … 73 80 * 1: Display standard information (recommended) 74 81 * 2: as 1 plus display of timing information during the assimilation process 75 * 3: Display detailed information for debugging76 82 * `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.) 77 83 … … 84 90 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: 85 91 * `rms_obs`: Assumed observation error 86 * ` local_range`: Localization radius in grid points for the observation domain in LSEIK and LETKF87 * `sra nge`: support radius, if a 5th order polynomial is used to weigh the observation errors92 * `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`) 88 94 * `locweight`: Type of localizing weight 89 It is useful to define variables l ke these at this central position. Of course, this definition has to be adapted to the particular model used.95 It is useful to define variables like these at this central position. Of course, this definition has to be adapted to the particular model used. 90 96 91 97 == User-supplied routine `U_init_ens` == … … 111 117 === Initialization for ensemble-based filters === 112 118 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.119 Generally, 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. 114 120 115 121 The 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. 116 122 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.123 For 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. 118 124 119 125 120 === Initialization for mode-based filters ===126 === Initialization for mode-based filters (deprecated in PDAF V2.x) === 121 127 122 128 The 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. … … 129 135 Standard output from PDAF_init should look like the following: 130 136 {{{ 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 132 +++ PDAF +++ 133 +++ Parallel Data Assimilation Framework +++ 134 +++ +++ 135 +++ Version 1.8 +++ 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 137 PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 138 PDAF +++ PDAF +++ 139 PDAF +++ Parallel Data Assimilation Framework +++ 140 PDAF +++ +++ 141 PDAF +++ Version 2.1 +++ 142 PDAF +++ +++ 143 PDAF +++ Please cite +++ 144 PDAF +++ L. Nerger and W. Hiller, Computers and +++ 145 PDAF +++ Geosciences, 2013, 55, 110-118, +++ 146 PDAF +++ doi:10.1016/j.cageo.2012.03.026 +++ 147 PDAF +++ when publishing work resulting from using PDAF +++ 148 PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 137 149 138 150 139 151 PDAF: Initialize filter 140 152 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 153 PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 154 PDAF +++ Error Subspace Transform Kalman Filter (ESTKF) +++ 155 PDAF +++ +++ 156 PDAF +++ Nerger et al., Mon. Wea. Rev. 140 (2012) 2335 +++ 157 PDAF +++ doi:10.1175/MWR-D-11-00102.1 +++ 158 PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 148 159 149 SEEKconfiguration150 151 152 --> Use fixed forgetting factor: 1.00 153 --> number of EOFs: 49 154 Perform re-diagonalization 160 PDAF ESTKF configuration 161 PDAF filter sub-type = 5 162 PDAF --> offline mode 163 PDAF --> Deterministic ensemble transformation 164 PDAF --> Use fixed forgetting factor: 1.00 165 PDAF --> ensemble size: 40 155 166 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 167 PDAF: Initialize Parallelization 168 PDAF Parallelization - Filter on model PEs: 169 PDAF Total number of PEs: 1 170 PDAF Number of parallel model tasks: 1 171 PDAF PEs for Filter: 1 172 PDAF # PEs per ensemble task and local ensemble sizes: 173 PDAF Task 1 174 PDAF #PEs 1 175 PDAF N 40 167 176 }}} 168 177