!options xopt(noeval)
subroutine suhloption(kulout)

!**** *suhloption* 

!     PURPOSE
!     --------

!       INITIALIZE  YHLOPTION

!**   INTERFACE
!     ---------
!       *CALL* *SUHLOPTION(KULOUT)

!     EXPLICIT ARGUMENTS :
!     --------------------
!       KULOUT : LOGICAL UNIT FOR THE OUTPUT

!     IMPLICIT ARGUMENTS :
!     --------------------
!       YHLOPTION

!     METHOD
!     ------
!       IRRELEVANT

!     EXTERNAL:
!     ---------
!       NONE. 

!     REFERENCE
!     ---------
!         -

!     AUTHOR.
!     -------
!      BENT H. SASS
!      ORIGINAL : 01/09 2005

!     ------------------------------------------------------------------
use parkind1  ,only : jpim    ,jprb
use yomhook   ,only : lhook   ,dr_hook
use yomlun    ,only : nulnam
use yhloption ,only : lhl, lhlorig, lhltend, hlprt, jscheme, hloption 
use yomphy    ,only : LPHSPSH

implicit none

integer(kind=jpim),intent(in)    :: kulout 
integer(kind=jpim)               :: jlev

real(kind=jprb)                  :: zhook_handle

#include "posnam.intfb.h"
#include "namhlopt.h"
#include "abor1.intfb.h"
!     ------------------------------------------------------------------

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

!        1.1   SET IMPLICIT DEFAULT VALUES

if (lhook) call dr_hook('suhloption',0,zhook_handle)

lhl     = .false.
lhlorig = .false. 
lhltend = .false. 
hlprt   = 0_jpim

do jlev=1,jscheme
  hloption(jlev)=-1
enddo


! -----------------------------------------------------------
!*       2.    Modify default values.
!              ----------------------

call posnam(nulnam,'NAMHLOPT')
read(nulnam,NAMHLOPT)
! -----------------------------------------------------------

!*       3.    Print final values.
!              -------------------
if( hlprt > 0_jpim) then

  write (unit=kulout,fmt='('' yhloption '')')
  write (unit=kulout,fmt='('' lhl =     '',L2  )') lhl
  write (unit=kulout,fmt='('' lhlorig = '',L2  )') lhlorig
  write (unit=kulout,fmt='('' lhltend = '',L2  )') lhltend
  write (unit=kulout,fmt='('' hlprt =   '',i3 )')  hlprt

  do jlev=1,jscheme
    write (unit=kulout,fmt='('' hloption(jlev)= '', i3 )') &
    & hloption(jlev) 
  enddo

endif
! --------------------------------------------------------------   
!*       4.    control
!              -------

!   INFORMATION ON PROCESSES:

!   PROCES 1: RADIATION
!   ------------------------------------------------------------
!   HLOPTION(1)  <0 ( Radiative processes switched off     )
!   HLOPTION(1)  =0 ( A HIRLAM radiation scheme not used)   
!   HLOPTION(1)  =1 ( Default HIRLAM radiation scheme used )

!   PROCES 2: CONDENSATION AND CONVECTION AND PRECIPITATION  
!   ------------------------------------------------------------ 
!   HLOPTION(2) <0 ( Condensation and convection switched off)
!   HLOPTION(2) =0 ( HIRLAM condens. and precip. not used )
!   HLOPTION(2) =1 ( STRACO scheme with all procesess used )
!   HLOPTION(2) =2 ( HIRLAM version of Tiedtke convection +
!                    Sundqvist stratiform scheme )
!   HLOPTION(2) =3 ( HIRLAM version of Tiedtke convection + 
!                    Rasch-Kristjansson stratiform part )
!   HLOPTION(2) =4 ( HIRLAM version of Kain-Fritsch convection +
!                    Rasch-Kristjansson stratiform part ) 
!   HLOPTION(2) =5 ( STRACO scheme without deep convection )

!   PROCES 3: TURBULENCE
!   ------------------------------------------------------------
!   HLOPTION(3) <0 ( Turbulence processes switched off )
!   HLOPTION(3) =0 ( HIRLAM turbulence scheme not used )
!   HLOPTION(3) =1 ( Holtslag scheme )
!   HLOPTION(3) =2 ( HIRLAM 'dry' version of CBR scheme )
!   HLOPTION(3) =3 ( HIRLAM 'moist' vesrion of CBR scheme )

!   PROCES 4: SURFACE PARAMETERIZATION SCHEME 
!             (currently no scheme implemented) 
!   -------------------------------------------------------
!   HLOPTION(4) =0 ( HIRLAM surface scheme not used )
!   -------------------------------------------------------
    WRITE(KULOUT,*) ' ================================= '
    WRITE(KULOUT,*) ' HIRLAM PHYSICS SCHEME DIAGNOSTICS '  
    WRITE(KULOUT,*) ' ================================= '

