| 337 | |

| 338 | |

| 339 | === `U_init_obsvar_local` (init_obsvar_local.F90) === |

| 340 | |

| 341 | This routine is used by the local filters LSEIK and LETKF. The routine is only called if the local adaptive forgetting factor is used (`type_forget=2` in the example impementation). |

| 342 | |

| 343 | The interface for this routine is: |

| 344 | {{{ |

| 345 | SUBROUTINE init_obsvar_local(domain_p, step, dim_obs_l, obs_l, meanvar_l) |

| 346 | |

| 347 | INTEGER, INTENT(in) :: domain_p ! Current local analysis domain |

| 348 | INTEGER, INTENT(in) :: step ! Current time step |

| 349 | INTEGER, INTENT(in) :: dim_obs_l ! Local dimension of observation vector |

| 350 | REAL, INTENT(in) :: obs_l(dim_obs_l) ! Local observation vector |

| 351 | REAL, INTENT(out) :: meanvar_l ! Mean local observation error variance |

| 352 | }}} |

| 353 | |

| 354 | The routine is called in the local filters during the loop over all local analysis domains by the by the routine that computes a local adaptive forgetting factor (PDAF_set_forget_local). The routine has to initialize a local mean observation error variance for all observations sued for the analysis in the current local analysis domain. |

| 355 | |

| 356 | Hints: |

| 357 | * For a model with domain-decomposition one might use the mean variance for the model sub-domain of the calling process. Alternatively one can compute a mean variance for the full model domain using MPI communication (e.g. the function `MPI_allreduce`). |

| 358 | * The observation vector `obs_p` is provided to the rotine for the case that the observation error variance is relative to the value of the observations. |