SUBROUTINE SU0PHY1S(KULOUT)

USE PARKIND1  ,ONLY : JPIM     ,JPRB

USE YOMLUN1S , ONLY : NULNAM
USE YOEPHY   , ONLY : LERADS   ,LESICE   ,LESURF   ,LEVDIF ,RTHRFRTI,&
     &                LEVGEN   ,LESSRO   ,LESN09,&
     &                LE4ALB   ,LEOCWA   ,LEOCCO  ,LEOCSA ,LEOCLA, &
     &                LEFLAKE  ,LEOCML   ,LELAIV  ,LECTESSEL, LEAGS, RLAIINT, &
     &                LECLIM10D,LESNML   ,LEINTWIND
USE YOMLOG1S , ONLY : LWRLKE

#ifdef DOC

!**** *SU0PHY*   - Initialize common YOxPHY controlling physics

!     Purpose.
!     --------
!           Initialize YOxPHY, the common that includes the
!           basic switches for the physics of the model.

!**   Interface.
!     ----------
!        *CALL* *SU0PHY(KULOUT) from SU0YOM1S

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

!        Implicit arguments :
!        --------------------
!        COMMON YOMPHY, YOEPHY

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

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

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

!        or

!        Documentation ARPEGE (depending on which physics will be used)

!     Author.
!     -------
!        J.-J. Morcrette                    *ECMWF*
!        J.-F. Geleyn for the ARPEGE rewriting.

!     Modifications.
!     --------------
!        Original : 91-11-12
!        Modified 92-02-22 by M. Deque (tests of consistency with *YOMDPHY*)
!        Modified by R. EL Khatib : 93-04-02 Set-up defaults controled by LECMWF
!        Modified 94-02-28 by M.  Deque  : Shallow convection clouds
!        Modified 93-10-28 by Ph. Dandin : FMR scheme with MF physics
!        Modified 93-08-24 by D. Giard (test of consistency with digital filter)
!        Modified by M. Hamrud    : 93-06-05 Make use of LECMWF for ECMWF
!        Modified 95-06-24 by Jean-Francois Mahfouf for 1D surface scheme only
!        Modified 95-03-30 by D. Giard (test of consistency NDPSFI,LTWOTL)
!        Modified 95-11-27 by M. Deque (2nd call to APLPAR)
!        Modified by F. Rabier    : 96-09-25 Full physics set-up for 801 job

!        P. Viterbo   ECMWF   03-12-2004  Include user-defined RTHRFRTI
!        Y. Takaya    ECMWF   07-10-2008  Implement ocean mixed layer model
!        E. Dutra             16-11-2009  snow 2009 cleaning
!        S. Boussetta/G.Balsamo May 2010  Include CTESSEL switch LECTESSEL
!        G.Balsamo/S. Boussetta June 2011 Include switch LEAGS (for modularity CO2&Evap)
!     ------------------------------------------------------------------
#endif

IMPLICIT NONE
INTEGER(KIND=JPIM) :: KULOUT

#include "namphy1s.h"
!     ------------------------------------------------------------------

!*       1.    Set default values.
!              -------------------

LERADS=.TRUE.
LESICE=.TRUE.
LESURF=.TRUE.
LEVDIF=.TRUE.
LEVGEN=.TRUE.
LESSRO=.TRUE.
LESN09=.TRUE.
LE4ALB=.FALSE. 
LEOCWA=.FALSE. 
LEOCCO=.FALSE. 
LEOCSA=.FALSE.
LEOCLA=.FALSE.
LEFLAKE=.FALSE. 
LEOCML=.FALSE. 
LELAIV=.FALSE.
LECTESSEL=.FALSE.
LEAGS=.FALSE.
LECLIM10D=.FALSE.
LESNML=.FALSE.
RLAIINT=0.0_JPRB
RTHRFRTI=0.0_JPRB
LEINTWIND=.FALSE.
!     ------------------------------------------------------------------


!*       2.    Print final values.
!              -------------------

REWIND(NULNAM)
READ(NULNAM,NAMPHY)

WRITE(UNIT=KULOUT,FMT='('' COMMON YOEPHY '')')
WRITE(UNIT=KULOUT,FMT='('' LERADS = '',L5 &
     &     ,'' LESURF = '',L5,'' LEVDIF = '',L5 &
     &     ,'' LESICEF = '',L5 &
     &     )') &
     & LERADS,LESURF,LEVDIF,LESICE
WRITE(UNIT=KULOUT,FMT='('' LEVGEN = '',L5 &
      &     ,'' LESSRO  = '',L5 )') LEVGEN,LESSRO 
WRITE(UNIT=KULOUT,FMT='('' LEFLAKE = '',L5)') LEFLAKE  
WRITE(UNIT=KULOUT,FMT='('' LEOCML = '',L5)') LEOCML 
WRITE(UNIT=KULOUT,FMT='('' LESN09 = '',L5)') LESN09
WRITE(UNIT=KULOUT,FMT='('' LESNML = '',L5)') LESNML
WRITE(UNIT=KULOUT,FMT='('' LELAIV = '',L5)') LELAIV
WRITE(UNIT=KULOUT,FMT='('' LECTESSEL = '',L5)') LECTESSEL
WRITE(UNIT=KULOUT,FMT='('' LEAGS = '',L5)') LEAGS
WRITE(UNIT=KULOUT,FMT='('' LECLIM10D = '',L5)') LECLIM10D
WRITE(UNIT=KULOUT,FMT='('' RLAIINT = '',f4.2)') RLAIINT

!     ------------------------------------------------------------------
IF ( .NOT. LEFLAKE ) THEN
  IF ( LWRLKE ) THEN
    WRITE(UNIT=KULOUT,FMT='('' LEFLAKE AND LWRLKE INCOMPAT! - CHANGING LWRLKE TO FALSE '')')
    LWRLKE=.FALSE.
  ENDIF
ENDIF

RETURN
END SUBROUTINE SU0PHY1S
