SUBROUTINE SUVAR(KULOUT)

!**** *SUVAR*   - Routine to initialize variational flags common

!     Purpose.
!     --------
!           Initialize variational control common
!**   Interface.
!     ----------
!        *CALL* *SUVAR(KULOUT)

!        Explicit arguments :
!        --------------------
!        KULOUT : Logical unit for the output

!        Implicit arguments :
!        --------------------
!        COMMON YOMVAR

!     Method.
!     -------
!        See documentation

!     Externals.
!     ----------

!     Reference.
!     ----------
!        ECMWF Research Department documentation of the IFS

!     Authors.
!     -------
!        Philippe Courtier  and Jean-Noel Thepaut *DMN/ECMWF*

!     Modifications.
!     --------------
!        Original : 90-12-01
!        modified by F.Rabier and J.N Thepaut : 91-01-15
!        J.N Thepaut : 91-02-15  (JC management)
!        J.N Thepaut : 91-08-22  (diagnostics 4D var with real obs.)
!        Bill Heckley: 91-06-06  (Jg management)
!        Bill Heckley and Ross Hoffman: 92-03-06  (RXMIN defined in SUVAR)
!        Modified by R. EL Khatib : 93-04-02 Set-up defaults controled by LECMWF
!        Modified by J.N. Thepaut : 93-06-10 Lanczos parameters.
!        Modified by F. Rabier : 95-01-25 Option LSTEP for sensitivity.
!        Modified by Mike Fisher  : 95-01-20 CGL parameters
!        Modified by Mike Fisher  : 95-09-20 setup for RCVGE
!        Modified by F. Bouttier  : 96-01-12 replace .not.LOBSDIF by LOBSTL
!        Modified by Mike Fisher  : 95-09-20 setup for RCVGE
!        Modified by J.N. Thepaut : 95-01-10 Full-Pos parameters in variational.
!        Modified by P. Gauthier  : 99-01-12 Parameters LJCDFI,LUSEJCDFI
!                                            and LUSEJCNMI added
!        Modified by E. Andersson : 98-06-18 Bg errors for radiances
!        Modified by E. Andersson : 98-08-05 TOVS control variable
!        Modified by M. Torki     : 99-02-20 N1CG1 (precond. CG) parameters
!        Modified by Y. Tremolet  : 00-03-20 Added call to SUDFI and
!                                            default switches for Jc-DFI.
!        Modified by N. Bormann   : 01-09-21 Initialise lamv_reassign_passive
!        Modified by A. Dethof    : 03-04240 Initialise lreo3_bcor
!        Modified by D. Dee       : 03-10-17 Initialise lvarbc
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        Y.Tremolet    01-Apr-2004 Setup model error stats
!        G. Radnoti    03-12-2004 : initialize lproptl
!        D. Tan        14-Mar-2005: Initialise laeolusamd, laeolusl2bp
!        A. Benedetti  14-Mar-2005: Initialise laerod
!        G. Desroziers and K. Yessad (sept 2005):
!         - split option LTRAJHR into LTRAJHR_ALTI and LTRAJHR_SURF.
!         - adapt option LTRAJHR to METEO-FRANCE configurations.
!        Modified by R. Engelen    : Mar 2008 Initialise lch4_bcor
!        G. Desroziers 28-Feb-2008: Possible computation of ensemble bg error variance
!        Y.Tremolet    27-Nov-2008 Setup for long windows
!        G. Desroziers 22-Dec-2008: Enable transf. of ARPEGE file in GRIB format (to be used in femars)
!     -------------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMLUN   , ONLY : NULNAM
USE YOMVAR   , ONLY : JPNRFT   ,NREFTS   ,NANATS   ,NGRATS   ,&
 & CFNSIGB  ,CFNSIGA  ,CFNSIGF  ,CFNPCV   ,&
 & NITER    ,NSIMU    ,NINFRA   ,NITER_MIN,&
 & NMIMP    ,NSIM4D   ,NDIAG    ,&
 & NFRREF   ,NFRANA   ,NFRGRA   ,NSIM4DL  ,&
 & NUPTRA   ,MUPTRA   ,NPCVECS  ,NBGVECS  ,NWRIEVEC ,&
 & NHEVECS  ,NSSBGV_COUNT       ,NSSHEV_COUNT       ,&
 & NFGFCLEN ,RDX      ,ALPHAG   ,ALPHAV, RXMIN ,EVBCGL   ,&
 & RCVGE    ,R_NORM_REDUCTION_ABORT_LEVEL ,R_MAX_CNUM_PC ,&
 & FILTERFACTOR, FILTEREXPO , FILTERRESOL ,&
 & LTEST    ,LTRREF   ,LZOWA    ,&
 & LJC      ,LJCNMI   ,LJCNMTL  ,&
 & LTWANA   ,LTWGRA   ,LAVCGL   ,&
 & LFCOBS   ,LFCOBSTEST , LREFINC, &
 & LMPCGL   ,LTWINC   ,LTSCV   ,L_ABS_CONVERGENCE ,L_INFO_CONVERGENCE ,&
 & LGRASCAL ,LWRIBVEC ,LREABVEC, LWRIEVEC ,LWRISIGB ,LWRISIGA ,&
 & LWRISIGF ,LFDBERR  ,LEVECCNTL,LEVECGRIB,&
 & L_CHECK_CONVERGENCE,NBGTRUNC ,LBGTRUNC ,&
 & LTOVSCV  ,LTOVSREP ,LCO2, LCLDSINK, CTOPBGE, CAMTBGE, LCO2ANER, LBGOBS   ,LBGM     ,LGCV     ,LANOBS ,&
 & LGCVJO   ,NITERGCV ,LWREINI  ,LPROPTL  ,&
 & LJCDFI  , LUSEJCDFI,LUSEJCNMI,ZEPSNEG  ,&
 & LN1CG1   ,N1IMP    ,NSELECT  ,&
 & NPRECO   ,NBFGSB   ,L3DFGAT  ,LCONGRAD ,LAMV_REASSIGN_PASSIVE,&
 & LSKIPMIN ,LINITCV  ,LMODERR, LREPRO4DVAR, LREO3_BCOR, LCH4_BCOR, LAVARC, LVARBC, &
 & L_INFO_CONTENT, N_INFO_CONTENT_METHOD, N_INFO_CONTENT_SEED  ,&
 & L_GUESS_RUNTIME, NITER_GUESS_RUNTIME, NFREQ_GUESS_RUNTIME, NMEM_GUESS_RUNTIME, &
 & L_OPENMP_CV, N_DIAGS_CONVERGENCE, N_DIAGS_EIGENVECS, &
 & L_CHECK_GRADIENT, RTOL_CHECK_GRADIENT,&
 & LAEOLUSAMD, LAEOLUSL2BP, &
 & LBACKGE, LFEMARSF, LFEMARSD, LJBIMPACT, LJCIMPACT
