= PDAF_diag_ensstats = This page documents the routine `PDAF_diag_ensstats` of PDAF, which was introduced with PDAF V1.12. This routine computes the higher-order ensemble statistics (skewness and kurtosis). Inputs are the ensemble array and the state vector about which the statistics are computed (usually the ensemble mean). In addition, the index of the element has to be specified for which the statistics are computed. If this is 0, the mean statistics over all elements are computed. The definition used for kurtosis follows that used by Lawson and Hansen, Mon. Wea. Rev. 132 (2004) 1966. The routine can be called in the pre/poststep routine of PDAF both before and after the analysis step to compute the ensemble statistics. The interface is the following: {{{ SUBROUTINE PDAF_diag_ensstats(dim, dim_ens, element, & state, ens, skewness, kurtosis, status) }}} with the following arguments: * `dim` : `integer, intent(in)`[[BR]] Size of state vector * `dim_ens` : `integer, intent(in)`[[BR]] Ensemble size * `element` : `integer, intent(in)`[[BR]] Element of state vector for which the histogram is computed. If `element=0`, the histogram is computed over the whole state vector * `state` : `real, intent(in), dimension(dim)`[[BR]] State vector * `ens` : `real, intent(in), dimension(dim, dim_ens)`[[BR]] State ensemble * `skewness` : `real, intent(out)`[[BR]] Skewness (third moment) of the ensemble distribution * `kurtosis` : `real, intent(out)`[[BR]] Kurtosis (fourth moment) of the ensemble distribution * `status` : `integer, intent(out)`[[BR]] Status flag An example of using `PDAF_diag_ensstats` can be found in the Lorenz-96 model example (see models/lorenz96/compute_truermse.F90).