Changes between Version 5 and Version 6 of PortingToPDAF3


Ignore:
Timestamp:
May 15, 2025, 11:33:39 AM (3 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PortingToPDAF3

    v5 v6  
    33[[PageOutline(2-3,Contents of this page)]]
    44
    5 PDAF V3.0 is not fully backward compatible with PDAF2. Modernizing the PDAF code motivated us to allow some changes which require code changes by the PDAF users. Thus, when switching from using PDAF2 to PDAF3, it is not possible to just compile the new PDAF library and link it with your code (in contrast to many previous releases).
     5PDAF V3.0 is not fully backward compatible with PDAF2. Modernizing the PDAF code motivated us to allow some changes which require code changes by the PDAF users. Thus, when upgrading from using PDAF2 to PDAF3, it is not possible to just compile the new PDAF library and link it with your code (in contrast to many previous releases).
    66
    77Here we explain the steps required to adapt your code to PDAF 3.
     
    99== Using PDAF3 with existing codes ==
    1010
    11 To use existing assimilation code, we recommend the following steps. This relates for Fortran code.
     11To use existing assimilation code, we recommend the following steps. This relates to Fortran code.
    1212
    13 * Include[[BR]] `USE PDAF`[[BR]] in all routines that call PDAF routines (e.g. in init_pdaf and assimilate_pdaf).
    14 * If you used `USE PDAF_interface_module` in your code, replace this by `USE PDAF`.
    15 * You might need to adapt the Makefile of your program to include[[BR]]`-IPATH_TO_PDAF_INCLUDE`,[[BR]] where PATH_TO_PDAF_INCLUDE is the directory `include/` of your PDAF installation. The compiler needs to find the PDAF module files which are placed in `include/`
    16 * particular cases:
    17   *  If the compile process of your programm includes the compilation of PDAF using src/Makefile: With PDAF3 the Makefile is now only in the base-directory and there is no Makefile any more in src/. Thus, you would need adapt to use the Makefile in the base-directory (or alternatively you can copy this Makefile into src/ and adapt it according to the hints given inside the Makefile
    18   * If you used the offline mode by specifying **subtype=5**: change `subtype` to 0 and add a call to the routine [wiki:PDAF_set_offline_mode] in `init_pdaf`. Alternatively switch from using the `put_state` routine to using the new `assim_offline` routine, e.g. [wiki:PDAF3_assim_offline_local].
    19   * If your code calls **PDAF_assimilate_lnetf** or **PDAF_put_state_lnetf**: There was an argument added for `init_obs_pdaf`. The code has to be adapted for this additional arguments. (see [wiki:PDAF_assimilate_lnetf] or [wiki:PDAF_put_state_lnetf])
    20   * If your code used the **SEEK filter**: This filter was deprecated for a longer time and is no longer available with PDAF V3. Any call to e.g. PDAF_assimilate_seek has to be removed.
    21   * If your code used the **'simplified interface'**, i.e. routines with ending `_si`: The `_si` routine are no longer present in PDAF V3. Instead use the full interface routine, i.e. the routine with the same name as the `_si` routine, but without `_si`. Then set the arguments to the names that you find inside the `_si` routine file from PDAF2.
     13* Include[[BR]] `USE PDAF`[[BR]] in all routines that call PDAF routines (e.g. in `init_pdaf` and `assimilate_pdaf`).
     14* If you used `USE PDAF_interface_module` in your code, replace this with `USE PDAF`.
     15* You might need to adapt the Makefile of your program to include[[BR]]`-IPATH_TO_PDAF_INCLUDE`,[[BR]] where PATH_TO_PDAF_INCLUDE is the directory `include/` of your PDAF installation. The compiler needs to find the PDAF module files which are placed in `include/`. If you use the Makefile from the template or tutorials, you can use `-I{BASEDIR}/include`.
     16* **Particular cases**:
     17  *  If the compile process of your programm includes the compilation of PDAF using **src/Makefile**: With PDAF3 the Makefile is now only in the base-directory and there is no Makefile any more in src/. Thus, you would need adapt to use the Makefile in the base-directory (or alternatively you can copy this Makefile into src/ and adapt it according to the hints given inside the Makefile
     18  * If you used the offline mode by specifying **subtype=5**: change `subtype` to 0 and add a call to the routine [wiki:PDAF_set_offline_mode] in `init_pdaf`. Alternatively, switch from using the `put_state` routine to using the new `assim_offline` routine, e.g. the universal routine [wiki:PDAF3_assim_offline].
     19  * If your code calls **PDAF_assimilate_lnetf** or **PDAF_put_state_lnetf**: We had to add an argument for `init_obs_pdaf`, which is required internally for the revised observation initialization. The code has to be adapted for this additional argument. (see [wiki:PDAF_assimilate_lnetf] or [wiki:PDAF_put_state_lnetf])
     20  * If your code used the **SEEK filter**: This filter was deprecated for a longer time and is no longer available with PDAF V3. Any call to e.g. `PDAF_assimilate_seek` has to be removed.
     21  * If your code used the **'simplified interface'**, i.e. routines with ending `_si`: The `_si` routines are no longer present in PDAF V3. Instead use the full interface routine, i.e. the routine with the same name as the `_si`-routine, but without `_si`. Then, set the arguments to the names that you find inside the `_si` routine file from PDAF2.
    2222
    23 With these adaptions, the compiling the program should be possible.
     23With these adaptions, compiling the program should be possible.
    2424
    25 Two additional changes relate to the specification of `subtype` and the integer and real parameters for `PDAF_init`:
    26 * A few of the parameters used to configure PDAF in the call to `PDAF_init` have changed their index. This only concerns the EnKF, LEnKF, LKNETF and PF. An overview of the parameters is show in the tables on the [wiki:AvailableOptionsforInitPDAFinPDAF3 page 'Available options for the different DA methods'].
     25**Two additional changes** relate to the specification of `subtype` and the integer and real parameters for `PDAF_init`:
     26* A few of the parameters used to configure PDAF in the call to `PDAF_init` have changed their index value. This only concerns the EnKF, LEnKF, LKNETF and PF. An overview of the parameters is shown in the tables on the [wiki:AvailableOptionsforInitPDAFinPDAF3 page 'Available options for the different DA methods'].
    2727* The values of `subtype` have been renumbered as follows
    28 ||= old subtype[[BR]]PDAF2 =||= new subtype[[BR]]PDAF3 =||
    29 || 0 || 0 (no change) ||
    30 || 1 || 1 (no change) ||
     28||= old subtype[[BR]]PDAF2 =||= new subtype[[BR]]PDAF3 =||=  comment =||
     29|| 0 || 0 || no change ||
     30|| 1 || 1 || no change ||
    3131|| 2 || 10 ||
    3232|| 3 || 11 ||
    3333|| 4 || 2 ||
    34 || 5 || 5 (no longer offline mode) ||
     34|| 5 || 5 || no longer offline mode ||
    3535|| 6 || 3 ||
    3636|| 7 || 4 ||
     
    3939== Porting to the PDAF3 interface ==
    4040
    41 PDAF V3.0 also provides a set of new routines to call the analysis step, which we call the PDAF3 interface, because the calls are of the format `PDAF3_assimilate_` or `PDAF3_put_state_. It is not required to switch to these new interface routines, but generally recommended.
     41PDAF V3.0 also provides a set of new routines to call the analysis step. We refer to this as the PDAF3 interface, because the calls are of the format `PDAF3_assimilate_`, `PDAF3_assim_offline`, `PDAF3_put_state`. It is not required to switch to these new interface routines, but it is generally recommended.
    4242
    43 Details about the PDAF3 interface are provided on the [wiki:PDAF3_interface Page on the PDAF3 interface].
     43Details about the PDAF3 interface are provided on the [wiki:PDAF3_interface page on the PDAF3 interface].
    4444
    4545== Using new features of PDAF V3.0 ==
    4646
    47 PDAF V3.0 also introduces several new features. An overview of these is given on the [wiki:PDAF3_new_functionality Page on new functionality on PDAF V3.0].
     47PDAF V3.0 also introduces several new features. An overview of these is given on the [wiki:PDAF3_new_functionality page on new functionality on PDAF V3.0].