USE YOMVCGL  , ONLY : NSAVEEV, NSAVEPC
USE YOMHCP   , ONLY : NHECP
USE YOMSENS  , ONLY : LGRVOL   ,NJROPT   ,LMINI     ,LBSENS
USE YOMVRTL  , ONLY : L131TL   ,L801TL   ,LTLINT   ,LOBSTL   ,LDRYTL,&
 & LINCV,LINCVDBG,RINCVLIM,RINCVSLOP  
USE YOMVFP   , ONLY : LSPINT
USE YOMCT0   , ONLY : NCONF    ,LOBSC1   ,NSTOP    ,LBACKG   ,LFDBOP
USE YOMCT0B  , ONLY : LECMWF
USE YOMTNEWT , ONLY : LIDMODEL 
USE YOMSLREP , ONLY : LSLADREP
USE TRAJECTORY_MOD, ONLY: LTRAJGP, LTRAJHR,LTRAJHR_ALTI,LTRAJHR_SURF,LREADGPTRAJ
USE YOMJQ    , ONLY : LSTATMERR
USE YOMMODEL_ERROR, ONLY: N_COUPLED_WINDOWS

!     -------------------------------------------------------------------------

IMPLICIT NONE

INTEGER(KIND=JPIM), INTENT(IN) :: KULOUT

!     -------------------------------------------------------------------------

INTEGER(KIND=JPIM) :: J
REAL(KIND=JPRB) :: Z
REAL(KIND=JPRB) :: ZHOOK_HANDLE

