PDAF_diag_variance
This page documents the routine PDAF_diag_variance of PDAF, which was introduced with PDAF V3.0.
This routine computes the unbiased variance of the ensemble and returns it in the form of a state vector. In addition, the mean standard deviation is computed taking into account domain-decomposition for parallelized models.
The routine can be called in the pre/poststep routine of PDAF both before and after the analysis step to compute the ensemble statistics. This variant computes the standard deviation for the provided ensemble over the full decomposed domain of a parallel model specified by COMM_filter. The variant without parallelization is PDAF_diag_variance_nompi.
The interface is:
SUBROUTINE PDAF_diag_variance(dim_p, dim_ens, state_p, ens_p, variance_p, &
stddev_g, do_mean, do_stddev, COMM_filter, status)
INTEGER, INTENT(in) :: dim_p ! state dimension
INTEGER, INTENT(in) :: dim_ens ! Ensemble size
REAL, INTENT(inout) :: state_p(dim_p) ! State vector
REAL, INTENT(in) :: ens_p(dim_p, dim_ens) ! State ensemble
REAL, INTENT(out) :: variance_p(dim_p) ! Variance state vector
REAL, INTENT(out) :: stddev_g ! Global standard deviation of ensemble
INTEGER, INTENT(in) :: do_mean ! 1 to compute ensemble mean;
! 0 take values froem state_p as ensemble mean
INTEGER, INTENT(in) :: do_stddev ! 1 to compute the ensemble mean standard deviation;
! 0 no computation of ensemble standard deviation
INTEGER, INTENT(in) :: COMM_filter ! Filter communicator
INTEGER, INTENT(out) :: status ! Status flag (0=success)
Note:
- The ensemble standard deviation is a common measure of the estimate model root mean square error. It is typically computed in
prepoststep_pdafto monitor the assimilation process. - The option
do_meanexists mainly for performance reasons. Ifstate_palready contains the ensemble mean state it does not need to be computed again. - The option
do_stddevalso exists for performance reasons. If one is not interested in this number, it does not need to be computed. - The routine computes the unbiased variance, i.e. the normalization is 1/(dim_ens-1)
- The MPI operations are only done in the communicator
COMM_filterwhich is specified as an argument. This allows to also use the routine if PDAF was not initialized by callingPDAF_init.
