MODULE YOECLDP

USE PARKIND1  ,ONLY : JPIM     ,JPRB

IMPLICIT NONE

SAVE

!     -----------------------------------------------------------------
!     ** YOECLDP - CONTROL PARAMETERS FOR PROGNOSTIC CLOUD SCHEME
!     -----------------------------------------------------------------

!     * E.C.M.W.F. PHYSICS PACKAGE *

!     C. JAKOB        E.C.M.W.F.          94/02/07
!     A. Tompkins     E.C.M.W.F.        2004/12/03 total water variance setup for
!                                                  moist advection-diffusion PBL
!     A. Tompkins     E.C.M.W.F.        2004/09/02 Aerosol in microphysics switches 

!      NAME     TYPE      PURPOSE
!      ----     ----      -------

!     *RAMID*   REAL      BASE VALUE FOR CALCULATION OF RELATIVE 
!                         HUMIDITY THRESHOLD FOR ONSET OF STRATIFORM
!                         CONDENSATION (TIEDTKE, 1993, EQUATION 24)
!     *RCLDIFF* REAL      DIFFUSION-COEFFICIENT FOR EVAPORATION BY
!                         TURBULENT MIXING (IBID., EQU. 30)
!     *RCLCRIT* REAL      BASE VALUE OF CRITICAL CLOUD WATER CONTENT 
!                         FOR CONVERSION TO RAIN (SUNDQUIST, 1988)
!     *RKCONV*  REAL      BASE VALUE FOR CONVERSION COEFFICIENT (IBID.)
!     *RPRC1*   REAL      COALESCENCE CONSTANT (IBID.)
!     *RPRC2*   REAL      BERGERON-FINDEISEN CONSTANT (IBID.)
!     *RCLDMAX* REAL      MAXIMUM CLOUD WATER CONTENT
!     *RPECONS* REAL      EVAPORATION CONSTANT AFTER KESSLER 
!                         (TIEDTKE, 1993, EQU.35)
!     *RPRECRHMAX* REAL   MAX THRESHOLD RH FOR EVAPORATION FOR ZERO COVER
!     *RTAUMEL* REAL      RELAXATION TIME FOR MELTING OF SNOW
!     *RAMIN*   REAL      LIMIT FOR A
!     *RLMIN*   REAL      LIMIT FOR L
!     *RKOOPTAU*  REAL    TIMESCALE FOR ICE SUPERSATURATION REMOVAL
!     *RVICE*     REAL    FIXED ICE FALLSPEED
!     *RVRAIN*    REAL    FIXED RAIN FALLSPEED
!     *RVSNOW*    REAL    FIXED SNOW FALLSPEED
!     *RTHOMO*    REAL    TEMPERATURE THRESHOLD FOR SPONTANEOUS FREEZING OF LIQUID DROPLETS
!     *RCOVPMIN*  REAL    MINIMUM PRECIPITATION COVERAGE REQUIRED FOR THE NEW PROGNOSTIC PRECIP
!     *RCLDTOPP*  REAL    TOP PRESSURE FOR CLOUD CALCULATION
!     *NCLDTOP*   INTEGER TOP LEVEL FOR CLOUD CALCULATION
!     *NSSOPT*  INTEGER   PARAMETRIZATION CHOICE FOR SUPERSATURATION
!     *NCLDDIAG*INTEGER   CONTROLS CLOUDSC DIAGNOSTICS IN PEXTRA
!     *NCLV*     INTEGER   NUMBER OF PROGNOSTIC EQUATIONS IN CLOUDSC 
!                         (INCLUDES WATER VAPOUR AS DUMMY VARIABLE) 
!      NAERCLD         INT  INDEX TO CONTROL SWITCHES FOR 
!                           AEROSOL-MICROPHYSICS INTERACTION, LAER*
!      RCCN            REAL DEFAULT CCN (CM-3)
!      RNICE           REAL DEFAULT ICE NUMBER CONCENTRATION (CM-3)
!      LAERLIQAUTOLSP  LOG  AEROSOLS AFFECT RAIN AUTOCONVERSION IN LSP
!      LAERLIQAUTOCP   LOG  AEROSOLS AFFECT RAIN AUTOCONVERSION IN CP
!      LAERLIQCOLL     LOG  AEROSOLS AFFECT RAIN COLLECTION 
!      LAERICESED      LOG  AEROSOLS AFFECT ICE SEDIMENTATION
!      LAERICEAUTO     LOG  AEROSOLS AFFECT ICE AUTOCONVERSION
!      NCLOUDACT       INT  CHOICE OF CLOUD ACTIVATION SCHEME
!      NACTPDF         INT  NUMBER OF SAMPLES OF GAUSSIAN PDF OF SUBGRID SCALE
!                           UPDRAFT VELOCITY FOR NCLOUDACT=2 OR 3
!      RCDNCOM          REAL CONSTANT IN MENON PARAM FOR ORGANIC MATTER -> CDNC
!      RCDNCSS          REAL CONSTANT IN MENON PARAM SEA SALT -> CDNC
!      RCDNCSU          REAL CONSTANT IN MENON PARAM FOR SULPHATE -> CDNC