!     -------------------------------------------------------------------------

#include "abor1.intfb.h"
#include "posnam.intfb.h"
#include "sudfi.intfb.h"
#include "suhcp.intfb.h"

!     -------------------------------------------------------------------------

#include "namvar.h"
#include "namvrtl.h"
#include "namsens.h"
#include "namvfp.h"

!     -------------------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('SUVAR',0,ZHOOK_HANDLE)

!      ----------------------------------------------------------------

!*       1.    SET DEFAULT VALUES.
!              -------------------

!        1.1 Set implicit default values

LTEST =.FALSE.
LREPRO4DVAR =.FALSE.
L_CHECK_CONVERGENCE = .TRUE.
R_NORM_REDUCTION_ABORT_LEVEL = 0.01_JPRB
IF (NCONF/100 == 0.OR.NCONF == 302) THEN
  LJC   =.FALSE.
ELSE
  LJC   =.TRUE.
ENDIF
LFCOBS    = .FALSE.
LFCOBSTEST= .FALSE.
LJCNMI    = .FALSE.
LJCNMTL   = .TRUE.
LUSEJCNMI = .TRUE.
LINITCV   = .TRUE.
LMODERR   = .FALSE.
LVARBC    = .FALSE.
LSTATMERR = .FALSE.

LJCDFI    = .FALSE.
LUSEJCDFI = .FALSE.
LTRAJHR   = .false.
LTRAJHR_ALTI   = .false.
LTRAJHR_SURF   = .false.
LTRAJGP   = .false.
LREADGPTRAJ= .false.

L_INFO_CONTENT = .false.
N_INFO_CONTENT_METHOD = 1
N_INFO_CONTENT_SEED = 0

LAEOLUSAMD   = .FALSE.
LAEOLUSL2BP  = .FALSE.

L_CHECK_GRADIENT=.FALSE.
RTOL_CHECK_GRADIENT=1E-2_JPRB
FILTERFACTOR=1.0_JPRB
FILTEREXPO=2.0_JPRB
FILTERRESOL=255.0_JPRB

LAVARC=.FALSE.
LTRREF=.FALSE.
LREFINC=.FALSE.
LAVCGL=.FALSE.
LMPCGL=.FALSE.
LWRIBVEC=.FALSE.
LREABVEC=.FALSE.
LWRIEVEC=.FALSE.
LEVECCNTL=.TRUE.
LEVECGRIB=.FALSE.
LWRISIGB=.FALSE.
LWRISIGA=.FALSE.
LWRISIGF=.FALSE.
LZOWA=.TRUE.
LWREINI=.FALSE.
LTWANA=.FALSE.
LTWGRA=.FALSE.
LTWINC=.FALSE.
LMINI=.FALSE.
LSKIPMIN=.FALSE.
NITER =50
NSIMU =60
NITER_MIN=0
NINFRA=10
NPCVECS = 10
NWRIEVEC = 1000001
N_DIAGS_CONVERGENCE=1
N_DIAGS_EIGENVECS=1
N_COUPLED_WINDOWS=0
NSAVEEV=5
NSAVEPC=3
R_MAX_CNUM_PC=10.0
EVBCGL = 1e-1_JPRB
!  NINFRA WILL BE CHANGED IN SUIOMI ACCORDING TO LWARM
RCVGE=1.E-2_JPRB
NFGFCLEN=6
NMIMP=4
NSIM4D=0
NSIM4DL=999
NDIAG=1
RDX=1.0E-12_JPRB
ALPHAG=1.E+6_JPRB
ALPHAV=1.0_JPRB
RXMIN = SQRT(EPSILON(Z))
NFRREF=1
DO J=0,JPNRFT
  NREFTS(J)=0
ENDDO
NFRANA=10
DO J=0,JPNRFT
  NANATS(J)=0
ENDDO
NFRGRA=1000
DO J=0,JPNRFT
  NGRATS(J)=0
ENDDO

LGRASCAL=.FALSE.
NUPTRA=99999
MUPTRA=2
IF(NCONF == 131) THEN
  NBGVECS=50
  LBGTRUNC=.TRUE.
  NBGTRUNC=1000
  LBGOBS=.TRUE.
  LBGM=.FALSE.
  LANOBS=.false.
