| 152 | | 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. |
| 153 | | |
| 154 | | The '''implementation steps''' are: |
| 155 | | 1. Include the observation-specific routine `localize_covar_TYPE` from the observation-module with 'use' |
| 156 | | 1. Initialize the array `coords` which holds the coordinates of all elements of the state vector for the current process domain |
| 157 | | 1. Add a call to the observation-specific routine localize_covar_TYPE |
| 158 | | |
| 159 | | As an '''example''', in `tutorial/online_2D_serialmodel/` we have |
| 160 | | {{{ |
| 161 | | SUBROUTINE localize_covar_pdafomi(dim_p, dim_obs, HP_p, HPH) |
| 162 | | |
| 163 | | USE obs_A_pdafomi, ONLY: localize_covar_A |
| 164 | | USE obs_B_pdafomi, ONLY: localize_covar_B |
| 165 | | USE obs_C_pdafomi, ONLY: localize_covar_C |
| 166 | | |
| 167 | | ... argument declarations omitted ... |
| 168 | | |
| 169 | | REAL, ALLOCATABLE :: coords_p(:,:) ! Coordinates of PE-local state vector entries |
| 170 | | |
| 171 | | ALLOCATE(coords_p(2, dim_p)) |
| 172 | | coords_p = ... ! Initialize coords_p |
| 173 | | |
| 174 | | CALL localize_covar_A(dim_p, dim_obs, HP_p, HPH, coords_p) |
| 175 | | CALL localize_covar_B(dim_p, dim_obs, HP_p, HPH, coords_p) |
| 176 | | CALL localize_covar_C(dim_p, dim_obs, HP_p, HPH, coords_p) |
| 177 | | |
| 178 | | DEALLOCATE(coords_p) |
| 179 | | }}} |
| 180 | | |
| 181 | | '''Notes:''' |
| 182 | | - Instead of allocating and filling the coordinate array `coords_p` in this routine one could also do it once in `init_pdaf` and declare the array in the module `mod_assimilation`. |
| 183 | | - 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 practice to keep the order of the calls consistent. |
| 184 | | |
| | 151 | This was a routine that was used in the PDAF-OMI variant in PDAF2. In PDAF3 this was replaced by [wiki:PDAFomi_set_localize_covar], which is called in the main routine `init_dim_obs` of an observation module. |
| | 152 | |
| | 153 | For PDAF2, see the [wiki:OMI_Callback_obs_pdafomi description of the callobs_obs_pdafomi.F90 in PDAF2]. |
| 243 | | == deallocate_obs_pdafomi == |
| 244 | | |
| 245 | | 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. |
| 246 | | |
| 247 | | || [[span(style=color: #FF0000, '''Note:''' Calling `deallocate_obs_pdafomi` is only required in PDAF V1.16. It is no longer required to call it in PDAF V2.0 and later)]] || |
| 248 | | |
| 249 | | The '''implementation steps''' are: |
| 250 | | 1. Include the observation-specific type `thisobs` from the observation-module with 'use' apply a name conversion like `obs_TYPE => thisobs` |
| 251 | | 1. add a call to `PDAFomi_deallocate_obs` giving the observation-specific `obs_TYPE` as argument. |
| 252 | | 1. To perform the deallocation, insert a call to deallocate_obs_pdafomi at the end of the routine `prepoststep_pdaf`. |
| 253 | | |
| 254 | | As an '''example''', in `tutorial/online_2D_serialmodel/` we have |
| 255 | | {{{ |
| 256 | | SUBROUTINE deallocate_obs_pdafomi(step) |
| 257 | | |
| 258 | | USE PDAFomi, ONLY: PDAFomi_deallocate_obs |
| 259 | | USE obs_A_pdafomi, ONLY: obs_A => thisobs |
| 260 | | USE obs_B_pdafomi, ONLY: obs_B => thisobs |
| 261 | | USE obs_C_pdafomi, ONLY: obs_C => thisobs |
| 262 | | |
| 263 | | ... argument declarations omitted ... |
| 264 | | |
| 265 | | CALL PDAFomi_deallocate_obs(obs_A) |
| 266 | | CALL PDAFomi_deallocate_obs(obs_B) |
| 267 | | CALL PDAFomi_deallocate_obs(obs_C) |
| 268 | | }}} |