MODULE YOMXFU

USE PARKIND1  ,ONLY : JPIM

USE TYPE_FLUXES, ONLY : fluxes_descriptor

IMPLICIT NONE

SAVE

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

!*    CONTROLS INSTANTANEOUS FLUXES

! LXFU = .F.     ===> EVERYTHING SWITCH OFF
! LREAXFU= .T.   ===> READ FIRST INPUT ON HISTORY FILE

! LXTRD  = .T.   ===> GRAVITY WAVE DRAG MOMENTUM FLUX
! LTXTRD  = .T.       => AT ALL LEVELS
! LXTRC  = .T.   ===> CONVECTIVE  Q,CPT,MOMENTUM FLUXES
! LTXTRC  = .T.       => AT ALL LEVELS
! LXTRT  = .T.   ===> TURBULENT   Q,CPT,MOMENTUM FLUXES
! LTXTRT  = .T.       => AT ALL LEVELS
! LXPLC  = .T.   ===> CONVECTIVE PRECIP
! LXPLCG  = .T.   ===> CONVECTIVE PRECIP as GRAUPEL
! LXPLCH  = .T.   ===> CONVECTIVE PRECIP as HAIL
! LXPLS  = .T.   ===> STRATIFORM PRECIP
! LXPLSG  = .T.   ===> STRATIFORM PRECIP as GRAUPEL
! LXPLSH  = .T.   ===> STRATIFORM PRECIP as HAIL
! LXR    = .T.   ===> RADIATION FLUXES
! LTXR    = .T.       => AT ALL LEVELS
! LTXNEB  = .T.   ===> CLOUDINESS AT ALL LEVELS
! LTXQICE = .T.   ===> TOTAL ICE WATER CONTENT AT ALL LEVELS
! LTXQLI  = .T.   ===> TOTAL LIQUID WATER CONTENT AT ALL LEVELS
! LXNEBTT= .T.   ===> TOTAL CLOUDINESS
! LXNEBPA= .T.   ===> PARTIAL CLOUDINESS
! LXCLS  = .T.   ===> U,V,T,Q,RH AT 2 OR 10 M HEIGHT (TIME T-DT)
! LXSOIL = .T.   ===> SOIL FLUXES
! LXICV = .T.    ===> INDEXES OF CONVECTION (CAPE & MOCON)
! LXCLP = .T.    ===> Height (in meters) of PBL
! LXTGST = .T.   ===> Gusts as U & V
! LXTTCLS = .T.  ===> Extreme temperatures at 2 meters
! LXHHCLS = .T.  ===> Extreme relative moistures at 2 meters
! LXQCLS = .T.   ===> Specific moisture at 2 meters
! LXTHW = .T.    ==> Theta'w' surface flux

! NFRXFU  : FREQUENCY OF WRITE UP OF FLUX DIAGNOSTICS
! NXFUTS  : ARRAY CONTAINING INSTANTANEOUS FLUX WRITE-UP STEPS
! NFRRAZ  : FREQUENCY OF RESET OF FLUX DIAGNOSTICS
! NRAZTS  : ARRAY CONTAINING INSTANTANEOUS FLUX RESET STEPS
! N1RAZ   : OVER-RIDING SWITCH FOR INSTANTANEOUS FLUX RESET (0=FALSE)
!     SEE YOMCT0 FOR EXPLANATION

! LRESET =.T.   ====> RESET AT THIS STEP (EXTREME TEMP. AND MOIST.)

INTEGER(KIND=JPIM), PARAMETER :: JPFUXT=240
INTEGER(KIND=JPIM), PARAMETER :: JPMXXFU=199

TYPE(fluxes_descriptor) :: TYPE_XFU(JPMXXFU)

INTEGER(KIND=JPIM) :: NTYPXFU
INTEGER(KIND=JPIM) :: NXFUTS(0:JPFUXT)
INTEGER(KIND=JPIM) :: NFRXFU
INTEGER(KIND=JPIM) :: NRAZTS(0:JPFUXT)
INTEGER(KIND=JPIM) :: NFRRAZ
INTEGER(KIND=JPIM) :: N1RAZ
INTEGER(KIND=JPIM) :: NFDXFU
LOGICAL :: LXFU
LOGICAL :: LRESET
LOGICAL :: LREAXFU
LOGICAL :: LXTRD
LOGICAL :: LXTRC
LOGICAL :: LXTRT
LOGICAL :: LXPLC
LOGICAL :: LXPLCG
LOGICAL :: LXPLCH
LOGICAL :: LXPLS
LOGICAL :: LXPLSG
LOGICAL :: LXPLSH
LOGICAL :: LXR
LOGICAL :: LXNEBTT
LOGICAL :: LXNEBPA
LOGICAL :: LXCLS
LOGICAL :: LXTTCLS
LOGICAL :: LXHHCLS
LOGICAL :: LXSOIL
LOGICAL :: LTXTRD
LOGICAL :: LTXTRC
LOGICAL :: LTXTRT
LOGICAL :: LTXR
LOGICAL :: LTXNEB
LOGICAL :: LTXQICE
LOGICAL :: LTXQLI
LOGICAL :: LXICV
LOGICAL :: LXCLP
LOGICAL :: LXTGST
LOGICAL :: LXQCLS
LOGICAL :: LXTHW

!     ------------------------------------------------------------
END MODULE YOMXFU