ELSE
  NBGVECS=0
  LBGTRUNC=.FALSE.
  NBGTRUNC=1000
  LBGOBS=.FALSE.
  LBGM=.FALSE.
  LANOBS=.FALSE.
ENDIF
NHEVECS=0
NSSBGV_COUNT=0
NSSHEV_COUNT=0
LTOVSCV=LOBSC1 .OR. NCONF/100 == 1
LTSCV=.FALSE.
LTOVSREP=.FALSE.
LGCV  =.FALSE.
LGCVJO=.FALSE.
NITERGCV=40
CFNSIGB='sigma_b'
CFNSIGA='sigma_a'
CFNSIGF='sigma_f'
CFNPCV ='precon'

! Variables of YOMVRTL/NAMVRTL
L131TL=.FALSE.
L801TL=.FALSE.
LOBSTL=.FALSE.
LTLINT=.FALSE.
LDRYTL=.FALSE.
LINCV=.FALSE.
LINCVDBG=.FALSE.
RINCVLIM=1.
RINCVSLOP=5.

LGRVOL=.FALSE.
NJROPT=1
LBSENS=.FALSE.

LIDMODEL=.FALSE.
L3DFGAT=.FALSE.

L_GUESS_RUNTIME=.TRUE.
NITER_GUESS_RUNTIME=10
NFREQ_GUESS_RUNTIME=5
NMEM_GUESS_RUNTIME =10

L_OPENMP_CV=.FALSE.
LSPINT=.FALSE.
L_ABS_CONVERGENCE=.FALSE.
L_INFO_CONVERGENCE=.FALSE.
LCONGRAD=.TRUE.
LN1CG1=.FALSE.
N1IMP=5
ZEPSNEG=1.E-8_JPRB
NPRECO=0
NBFGSB=2
NSELECT=1
LAMV_REASSIGN_PASSIVE = .FALSE.
LREO3_BCOR = .FALSE.
LCH4_BCOR = .FALSE.
LPROPTL = .FALSE.
LCO2=.FALSE.
LCO2ANER=.FALSE.
LCLDSINK=.TRUE.
CTOPBGE=3.0
CAMTBGE=0.01


LBACKGE=.FALSE.
LFEMARSF=.FALSE.
LFEMARSD=.FALSE.

!     1.2 Modify default values according to LECMWF

IF (LECMWF) THEN
  NGRATS(0)=1
  NGRATS(1)=1
  IF (NCONF==131 .AND. NSTOP>1) THEN
    LTRAJGP   = .TRUE.
    LJCDFI    = .TRUE.
    LUSEJCDFI = .TRUE.
    LJC       = .FALSE.
    LJCNMI    = .FALSE.
    LJCNMTL   = .FALSE.
    LUSEJCNMI = .FALSE.
  ENDIF
  ALPHAG=100.
  IF (NCONF==401 .OR. NCONF==501 .OR. NCONF==601) THEN
    LTRAJGP   = .TRUE.
  ENDIF
  L_OPENMP_CV=.TRUE.
  LSPINT=.TRUE.
  L_INFO_CONVERGENCE=.TRUE.
  RCVGE=0.03
  NITER_MIN=10
ENDIF

!      ----------------------------------------------------------------

!*       2.    Modifies default values.
!              ------------------------

CALL POSNAM(NULNAM,'NAMVAR')
READ(NULNAM,NAMVAR)

CALL POSNAM(NULNAM,'NAMVRTL')
READ(NULNAM,NAMVRTL)

CALL POSNAM(NULNAM,'NAMSENS')
READ(NULNAM,NAMSENS)

CALL POSNAM(NULNAM,'NAMVFP')
READ(NULNAM,NAMVFP)

!      ----------------------------------------------------------------

IF(.NOT.LJCNMI.AND..NOT.LJCNMTL) THEN
  LJC=.FALSE.
ENDIF

!*       2.1   Make sure AN diagnostics switches don't interfere
!*             with other configurations.
IF (NCONF/100 /= 1) THEN
  NFRANA=1
  DO J=0,JPNRFT
    NANATS(J)=0
  ENDDO
  NFRGRA=1
  DO J=0,JPNRFT
    NGRATS(J)=0
  ENDDO
