!------------------------------------------------------------------------- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! !------------------------------------------------------------------------- !BOP ! ! !MODULE: m_soqcs --- Implements Statistical On-line QC System ! ! !INTERFACE: ! MODULE m_soqcs ! !USES: use m_odsmeta ! ODS metadata: qc flags, etc use m_ods ! ODS vector class (GEOS-4) use m_ods_structure ! ODS vector class (GEOS-2) use m_die ! error messages ! ! !PUBLIC MEMBER FUNCTIONS: ! PUBLIC soqcs ! QC main interface ! ! !DESCRIPTION: This module is a simple wrapper around the GEOS-2 ! {\tt psas\_qc()} package. It also provides access to the ! quality marks. ! ! !REVISION HISTORY: ! ! 10oct1999 da Silva Initial code. ! !EOP !------------------------------------------------------------------------- CONTAINS !------------------------------------------------------------------------- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! !------------------------------------------------------------------------- !BOP ! ! !IROUTINE: SOQCS --- Performs Statistical On-line Quality Control ! ! !INTERFACE: ! subroutine SOQCS ( y, nobs, nobs_good ) ! !USES: Implicit NONE ! ! !PARAMETERS: ! integer, intent(in) :: nobs ! number of observations type(obs_vect), intent(inout) :: y ! observation vector ! !RETURN VALUE: integer, intent(out) :: nobs_good ! number of obs passing ! QC; these are now at ! the front of the list ! ! !DESCRIPTION: This routine implements the following quality checks on ! the observations: ! ! \begin{tabbing} ! xxx\=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\=\kill ! \> background check: \> marks outliers as suspect or extreme\\ ! \> iterated buddy check: \> compares suspects with neighboring data\\ ! \> wind check: \> eliminates unpaired wind components\\ ! \> profile check: \> eliminates profiles containing bad data ! \end{tabbing} ! ! The main driver routine {\tt SOQCS} requires an ODS vector as input. ! Apart from the order of the data within the ODS structure, only the ODS ! quality control attributes {\tt qcexcl} and {\tt qchist} will be changed ! on output. Data that passed quality control will have {\tt qcexcl}$=0$ and ! will be located in the top section of the ODS structure. ! \\[1ex] ! On input, {\tt SOQCS} will reset any quality control marks that were ! previously set by this package. In addition, the result (i.e. the values ! of the quality control marks) is independent of the order of the input data. ! Consequently, applying {\tt SOQCS} more than once to the same set of ! data will not change the result. ! \\[1ex] ! Numerical values and descriptions of all quality control marks produced ! by {\tt SOQCS}, and by other GEOS DAS quality control procedures, are ! defined in the include file {\tt qcflag.h}. ! \\[1ex] ! {\bf Rules pertaining to quality control marks:} ! ! \bv ! 1. Generally, the only permitted values are: ! ! qchist = 0, 1, ..., NH_P + NH_Q ! qcexcl = 0, 1, ..., NX_P + NX_Q ! ! qchist = 0, 1, ..., NH_P and qcexcl = 0, 1, ..., NX_P are reserved ! for preprocessing; the remaining flag values may be generated by this ! package or at a later stage in the data stream. ! ! 2. On input, any qcexcl>NX_P will be immediately reset to qcexcl=0, ! and any qchist>NH_P will be immediately reset to qchist=0. ! ! In combination with the rules below, this rule implies that flags will ! be reset to their original values when this package was first called. ! ! 3. If 0