SUBROUTINE SUCOV(CDCTL,KULOUT) 2,2
#if defined (DOC)
*
***s/r SUCOV  - Characterization of the forecast error covariance
*
*
*Author  : P. Gauthier *ARMA/AES  June 9, 1992
*Revision:
*     . P. Gauthier *ARMA/AES May 25,1993: -Treatment of specific humidity
*     .                                     and  surface pressure
*     . P. Gauthier *ARMA/AES September 28, 1993
*     .                      Restructuration to account for the nature of
*     .                      the control variable
*     . L. Fillion *ARMA/AES Nov 1994
*     .                      Restructuration to account for the nature of
*                            the multivariate control variable. Also,
*                            1) Debugging and validation of the grid-point option
*                            2) Include computation of the standard-deviation
*                               of the ageostrophic height-field error from
*                               geostrophic departure.
*                               A treshold tropical value ZGZMIN of
*                               20% of the geostrophic height-field error VARIANCE
*                               at 30 degree latitude is ensured.
*     . L. Fillion *ARMA/AES Jan 1995
*                            1) Read vertical error-correlations
*                            2) Call to SUVERCOR made compulsory.
*                            3) call to SUSTAT
*
*     . C. Charette ARMA/AES Jan 96
*                            Remove the key LSTAT. Displaced the code
*                            dependent on the option LSTAT=.F. to
*                            the module SUSTAT. Remove 'comstat.cdk'
*     . S. Pellerin *ARMA/AES Sept 97.
*                   - Control of the different model state of the 3Dvar
*                     through COMSTATE, COMSTATEC and COMSTNUM common
*                     blocks variables (comstate.cdk).
*     . M. Buehner November 97
*     .            Add call to SUCORNS when NANALVAR=3
*                  Call sunewstats when cvcord ne PRESS
*     . J. Halle    *CMDA/AES Oct 99.
*                   - Added ground temperature (TG) to model state.
*     . M. Buehner ARMA May 2008
*                   - add call to sucorns2 for new approach for PtoT
*                     and localized Tb correlations (NANALVAR=4)
*     . Y.J. Rochon ARQX Feb 2009
*                   - SUCORNS2 modified to be used for both NANALVAR=3 & 4.
*
*    -------------------
**    Purpose: to initialize the inverse forecast error correlation
*     .        and the forecast error standard deviation
*
*Arguments
*     CDCTL   : 'I' --> identity is used for the correlation in spectral space
*     .         'H' --> homegeneous and isotropic error correlation
*               '0' --> return no statistics needed
#endif
      IMPLICIT NONE
*implicits
#include "comdim.cdk"
#include "comlun.cdk"
#include "comcva.cdk"
*
      CHARACTER*1 CDCTL
      INTEGER JLEV, JLA, JK, JGL, KULOUT
      REAL*8 ZVORSC, ZDIVSC, ZGZSC, ZPSSC, ZTGSC, ZQSC, zozsc
      REAL*8 ZSIGU, ZSIGV, ZSIGQ, ZSIGPS, ZSIGTG, ZCON, ZGZMIN
      REAL*8 DLFACT
      EXTERNAL INITRND
C
      IF(CDCTL .EQ. '0') THEN
         WRITE(NULOUT,9000)CDCTL
         RETURN
      ENDIF
 9000 FORMAT(//,3(" *****************"),/
     S     ," SUCOV: CDCTL=",A1,"       NO EXECUTION",/
     S     ,3(" *****************"))
C
      WRITE(NULOUT,FMT=9010)
 9010 FORMAT(//,1x,"-SUCOV: defining the forecast error"
     S     ," correlation as",/
     S     ," NOTE: MORE DIAGNOSTICS ABOUT FORECAST ERROR ARE",/
     S     ,"       WRITTEN ON THE FILE: DIAGSTAT")
C
C*0.  Prepare background error statistics
C
C     ------------------------------------------------
C
c  Initialize BG stats estimated from NMC method (when using model levels)
c
      call sunewstats(0,0)
c
C  INITIALIZE THE PROJECTION THAT DIAGONALIZES CORNS
c
      IF(NANALVAR.eq.3.or.NANALVAR.eq.4) CALL SUCORNS2
c
c      IF(NANALVAR.eq.3) THEN
c        CALL SUCORNS
c      ELSEIF(NANALVAR.eq.4) THEN
c        CALL SUCORNS2
c      ENDIF
C
      RETURN
      END