ENDIF

!*       2.2   Sensitivity configurations 8xx
IF (NCONF/100 == 8) THEN
  NFRGRA=1
  NGRATS(0)=0
  IF(LBSENS) LBACKG=.TRUE.
ENDIF
IF (LTEST) THEN
  WRITE(KULOUT,'('' SUVAR: LTEST = T => LREFINC = F'')')
  LREFINC=.FALSE.
ENDIF

!*       2.3   Forecast sensitivity to observations
IF (LECMWF .AND. LFCOBS) THEN
  WRITE(KULOUT,'('' SUVAR: LECMWF and LFCOBS => LREFINC = T'')')
  LREFINC=.TRUE.
ENDIF

!*       2.4   Check obviously wrong namelist variables

!     check: OBSTL requires L131TL
IF (LOBSTL .AND. .NOT.L131TL) CALL ABOR1 ('LOBSTL requires L131TL')

!     check: standard use of forecast sensitivity to observations at ECMWF
IF (LECMWF .AND. LFCOBS .AND. (.NOT.LREFINC)) THEN
  CALL ABOR1(' LECMWF=T and LFCOBS requires LREFINC=T.')
ENDIF

!*    check: LAVCGL requires config 131
IF (LAVCGL .AND. NCONF /= 131) CALL ABOR1 ('LAVCGL requires config 131')

!*    check: NUPTRA must be specified in the namelist for security
IF ( (LOBSC1.OR.(NCONF==131)) .AND. (NUPTRA==99999) )&
 & CALL ABOR1('NUPTRA must be specified in NAMVAR (e.g.-1)')  
IF ( (LOBSC1.OR.(NCONF==131)) .AND. (NUPTRA>MUPTRA) )&
 & CALL ABOR1('NUPTRA must be smaller or equal to MUPTRA')  

!*    check: LBGOBS and LBGM require randomisation
IF(LBGOBS .AND. NBGVECS == 0)&
 & CALL ABOR1('LBGOBS requires randomisation, but NBGVECS=0')  
IF(LBGM .AND. NBGVECS == 0)&
 & CALL ABOR1('LBGM requires randomisation, but NBGVECS=0')  

!*    check: LN1CG1 and LCONGRAD mutually exclusive
IF (LN1CG1 .AND. LCONGRAD) &
 & CALL ABOR1('LN1CG1 and LCONGRAD are mutually exclusive')  

!*    check: all components needed to make 4D-Var reproducible
LSLADREP = LSLADREP .OR. LREPRO4DVAR
LTOVSREP = LTOVSREP .OR. LREPRO4DVAR

!*    check: LAEOLUSL2BP requires LAEOLUSAMD
IF (LAEOLUSL2BP .AND. (.NOT.LAEOLUSAMD) ) &
 & CALL ABOR1 ('LAEOLUSL2BP requires LAEOLUSAMD')

IF (L_ABS_CONVERGENCE .AND. L_INFO_CONVERGENCE) &
 & CALL ABOR1 ('L_ABS_CONVERGENCE and L_INFO_CONVERGENCE mutually exclusive')

IF (L_INFO_CONVERGENCE .AND..NOT. LCONGRAD) &
 & CALL ABOR1 ('L_INFO_CONVERGENCE requires LCONGRAD')

IF (LAVCGL .AND..NOT. LCONGRAD) &
 & CALL ABOR1 ('LAVCGL requires LCONGRAD')

!*       2.5   Setups

IF (LJCDFI) CALL SUDFI

LFDBERR = LAVCGL.AND.LECMWF.AND.LFDBOP

IF (LAVARC) THEN
! check: LAVARC requires L131TL
  IF (.NOT.L131TL) THEN
    CALL ABOR1('LAVARC requires L131TL true')
  ENDIF
  CALL SUHCP(KULOUT)
! check: LAVARC requires the correction times to be specified
  IF (NHECP(0)==0) THEN
    CALL ABOR1('LAVARC and correction times NHECP inconsistent')
  ENDIF
ELSE
  NHECP(:)=0
ENDIF

IF (.NOT.LTRAJHR) THEN
  LTRAJHR_ALTI=.FALSE.
  LTRAJHR_SURF=.FALSE.
