= PDAF-OMI: The file callback_obs_pdafomi.F90 = [[PageOutline(2-3,Contents of this page)]] 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. 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/`. 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 == init_dim_obs_pdafomi == 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_TYPE`. The sum of these individual dimension yields the total number of observations, which is returned to PDAF. The implementation steps are: 1. Include the observation-specific routine `init_dim_obs_TYPE` and the variable `assim_TYPE` from the observation-module with 'use' 1. Declare a dimension variable `dim_obs_TYPE` and initialize it to 0 1. Add a call to the observation-specific routine init_dim_obs_TYPE with the condition `IF (assim_TYPE)` 1. add `dim_obs_TYPE` to the final sum computing `dim_obs`. Notes: - The variable `assim_TYPE` indicates whether a particular observation type is assimilated. It is usually defined in init_pdaf, or by reading from the command line or a namelist file. - 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`. == obs_op_pdafomi == In this routine one just calls `obs_op_TYPE` for each observation type. The implementation steps are: 1. Include the observation-specific routine `obs_op_TYPE` from the observation-module with 'use' 1. Add a call to the observation-specific routine obs_op_TYPE Notes: - The order of the calls to `obs_op_TYPE` is not relevant because the setup of the overall full observation vector is defined by the order of the calls in init_dim_obs_pdafomi. Anyway, it's good practive to keep the order of the calls consistent. == init_dim_obs_l_pdafomi == In this routine one just calls `init_dim_obs_l_TYPE` for each observation type. The routine is only required for domain-localized filters (like LESTKF, LETKF, LNETF). The implementation steps are: 1. Include the observation-specific routine `init_dim_obs_l_TYPE` from the observation-module with 'use' 1. Add a call to the observation-specific routine init_dim_obs_l_TYPE == localize_covar_pdafomi == In this routine one calls `localize_covar_TYPE` for each observation type. The routine is only required for the localized EnKF and performs covariance localization. The implementation steps are: 1. Include the observation-specific routine `localize_covar_TYPE` from the observation-module with 'use' 1. Initialize the array `coords` which holds the coordinates of all elements of the state vector for the current process domain 1. Add a call to the observation-specific routine localize_covar_TYPE == deallocate_obs_pdafomi == The file callback_obs_pdafomi.F90 also contains a routine deallocate_obs_pdafomi. Each obs-module allocates arrays in the observation type `obs_f` and `deallocate_obs_pdafomi` is used to deallocate the different observation-specific arrays after the analysis step. The implementation steps are: 1. Include the observation-specific type `thisobs` from the observation-module with 'use' apply a name conversion like `obs_TYPE => thisobs` 1. add a call to `PDAFomi_deallocate_obs` giving the observation-specific `obs_TYPE` as argument. 1. To perform the deallocation, insert a call to deallocate_obs_pdafomi at the end of the routine `prepoststep_pdaf`.