| 3 | [[PageOutline(2-3,Contents of this page)]] |
| 4 | |
| 5 | The file `callback_obs_pdafomi.F90` contains are those routines that are directly called by PDAF as call-back routines. In the example codes we use all routines with the suffix _pdafomi to distinguish them from routine from existing implementation where the suffix is typically _pdaf. |
| 6 | |
| 7 | The file `templates/omi/callback_obs_pdafomi.F90` provides a template for implementing the routines. A compact example canbe found in `tutorial/online_2D_serialmodel_omi/`. |
| 8 | |
| 9 | As mentioned in the OMI introduction, the routines are mainly pass-through routines. Thus, one typically includes the observation-specific routine with ‘use’ and then calls this routine. However, the is small additional functionality in the different routines which has to be handles when implementing the routine or adding an observation type |
| 10 | |
| 11 | == init_dim_obs_pdafomi == |
| 12 | |
| 13 | In this routine we declare a dimension variable `dim_obs_TYPE` for each observation type. This is initialized by the corresponding routine init_dim_obs_f_TYPE. The sum of these individual dimension yields the total number of observations, which is returned to PDAF. |
| 14 | |
| 15 | The implementation steps are: |
| 16 | 1. Include the observation-specific routine `init_dim_obs_TYPE` and the variable `assim_TYPE` from the observation-module with 'use' |
| 17 | 1. Declare a dimension variable `dim_obs_TYPE` and initialize it to 0 |
| 18 | 1. Add a call to the observation-specific routine init_dim_obs_TYPE with the condition `IF (assim_TYPE)` |
| 19 | 1. add `dim_obs_TYPE` to the final sum computing `dim_obs`. |
| 20 | |
| 21 | Notes: |
| 22 | - The variable `assim_TYPE` indicates whether a particular observation type is assimilated. |
| 23 | - The observation-module can have either a specific name for `init_dim_obs_TYPE` or a generic name. If the generic name `init_dim_obs` is used one can apply a name conversion `init_dim_obs_TYPE => init_dim_obs`. |
| 24 | |
| 25 | |
| 26 | |
| 27 | == obs_op_pdafomi == |
| 28 | |
| 29 | In this routine one has to use the offset variable `offset_obs`. It is initialized to zero and then used as an argument in each call to the observation-specific obs_op_TYPE routine. This offset defines the order in which the observations are treated in the full observation vector. |
| 30 | |
| 31 | The implementation steps are: |
| 32 | 1. Include the observation-specific routine `obs_op_TYPE` from the observation-module with 'use' |
| 33 | 1. Ensure that the integer variable `offset_obs` is declared and initialized to 0 |
| 34 | 1. Add a call to the observation-specific routine obs_op_TYPE |
| 35 | |
| 36 | Notes: |
| 37 | - The order of the calls to `obs_op_TYPE` determine how the different observations are ordered in the full observation vector containing all observation types. |
| 38 | |
| 39 | |
| 40 | == init_dim_obs_l_pdafomi == |
| 41 | |
| 42 | In this routine two offset variables `offset_obs_f` and `offset_obs_l` are used to ensure a consistent order of the calls. |
| 43 | |
| 44 | The implementation steps are: |
| 45 | 1. Include the observation-specific routine `init_dim_obs_l_TYPE` from the observation-module with 'use' |
| 46 | 1. Ensure that the integer variables `offset_obs` and `offset_obs_l` are declared and initialized to 0 |
| 47 | 1. Add a call to the observation-specific routine init_dim_obs_l_TYPE |
| 48 | |
| 49 | == deallocate_obs_pdafomi == |
| 50 | |
| 51 | The file callback_obs_pdafomi.F90 also contains a routine deallocate_obs_pdafomi. Each obs-module allocates arrays in the observation type zobs_f` and `deallocate_obs_pdafomi` is used to deallocate the different observation-specific arrays after the analysis step. |
| 52 | |
| 53 | The implementation steps are: |
| 54 | 1. Include the observation-specific type `thisobs` from the observation-module with 'use' apply a name conversion like `obs_TYPE => thisobs` |
| 55 | 1. add a call to `PDAFomi_deallocate_obs` giving the observation-specific `obs_TYPE` as argument. |
| 56 | 1. To perform the deallocation, insert a call to deallocate_obs_pdafomi at the end of the routine `prepoststep_pdaf`. |