ENDIF
IF(LTRAJHR .AND. LECMWF) THEN
  LTRAJHR_ALTI=.TRUE.
  LTRAJHR_SURF=.TRUE.
ENDIF  
!      -----------------------------------------------------------

!*       3.    Print final values.
!              -------------------

WRITE(KULOUT,'('' COMMON YOMVAR '')')
WRITE(KULOUT,'('' LTEST = '',L2 &
 & ,'' LTRREF = '',L2,'' LZOWA = '',L2 &
 & ,'' LWREINI = '',L2)')&
 & LTEST,LTRREF,LZOWA,LWREINI  
WRITE(KULOUT,'('' LJC = '',L2,'' LJCNMI = '',L2 &
 & ,'' LJCDFI = '',L2,'' LUSEJCDFI = '',L2,'' LUSEJCNMI = '',L2 &
 & ,'' LJCNMTL= '',L2,'' ALPHAG = '',E13.7,'' ALPHAV = '',E13.7,/&
 & ,'' LGRASCAL = '',L2,'' LAVCGL = '',L2,/&
 & ,'' LWRISIGB= '',L2,'' LWRISIGA= '',L2,'' LWRISIGF= '',L2,/&
 & ,'' LWRIBVEC= '',L2,'' LREABVEC= '',L2,'' LWRIEVEC= '',L2,'' LMPCGL= '',L2,/&
 & ,'' LN1CG1= '',L2)')&
 & LJC,LJCNMI,LJCDFI,LUSEJCDFI,LUSEJCNMI,LJCNMTL,ALPHAG,ALPHAV,&
 & LGRASCAL,LAVCGL,LWRISIGB,LWRISIGA,LWRISIGF,LWRIBVEC,LREABVEC,LWRIEVEC,&
 & LMPCGL,LN1CG1  
WRITE(KULOUT,*)'N_DIAGS_CONVERGENCE, N_DIAGS_EIGENVECS=', &
              & N_DIAGS_CONVERGENCE, N_DIAGS_EIGENVECS
WRITE(KULOUT,'('' LAVARC = '',L2)') LAVARC
WRITE(KULOUT,'('' NITER  = '',I6,'' NSIMU  = '',I6 &
 & ,'' NITER_MIN = '',I6 &
 & ,'' NINFRA = '',I6,'' RCVGE  = '',E13.7 &
 & ,'' NMIMP  = '',I6 &
 & ,'' N1IMP = '',I6,'' NSELECT = '',I6,'' NPRECO = '',I6 &
 & ,'' NBFGSB = '',I6,'' ZEPSNEG = '',E13.7 &
 & ,'' NSIM4D = '',I6,'' NDIAG = '',I6,'' NSIM4DL = '',I6)')&
 & NITER ,NSIMU ,NITER_MIN,NINFRA,RCVGE,NMIMP,N1IMP,&
 & NSELECT,NPRECO,NBFGSB,ZEPSNEG,&
 & NSIM4D,NDIAG,NSIM4DL  
WRITE(KULOUT,'('' RDX  = '',E13.7,'' RXMIN = '',E13.7)')RDX,RXMIN
WRITE(KULOUT,'('' NFRREF = '',I6,'' NFRANA = '',I6 &
 & ,'' NFRGRA = '',I6)')&
 & NFRREF,NFRANA,NFRGRA  
WRITE(KULOUT,*)' NREFTS = ',NREFTS(0),(NREFTS(J),J=1,ABS(NREFTS(0)))
WRITE(KULOUT,*)' NANATS = ',NANATS(0),(NANATS(J),J=1,ABS(NANATS(0)))
WRITE(KULOUT,*)' NGRATS = ',NGRATS(0),(NGRATS(J),J=1,ABS(NGRATS(0)))
WRITE(KULOUT,'('' NUPTRA = '',I6,'' MUPTRA = '',I6,'' NBGVECS= '',I6 &
 & ,'' LBGTRUNC= '',L2,'' NBGTRUNC= '',I6 &
 & ,'' LBGOBS= '',L2,'' LBGM= '',L2,'' LANOBS= '',L2)')&
 & NUPTRA,MUPTRA,NBGVECS,LBGTRUNC,NBGTRUNC,LBGOBS,LBGM,LANOBS  
