Compute mean observation error variance
This routine will only be called, if the adaptive forgetting factor feature is used. Please note that this is an experimental feature.
The routine is called in global filters (like ESTKF) during the analysis or in local filters (e.g. LESTKF) before the loop over local analysis domains by the routine PDAF_set_forget that estimates an adaptive forgetting factor. The routine has to initialize the mean observation error variance. For global filters this should be the global mean, while for local filters it should be the mean for the PE-local sub-domain. (init_obsvar_l_TYPE is the localized variant for local filters)
The routine assumes a diagonal observation error covariance matrix.
If the observation counter is zero the computation of the mean variance is initialized. The output is always the mean variance. If the observation counter is >0 the computed was initialized for another observation. To proceed the computation, meanvar is first multiplied with the observation counter to obtain the variance sum. Then the computation of the mean is continued.
Revision history: * 2019-09 - Lars Nerger - Initial code from restructuring observation routines * Later revisions - see repository log
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
real, | intent(inout) | :: | meanvar | |||
integer, | intent(inout) | :: | cnt_obs |