REAL(KIND=JPRB) :: RAMID
REAL(KIND=JPRB) :: RCLDIFF
REAL(KIND=JPRB) :: RCLDIFFC
REAL(KIND=JPRB) :: RCLCRIT
REAL(KIND=JPRB) :: RKCONV
REAL(KIND=JPRB) :: RPRC1
REAL(KIND=JPRB) :: RPRC2
REAL(KIND=JPRB) :: RCLDMAX
REAL(KIND=JPRB) :: RPECONS
REAL(KIND=JPRB) :: RPRECRHMAX
REAL(KIND=JPRB) :: RTAUMEL
REAL(KIND=JPRB) :: RAMIN
REAL(KIND=JPRB) :: RLMIN
REAL(KIND=JPRB) :: RKOOPTAU
REAL(KIND=JPRB) :: RCLDTOPP
REAL(KIND=JPRB) :: RLCRITSNOW
REAL(KIND=JPRB) :: RSNOWLIN1
REAL(KIND=JPRB) :: RSNOWLIN2
REAL(KIND=JPRB) :: RICEHI1
REAL(KIND=JPRB) :: RICEHI2
REAL(KIND=JPRB) :: RICEINIT
REAL(KIND=JPRB) :: RVICE
REAL(KIND=JPRB) :: RVRAIN
REAL(KIND=JPRB) :: RVSNOW
REAL(KIND=JPRB) :: RTHOMO
REAL(KIND=JPRB) :: RCOVPMIN
REAL(KIND=JPRB) :: RCCN
REAL(KIND=JPRB) :: RNICE
!>>dod renamed from RCCN...
REAL(KIND=JPRB) :: RCDNCOM
REAL(KIND=JPRB) :: RCDNCSS
REAL(KIND=JPRB) :: RCDNCSU
!<<dod

LOGICAL :: LCLDEXTRA, LCLDBUDGET

INTEGER(KIND=JPIM) :: NSSOPT
INTEGER(KIND=JPIM) :: NCLDTOP
INTEGER(KIND=JPIM) :: NCLDDIAG
INTEGER(KIND=JPIM),PARAMETER :: NCLV=5      ! number of microphysics variables
INTEGER(KIND=JPIM),PARAMETER :: NCLDQL=1    ! liquid cloud water
INTEGER(KIND=JPIM),PARAMETER :: NCLDQI=2    ! ice cloud water
INTEGER(KIND=JPIM),PARAMETER :: NCLDQR=3    ! rain water
INTEGER(KIND=JPIM),PARAMETER :: NCLDQS=4    ! snow
INTEGER(KIND=JPIM),PARAMETER :: NCLDQV=5    ! vapour

! aerosols
INTEGER(KIND=JPIM) :: NAERCLD
LOGICAL :: LAERLIQAUTOLSP
LOGICAL :: LAERLIQAUTOCP
LOGICAL :: LAERLIQAUTOCPB
LOGICAL :: LAERLIQCOLL
LOGICAL :: LAERICESED
LOGICAL :: LAERICEAUTO

!>>dod
! cloud activation parameterization:
INTEGER(KIND=JPIM) :: NCLOUDACT
INTEGER(KIND=JPIM) :: NACTPDF

! possible values (0=prescribed CDNC):
INTEGER(KIND=JPIM), PARAMETER :: JP_ACT_MENON = 1
INTEGER(KIND=JPIM), PARAMETER :: JP_ACT_ABDULRAZZAK_GHAN = 2
INTEGER(KIND=JPIM), PARAMETER :: JP_ACT_FOUNTOUKIS_NENES = 3

! density of liquid water [kg m-3] 
REAL(KIND=JPRB), PARAMETER, PUBLIC :: PPRHO_WAT = 1000.0_JPRB  

! cloud to rain critical radius (autoconversion)
! used in cloud microphysics (NCLOUDACT > 0 and NAERCLD/bit0 = 1)
REAL(KIND=JPRB), PUBLIC :: RLCRIT_UPHYS 

! density of cloud ice [kg m-3] 
REAL(KIND=JPRB), PARAMETER, PUBLIC :: PPRHO_ICE = 900.0_JPRB  

! ice to snow critical radius (autoconversion)
REAL(KIND=JPRB), PARAMETER, PUBLIC :: PPRICE_CRIT = 60.0E-6_JPRB     

! output of diagnostics via PEXTRA
LOGICAL, PUBLIC :: LACI_DIAG
!<<dod

! variance arrays
REAL(KIND=JPRB) :: NSHAPEP
REAL(KIND=JPRB) :: NSHAPEQ
INTEGER(KIND=JPIM) :: NBETA
REAL(KIND=JPRB) :: RBETA(0:100)
REAL(KIND=JPRB) :: RBETAP1(0:100)
END MODULE YOECLDP