WRITE(KULOUT,*) ' LTOVSCV=',LTOVSCV,' LTSCV=',LTSCV
WRITE(KULOUT,*) ' LCO2=',LCO2
WRITE(KULOUT,*) ' LCO2ANER=',LCO2ANER
WRITE(KULOUT,*) ' L_ABS_CONVERGENCE = ',L_ABS_CONVERGENCE
WRITE(KULOUT,*) ' L_INFO_CONVERGENCE = ',L_INFO_CONVERGENCE
WRITE(KULOUT,*) ' L_CHECK_CONVERGENCE = ',L_CHECK_CONVERGENCE
WRITE(KULOUT,*) ' R_NORM_REDUCTION_ABORT_LEVEL = ',&
 & R_NORM_REDUCTION_ABORT_LEVEL  
WRITE(KULOUT,*)' FILTERFACTOR = ',FILTERFACTOR, 'FILTEREXPO = ',FILTEREXPO, &
 &             ' FILTERRESOL = ',FILTERRESOL
WRITE(KULOUT,'('' LTRAJHR= '',L2,'' LTRAJGP= '',L2)') LTRAJHR,LTRAJGP
WRITE(KULOUT,'('' LTRAJHR_ALTI= '',L2)') LTRAJHR_ALTI
WRITE(KULOUT,'('' LTRAJHR_SURF= '',L2)') LTRAJHR_SURF
WRITE(KULOUT,'('' LREADGPTRAJ= '',L2)') LREADGPTRAJ
WRITE(KULOUT,'('' LINITCV= '',L2,'' LMODERR= '',L2,'' N_COUPLED_WINDOWS = '',I6)') &
 & LINITCV,LMODERR,N_COUPLED_WINDOWS
WRITE(KULOUT,'('' LVARBC= '',L2)') LVARBC
WRITE(KULOUT,'('' LAEOLUSAMD= '',L2,'' LAEOLUSL2BP= '',L2)')&
 & LAEOLUSAMD, LAEOLUSL2BP
WRITE(KULOUT,'('' LSTATMERR= '',L2)') LSTATMERR
WRITE(KULOUT,'('' LREPRO4DVAR= '',L2,'' LSLADREP= '',L2,'' LTOVSREP= '',L2)')&
 & LREPRO4DVAR, LSLADREP, LTOVSREP  
WRITE(KULOUT,'('' LSKIPMIN= '',L2)') LSKIPMIN
WRITE(KULOUT,'('' LFCOBS= '',L2,'' LFCOBSTEST= '',L2)') LFCOBS, LFCOBSTEST
WRITE(KULOUT,'('' LREFINC= '',L2)') LREFINC

WRITE(KULOUT,'('' COMMON YOMSENS'')')
WRITE(KULOUT,'('' LMINI = '',L2)')LMINI
WRITE(KULOUT,'('' LGRVOL = '',L2,'' NJROPT = '',I6)') LGRVOL,NJROPT
WRITE(KULOUT,'('' LBSENS = '',L2)')LBSENS

WRITE(KULOUT,'('' COMMON YOMVRTL '')')
WRITE(KULOUT,*) 'L131TL=',L131TL,' L801TL=',L801TL,' LOBSTL=',LOBSTL
WRITE(KULOUT,*) 'LDRYTL=',LDRYTL
WRITE(KULOUT,*) 'LINCV=',LINCV,' LINCVDBG=',LINCVDBG,&
 & 'RINCVLIM=',RINCVLIM,' RINCVSLOP=',RINCVSLOP  

WRITE(KULOUT,'('' COMMON YOMVFP '')')
WRITE(KULOUT,'('' LSPINT = '',L2)') LSPINT
WRITE(KULOUT,*) 'LPROPTL=',LPROPTL
WRITE(KULOUT,*) 'LBACKGE=',LBACKGE
WRITE(KULOUT,*) 'LFEMARSF=',LFEMARSF
WRITE(KULOUT,*) 'LFEMARSD=',LFEMARSD
!     ------------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('SUVAR',1,ZHOOK_HANDLE)
END SUBROUTINE SUVAR