!   PRINT WARNING IF THE TENDENCY SWITCH IS TRUE (LHLTEND =TRUE)
!   WHILE ONE OF THE HIRLAM PROCESSES (RADIATION, TURBULENCE 
!   OR CONDENSATION/CONVECTION) IS NOT SWITCHED ON. THIS 
!   IMPLIES IN THE PRESENT IMPLEMENTATION THAT THE FULL HIRLAM  
!   PHYSICS TENDENCIES ARE NOT ACCUMULATED IN SUBROUTINE
!   HL_CPTEND. 

    IF( (LHLTEND).AND.((HLOPTION(1) <= 0).OR.(HLOPTION(1) > 1) ) ) &
 & WRITE(KULOUT,*) ' WARNING: HLOPTION(1) should be 1 if LHLTEND=T '
    IF( (LHLTEND).AND.((HLOPTION(2) <= 0).OR.(HLOPTION(2) > 5) ) ) &
 & WRITE(KULOUT,*) ' WARNING: HLOPTION(2) has illegal value since LHLTEND=T '
    IF( (LHLTEND).AND.((HLOPTION(3) <= 0).OR.(HLOPTION(3) > 3) ) ) &
 & WRITE(KULOUT,*) ' WARNING: HLOPTION(3) has illegal value since LHLTEND=T '

  IF (LPHSPSH .AND. LHLTEND) THEN
    ! * LPHSPSH requires flux interface.
    WRITE(KULOUT,'(1X,A)') ' SUHLOPTION: LPHSPSH requires flux interface '
    CALL ABOR1('SUHLOPTION: LPHSPSH requires flux interface')
  ENDIF

IF( HLPRT > 1 ) THEN 
! ====================================================================
  IF( HLOPTION(1) < 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 1 '
    WRITE(KULOUT,*) ' RADIATION PROCESS NOT SWITCHED ON '
  ENDIF
  IF( HLOPTION(1) == 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 1 '
    WRITE(KULOUT,*) ' RUN WILL USE A NON-HIRLAM RADIATION SCHEME IF POSSIBLE '
  ENDIF
  IF( HLOPTION(1) == 1_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 1 '
    WRITE(KULOUT,*) ' RUN WILL USE HIRLAM RADIATION SCHEME IF POSSIBLE '
  ENDIF
  IF( HLOPTION(1) > 1_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 1 '
    WRITE(KULOUT,*) ' CHOSEN HIRLAM SCHEME SPECIFICATION NOT SUPPORTED'
  ENDIF
! ----------------------------------------------------------------
  IF( HLOPTION(2) < 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' CONDENSATION AND CONVECTION PROCESSES SWITCHED OFF '
  ENDIF
  IF( HLOPTION(2) == 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' RUN WILL USE A NON-HIRLAM CONDENSATION SCHEME '
  ENDIF
  IF( HLOPTION(2) == 1_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' RUN WILL USE FULL HIRLAM STRACO SCHEME IF POSSIBLE '
  ENDIF
  IF( HLOPTION(2) == 2_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' HIRLAM Tiedke + HS SCHEME CURRENTLY NOT SUPPORTED '
  ENDIF
  IF( HLOPTION(2) == 3_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' HIRLAM Tiedtke + RK SCHEME CURRENTLY NOT SUPPORTED '
  ENDIF
  IF( HLOPTION(2) == 4_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' HIRLAM KF + RK SCHEME CURRENTLY NOT SUPPORTED '
  ENDIF
  IF( HLOPTION(2) == 5_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' HIRLAM STRACO WITHOUT DEEP CONV. WILL BE USED '
  ENDIF
  IF( HLOPTION(2) > 5_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 2'
    WRITE(KULOUT,*) ' CHOSEN HIRLAM SCHEME SPECIFICATION NOT SUPPORTED '
  ENDIF
! --------------------------------------------------------------- 
  IF( HLOPTION(3) < 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' TURBULENCE PROCESS SWITCHED OFF '
  ENDIF
  IF( HLOPTION(3) == 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' A NON-HIRLAM TURBULENCE SCHEME IS USED'
  ENDIF
  IF( HLOPTION(3) == 1_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' HIRLAM Holtslag SCHEME CURRENTLY NOT SUPPORTED '
  ENDIF
  IF( HLOPTION(3) == 2_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' HIRLAM DRY CBR SCHEME WILL BE USED IF POSSIBLE '
  ENDIF
  IF( HLOPTION(3) == 3_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' HIRLAM MOIST CBR SCHEME WILL BE USED IF POSSIBLE '
  ENDIF
  IF( HLOPTION(3) > 3_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 3'
    WRITE(KULOUT,*) ' CHOSEN HIRLAM SCHEME SPECIFICATION NOT SUPPORTED '
  ENDIF
! ----------------------------------------------------------------
  IF( HLOPTION(4) > 0_JPIM ) THEN
    WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = 4'
    WRITE(KULOUT,*) ' CHOSEN HIRLAM SCHEME SPECIFICATION NOT SUPPORTED '
  ENDIF 
! ----------------------------------------------------------------
  DO JLEV=5,JSCHEME

    IF( HLOPTION(JLEV) > 0_JPIM ) THEN
      WRITE(KULOUT,*) ' HIRLAM PHYSICS PROCES NUMBER = ', JLEV
      WRITE(KULOUT,*) ' CHOSEN HIRLAM SCHEME SPECIFICATION NOT SUPPORTED '
    ENDIF

  ENDDO
! -----
ENDIF 
! ================================================================ 
if(lhook) call dr_hook('suhloption',1,zhook_handle)
end subroutine suhloption
