! **  WELCOME TO THE ENVIRONMENTAL FLUID DYNAMICS COMPUTER CODE ORIGINALLY  
! **  DEVELOPED BY JOHN M. HAMRICK.  THE EFDC CODE WAS INITIALLY  
! **  DEVELOPED AT VIRGINIA INSTITUTE OF MARINE SCIENCE,  
! **  SCHOOL OF MARINE SCIENCE, THE COLLEGE OF  
! **  WILLIAM AND MARY, GLOUCESTER POINT, VA 23062.  
! **  
! **  THIS VERSION OF THE CODE IS THE RESULT OF UPGRADES AND STREAMLINING
! **  BY DYNAMIC SOLUTIONS-INTERNATIONAL, LLC.
! **     EDMONDS, WA, USA  /  HANOI, VIETNAM
! **  
! **  THIS CODE HAS BEEN COMPLIED ON A WINDOWS SYSTEM USING INTEL'S FORTRAN COMPILER     
! **        
! **  THIS VERSION PROVIDES AUTOMATIC MEMORY ALLOCATION USING F90'S
! **  DYNAMIC MEMORY ALLOCATION FUNCTIONS         

  
MODULE GLOBAL

  !----------------------------------------------------------------------!  
  ! CHANGE RECORD  
  ! DATE MODIFIED     BY               DESCRIPTION
  !----------------------------------------------------------------------!
  !    2015-06       PAUL M. CRAIG     IMPLEMENTED SIGMA-Z (SGZ) IN EE 

  INTEGER(4),PARAMETER :: RKD  = 8                 !REAL(RKD):    THIS ALWAYS DOUBLE PRECISION
  INTEGER(4),PARAMETER :: RK4  = 4                 !REAL(RK4):    THIS ALWAYS REAL*4
  INTEGER(4),PARAMETER :: IK8  = 8                 !INTEGER(IK8): THIS ALWAYS INTEGER*8
  INTEGER(4),PARAMETER :: IKV  = 4                 !INTEGER: DEPRECATED - USE COMPILER DATA DEFAULTS TO SPECIFY DEFAULT PRECISION
  INTEGER(4),PARAMETER :: IK4  = 4                 !INTEGER(4): THIS ALWAYS INTEGER*4
  
  INTEGER(4),PARAMETER :: ULOC = 301               !OPEN UNIT FOR LAGRA.INP
  INTEGER(4),PARAMETER :: ULGR = 302               !OPEN UNIT FOR LAGRA.OUT
  INTEGER(4),PARAMETER :: UCOR = 303               !OPEN UNIT FOR CORNRES.INP
  INTEGER(4),PARAMETER :: WUNI = 304
  INTEGER(4),PARAMETER :: UGRP = 305
  INTEGER(4),PARAMETER :: UTBL = 306
  INTEGER(4),PARAMETER :: UINP = 307
  INTEGER(4),PARAMETER :: UOUT = 308

  INTEGER(4),PARAMETER :: NTSWQVM=23               !NTSWQVM CHANGED FROM 22 TO 23 TO ACCOMODATE CO2
  
  TYPE CELL
    INTEGER, ALLOCATABLE :: ICEL(:),JCEL(:)
    REAL(RKD),    ALLOCATABLE :: XCEL(:)                 
    REAL(RKD),    ALLOCATABLE :: YCEL(:)  
  END TYPE
  
  TYPE TSR
    INTEGER :: NREC               
    REAL,ALLOCATABLE :: VAL(:,:)  
    REAL,ALLOCATABLE :: TIM(:)    
  END TYPE

  TYPE OPERATIONDATA                ! TRIGGER FOR OPERATION OF GATES/PUMPS
    REAL :: LEVEL                   ! TRIGGER LEVEL
    INTEGER :: STATE                ! 0 = OFF, 1 = ON
    INTEGER :: ID                   ! INDEX OF RATING CURVE/MASK FOR CONTROL PARAMETER
    REAL :: HEIGHT                  ! OPENING HEIGHT (M), FOR UPWARD OPENING
    REAL :: WIDTH                   ! OPENING WIDTH (M), FOR SIDEWARD OPENING
    REAL :: SILL                    ! SILL LEVEL CHANGE (M), FOR DOWNWARD OPENING
    REAL :: FLOW                    ! FLOW RATE (M3/S), FOR PUMPS
    INTEGER :: UNITS                ! NUMBER OF GATES, PUMP UNITS
    REAL :: RATE                    ! RATE OF OPENING/CLOSING
  END TYPE

  TYPE CONTROLRULES                 ! OPERATION RULES FOR OF GATES/PUMPS
    INTEGER :: PARAM                ! MASK FOR CONTROL PARAMETERS
    INTEGER :: STATE                ! 0 = OFF, 1 = ON
    INTEGER :: NTRGON,NTROFF  
    TYPE(OPERATIONDATA),ALLOCATABLE :: TRGON(:), TROFF(:)
  END TYPE  
  
  TYPE CONTROLSERIES                ! GATE OPENING TIME-SERIES
    INTEGER :: ITYPE                ! STRUCTURE CONTROL TYPE: 0 = UNCONTROLED, 1=TS, 2=US, 3=HDIFF
    INTEGER :: COUNT                ! # POINTS
    INTEGER :: PARAM                ! MASK FOR CONTROL PARAMETERS
    REAL :: TMUL,TADD
    REAL,ALLOCATABLE :: TIME(:),HEIGHT(:),WIDTH(:),SILL(:),FLOW(:),RATE(:) 
    INTEGER,ALLOCATABLE :: ID(:),NUM(:)   ! NUMBER OF GATES/PUMP UNITS
  END TYPE
  
  TYPE STRCONTROL                   ! INFO ON THE CONTROL OF HYDRAULIC STRUCTURE
    INTEGER :: ITYPE                ! STRUCTURE CONTROL TYPE: 0 = UNCONTROLED, 1=TS, 2=US, 3=HDIFF
    INTEGER :: ID                   ! ID OF ASSOCIATED CONTROL DATA
    INTEGER :: IQCTL1,JQCTL1        ! 1ST REF. CELL, ALLOWS REF. CELL BE DIFFERENT FROM US. CELL
    INTEGER :: IQCTL2,JQCTL2        ! 2ND REF. CELL, ALLOWS REF. CELL BE DIFFERENT FROM DS. CELL
    INTEGER :: SUBID                ! SUB INDEX OF ASSOCIATED CONTROL DATA
    REAL(RKD) :: TSTART, TOPEN
    TYPE(OPERATIONDATA) :: CUR,LIM  ! INITIAL CONDITION (CURRENT VALUE) & LIMIT
    REAL :: PREV                    ! PREVIOUS CONTROL LEVEL
  END TYPE  

  TYPE WAVE
    REAL :: TWX                ! *** BED SHEAR STRESS BY WAVE X  (M2/S2)
    REAL :: TWY                ! *** BED SHEAR STRESS BY WAVE Y  (M2/S2)
    REAL(RKD) :: K             ! *** ANGULAR WAVE NUMBER         (RAD/M)
    REAL(RKD) :: KHP           ! *** ANGULAR WAVE NUMBER*DEPTH     (RAD)
    REAL(RKD) :: UDEL          ! *** ORBITAL VELOCITY              (M/S)
    REAL(RKD) :: LENGTH        ! *** WAVE LENGTH                     (M)
    REAL(RKD) :: HEIGHT        ! *** WAVE HEIGHT, APPLIED            (M)
    REAL(RKD) :: HEISIG        ! *** WAVE HEIGHT, SIGNIFICANT        (M)
    REAL(RKD) :: DIR           ! *** WAVE DIRECTION (RADIANS) COUNTER-CLOCKWISE (CELL-EAST AXIS,WAVE)
    REAL(RKD) :: FREQ          ! *** WAVE FREQUENCY              (1/SEC) 
    REAL(RKD) :: PERIOD        ! *** WAVE PERIOD                   (SEC)
    REAL(RKD), ALLOCATABLE :: DISSIPA(:)    ! *** WAVE DISSIPATION              (SEC)
  END TYPE WAVE
  
  REAL(RKD), PARAMETER :: WLMIN = 0.01
  REAL(RKD), PARAMETER :: WLMAX = 300
  REAL(RKD), PARAMETER :: EPS = 0.001
  REAL(RKD), PARAMETER :: QQMAX = 0.2       ! *** MAXIMUM TURBULENT INTENSITY 20% (I=u'/U)
  REAL(RKD), PARAMETER :: WHMI = 1D-3       ! *** MINIMUM WAVE HEIGHT
  REAL(RKD)            :: SHLIM             ! *** MINIMUM WAVE NUMBER*DEPTH

  CHARACTER*50 AGRFN
  CHARACTER*50 BENFN
  CHARACTER*12 FNDBDH
  CHARACTER*12 FNDDYE
  CHARACTER*12 FNDSAL
  CHARACTER*12 FNDSDB
  CHARACTER*12 FNDSDW
  CHARACTER*12 FNDSEL
  CHARACTER*12 FNDSNB
  CHARACTER*12 FNDSNW
  CHARACTER*12 FNDTEM
  CHARACTER*12 FNDUUU
  CHARACTER*12 FNDVVV
  CHARACTER*12 FNDWWW
  CHARACTER*50 ICIFN
  CHARACTER*50 NCOFN
  CHARACTER*50 NPLFN
  CHARACTER*50 PSLFN
  CHARACTER*50 RSTOFN
  CHARACTER*50 STLFN
  CHARACTER*50 SUNFN
  CHARACTER*8  OUTDIR
  CHARACTER*100 RUNTITLE
  !
  CHARACTER*20 CCTITLE(100)
  CHARACTER*20 CVTITLE(100)
  CHARACTER*3  WQTSNAME(NTSWQVM)
  !
  CHARACTER*20,ALLOCATABLE,DIMENSION(:) :: CLSL
  CHARACTER*20,ALLOCATABLE,DIMENSION(:) :: CLTMSR
  CHARACTER* 5,ALLOCATABLE,DIMENSION(:) :: SYMBOL
  
  LOGICAL ISCURVATURE
  LOGICAL DEBUG
  LOGICAL COMPUTESOLRAD
  LOGICAL USESHADE
  LOGICAL LDAYLIGHT
  
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LMASKDRY          ! *** LMASKDRY=TRUE CELL IS WET.  CONTROLS ACTIVE CELL OPERATIONS
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: OLDMASK  
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: SMHYST
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LWVMASK           ! *** MASK TO DETERMINE IF WAVE CALCUATIONS ARE ON/OFF FOR EACH CELL
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LOPENBCDRY        ! *** FLAG TO DETERMINE IF PSER IS BELOW CELL BOTTOM
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LSVHTWINDE        ! *** FLAG TO DETERMINE WIND HEAT EXCHANGE COEFFICIENTS ARE BEING USED - EVAPORATION
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LSVHTWINDC        ! *** FLAG TO DETERMINE WIND HEAT EXCHANGE COEFFICIENTS ARE BEING USED - CONDUCTION 
  
  INTEGER(IK8) :: N                                     ! *** GLOBAL COUNTER OF INTERATIONS BASED ON DT 
  INTEGER(IK8) :: NRESTART                              ! *** GLOBAL COUNTER OF INTERATIONS AT THE TIME OF WRITING THE RESTART FILE
  INTEGER(IK8) :: NITER                                 ! *** GLOBAL COUNTER OF ACTUAL INTERATIONS
  INTEGER(IK8) :: NTS                                   ! *** GLOBAL COUNTER OF MAXIMUM INTERATIONS BASED ON DT
  INTEGER(IK8) :: NDISP

  INTEGER :: I3DMAX
  INTEGER :: I3DMIN
  INTEGER :: I3DRW
  INTEGER :: IADJDMP
  INTEGER :: IALSTUP
  INTEGER :: IALTYP
  INTEGER :: IASWRAD
  INTEGER :: IATMP
  INTEGER :: IAUXICM
  INTEGER :: IBEDBDNU
  INTEGER :: IBEDDDNU
  INTEGER :: IBEDINTP
  INTEGER :: IBEDLAYU
  INTEGER :: IBEDMNX
  INTEGER :: IBEDV
  INTEGER :: IBMECH
  INTEGER :: IBMECHD
  INTEGER :: IBMECHK
  INTEGER :: IBSC
  INTEGER :: IC
  INTEGER :: ICICM1
  INTEGER :: ICICM2
  INTEGER :: ICICM3
  INTEGER :: ICICM4
  INTEGER :: ICICM5
  INTEGER :: ICK2COR
  INTEGER :: ICM
  INTEGER :: ICRCA1
  INTEGER :: ICRCA2
  INTEGER :: ICRCA3
  INTEGER :: ICRCA4
  INTEGER :: ICRCA5
  INTEGER :: ICSHOW
  INTEGER :: IDNOTRVA
  INTEGER :: IDRYCK    ! *** Not Used
  INTEGER :: IDRYTBP
  INTEGER :: IG
  INTEGER :: IGM
  INTEGER :: IHYDOUT
  INTEGER :: IINTPG
  INTEGER :: ILRPD1    ! *** Not Used
  INTEGER :: ILRPD2    ! *** Not Used
  INTEGER :: IMORPH
  INTEGER :: INITTEMP
  INTEGER :: INSMICI
  INTEGER :: INSMRST
  INTEGER :: INWQAGR
  INTEGER :: INWQBEN
  INTEGER :: INWQICI
  INTEGER :: INWQNPL
  INTEGER :: INWQPSL
  INTEGER :: INWQRST
  INTEGER :: INWQSTL
  INTEGER :: INWQSUN
  INTEGER :: IPLRPD    ! *** Not Used
  INTEGER :: IPPHXY
  INTEGER :: IQOPT
  INTEGER :: IRECL
  INTEGER :: IRVEC
  INTEGER :: ITRICELL
  INTEGER :: IS2LMC
  INTEGER :: IS2TIM
  INTEGER :: IS2TL
  INTEGER :: IS3DDYE
  INTEGER :: IS3DO
  INTEGER :: IS3DSAL
  INTEGER :: IS3DSED
  INTEGER :: IS3DSND
  INTEGER :: IS3DTEM
  INTEGER :: IS3DTOX
  INTEGER :: IS3DUUU
  INTEGER :: IS3DVVV
  INTEGER :: IS3DWWW
  INTEGER :: ISADMP
  INTEGER :: ISAVBMX
  INTEGER :: ISSQL
  INTEGER :: ISAVEC
  INTEGER :: ISBAL
  INTEGER :: ISBDLDBC
  INTEGER :: ISBEDSTR
  INTEGER :: ISBEXP
  INTEGER :: ISBLFUC
  INTEGER :: ISBODYF
  INTEGER :: ISBSDFUF
  INTEGER :: ISCDMA
  INTEGER :: ISCFL
  INTEGER :: ISCFLM
  INTEGER :: ISCHAN
  INTEGER :: ISCLO
  INTEGER :: ISCOMP
  INTEGER :: ISCORTBC
  INTEGER :: ISCORTBCD
  INTEGER :: ISCORV
  INTEGER :: ISCOSMIC
  INTEGER :: ISDCCA
  INTEGER :: ISDHD
  INTEGER :: ISDIA
  INTEGER :: ISDICM
  INTEGER :: ISDIQ
  INTEGER :: ISDISP
  INTEGER :: ISDIUDIA
  INTEGER :: ISDIURDO
  INTEGER :: ISDIVEX
  INTEGER :: ISDMPP
  INTEGER :: ISDMPT
  INTEGER :: ISDMPU
  INTEGER :: ISDMPW
  INTEGER :: ISDRY
  INTEGER :: ISDRYD
  INTEGER :: ISDSOLV
  INTEGER :: ISDTXBUG
  INTEGER :: ISDUMP
  INTEGER :: ISDYNSTP
  INTEGER :: ISDZBR
  INTEGER :: ISECSPV
  INTEGER :: ISECVPV
  INTEGER :: ISEDAL
  INTEGER :: ISEDBED
  INTEGER :: ISEDBINT
  INTEGER :: ISEDEFF
  INTEGER :: ISEDINT
  INTEGER :: ISEDVW
  INTEGER :: ISEDWC
  INTEGER :: IHMDSUB
  INTEGER :: ISFAVB
  INTEGER :: ISFDCH
  INTEGER :: ISFIRST
  INTEGER :: ISGWIE
  INTEGER :: ISGWIT
  INTEGER :: ISHDMF
  INTEGER :: ISHELTERVARY
  INTEGER :: ISHOW
  INTEGER :: ISHPRT
  INTEGER :: ISHTA
  INTEGER :: ISIA
  INTEGER :: ISICM
  INTEGER :: ISINWV
  INTEGER :: ISITB
  INTEGER :: ISLOG
  INTEGER :: ISLRPD   ! *** Not Used
  INTEGER :: ISLSHA
  INTEGER :: ISLSTR
  INTEGER :: ISLTMT
  INTEGER :: ISLTMTS
  INTEGER :: ISMASK
  INTEGER :: ISMHYST
  INTEGER :: ISMICI
  INTEGER :: ISMMC
  INTEGER :: ISMORST
  INTEGER :: ISMOZB
  INTEGER :: ISMRST
  INTEGER :: ISMTS
  INTEGER :: ISMTSB
  INTEGER :: ISMTSDT
  INTEGER :: ISMTSE
  INTEGER :: ISMUD
  INTEGER :: ISMZ
  INTEGER :: ISMZB
  INTEGER :: ISNDAL
  INTEGER :: ISNDVW
  INTEGER :: ISNDWC
  INTEGER :: ISNEGH
  INTEGER :: ISNKH
  INTEGER :: ISPAR
  INTEGER :: ISPCOR
  INTEGER :: ISPD
  INTEGER :: ISPERC
  INTEGER :: ISCONNECT
  INTEGER :: ISPNHYDS
  INTEGER :: ISPPH
  INTEGER :: ISQQ
  INTEGER :: ISR3DO
  INTEGER :: ISRCA
  INTEGER :: ISRESTI
  INTEGER :: ISRESTIOPT
  INTEGER :: ISRESTO
  INTEGER :: ISRESTR
  INTEGER :: ISRLID
  INTEGER :: ISRPPH
  INTEGER :: ISRVPH
  INTEGER :: ISRVPV
  INTEGER :: ISSBAL
  INTEGER :: ISSDBIN
  INTEGER :: ISSED2DT
  INTEGER :: ISSFLDN
  INTEGER :: ISSFLFE
  INTEGER :: ISSSMMT
  INTEGER :: ISTDOCB
  INTEGER :: ISTDOCW
  INTEGER :: ISTICM
  INTEGER :: ISTL
  INTEGER :: ISTMSR
  INTEGER :: ISTPOCB
  INTEGER :: ISTPOCW
  INTEGER :: ISTRANACTIVE
  INTEGER :: ISVEG
  INTEGER :: ISVEGL
  INTEGER :: ISVHEAT 
  INTEGER :: ISVPH
  INTEGER :: ISVPV
  INTEGER :: ISWASP
  INTEGER :: ISWASP1
  INTEGER :: ISWASPD
  INTEGER :: ISWAVE
  INTEGER :: ISWCBL
  INTEGER :: ISWQAVG
  INTEGER :: ISWQCMAP
  INTEGER :: ISWQLVL
  INTEGER :: ISWQMAX
  INTEGER :: ISWQMIN
  INTEGER :: ISWQSMAP
  INTEGER :: ISWRSI
  INTEGER :: ISWRSR
  INTEGER :: ISWVSD
  INTEGER :: ISWQFLUX
  INTEGER :: ITER
  INTEGER :: ITERHPM
  INTEGER :: ITERM
  INTEGER :: ITNWQ
  INTEGER :: NRAMPUP
  INTEGER :: NUPSTEP
  INTEGER :: ITRMAX
  INTEGER :: ITRMIA
  INTEGER :: ITRMIN
  INTEGER :: ITWCBL1
  INTEGER :: ITWCBL2
  INTEGER :: ITWCBL3
  INTEGER :: ITWCBL4
  INTEGER :: ITWCBL5
  INTEGER :: IUSEWVCELLS
  INTEGER :: IVOPT
  INTEGER :: IVPHXY
  INTEGER :: IWDRAG 
  INTEGER :: IWQAGR
  INTEGER :: IWQBEN
  INTEGER :: IWQDIUDT
  INTEGER :: IWQFCB
  INTEGER :: IWQICI
  INTEGER :: IWQM
  INTEGER :: IWQNC
  INTEGER :: IWQNPL
  INTEGER :: IWQONC
  INTEGER :: IWQORST
  INTEGER :: IWQPS
  INTEGER :: IWQPSL
  INTEGER :: IWQRST
  INTEGER :: IWQSI
  INTEGER :: IWQSRP
  INTEGER :: IWQSTL
  INTEGER :: IWQSTOX
  INTEGER :: IWQSUN
  INTEGER :: IWQTS
  INTEGER :: IWQTSB
  INTEGER :: IWQTSDT
  INTEGER :: IWQTSE
  INTEGER :: IWQVLIM
  INTEGER :: IWQZ
  INTEGER :: J3DMAX
  INTEGER :: J3DMIN
  INTEGER :: JC
  INTEGER :: JCM
  INTEGER :: JCSHOW
  INTEGER :: JG
  INTEGER :: JGM
  INTEGER :: JLRPD1   ! *** Not Used
  INTEGER :: JLRPD2   ! *** Not Used
  INTEGER :: JS3DDYE
  INTEGER :: JS3DSAL
  INTEGER :: JS3DSED
  INTEGER :: JS3DSND
  INTEGER :: JS3DTEM
  INTEGER :: JS3DTOX
  INTEGER :: JS3DUUU
  INTEGER :: JS3DVVV
  INTEGER :: JS3DWWW
  INTEGER :: JSBAL
  INTEGER :: JSBALE
  INTEGER :: JSBALO
  INTEGER :: JSBPH
  INTEGER :: JSBPHA
  INTEGER :: JSDUMP
  INTEGER :: JSHYDOUT
  INTEGER :: JSICM
  INTEGER :: JSLRPD
  INTEGER :: JSLSHA
  INTEGER :: JSPPH
  INTEGER :: JSRCA
  INTEGER :: JSRESTR
  INTEGER :: JSRPPH
  INTEGER :: JSRVPH
  INTEGER :: JSRVPV
  INTEGER :: JSSBAL
  INTEGER :: JSTBXY
  INTEGER :: JSTMSR
  INTEGER :: JSVPH
  INTEGER :: JSVPV
  INTEGER :: JSVSFP
  INTEGER :: JSWASP
  INTEGER :: JSWAVE
  INTEGER :: JSSWAVE
  INTEGER :: JSWRPH
  INTEGER :: KB
  INTEGER :: KBB         ! *** BOTTOM LAYER (ORIGINAL:KBB=1, SEDZLJ:KBB=KB)
  INTEGER :: KBH         ! *** NOT USED, BUT MAINTAINED FOR GVC
  INTEGER :: KBM
  INTEGER :: KC
  INTEGER :: KCM
  INTEGER :: KGM
  INTEGER :: KPC
  INTEGER :: KPCM
  INTEGER :: KS
  INTEGER :: KSM
  INTEGER :: L1LOC
  INTEGER :: L2LOC
  INTEGER :: L3LOC
  INTEGER :: L4LOC
  INTEGER :: LA
  INTEGER :: LALT
  INTEGER :: LB
  INTEGER :: LC
  INTEGER :: LCLT
  INTEGER :: LCM
  INTEGER :: LCMWQ
  INTEGER :: LDM
  INTEGER :: LDMWQ
  INTEGER :: LMINSTEP
  INTEGER :: LORMAX
  INTEGER :: LR
  INTEGER :: LSLSHA
  INTEGER :: LVC
  INTEGER :: LWASP
  INTEGER :: MAXRECL
  INTEGER :: MAXRECL0
  INTEGER :: MAXRECL2
  INTEGER :: MAXRECL3
  INTEGER :: MAXRECL4
  INTEGER :: MDCHCK
  INTEGER :: MDCHH
  INTEGER :: MDCHHD
  INTEGER :: MDCHHD2
  INTEGER :: MDCHHQ
  INTEGER :: MDCHIL
  INTEGER :: MDCHITM
  INTEGER :: MDVSM
  INTEGER :: MGM
  INTEGER :: MLLSHA
  INTEGER :: MLM
  INTEGER :: MLRAVG
  INTEGER :: MLRPDRT   ! *** Not Used
  INTEGER :: MLTMSR
  INTEGER :: MLTMSRM
  INTEGER :: NPMXPTSM
  INTEGER :: NPMXZM
  INTEGER :: MSFSER
  INTEGER :: MSFTLST
  INTEGER :: MTIDE
  INTEGER :: MTM
  INTEGER :: MTSSTSPM
  INTEGER :: MTVSM
  INTEGER :: MVEGOW
  INTEGER :: MVEGTYP
  INTEGER :: NASER
  INTEGER :: NASERM
  INTEGER :: NATD
  INTEGER :: NAZD
  INTEGER :: NBAL
  INTEGER :: NBALE
  INTEGER :: NBALO
  INTEGER :: NBAN
  INTEGER :: NBBEM
  INTEGER :: NBBNM
  INTEGER :: NBBSM
  INTEGER :: NBBWM
  INTEGER :: NBC
  INTEGER :: NBDYNSTP
  INTEGER :: NBTMSR
  INTEGER :: NBUD
  INTEGER :: NBVSFP
  INTEGER :: NC
  INTEGER :: NC3DO
  INTEGER :: NCALL3D
  INTEGER :: NCBE
  INTEGER :: NCBN
  INTEGER :: NCBS
  INTEGER :: NCBW
  INTEGER :: NCDUMP
  INTEGER :: NCHANM
  INTEGER :: NCHYDOUT
  INTEGER :: NCICM
  INTEGER :: NCICM1
  INTEGER :: NCICM2
  INTEGER :: NCICM3
  INTEGER :: NCICM4
  INTEGER :: NCICM5
  INTEGER :: NCLSHA
  INTEGER :: NCPD
  INTEGER :: NCPPH
  INTEGER :: NCRCA1
  INTEGER :: NCRCA2
  INTEGER :: NCRCA3
  INTEGER :: NCRCA4
  INTEGER :: NCRCA5
  INTEGER :: NCSERM
  INTEGER :: NCTBC
  INTEGER :: NCTMSR
  INTEGER :: NCVPH
  INTEGER :: NCVPV
  INTEGER :: NDASER
  INTEGER :: NDCSER
  INTEGER :: NDDAM
  INTEGER :: NDDOAVG
  INTEGER :: NDDOCNT
  INTEGER :: NDGWSER
  INTEGER :: NDLTAVG
  INTEGER :: NDLTCNT
  INTEGER :: NDM
  INTEGER :: NDMWQ
  INTEGER :: NDOCNT
  INTEGER :: NDPSER
  INTEGER :: NDQCLT
  INTEGER :: NDQCLT2
  INTEGER :: NDQSER
  INTEGER :: NDQWRSR
  INTEGER :: NDRYSTP
  INTEGER :: NDVEGSER
  INTEGER :: NDWQCSR
  INTEGER :: NDWQPSR
  INTEGER :: NFDCHZ
  INTEGER :: NFICM
  INTEGER :: NFIELD
  INTEGER :: NFLTMT
  INTEGER :: NGLM
  INTEGER :: NGWSER
  INTEGER :: NGWSERM
  INTEGER :: NHAR
  INTEGER :: NINCRMT
  INTEGER :: NINTFL
  INTEGER :: NITERAT
  INTEGER :: NJPSM
  INTEGER :: NJUNX
  INTEGER :: NJUNXM
  INTEGER :: NJUNY
  INTEGER :: NJUNYM
  INTEGER :: NLCDA
  INTEGER :: NLDAM
  INTEGER :: NLRPD
  INTEGER :: NLTC
  INTEGER :: NLTS
  INTEGER :: NMMT
  INTEGER :: NMNLO
  INTEGER :: NBCSOP
  INTEGER :: NBCSOP2
  INTEGER :: NBCS
  INTEGER :: NP3DO
  INTEGER :: NPBE
  INTEGER :: NPBEM
  INTEGER :: NPBN
  INTEGER :: NPBNM
  INTEGER :: NPBS
  INTEGER :: NPBSM
  INTEGER :: NPBW
  INTEGER :: NPBWM
  INTEGER :: NPD
  INTEGER :: NPDM
  INTEGER :: NPDRT   ! *** Not Used
  INTEGER :: NPEWBP
  INTEGER :: NPFORM
  INTEGER :: NPFORT
  INTEGER :: NPNSBP
  INTEGER :: NPPPH
  INTEGER :: NPRINT
  INTEGER :: NPSER
  INTEGER :: NPSERM
  INTEGER :: NPSTMSR
  INTEGER :: NPVPH
  INTEGER :: NPVPV
  INTEGER :: NQCTLM
  INTEGER :: NQCTL
  INTEGER :: NQCTLT
  INTEGER :: NQCTTM
  INTEGER :: NQIJ
  INTEGER :: NQINFLM
  INTEGER :: NQJPIJ
  INTEGER :: NQJPM
  INTEGER :: NQSER
  INTEGER :: NQSERM
  INTEGER :: NQSIJ
  INTEGER :: NQSIJM
  INTEGER :: NQWR
  INTEGER :: NQWRM
  INTEGER :: NQWRSR
  INTEGER :: NQWRSRM
  INTEGER :: NR0
  INTEGER :: NR1
  INTEGER :: NR2
  INTEGER :: NR3
  INTEGER :: NR4
  INTEGER :: NR5
  INTEGER :: NR6
  INTEGER :: NRC
  INTEGER :: NRCAL3D
  INTEGER :: NREC
  INTEGER :: NREC0
  INTEGER :: NREC2
  INTEGER :: NREC3
  INTEGER :: NREC4
  INTEGER :: NRFLD
  INTEGER :: NSBDLDBC
  INTEGER :: NSBMAX
  INTEGER :: NSCM
  INTEGER :: NSDUMP
  INTEGER :: NSED
  INTEGER :: NSEDSER
  INTEGER :: NSEDSRF
  INTEGER :: NSEDSRL
  INTEGER :: NSHMAX
  INTEGER :: NSHOWC
  INTEGER :: NSHOWR
  INTEGER :: NSHTYPE
  INTEGER :: NSM
  INTEGER :: NSMG
  INTEGER :: NSMGM
  INTEGER :: NSMTS
  INTEGER :: NSMTSM
  INTEGER :: NSMZ
  INTEGER :: NSMZM
  INTEGER :: NSNAPSHOTS
  INTEGER :: NSND
  INTEGER :: NSNDSER
  INTEGER :: NSNDSRF
  INTEGER :: NSNDSRL
  INTEGER :: NSNM
  INTEGER :: NSTM
  INTEGER :: NSTMSR
  INTEGER :: NSTVM
  INTEGER :: NSVSFP
  INTEGER :: NTC
  INTEGER :: NTCLSHA
  INTEGER :: NTCMMT
  INTEGER :: NTCNB   ! *** Not Used
  INTEGER :: NTCPP   ! *** Not Used
  INTEGER :: NTCVB
  INTEGER :: NTIMER
  INTEGER :: NTOX
  INTEGER :: NTOXSER
  INTEGER :: NTOXSRF
  INTEGER :: NTOXSRL

  INTEGER :: NTSBR
  INTEGER :: NTSM
  INTEGER :: NTSMMT
  INTEGER :: NTSPTC
  INTEGER :: NTSPTC2
  INTEGER :: NTSSMV
  INTEGER :: NTSSMVM
  INTEGER :: NTSSTSP
  INTEGER :: NTSSTSPM
  INTEGER :: NTSTBC
  INTEGER :: NTSVB
  INTEGER :: NTSWQV
  INTEGER :: NTSWV
  INTEGER :: NTTC
  INTEGER :: NTTS
  INTEGER :: NTXM
  INTEGER :: NUBEM
  INTEGER :: NVBSM
  INTEGER :: NVEGCELLS
  INTEGER :: NVEGSER
  INTEGER :: NVEGSERM
  INTEGER :: NVEGTPM
  INTEGER :: IWVCOUNT
  INTEGER :: NWGG
  INTEGER :: NWGGM
  INTEGER :: NWHYDOUT
  INTEGER :: NWPD      ! *** Not Used
  INTEGER :: NWQCNT
  INTEGER :: NWQCSRM
  INTEGER :: NWQOBE
  INTEGER :: NWQOBN
  INTEGER :: NWQOBS
  INTEGER :: NWQOBW
  INTEGER :: NWQPS
  INTEGER :: NWQPSM
  INTEGER :: NWQPSRM
  INTEGER :: NWQTD
  INTEGER :: NWQTDM
  INTEGER :: NWQTS
  INTEGER :: NWQTSM
  INTEGER :: NWQV
  INTEGER :: NWQVM
  INTEGER :: NWQZ
  INTEGER :: NWQZM
  INTEGER :: NWSER
  INTEGER :: NWSERM
  INTEGER :: NWTMSR
  INTEGER :: NWUPDT
  INTEGER :: NWVCELLS
  INTEGER :: NXYSDATM
  
  ! *** Card C1A
  INTEGER :: IGRIDH
  INTEGER :: KMINV
  INTEGER :: IGRIDV
  INTEGER :: ITIMSOL  
  INTEGER :: ISHOUSATONIC
  REAL    :: SGZHPDELTA
  
  ! *** CARD 9A
  INTEGER :: KSIG      ! *** Not Used
  INTEGER :: ISETGVC
  INTEGER :: ISGVCCK
  
  ! *** CARD 12A
  INTEGER :: ISLLIM
  INTEGER :: IFPROX
  INTEGER :: ISVTURB
  REAL :: BC_EDGEFACTOR

  ! *** CARD 36A
  INTEGER :: ISBSDIAM
  INTEGER :: ISBKERO    
  
  ! *** CARD 46A ICE EFFECTS
  INTEGER :: ISICE
  INTEGER :: ISICECOV   ! *** ISICE=1  ICE FUNCTION (NOT USED)
  INTEGER :: NISER      ! *** ISICE=1  NUMBER OF ICE INPUT SERIES
  INTEGER :: ICETHKFUN  ! *** ISICE=3  ICE FUNCTION (NOT USED)
  INTEGER(4) :: ISRHEVAP   ! *** FLAG TO USE RYAN HARLEMAN WIND FUNCTION
  
  REAL ::  AFW           ! *** WIND FUNCTION A   AFW + BFW*WIND2M**CFW (WATER)
  REAL ::  BFW           ! *** WIND FUNCTION B
  REAL ::  CFW           ! *** WIND FUNCTION C
  REAL ::  AFWI          ! *** WIND FUNCTION A   AFW + BFW*WIND2M**CFW (ICE)
  REAL ::  BFWI          ! *** WIND FUNCTION B
  REAL ::  CFWI          ! *** WIND FUNCTION C
  REAL ::  DYICEBEG      ! *** ISICE=2  
  REAL ::  DYICEEND      ! *** ISICE=2  
  REAL ::  DYICEM1       ! *** ISICE=2  
  REAL ::  DYICEM2       ! *** ISICE=2  
  REAL ::  RICETHK0      ! *** ISICE=2  ICE THICKNESS
  REAL ::  TEMPICE       ! *** ISICE=1  TEMPERTURE OF THE ICE
  REAL ::  ICETHMX       ! *** MAXIMUM ICE THICKNESS (M)
  REAL ::  MINICETHICK   ! *** ICE GROWTH MINIMUM TO ALLOW ICE COVER FORMATION (m)
  REAL ::  HWI           ! *** COEFFICIENT OF WATER-ICE HEAT EXCHANGE, W/(M^2 C)
  REAL ::  ICEK          ! *** ICE CONDUCTIVITY, ~2.12 W/M/DEGC
  REAL ::  ALBEDOI       ! *** RATIO OF REFLECTION TO INCIDENT RADIATION (ICE)
  REAL ::  BETAI         ! *** FRACTION OF SOLAR RADIATION ABSORBED IN THE ICE SURFACE
  REAL ::  GAMMAI        ! *** SOLAR RADIATION EXTINCTION COEFFICIENT, 1/m
  REAL ::  CDICE         ! *** DRAG COEFFICIENT FOR ICE
  REAL ::  RHOI          ! *** DENSITY OF ICE (KG/M3)  (DEFAULT = 916.0)
  REAL ::  RISEVEL       ! *** FRAZIL ICE RISE VELOCITY (M/S), TYPICAL VALUES RANGE FROM .003 TO .022 M/S
  REAL ::  MELTFACTOR    ! *** ICE MELT FACTOR.  < 1.0 TO REDUCE THE SPEED OF ICE MELT

  REAL, PARAMETER :: REFL = 0.06    ! *** SHORTWAVE RADIATION RELFECTED OFF SURFACE  

  REAL ::  TOXSTEPW       ! *** TIME STEP FOR TOXIC KINETIC UPDATE            (SECONDS)
  REAL ::  TOXSTEPB       ! *** TIME STEP FOR TOXIC BED DIFFUSION AND MIXING  (SECONDS)
  REAL ::  TOX_DEP_MAX    ! *** VOLATILIZATION: MINIMUM DEPTH FOR LAKE CONDITIONS TO APPLY           (METERS)
  REAL ::  TOX_VEL_MAX    ! *** VOLATILIZATION: MAXIMUM WATER VELOCITY FOR LAKE CONDITIONS TO APPLY  (M/S)
  REAL ::  TOXTEMP        ! *** USER DEFINED CONSTANT TEMPERATURE (DEG C)
  
  LOGICAL :: LFRAZIL      ! *** FLAG IS TRUE OF FRAZIL ICE EXISTS
  LOGICAL :: LCHECKICE    ! *** FLAG TO DETERMINE IF ICE CONDITIONS MAY EXIST
  
  ! *** BANK EROSION
  INTEGER :: NBEPAIR,NBEPAIRM
  INTEGER :: NBESER,NBESERM
  INTEGER :: NDBESER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IBANKBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JBANKBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICHANBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCHANBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NBESERN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MBESER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MBETLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPMXZ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LPMXZ

  REAL,ALLOCATABLE,DIMENSION(:)     :: FBESER
  REAL,ALLOCATABLE,DIMENSION(:)     :: BESERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: FWCBESERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCBESER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TABESER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TBESER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BESER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FWCBESER
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSBDTOPBEBKB
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSBDTOPBECHB
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSBDTOPBECHW
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWBDTOPBEBKB
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWBDTOPBECHB
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWBDTOPBECHW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDFBEBKB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDFBECHB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDFBECHW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDFBEBKB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDFBECHB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDFBECHW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXFBEBKB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXFBECHB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXFBECHW

  INTEGER :: ISADAC(0:10)
  INTEGER :: ISADAH(0:10)
  INTEGER :: ISADAV(0:10)
  INTEGER :: ISCDA(0:10)
  INTEGER :: ISCDCA(0:10)
  INTEGER :: ISCI(0:10)
  INTEGER :: ISCO(0:10)
  INTEGER :: ISFCT(0:10)
  INTEGER :: ISHPLTV(10)
  INTEGER :: ISPHXY(10)
  INTEGER :: ISPLIT(0:10)
  INTEGER :: ISRSPH(10)
  INTEGER :: ISRSPV(10)
  INTEGER :: ISSPH(10)
  INTEGER :: ISSPV(10)
  INTEGER :: ISTOPT(0:10)
  INTEGER :: ISTRAN(0:10)
  INTEGER :: ISTRWQ(NTSWQVM)
  INTEGER :: IWRSP(20)       ! *** SEDZLJ
  INTEGER :: JSRSPH(10)
  INTEGER :: JSRSPV(10)
  INTEGER :: JSSPH(10)
  INTEGER :: JSSPV(10)
  INTEGER :: LWQTS(NTSWQVM)
  INTEGER :: NCSPH(10)
  INTEGER :: NCSPV(10)
  INTEGER :: NIJSPV(10)
  INTEGER :: NIJVPV(10)
  INTEGER :: NPSPH(10)       ! *** NOT USED
  INTEGER :: NPSPV(10)       ! *** NOT USED
  INTEGER :: NWQCSR(NTSWQVM)
  !
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IACTLR
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IAIJ
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IAKL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IAP
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IBENMAP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IBLTAUC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICALJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICCDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICFLMP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ICPSL
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ICSMTS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ICWQTS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IEPEW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IGWSER         ! *** FLAG TO SET TYPE OF GW FLOW TERM.  0-M^3/S,  1-M/S
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IJCT
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IJCTLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ILLSHA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ILLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ILTMSR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMDCHH
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMDCHU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMDCHV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMWQZT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMWQZT1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IMWQZT2
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: INPNS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: INTPSER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IOUTJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IPART
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IPBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IPBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IPBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IPBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQCAX
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQCTLD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQCTLU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQWRD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IQWRU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IRELH
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IROUSE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISBDLD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISCDRY
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISDBLDIR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISDIFBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISDJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISEDBU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISEDSCOR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISEDWU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISENT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISLTAUC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPROBDEP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISMT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISMZMAP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISNDBU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISNDEQ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISNDM1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISNDM2
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISNDWU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISPNS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ISPV
  
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISSBCP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISTJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISTOC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISTOXR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISUDPC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ISWDINT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ITOXBU
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ITOXKIN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ITOXWU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ITPCDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ITXBDUT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: ITXINT
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ITXPARB
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ITXPARBC
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ITXPARW
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: ITXPARWC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IUPCJP
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IVPV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWGG
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWPEW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQCBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQCBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQCBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQCBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQKA
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQOBE
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQOBN
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQOBS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQOBW
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQPSC
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQPSV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWQT
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IWQZMAP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: IWRSPB
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCCDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JCPSL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JEPEW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JLLSHA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JLLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JLTMSR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JMDCHH
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JMDCHU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JMDCHV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JNPNS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JPBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JPBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JPBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JPBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQCAX
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQCTLD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQCTLU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQWRD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JQWRU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JSPNS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: JSPV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JSS3DSED
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JSS3DSND
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JSS3DTOX
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JUPCJP
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: JVPV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWGG
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWPEW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWQCBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWQCBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWQCBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: JWQCBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KBT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KCEFDC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KCPSL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KEFFJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KFEFDC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KPS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KQJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KQWRD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KQWRU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: KUPCJP
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: KUPW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LBERC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LBNRC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LBSRC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LBWRC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCDA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCEFDC
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LCHNC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCONSOL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LCTLT
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LIJ
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LIJLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LJUNX
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LJUNY
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LLBC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LLRC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LLSHA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LMDCHH
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LMDCHU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LMDCHV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LNC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LNCLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LNEC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LNWC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LOBCS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LOBCS2
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LBCS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LEC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LORDER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LPBE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LPBN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LPBS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LPBW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LQCTLD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LQCTLU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LQS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LQWRD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LQWRU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSBLBCD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSBLBCU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSCLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSEC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSHAB
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSHAP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSHAU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSHAUE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSMTS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LSWC
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LUPU
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LUPV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LWC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LWGG
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LWVCELL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MATLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MCNTLR
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: MCSER
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: MCTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MDCHTYP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MFDCHZ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MGWSER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MGWTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MPSER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MPTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MQCTL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MQSER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MQTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MQWRSR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MQWRTLST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MSVSED
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MSVSND
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MSVTOX
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRA
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRQ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRQE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRUE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTMSRUT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTSCUR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MTSSTSP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MVEGL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MVEGSER
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MVEGTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MVPSL
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: MWQCTLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MWQPSR
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MWQPTLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: MWTLAST
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NATDRY
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NCHNC
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NCSER
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERA
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERE
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERJP
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERN
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERQ
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCSERW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NDRY             ! *** NUMBER OF TIME STEPS THE EACH CELL HAS BEEN DRY
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NGWSL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NJEL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NJPMX
  INTEGER(IK8),ALLOCATABLE,DIMENSION(:,:,:) :: NLOE
  INTEGER(IK8),ALLOCATABLE,DIMENSION(:,:,:) :: NLON
  INTEGER(IK8),ALLOCATABLE,DIMENSION(:,:,:) :: NLOS
  INTEGER(IK8),ALLOCATABLE,DIMENSION(:,:,:) :: NLOW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NLRPDRT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPORTJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERE1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERN1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERS1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NPSERW1
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQCMINS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQCMUL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQCTLQ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQCTYP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQSERJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQSERQ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQSMF
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQSMUL
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQWRMFD
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQWRMFU
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQWRSERJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NQWRSERQ
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NSP2
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTSCRE
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTSCRN
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTSCRS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTSCRW
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTSSSS
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NTVSFP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NUDJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NUDJPC
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NUTMP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NVEGSERV
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NXYSDAT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: NZPRJP
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: QCTLGRP
  
  ! ** W-E CONNECTIONS LT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LECLT
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: LWCLT
  !
  REAL :: ABMAX
  REAL :: ABMIN
  REAL :: ABMX
  REAL :: ABO
  REAL :: AC
  REAL :: AC2
  REAL :: ACS
  REAL :: ACS2
  REAL :: AHD
  REAL :: AHO
  REAL :: AMOBEG
  REAL :: AMOBEGE
  REAL :: AMOBEGO
  REAL :: AS
  REAL :: AS2
  REAL :: ASFZERD
  REAL :: AVCON
  REAL :: AVCON1
  REAL :: AVMAX
  REAL :: AVMIN
  REAL :: AVMX
  REAL :: AVO
  REAL :: BBEBEG  
  REAL :: BBEBEGE
  REAL :: BBEBEGO
  REAL :: BBEOUT
  REAL :: BBEOUTE
  REAL :: BBEOUTO
  REAL :: BEDEX
  REAL :: BEDPORC
  REAL :: BELADJ
  REAL :: BELCVRT
  REAL :: BELVMIN
  REAL :: BENDAY
  REAL :: BETAF 
  REAL :: BLBSNT
  REAL :: BMECH1
  REAL :: BMECH2
  REAL :: BMECH3
  REAL :: BMECH4
  REAL :: BMECH5
  REAL :: BMECH6
  REAL :: BSC
  REAL :: BSEDBEG
  REAL :: BSEDEND
  REAL :: BVOLBEG2T  
  REAL :: BVOLOUT
  REAL :: CDLAT1
  REAL :: CDLAT2
  REAL :: CDLAT3
  REAL :: CDLON1
  REAL :: CDLON2
  REAL :: CDLON3
  REAL :: CF
  REAL :: CFCDCWQ
  REAL :: CFCDDWQ
  REAL :: CFCDGWQ
  REAL :: CFMAX
  REAL :: CK2FCX
  REAL :: CK2FCY
  REAL :: CK2UUC
  REAL :: CK2UUM
  REAL :: CK2UVC
  REAL :: CK2UVM
  REAL :: CK2VVC
  REAL :: CK2VVM
  REAL :: COEFTSBL
  REAL :: COEHEFF
  REAL :: COEHEFF2
  REAL :: CONVQ
  REAL :: CONVR
  REAL :: CONVV
  REAL :: CORDT
  REAL :: CSALR
  REAL :: CTE1
  REAL :: CTE2
  REAL :: CTE3
  REAL :: CTE4
  REAL :: CTE5
  REAL :: CTURB
  REAL :: CTURB2
  REAL :: CTURB2B
  REAL :: CTURB3
  REAL :: CVTWHA
  REAL :: DABEDT
  REAL :: DAGWZ
  REAL :: DELT
  REAL :: DELTI
  REAL :: DEPSED
  REAL :: DEXP
  REAL :: DIASED
  REAL :: DMLMIN
  REAL :: DMULT
  REAL :: DSEDGMM
  REAL :: DSFLMNT
  REAL :: DSFLMXT
  REAL :: DS_LAT
  REAL :: DS_LONG
  REAL :: DT
  REAL :: DT2
  REAL :: DTD
  REAL :: DTDYN
  REAL :: DTDYN1
  REAL :: DTI
  REAL :: DTL1MN
  REAL :: DTL2MN
  REAL :: DTL3MN
  REAL :: DTL4MN
  REAL :: DTMAX
  REAL :: DTMIN
  REAL :: DTSED
  REAL :: DTSSFAC
  REAL :: DTSSDHDT
  REAL :: DTWQ
  REAL :: DTWQO2
  REAL :: DX
  REAL :: XYRATIO
  REAL :: DY
  REAL :: DYE3DMA
  REAL :: DYE3DMI
  REAL :: DYEA
  REAL :: DYEBEG
  REAL :: DYEBEG2T
  REAL :: DYEBEGE
  REAL :: DYEBEGO
  REAL :: DYEBMO2T
  REAL :: DYEEND2T
  REAL :: DYEOUT
  REAL :: DYEOUT2T
  REAL :: DYEOUTE
  REAL :: DYEOUTO
  REAL :: DZ
  REAL :: DZI
  REAL :: DZS
  REAL :: ERR
  REAL :: ERRMAX
  REAL :: ERRMIN
  REAL :: ETIMEDAY
  REAL :: ETIMESEC
  REAL :: EVAPCVT
  REAL :: FILT3TL
  REAL :: FOURDPI
  REAL :: FSCORTBC
  REAL :: FSWRATF
  REAL :: G
  REAL :: GI
  REAL :: GID2
  REAL :: GP
  REAL :: GPDIASED
  REAL :: GPO
  REAL :: HADJ
  REAL :: HBEDAL
  REAL :: HBEDALMN
  REAL :: HBEDALX
  REAL :: HBEDMAX
  REAL :: HBEDMIN
  REAL :: HBFDCH
  REAL :: HCVRT
  REAL :: HDRY
  REAL :: HDRYWAV
  REAL :: HDRYICE
  REAL :: HEQT
  REAL :: HMIN
  REAL :: HTBED1
  REAL :: HTBED2
  REAL :: HWET
  REAL :: PARADJ
  REAL :: PDGINIT
  REAL :: PI
  REAL :: PI2
  REAL :: PPEBEG
  REAL :: PPEBEGE
  REAL :: PPEBEGO
  REAL :: PPEOUT
  REAL :: PPEOUTE
  REAL :: PPEOUTO
  REAL :: QCHERR
  REAL :: QQLMIN
  REAL :: QQMIN
  REAL :: QXE
  REAL :: QXEVP
  REAL :: QXW
  REAL :: QXWVP
  REAL :: QYN
  REAL :: QYNVP
  REAL :: QYS
  REAL :: QYSVP
  REAL :: RAINCVT
  REAL :: RCHC
  REAL :: RCICM1
  REAL :: RCICM2
  REAL :: RCICM3
  REAL :: RCICM4
  REAL :: RCICM5
  REAL :: RCRCA1
  REAL :: RCRCA2
  REAL :: RCRCA3
  REAL :: RCRCA4
  REAL :: RCRCA5
  REAL :: REVC
  REAL :: RIFTRM
  REAL :: RITB
  REAL :: RITB1
  REAL :: RKCWQ
  REAL :: RKDSFLT
  REAL :: RKDYE
  REAL :: RMLSHA
  REAL :: RMWET
  REAL :: RNEW
  REAL :: RNH4WQ_
  REAL :: RNO3WQ_
  REAL :: RNPOR
  REAL :: ROLD
  REAL :: RP
  REAL :: RPIA
  REAL :: RIQMAX
  REAL :: RSDERDE
  REAL :: RSDERDO
  REAL :: RSQM
  REAL :: RSQMIA
  REAL :: RSWRSI
  REAL :: RSWRSR
  REAL :: RTLSHA
  REAL :: RTTLSHA
  REAL :: S2TL
  REAL :: S3TL
  REAL :: SAL3DMA
  REAL :: SAL3DMI
  REAL :: SALA
  REAL :: SALBEG
  REAL :: SALBEGE
  REAL :: SALBEGO
  REAL :: SALOUT
  REAL :: SALOUTE
  REAL :: SALOUTO
  REAL :: SCALQ
  REAL :: SCALV
  REAL :: SED3DMA
  REAL :: SED3DMI
  REAL :: SEDBEG
  REAL :: SEDBMO
  REAL :: SEDEND
  REAL :: SEDERR
  REAL :: SEDIFF
  REAL :: SEDIN
  REAL :: SEDMDGM
  REAL :: SEDMDMN
  REAL :: SEDMDMX
  REAL :: SEDSTART
  REAL :: SEDSTEP
  REAL :: SEDOUT
  REAL :: SEDVDRD
  REAL :: SEDVDRM
  REAL :: SEDVRDT
  REAL :: SELVMAX
  REAL :: SELZERD
  REAL :: SFATBTT
  REAL :: SFLA
  REAL :: SFLKILL
  REAL :: SFNTBET
  REAL :: SHSBEDMX
  REAL :: SM1OKMDP
  REAL :: SMASSBEG
  REAL :: SMASSEND
  REAL :: SMASSIN
  REAL :: SMASSOUT
  REAL :: SMCO2PO4
  REAL :: SMCO2SI
  REAL :: SMCSHSCH
  REAL :: SMDIFT
  REAL :: SMDP1SI
  REAL :: SMFD1H2S
  REAL :: SMFD1NH4
  REAL :: SMFD2H2S
  REAL :: SMFD2NH4
  REAL :: SMFD2PO4
  REAL :: SMFD2SI
  REAL :: SMFP1H2S
  REAL :: SMFP1NH4
  REAL :: SMFP2H2S
  REAL :: SMFP2NH4
  REAL :: SMFP2PO4
  REAL :: SMFP2SI
  REAL :: SMHYDUR  ! WQ VARIABLE DT
  REAL :: SMHYLAG  ! WQ VARIABLE DT
  REAL :: SMJDSI
  REAL :: SMKBST
  REAL :: SMKMDP
  REAL :: SMKMNH4
  REAL :: SMKMO2N
  REAL :: SMKMPSI
  REAL :: SMM1
  REAL :: SMM2
  REAL :: SMO2BS
  REAL :: SMO2C
  REAL :: SMO2NH4
  REAL :: SMO2NO3
  REAL :: SMP2PO4
  REAL :: SMP2SI
  REAL :: SMPOCR
  REAL :: SMRBIBT
  REAL :: SMSISAT
  REAL :: SND3DMA
  REAL :: SND3DMI
  REAL :: SNDDMX
  REAL :: SNDVDRD
  REAL :: SNLT
  REAL :: SOLFRDT
  REAL :: SOLSRDT
  REAL :: SSALMAX
  REAL :: SSEDBEG
  REAL :: SSEDEND
  REAL :: STDOCBC
  REAL :: STDOCWC
  REAL :: STEMFAC
  REAL :: STPOCBC
  REAL :: STPOCWC
  REAL :: SWRATNF
  REAL :: SWRATNS
  REAL :: TASFSER
  REAL :: TAUCMIN
  REAL :: TBDYNSTP
  REAL :: TBEDIT
  REAL :: TBEGAN
  REAL :: TBEGIN
  REAL :: TCALTRAN
  REAL :: TCON
  REAL :: TCSFSER
  REAL :: TCTMSR
  REAL :: TCVP
  REAL :: TDINTS
  REAL :: TEDUMP
  REAL :: TEM3DMA
  REAL :: TEM3DMI
  REAL :: TEMA
  REAL :: TEMO
  REAL :: TENDRNSEC
  REAL :: TFCAVG
  REAL :: TIDALP
  REAL :: TIMEBF
  REAL :: TIMESUM
  REAL :: TIMESUM2
  REAL :: TIMESUM3
  REAL :: TN
  REAL :: TNT
  REAL :: TOUTPUT
  REAL :: TOX3DMA
  REAL :: TOX3DMI
  REAL :: TPN
  REAL :: TRELAXV
  REAL :: TSCDA
  REAL :: TSDUMP
  REAL :: TSRSF
  REAL :: TSSSF
  REAL :: TTBXY
  REAL :: TVAL
  REAL :: UMOBEG
  REAL :: UMOBEGE
  REAL :: UMOBEGO
  REAL :: UMOOUT
  REAL :: UMOOUTE
  REAL :: UMOOUTO
  REAL :: UUEBEG
  REAL :: UUEBEGE
  REAL :: UUEBEGO
  REAL :: UUEOUT
  REAL :: UUEOUTE
  REAL :: UUEOUTO
  REAL :: UUU3DMA
  REAL :: UUU3DMI
  REAL :: UVEGSCL
  REAL :: VETZERD
  REAL :: VEXP
  REAL :: VISMUD
  REAL :: VISMUDST
  REAL :: VKC
  REAL :: VMOBEG
  REAL :: VMOBEGE
  REAL :: VMOBEGO
  REAL :: VMOOUT
  REAL :: VMOOUTE
  REAL :: VMOOUTO
  REAL :: VMULT
  REAL :: VOLBEG
  REAL :: VOLBEG2T
  REAL :: VOLBEGE
  REAL :: VOLBEGO
  REAL :: VOLMBEG
  REAL :: VOLMEND
  REAL :: VOLMIN
  REAL :: VOLMORPH2T
  REAL :: VOLMOUT
  REAL :: VOLOUT
  REAL :: VOLOUTE
  REAL :: VOLOUTO
  REAL :: VOLZERD
  REAL :: VVEBEG
  REAL :: VVEBEGE
  REAL :: VVEBEGO
  REAL :: VVEOUT
  REAL :: VVEOUTE
  REAL :: VVEOUTO
  REAL :: VVV3DMA
  REAL :: VVV3DMI
  REAL :: WQAANOX
  REAL :: WQANCC
  REAL :: WQANCD
  REAL :: WQANCG
  REAL :: WQANCM
  REAL :: WQANDC
  REAL :: WQAOCR
  REAL :: WQAOCRPM
  REAL :: WQAOCRRM
  REAL :: WQAONT
  REAL :: WQAPCM
  REAL :: WQASCD
  REAL :: WQCHLC
  REAL :: WQCHLD
  REAL :: WQCHLG
  REAL :: WQCHLM
  REAL :: WQCIA
  REAL :: WQCIB
  REAL :: WQCIC
  REAL :: WQCIM
  REAL :: WQCP1PRM
  REAL :: WQCP2PRM
  REAL :: WQCP3PRM
  REAL :: WQDOPC
  REAL :: WQDOPD
  REAL :: WQDOPG
  REAL :: WQFCDC
  REAL :: WQFCDD
  REAL :: WQFCDG
  REAL :: WQFCDM
  REAL :: WQFCDP
  REAL :: WQFCDPM
  REAL :: WQFCLP
  REAL :: WQFCLPM
  REAL :: WQFCRP
  REAL :: WQFCRPM
  REAL :: WQFD
  REAL :: WQFNDC
  REAL :: WQFNDD
  REAL :: WQFNDG
  REAL :: WQFNDM
  REAL :: WQFNDP
  REAL :: WQFNDPM
  REAL :: WQFNIC
  REAL :: WQFNID
  REAL :: WQFNIG
  REAL :: WQFNIM
  REAL :: WQFNIP
  REAL :: WQFNIPM
  REAL :: WQFNLC
  REAL :: WQFNLD
  REAL :: WQFNLG
  REAL :: WQFNLM
  REAL :: WQFNLP
  REAL :: WQFNLPM
  REAL :: WQFNRC
  REAL :: WQFNRD
  REAL :: WQFNRG
  REAL :: WQFNRM
  REAL :: WQFNRP
  REAL :: WQFNRPM
  REAL :: WQFPDC
  REAL :: WQFPDD
  REAL :: WQFPDG
  REAL :: WQFPDM
  REAL :: WQFPDP
  REAL :: WQFPDPM
  REAL :: WQFPIC
  REAL :: WQFPID
  REAL :: WQFPIG
  REAL :: WQFPIM
  REAL :: WQFPIP
  REAL :: WQFPIPM
  REAL :: WQFPLC
  REAL :: WQFPLD
  REAL :: WQFPLG
  REAL :: WQFPLM
  REAL :: WQFPLP
  REAL :: WQFPLPM
  REAL :: WQFPRC
  REAL :: WQFPRD
  REAL :: WQFPRG
  REAL :: WQFPRM
  REAL :: WQFPRP
  REAL :: WQFPRPM
  REAL :: WQFSID
  REAL :: WQFSIP
  REAL :: WQFSPD
  REAL :: WQFSPP
  REAL :: WQI0
  REAL :: WQI0OPT
  REAL :: WQI1
  REAL :: WQI2
  REAL :: WQI3
  REAL :: WQISMIN
  REAL :: WQKCNT
  REAL :: WQKDCALG
  REAL :: WQKDN
  REAL :: WQKDNALG
  REAL :: WQKDOTAM
  REAL :: WQKDP
  REAL :: WQKDPALG
  REAL :: WQKECHL
  REAL :: WQKECHLE
  REAL :: WQKEPOM
  REAL :: WQKEDOM
  REAL :: WQKEPOC
  REAL :: WQKETSS
  REAL :: WQKFCB
  REAL :: WQTFCB
  REAL :: WQKG1M
  REAL :: WQKG2M
  REAL :: WQKHBMF
  REAL :: WQKHCO2C
  REAL :: WQKHCO2G
  REAL :: WQKHCO2D
  REAL :: WQKHCO2M
  REAL :: WQKHDNN
  REAL :: WQKHNC
  REAL :: WQKHND
  REAL :: WQKHNDO
  REAL :: WQKHNG
  REAL :: WQKHNM
  REAL :: WQKHNN
  REAL :: WQKHORDO
  REAL :: WQKHPC
  REAL :: WQKHPD
  REAL :: WQKHPG
  REAL :: WQKHPM
  REAL :: WQKHRC
  REAL :: WQKHRD
  REAL :: WQKHRG
  REAL :: WQKHS
  REAL :: WQKLC
  REAL :: WQKLCALG
  REAL :: WQKLN
  REAL :: WQKLNALG
  REAL :: WQKLP
  REAL :: WQKINUPT
  REAL :: WQKLPALG
  REAL :: WQKPO4P
  REAL :: WQKRC
  REAL :: WQKRCALG
  REAL :: WQKRN
  REAL :: WQKRNALG
  REAL :: WQKRP
  REAL :: WQKRPALG
  REAL :: WQKSAP
  REAL :: WQKTBM
  REAL :: WQMCMIN
  REAL :: WQNITM
  REAL :: WQSTOX
  REAL :: WQTAMDMX
  REAL :: WQTMM1
  REAL :: WQTMM2
  REAL :: WQTDMIN
  REAL :: WQTDMAX
  REAL :: WQTDINC
  REAL :: WQTDsMIN
  REAL :: WQTDsMAX
  REAL :: WQTDsINC
  REAL :: WQTRG
  REAL :: WQTSB
  REAL :: WQTSE
  REAL :: WQTSDT
  REAL :: WQWSM
  REAL :: WSFLSMT
  REAL :: WSFLSTT
  REAL :: WSHELE
  REAL :: WSHELN
  REAL :: WSMB
  REAL :: WSMH
  REAL :: WVDISH
  REAL :: WVDISV
  REAL :: WVFRQ
  REAL :: WVLSH
  REAL :: WVLSX
  REAL :: WVOLBEG2T
  REAL :: WVOLOUT
  REAL :: WVPRD
  REAL :: WWW3DMA
  REAL :: WWW3DMI
  REAL :: XSMDPMIN
  REAL :: ZBRADJ
  REAL :: ZBRCVRT
  REAL :: ZBRWALL
  REAL :: ZSSMAX
  REAL :: ZSSMIN

  ! *** TIMING VARIABLES
  REAL(RKD) TAVB
  REAL(RKD) TCEXP
  REAL(RKD) TCONG
  REAL(RKD) THDMT
  REAL(RKD) THEAT
  REAL(RKD) THMDF
  REAL(RKD) TLRPD
  REAL(RKD) TMISC
  REAL(RKD) TPUV
  REAL(RKD) TQCTL
  REAL(RKD) TQQQ
  REAL(RKD) TSADV
  REAL(RKD) TTSED
  REAL(RKD) TSSTX
  REAL(RKD) TSSEDZLJ
  REAL(RKD) TUVW
  REAL(RKD) TVDIF
  REAL(RKD) TWQADV
  REAL(RKD) TWQDIF
  REAL(RKD) TWQKIN
  REAL(RKD) TWQSED

  ! *** CARD 9A
  REAL :: SELVREF
  REAL :: BELVREF
  
  REAL :: ANGVPV(10)
  REAL :: DSFLMN(100)
  REAL :: DSFLMX(100)
  REAL :: FUNKH(1001)
  REAL :: RKDSFL(100)
  REAL :: RKHTAB(1001)
  REAL :: SBPLTV(7)
  REAL :: SFATBT(100)
  REAL :: SFNTBE(100)
  REAL :: SHPLTV(7)
  REAL :: TARRAY(2)
  REAL :: TSFSER(100)
  REAL :: WQATM(NTSWQVM)
  REAL :: WSFLSM(100)
  REAL :: WSFLST(100)
  !
  REAL,ALLOCATABLE,DIMENSION(:)     :: AAU
  REAL,ALLOCATABLE,DIMENSION(:)     :: AAV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ABEFF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ABLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ACCWFLD
  REAL,ALLOCATABLE,DIMENSION(:)     :: ACCWX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ACOEF
  REAL,ALLOCATABLE,DIMENSION(:)     :: AGWELV
  REAL,ALLOCATABLE,DIMENSION(:)     :: AGWELV1
  REAL,ALLOCATABLE,DIMENSION(:)     :: AGWELV2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AHC
  REAL,ALLOCATABLE,DIMENSION(:)     :: AHDXY
  REAL,ALLOCATABLE,DIMENSION(:)     :: AHOXY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AHU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AHULPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AHV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AHVLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ALOW
  REAL,ALLOCATABLE,DIMENSION(:)     :: ALPVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMCP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AMCU
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMCUE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AMCV
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMCVE
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMPU
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMPV
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMSP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AMSU
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMSUE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AMSV
  REAL,ALLOCATABLE,DIMENSION(:)     :: AMSVE
  REAL,ALLOCATABLE,DIMENSION(:)     :: ANGWRMFD
  REAL,ALLOCATABLE,DIMENSION(:)     :: AP
  REAL,ALLOCATABLE,DIMENSION(:)     :: APCG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: APT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: AQCTL
  REAL,ALLOCATABLE,DIMENSION(:)     :: ASURFEL
  REAL,ALLOCATABLE,DIMENSION(:)     :: ATMP
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: ATMWHT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AV
  REAL,ALLOCATABLE,DIMENSION(:)     :: AVOXY        ! *** SPATIALLY VARYING AVO
  REAL,ALLOCATABLE,DIMENSION(:)     :: AVBXY        ! *** SPATIALLY VARYING ABO
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AVUI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: AVVI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: B
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: B0
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: B1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: B1DT1
  REAL,ALLOCATABLE,DIMENSION(:)     :: BBU
  REAL,ALLOCATABLE,DIMENSION(:)     :: BBV
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: BCLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BDENBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BDENBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: BDENBEDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: BDENBEDA1
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: BDISP
  REAL,ALLOCATABLE,DIMENSION(:)     :: BDLPSQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDBINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDBKDSV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDDINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDLINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDPORSV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDTHKSV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BEDVDRSV
  REAL,ALLOCATABLE,DIMENSION(:)     :: BELAGW
  REAL,ALLOCATABLE,DIMENSION(:)     :: BELSURF
  REAL,ALLOCATABLE,DIMENSION(:)     :: BELV
  REAL,ALLOCATABLE,DIMENSION(:)     :: BELV0
  REAL,ALLOCATABLE,DIMENSION(:)     :: BELV1
  REAL,ALLOCATABLE,DIMENSION(:)     :: BETVEG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BMNN
  REAL,ALLOCATABLE,DIMENSION(:)     :: BPVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: BQCLCE
  REAL,ALLOCATABLE,DIMENSION(:)     :: BQWRMFD
  REAL,ALLOCATABLE,DIMENSION(:)     :: BQWRMFU
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: BSLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: BTLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: BTMP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CAC
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CBE
  REAL,ALLOCATABLE,DIMENSION(:)     :: CBEDTOTAL
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CBN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CBS
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CBW
  REAL,ALLOCATABLE,DIMENSION(:)     :: CC
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCC
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCC
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCCHH
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCCHU
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCCHV
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCI
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCCOS1
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCE
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CCLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCN
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCNHTT
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCS
  REAL,ALLOCATABLE,DIMENSION(:)     :: CCW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CDZKK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CDZKKP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CDZKMK
  REAL,ALLOCATABLE,DIMENSION(:)     :: CE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CFLCAC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CFLUUU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CFLVVV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CFLWWW
  REAL,ALLOCATABLE,DIMENSION(:)     :: CFRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: CHANFRIC
  REAL,ALLOCATABLE,DIMENSION(:)     :: CHANLEN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CLOE
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CLON
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CLOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: CLOUDT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CLOW
  REAL,ALLOCATABLE,DIMENSION(:)     :: CLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: CMB
  REAL,ALLOCATABLE,DIMENSION(:)     :: CN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: COEFK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: COEFSK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONGW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONPARB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONPARBC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONPARW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONPARWC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CONT
  REAL,ALLOCATABLE,DIMENSION(:)     :: COSEDHID
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CPFAM0
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CPFAM1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CPFAM2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CQBEDLOADX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CQBEDLOADY
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CQCJP
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CQS
  REAL,ALLOCATABLE,DIMENSION(:)     :: CQSE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CQWR
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CQWRSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CQWRSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: CS
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: CSHIELDS50
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CSLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: CTAUC
  REAL,ALLOCATABLE,DIMENSION(:)     :: CTLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CTURBB1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CTURBB2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CU1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CU2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CUDISPT
  REAL,ALLOCATABLE,DIMENSION(:)     :: CUE
  REAL,ALLOCATABLE,DIMENSION(:)     :: CUN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CUPP
  REAL,ALLOCATABLE,DIMENSION(:)     :: CUU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CVDISPT
  REAL,ALLOCATABLE,DIMENSION(:)     :: CVE
  REAL,ALLOCATABLE,DIMENSION(:)     :: CVN
  REAL,ALLOCATABLE,DIMENSION(:)     :: CVV
  REAL,ALLOCATABLE,DIMENSION(:)     :: CW
 
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CWRCJP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: CYASUM
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DDOMAX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DDOMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: DIFTOX
  REAL,ALLOCATABLE,DIMENSION(:)     :: DIFTOXS
  REAL,ALLOCATABLE,DIMENSION(:)     :: DJET
  REAL,ALLOCATABLE,DIMENSION(:)     :: DJPER
  REAL,ALLOCATABLE,DIMENSION(:)     :: DLAT
  REAL,ALLOCATABLE,DIMENSION(:)     :: DLON
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DML
  REAL,ALLOCATABLE,DIMENSION(:)     :: DPDIFTOX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DSTRSE
  REAL,ALLOCATABLE,DIMENSION(:)     :: DTAUC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXDJ
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXFP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXIU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXIV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXXTCA
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYIP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYIU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYIV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYTCA
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DXYV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYDI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DYE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DYE1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DYEAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DYEINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DYELPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYFP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYIU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYIV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYP
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYU
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYV
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYXTCA
  REAL,ALLOCATABLE,DIMENSION(:)     :: DYYTCA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DZBTR
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DZBTR1
  !REAL,ALLOCATABLE,DIMENSION(:)     :: DZC
  !REAL,ALLOCATABLE,DIMENSION(:)     :: DZG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DZIC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DZIG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: DZSUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: DZWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: FACBEDL
  REAL,ALLOCATABLE,DIMENSION(:)     :: FACSUSL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FBBX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FBBY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FBODYFX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FBODYFY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FCAX
  REAL,ALLOCATABLE,DIMENSION(:)     :: FCAXE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FCAY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FCAY1
  REAL,ALLOCATABLE,DIMENSION(:)     :: FCAY1E
  REAL,ALLOCATABLE,DIMENSION(:)     :: FCAYE
  REAL,ALLOCATABLE,DIMENSION(:)     :: FCORC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFPOCB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FMDUX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FMDUY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FMDVX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FMDVY
  REAL,ALLOCATABLE,DIMENSION(:)     :: FP
  REAL,ALLOCATABLE,DIMENSION(:)     :: FP1
  REAL,ALLOCATABLE,DIMENSION(:)     :: FPGXE
  REAL,ALLOCATABLE,DIMENSION(:)     :: FPGYE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PMCTESTX    ! *** CREATED AND ALLOCATED FOR DEBUG ASSIGNMENTS - NOT USED FOR ROUTINE RUNS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PMCTESTY    ! *** CREATED AND ALLOCATED FOR DEBUG ASSIGNMENTS - NOT USED FOR ROUTINE RUNS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FPOCB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FPOCBST
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FPOCWST
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FPROX
  REAL,ALLOCATABLE,DIMENSION(:)     :: FPTMP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FRACCOH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FRACNON
  REAL,ALLOCATABLE,DIMENSION(:)     :: FSCORTBCV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FUDISP
  REAL,ALLOCATABLE,DIMENSION(:)     :: FUHDYE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FUHU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FUHV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FVDISP
  REAL,ALLOCATABLE,DIMENSION(:)     :: FVHDXE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FVHU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FVHV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FWQQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FWQQL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FWU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FWV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FX
  REAL,ALLOCATABLE,DIMENSION(:)     :: FXE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FXVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: FXVEGE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FXWAVE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FY
  REAL,ALLOCATABLE,DIMENSION(:)     :: FYE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FYVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: FYVEGE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FYWAVE
  REAL,ALLOCATABLE,DIMENSION(:)     :: FZU
  REAL,ALLOCATABLE,DIMENSION(:)     :: FZV
  REAL,ALLOCATABLE,DIMENSION(:)     :: GAMB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: GAMTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: GAMVEG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: GLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: GWCSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: GWCSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: GWFAC
  REAL,ALLOCATABLE,DIMENSION(:)     :: GWLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: GWSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: GWSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1C
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1P
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1U
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1UI
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1V
  REAL,ALLOCATABLE,DIMENSION(:)     :: H1VI
  REAL,ALLOCATABLE,DIMENSION(:)     :: H2P
  REAL,ALLOCATABLE,DIMENSION(:)     :: H2WQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: HBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: HBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: HBEDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: HBEDA1
  REAL,ALLOCATABLE,DIMENSION(:)     :: HCTLDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: HCTLDM
  REAL,ALLOCATABLE,DIMENSION(:)     :: HCTLUA
  REAL,ALLOCATABLE,DIMENSION(:)     :: HCTLUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: HDFUFX
  REAL,ALLOCATABLE,DIMENSION(:)     :: HDFUFY
  REAL,ALLOCATABLE,DIMENSION(:)     :: HDFUF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: HDIFCTD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: HDIFCTL
  REAL,ALLOCATABLE,DIMENSION(:)     :: HGDH
  REAL,ALLOCATABLE,DIMENSION(:)     :: HLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMPW
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMU
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMUW
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMV
  REAL,ALLOCATABLE,DIMENSION(:)     :: HMVW
  REAL,ALLOCATABLE,DIMENSION(:)     :: HP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HPI
  REAL,ALLOCATABLE,DIMENSION(:)     :: HPTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HPVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: HRU
  REAL,ALLOCATABLE,DIMENSION(:)     :: HRUO
  REAL,ALLOCATABLE,DIMENSION(:)     :: HRV
  REAL,ALLOCATABLE,DIMENSION(:)     :: HRVO
  REAL,ALLOCATABLE,DIMENSION(:)     :: HTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HU
  REAL,ALLOCATABLE,DIMENSION(:)     :: HUDRY
  REAL,ALLOCATABLE,DIMENSION(:)     :: HUI
  REAL,ALLOCATABLE,DIMENSION(:)     :: HUTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HUWET
  REAL,ALLOCATABLE,DIMENSION(:)     :: HV
  REAL,ALLOCATABLE,DIMENSION(:)     :: HVDRY
  REAL,ALLOCATABLE,DIMENSION(:)     :: HVI
  REAL,ALLOCATABLE,DIMENSION(:)     :: HVTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: HVWET
  REAL,ALLOCATABLE,DIMENSION(:)     :: HWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: HWQI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: HYDCN
  REAL,ALLOCATABLE,DIMENSION(:)     :: O2WQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: OBCLIST
  REAL,ALLOCATABLE,DIMENSION(:)     :: P
  REAL,ALLOCATABLE,DIMENSION(:)     :: P1
  REAL,ALLOCATABLE,DIMENSION(:)     :: P1DT1
  REAL,ALLOCATABLE,DIMENSION(:)     :: PATMT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PCBE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PCBN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PCBS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PCBW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PCLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: PDIFTOX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PEXP
  REAL,ALLOCATABLE,DIMENSION(:)     :: PSERZDF
  REAL,ALLOCATABLE,DIMENSION(:)     :: PSERZDS 
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFAM
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFAM1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFAM2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFPH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFPH1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PFPH2
  REAL,ALLOCATABLE,DIMENSION(:)     :: PHASEE
  REAL,ALLOCATABLE,DIMENSION(:)     :: PHASEU
  REAL,ALLOCATABLE,DIMENSION(:)     :: PHASEV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PHID
  REAL,ALLOCATABLE,DIMENSION(:)     :: PHJET
  REAL,ALLOCATABLE,DIMENSION(:)     :: PLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: PMDCH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PMXDEPTH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PMXCOEF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PARTMIXZ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PNHYDS
  REAL,ALLOCATABLE,DIMENSION(:)     :: PO4DWQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PORBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PORBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: PPH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSBE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSBN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSBS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSBW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSERS
  REAL,ALLOCATABLE,DIMENSION(:)     :: PSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: PSERST
  REAL,ALLOCATABLE,DIMENSION(:)     :: PSHADE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: PTLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: PTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: PVEGX
  REAL,ALLOCATABLE,DIMENSION(:)     :: PVEGY
  REAL,ALLOCATABLE,DIMENSION(:)     :: PVEGZ
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCELLCTR
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHANU
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHANUN
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHANV
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHANVN
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHNULP
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCHNVLP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QCOEF
  REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: QCTL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QCTLST
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QCTLSTO
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: QCTLT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QCTLTLP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QCTLTO
  REAL,ALLOCATABLE,DIMENSION(:)     :: QCTLMU
  REAL,ALLOCATABLE,DIMENSION(:)     :: QDWASTE
  REAL,ALLOCATABLE,DIMENSION(:)     :: QFACTOR
  REAL,ALLOCATABLE,DIMENSION(:)     :: QGW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QJPENT
  REAL,ALLOCATABLE,DIMENSION(:)     :: QJPENTT
  REAL,ALLOCATABLE,DIMENSION(:)     :: QMORPH
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQ1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQ2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQSQR
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQCJP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQL1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QQL2
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQWC
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQWCR
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQWV1
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQWV2
  REAL,ALLOCATABLE,DIMENSION(:)     :: QQWV3
  REAL,ALLOCATABLE,DIMENSION(:)     :: QRAIN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSBDLDIN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSBDLDOT
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSBDLDP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSBDLDX
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSBDLDY
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSBDTOP
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: QSEDBED
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: QSEDBED1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSEDBEDA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSEDBEDA1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSERT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSERCELL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSRTLPN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSRTLPP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSS
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSSDPA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSUME
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSUMELPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: QSUM1E
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QSUMLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWATPA
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWBDTOP
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWIDTH
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWR
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWRCJP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QWRSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWRSERT
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWRSERTLP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QWTRBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: QWTRBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWTRBEDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: QWTRBEDA1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RADBOT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RADNET  
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RADTOP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RADKE
  !REAL,ALLOCATABLE,DIMENSION(:,:)   :: RAIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: RAINLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: RAINT
  REAL,ALLOCATABLE,DIMENSION(:)     :: RBPSBL
  REAL,ALLOCATABLE,DIMENSION(:)     :: RCX
  REAL,ALLOCATABLE,DIMENSION(:)     :: RCY
  REAL,ALLOCATABLE,DIMENSION(:)     :: RDLPSQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: REAC
  REAL,ALLOCATABLE,DIMENSION(:)     :: RHAT
  REAL,ALLOCATABLE,DIMENSION(:)     :: RHS
  REAL,ALLOCATABLE,DIMENSION(:)     :: RI
  REAL,ALLOCATABLE,DIMENSION(:)     :: RINFLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: RJ
  REAL,ALLOCATABLE,DIMENSION(:)     :: RK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RKASUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: RKTOXP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RLIGHTC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RLIGHTT
  REAL,ALLOCATABLE,DIMENSION(:)     :: RMAJ
  REAL,ALLOCATABLE,DIMENSION(:)     :: RMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: RNH4NO3  
  REAL,ALLOCATABLE,DIMENSION(:)     :: RNH4WQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: RNO3WQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: ROUSE
  REAL,ALLOCATABLE,DIMENSION(:)     :: RQCMUL
  REAL,ALLOCATABLE,DIMENSION(:)     :: RQSMUL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: RRHS
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSEDERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSNDM
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSOL
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSSBCE
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSSBCN
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSSBCS
  REAL,ALLOCATABLE,DIMENSION(:)     :: RSSBCW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: RTOXERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SAAX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SAAY
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SAL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SAL1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SALAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SALINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SALLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDG1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDG2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDG3
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDG4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBDLDP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBLOUT2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBLOUT2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBLOUT2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBXO
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBY
  REAL,ALLOCATABLE,DIMENSION(:)     :: SBYO
  REAL,ALLOCATABLE,DIMENSION(:)     :: SCAX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SCAY
  REAL,ALLOCATABLE,DIMENSION(:)     :: SCB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SCLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SCVEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: SDBLV
  REAL,ALLOCATABLE,DIMENSION(:)     :: SDEN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SDENAVG
  REAL,ALLOCATABLE,DIMENSION(:)     :: SDX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SDY
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SED
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SED3DMAX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SED3DMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDAD
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDB1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDBA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBEG2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBEG2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBEG2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDBINIT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDBLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBMO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBMO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBMO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDBO
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDBT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDBTLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDDIA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDDIA50
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDDIA90
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDEND2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDEND2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDEND2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERR2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERR2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDERR2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDFLUX2T
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDFPA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDINIT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDO
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDOUT2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDOUT2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEDOUT2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SEDS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SEDTLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SEXP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SFL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SFL2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SFLAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SFLINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SFLLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SFLSBOT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SGSM1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SIGPHI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SIGPHIA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SKTOXP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1DIFT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1H2S
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1NH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1NO3
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1PO4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM1SI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2DIFT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2H2S
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2NH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2NO3
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2PO4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SM2SI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMAC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMBST
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMCSOD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMD1PO4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMD1SI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMDFC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMDFN
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMDFP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDFSI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDGFC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDGFN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDGFP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDP1PO4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDPMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMDTOH
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFCBC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFCBD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFCBG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMFCR
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFNBC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFNBD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFNBG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMFNR
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFPBC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFPBD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMFPBG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMFPR
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMHODT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMHSED
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMHYPD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMJAQH2S
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMJDEN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMJGCH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMJNIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMK1H2S
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMK1NO3
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMK2NO3
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMKL12
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMKNH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMNSOD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMPOC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMPON
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMPOP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMPSI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMSS
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTD1CH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTD2CH4
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMTDCD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTDDD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTDDP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMTDND
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTDNH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTDNO3
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SMTDPD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTDSI
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMW12
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMW2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMW2DTOH
  REAL,ALLOCATABLE,DIMENSION(:)     :: SMW2PHODT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SND
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SND1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SND3DMAX
  REAL,ALLOCATABLE,DIMENSION(:)     :: SND3DMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDAD
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDB1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDBA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDBA1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBAT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBEG2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBEG2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBEG2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDBINIT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDBLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBMO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBMO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDBMO2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDBS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDBT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDBTLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDEND2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDEND2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDEND2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDEQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDEQSAV
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDEQB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERR2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERR2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDERR2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDFBL
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDFBL2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDFLUX2T
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDFPA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDINIT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDOUT2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDOUT2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SNDOUT2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: SNDS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SNDTLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: SODMULT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SODSUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: SOLFRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: SOLSRD
  !REAL,ALLOCATABLE,DIMENSION(:,:)   :: SOLSWR
  REAL,ALLOCATABLE,DIMENSION(:)     :: SOLSWRT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBE1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBE2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBN1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBN2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBS1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBS2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBW1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SPBW2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SPFAM0
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SPFAM1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SPFAM2
  REAL,ALLOCATABLE,DIMENSION(:)     :: SSG
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SSLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: SSSIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: SSSIN1
  REAL,ALLOCATABLE,DIMENSION(:)     :: SSSS
  REAL,ALLOCATABLE,DIMENSION(:)     :: STBX
  REAL,ALLOCATABLE,DIMENSION(:)     :: STBXO
  REAL,ALLOCATABLE,DIMENSION(:)     :: STBY
  REAL,ALLOCATABLE,DIMENSION(:)     :: STBYO
  REAL,ALLOCATABLE,DIMENSION(:)     :: STCAP
  REAL,ALLOCATABLE,DIMENSION(:)     :: STCUV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: STDOCB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: STDOCW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: STFPOCB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: STFPOCW
  REAL,ALLOCATABLE,DIMENSION(:)     :: STLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: STPOCB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: STPOCW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: STRSE
  REAL,ALLOCATABLE,DIMENSION(:)     :: SUB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SUBO
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVBO
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVKEBACK
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVREVC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVRCHC
  REAL,ALLOCATABLE,DIMENSION(:)     :: SWB
  REAL,ALLOCATABLE,DIMENSION(:)     :: SWQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: SWQSUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAASER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TACSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TADFLUX
  REAL,ALLOCATABLE,DIMENSION(:)     :: TADFLUX2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAGWSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAPSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAQSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAQWRSR
  REAL,ALLOCATABLE,DIMENSION(:)     :: TATMT
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUBSED
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUBSND
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TAUCRCOH
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUD
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUN
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUR
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TAURB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAUDS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TAUNS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TAURS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEXPS
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAVEGSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TAWSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TBX
  REAL,ALLOCATABLE,DIMENSION(:)     :: TBX1
  REAL,ALLOCATABLE,DIMENSION(:)     :: TBY
  REAL,ALLOCATABLE,DIMENSION(:)     :: TBY1
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCASER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TCCSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCGWSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCP
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCPSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCQSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCQWRSR
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCSHIELDS
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCVEGSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCWQPSR
  REAL,ALLOCATABLE,DIMENSION(:)     :: TCWSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEM
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEM1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEMAD
  REAL,ALLOCATABLE,DIMENSION(:)     :: TEMB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TEMB1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEMINIT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEMLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TEMSUM
  REAL,ALLOCATABLE,DIMENSION(:)     :: TEXP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TGWSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: THJET
  REAL,ALLOCATABLE,DIMENSION(:)     :: TMP3D
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOX
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_KB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_KW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_MXD
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_Q10B
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_Q10W
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BIO_TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BLK_KB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BLK_KW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOX_BLK_MXD
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOX1
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXATM
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXB1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXBA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXBA1
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBEG2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBEG2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBEG2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXBINIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBLB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBLB2T
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXBLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBMO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBMO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXBMO2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXBS
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXCDFB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXCDFW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXEND2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXEND2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXEND2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERE2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERE2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERE2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERO2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERO2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERO2TW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERR2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERR2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXERR2TW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXF
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXFB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXFBL
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXFBL2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXFBLT
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXFDFB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXFDFW
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXFLUXB2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXFLUXW2T
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXINIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXINTB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXINTW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXOUT2T
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXOUT2TB
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXOUT2TW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXPARB
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXPARBC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXPARW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXPARWC
  REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: TOXPFB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXPFTB
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXPFTW
  REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: TOXPFW
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: TOXS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TOXTMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXWBALN
  REAL,ALLOCATABLE,DIMENSION(:)     :: TOXWBALO
  REAL,ALLOCATABLE,DIMENSION(:)     :: TPCOORDE
  REAL,ALLOCATABLE,DIMENSION(:)     :: TPCOORDN
  REAL,ALLOCATABLE,DIMENSION(:)     :: TPCOORDS
  REAL,ALLOCATABLE,DIMENSION(:)     :: TPCOORDW
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TPSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TQWRSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TSSRD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TSSTOP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TSSTRT
  REAL,ALLOCATABLE,DIMENSION(:)     :: TSX
  REAL,ALLOCATABLE,DIMENSION(:)     :: TSX1
  REAL,ALLOCATABLE,DIMENSION(:)     :: TSY
  REAL,ALLOCATABLE,DIMENSION(:)     :: TSY1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR1E
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR1N
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR1S
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR1W
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR2C
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR2E
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR2N
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR2S
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVAR2W
  REAL,ALLOCATABLE,DIMENSION(:)     :: TVAR3C
  REAL,ALLOCATABLE,DIMENSION(:)     :: TVAR3E
  REAL,ALLOCATABLE,DIMENSION(:)     :: TVAR3N
  REAL,ALLOCATABLE,DIMENSION(:)     :: TVAR3S
  REAL,ALLOCATABLE,DIMENSION(:)     :: TVAR3W
  REAL,ALLOCATABLE,DIMENSION(:)     :: TWATER  !BRW to output to tecplot_algae
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TVEGSER
  REAL,ALLOCATABLE,DIMENSION(:)     :: TWQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: TWQPSER
  REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: TXPFLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: U
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: U0
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: U1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: U1DT1
  REAL,ALLOCATABLE,DIMENSION(:)     :: U1V
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: U2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UAGD
  REAL,ALLOCATABLE,DIMENSION(:)     :: UCELLCTR
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: UCLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: UCOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: UE0
  REAL,ALLOCATABLE,DIMENSION(:)     :: UE1DT1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UECLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: UELPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: UELSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UESLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: UETLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: UHDY1E
  REAL,ALLOCATABLE,DIMENSION(:)     :: UHDY2E
  REAL,ALLOCATABLE,DIMENSION(:)     :: UHDYE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UHDYEK       ! *** LAYER SPECIFIC FLOW DELTA, U FACE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UHDY1EK      ! *** LAYER SPECIFIC FLOW DELTA, U FACE, 1 TS BACK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UHDY2EK      ! *** LAYER SPECIFIC FLOW DELTA, U FACE, 2 TS BACK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UHDYWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: UHE
  REAL,ALLOCATABLE,DIMENSION(:)     :: UHEQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UHLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UIRT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ULPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ULSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: USIN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: USLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: USTAR
  REAL,ALLOCATABLE,DIMENSION(:)     :: USTARSED
  REAL,ALLOCATABLE,DIMENSION(:)     :: USTARSND
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UTLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UTLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UUU
  REAL,ALLOCATABLE,DIMENSION(:)     :: UV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UVPT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: UWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: UWVSQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: V
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: V0
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: V1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: V1DT1
  REAL,ALLOCATABLE,DIMENSION(:)     :: V1U
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: V2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VAGD
  REAL,ALLOCATABLE,DIMENSION(:)     :: VCELLCTR
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: VCLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: VCOS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VDRBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VDRBED1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VDRBED2
  REAL,ALLOCATABLE,DIMENSION(:)     :: VDRBEDA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VDRBEDSED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VDRBEDSND
  REAL,ALLOCATABLE,DIMENSION(:)     :: VDRDEPO
  REAL,ALLOCATABLE,DIMENSION(:)     :: VDRHBEDA1
  REAL,ALLOCATABLE,DIMENSION(:)     :: VDRRSPO
  REAL,ALLOCATABLE,DIMENSION(:)     :: VDWASTE
  REAL,ALLOCATABLE,DIMENSION(:)     :: VE0
  REAL,ALLOCATABLE,DIMENSION(:)     :: VE1DT1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VECLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: VEGK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VEGSERB
  REAL,ALLOCATABLE,DIMENSION(:)     :: VEGSERBT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VEGSERH
  REAL,ALLOCATABLE,DIMENSION(:)     :: VEGSERHT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VEGSERR
  REAL,ALLOCATABLE,DIMENSION(:)     :: VEGSERRT
  REAL,ALLOCATABLE,DIMENSION(:)     :: VELPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: VELSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VESLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: VETLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: VFRBED
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: VFRBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: VHDX1E
  REAL,ALLOCATABLE,DIMENSION(:)     :: VHDX2E
  REAL,ALLOCATABLE,DIMENSION(:)     :: VHDXE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VHDXEK       ! *** LAYER SPECIFIC FLOW DELTA, V FACE, 1 TS BACK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VHDX1EK      ! *** LAYER SPECIFIC FLOW DELTA, V FACE, 1 TS BACK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VHDX2EK      ! *** LAYER SPECIFIC FLOW DELTA, V FACE, 2 TS BACK
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VHDXWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: VHE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VHLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VIRT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VOLBW2
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VOLBW3
  REAL,ALLOCATABLE,DIMENSION(:)     :: VOLPERC
  REAL,ALLOCATABLE,DIMENSION(:)     :: VOLSEL
  REAL,ALLOCATABLE,DIMENSION(:)     :: VOLWQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: VSIN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: VSLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VTLPF
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VTLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: VU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VVLSHA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VVPT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VVV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: VWQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: W
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: W1
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: W2
  REAL,ALLOCATABLE,DIMENSION(:)     :: WACCWE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WAGD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WC2
  REAL,ALLOCATABLE,DIMENSION(:)     :: WCOREST
  REAL,ALLOCATABLE,DIMENSION(:)     :: WCORWST
  REAL,ALLOCATABLE,DIMENSION(:)     :: WCORNTH
  REAL,ALLOCATABLE,DIMENSION(:)     :: WCORSTH
  REAL,ALLOCATABLE,DIMENSION(:)     :: WINDCD10
  REAL,ALLOCATABLE,DIMENSION(:)     :: WINDH
  REAL,ALLOCATABLE,DIMENSION(:)     :: WINDST
  REAL,ALLOCATABLE,DIMENSION(:)     :: WINDSTKA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WINDSTKA_SAVE
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WIRT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WKQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: WLSHA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WNDVELE
  REAL,ALLOCATABLE,DIMENSION(:)     :: WNDVELN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WNDWHT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQAPC
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQATML
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQBCSET
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQBDSET
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFCOD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFNH4
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFNO3
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFO2
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFPO4D
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBFSAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQBGSET
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMRC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMRG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQBMRM
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQCHL
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDENIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFBC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFBD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFBG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFLC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFLN
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFLP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFRC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFRN
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFRP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDFSI
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDOPM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQDOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQH10
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQHT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQI0BOT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKBP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKCD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQKCOD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKDC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKDCALM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKDON
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKDOP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKEB
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKHCOD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKHR
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKHRM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKK
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKLPC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKLPN
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKLPP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMV
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVB
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVE
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKMVMIN
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRDOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRO
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRPC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRPN
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRPP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKSUA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKTR
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQLPSET
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQN17
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQNIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQO18
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQOBCE
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQOBCN
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQOBCS
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQOBCW
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQOBTOT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQP19
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPMC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPMD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPMG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPMM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPNC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPND
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPNG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPNM
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQPO4D
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRRC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRRG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPRRM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQPSQ
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQPSSER
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQPSSRT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQR20
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQRPSET
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQRR
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQSAD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQSDCOEF
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQT10
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQT17
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQTAMP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTD1FCB
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTD2FCB
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDGC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDGD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDGG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDGM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDGP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDHDR
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQTDKR
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDMNL
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDNIT
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDRC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDRD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDRG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDRM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQTDTAM
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQV
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQVO
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQWDSL
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQWPSL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQWPSLC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSD
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSG
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSLP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSRP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQWSS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQWSSET
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WRSPB
  REAL,ALLOCATABLE,DIMENSION(:)     :: WRSPBA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WRSPO
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WRSPS
  REAL,ALLOCATABLE,DIMENSION(:)     :: WRSPSA
  REAL,ALLOCATABLE,DIMENSION(:)     :: WS
  REAL,ALLOCATABLE,DIMENSION(:)     :: WS2
  REAL,ALLOCATABLE,DIMENSION(:)     :: WSEDO
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WSETA
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WTCI
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WTLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVDTKEM
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVDTKEP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVENEP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVHUU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVHUV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVHVV
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVKHC
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVKHU
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVKHV
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVPP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVPT
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVPU
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WVPV
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVTMP1
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVTMP2
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVTMP3
  REAL,ALLOCATABLE,DIMENSION(:)     :: WVTMP4
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WWQ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WWW
  REAL,ALLOCATABLE,DIMENSION(:)     :: XBENMUD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: XDOSAT
  REAL,ALLOCATABLE,DIMENSION(:)     :: XJETL
  REAL,ALLOCATABLE,DIMENSION(:)     :: XSMO20
  REAL,ALLOCATABLE,DIMENSION(:)     :: YJETL
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: Z
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZAD
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZBEDC
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZBEDG
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZBEDGT
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZBR
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZBRE
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZBRSED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZELBED
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZELBED1
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZELBEDA
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZELBEDA1
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZEQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZEQD
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZEQDI
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZEQI
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZETATOP
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZJET
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZP
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZZ
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZZC
  REAL,ALLOCATABLE,DIMENSION(:)     :: ZZP

  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: SNAPSHOTS

  ! *******************************************************************************************
  ! Begin SEDZLJ variables
  ! PT- All REAL(RKD) :: values are explicitly specified as DOUBLE PRECISION for accuracy. 7/16/08
  LOGICAL :: LSEDZLJ
  INTEGER :: IFWAVE
  INTEGER :: IHTSTRT
  INTEGER :: IMORPH_SEDZLJ
  INTEGER :: ISSLOPE
  INTEGER :: ISWNWAVE
  INTEGER :: ITBM
  INTEGER :: KZ      
  INTEGER :: NCALC_BL
  INTEGER :: NDYCOUNT
  INTEGER :: NEQUIL
  INTEGER :: NSEDFLUME
  INTEGER :: NSICM
  INTEGER :: NNONCO
  INTEGER :: NVAR_BED
  INTEGER :: NWARNING
  INTEGER :: NWVCOUN
  INTEGER :: NWVCOUNT
  INTEGER :: STWVNUM
  INTEGER :: STWVTIM
  INTEGER :: STINC

  REAL(RKD) :: DTSEDJ      ! *** SEDZLJ timestep in REAL(RKD) for better mass balance
  REAL(RKD) :: HPMIN       ! *** Minimum depth to compute shears for SEDZLJ
  REAL(RKD) :: MAXDEPLIMIT ! *** The maximum limit of mass from 1st layer deposited on active bed layer.
  REAL(RKD) :: RHO         ! *** EFDC variable in units of MKS 1000. kg/m^3
  REAL(RKD) :: TACTM       ! *** Non-dimensional active layer thickness multiplier
  REAL(RKD) :: TAUCONST
  REAL(RKD) :: TIMEDAY
  REAL(RKD) :: TIMESEC
  REAL(RKD) :: TIMEEND
  REAL(RKD) :: TIMERST     ! *** Restart interval in days
  REAL(RKD) :: WATERDENS   ! *** Add new parameter for water density rho_w
  REAL(RKD) :: ZBSKIN

  ! *** NEW PARAMETERS FOR UPDATED SEDZLJ
  REAL(RKD) :: ALPHA_DEP
  REAL(RKD) :: ALAY_EXP
  REAL(RKD) :: ALAY_EXP_D50
  REAL(RKD) :: ALAY_CON
  REAL(RKD) :: ALPHA_D90
  REAL(RKD) :: BEDLOAD_CUTOFF
  REAL(RKD) :: CF_MIN
  REAL(RKD) :: EXP_HFACT_COH
  REAL(RKD) :: SIGMA_PDEP_COH
  REAL(RKD) :: SIGMA_PDEP_NON
  REAL(RKD) :: TAUB_MIN
  REAL(RKD) :: Z0_BED

  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: BLFLAG        !(LCM,NSCM)
  INTEGER,ALLOCATABLE,DIMENSION(:)     :: BEDMAP        !(LCM)
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LAYERACTIVE   !(KB,LCM)
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: NCORENO       !(IGM,JGM)
  
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TIMEDRY       !(LCM)

  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: ALPHA_PX      !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: ALPHA_PY      !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: ALPHA_RX      !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: ALPHA_RY      !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: ATOXKIN       !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: ATOXVOL       !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: BLVEL         !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: BULKDENS      !(KB,LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: CBL           !(LCM,NSCM) 
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: CBLTOX        !(LCM,NTXM) 
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: CBLTXCON      !(LCM,NSCM,NTXM) 
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: CSED_C1_NEW
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: CSED_C1_OLD
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: CSED_C2_NEW
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: CSED_C2_OLD
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: D50           !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: D50AVG        !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: DBL           !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: DEPO          !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: DISTAR        !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: DWS           !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: DWSIN         !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: DZBL          !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: DZBL_LAST     !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: ERATETEMP     !(INCORE,KB,ITBM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: EBL           !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: ERATEND       !(NSICM,ITBM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: ERATE         !(KB,LCM,ITBM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: ESUS          !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: ETOTO         !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: FWDIR         !(LCM,8)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: FWVTP         !(LCM)   
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: HPCM          !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: KPART         !(NTXM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:,:) :: PERSED        !(NSCM,KB,LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: PSUS          !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: QBLFLUX       !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: SCND          !(NSICM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: SEDDENS       !(INCORE)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: SH_SCALE      !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: SSGI          !(NSCM)   DSEDGMM array
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: STWVHT        !(LCM,200)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: STWVTP        !(LCM,200)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: STWVDR        !(LCM,200)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TAU           !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: TAUCOR        !(KB,LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TAUCRITE      !(NSICM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TCRE          !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TAULOC        !(ITBM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TCRSUS        !(NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: TRANS         !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: TSED          !(KB,LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: TSED0         !(KB,LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TSEDT         !(LCM),TOXFTMP,TOXXTMP
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: TSET0T        !(LCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: UBL           !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: USW           !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:,:)   :: VBL           !(LCM,NSCM)
  REAL(RKD),ALLOCATABLE,DIMENSION(:)     :: WVANG         !(LCM)

  CHARACTER*7  OPT_WVOL,OPT_CHEM_MASSBAL,OPT_SORPTION,OPT_VOLAT
  CHARACTER*8  OPT_UWIND,OPT_ATEMPC
  CHARACTER(LEN=7) :: OPT_SEDTRAN
  CHARACTER(LEN=7) :: OPT_CHEMBED
  CHARACTER(LEN=8) :: OPT_CBED_START
  CHARACTER(LEN=8) :: OPT_CBED_GWINFLOW
  CHARACTER(LEN=8) :: OPT_CBED_GW_CONC
  CHARACTER(LEN=8) :: OPT_TEMPC_BED
  CHARACTER(LEN=8) :: OPT_BDENS_BED
  CHARACTER(LEN=8) :: OPT_DOC_BED
  CHARACTER(LEN=8) :: OPT_FOC_BED
  CHARACTER(LEN=8) :: OPT_FSED_BED
  CHARACTER(LEN=8) :: OPT_KOC_BED
  CHARACTER(LEN=8) :: OPT_KOC_BED_VARY
  CHARACTER(LEN=8) :: OPT_POROS_BED
  CHARACTER(LEN=8) :: OPT_WTEMPC

  CHARACTER*64,ALLOCATABLE,DIMENSION(:) :: FNAM713_CBED_GW_C
  CHARACTER* 9,ALLOCATABLE,DIMENSION(:) :: OPT_CBED_DEC_MTX
  CHARACTER* 8,ALLOCATABLE,DIMENSION(:) :: OPT_DECAY_CBED

  CHARACTER*80,ALLOCATABLE,DIMENSION(:) :: FNAM_CBED_DECAY

  REAL,ALLOCATABLE,DIMENSION(:) :: TOX_ADJ            ! *** Volatilization rate adjustment factor  (dimensionless)
  REAL,ALLOCATABLE,DIMENSION(:) :: TOX_ATM            ! *** Atmosphereic concentration  (ug/l)
  REAL,ALLOCATABLE,DIMENSION(:) :: TOX_HE             ! *** Henry's constant, ( PA(atm)*m^3(water)/mole(gas) )
  REAL,ALLOCATABLE,DIMENSION(:) :: TOX_MW             ! *** Molecular Weight  (g/mole)
  REAL,ALLOCATABLE,DIMENSION(:) :: TOX_KV_TCOEFF      ! *** Mass Transfer Temperature Coefficient (dimensionless)

  ! End SEDZLJ variables

  ! Begin Dissolved Carbondioxide variables    VB
  REAL,ALLOCATABLE,DIMENSION(:)     :: CO2WQ
  REAL,ALLOCATABLE,DIMENSION(:)     :: CDOSATIDX
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQCDOS
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: WQITOP
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQKRCDOS
  REAL,ALLOCATABLE,DIMENSION(:)     :: WQP22
  ! End Dissolved Carbondioxide variables

  ! *******************************************************************************************
  ! *** LAGRANGIAN TRAJECTORIES OF DRIFTERS
  INTEGER,ALLOCATABLE :: NACTT(:)
  INTEGER,ALLOCATABLE :: JSPD(:)
  
  REAL,      ALLOCATABLE :: MOC(:)            ! *** MASS CONCENTRATION OF OIL [MG/L]

  REAL(RKD) ,ALLOCATABLE :: XLA(:)            ! *** XLA(NPD) DRIFTER COORDINATES
  REAL(RKD) ,ALLOCATABLE :: YLA(:)            ! *** YLA(NPD)
  REAL(RKD) ,ALLOCATABLE :: ZLA(:)            ! *** ZLA(NPD)
  REAL(RKD) ,ALLOCATABLE :: VELB(:)           ! *** VELB(1:KC+1) VETICAL DISTRIBUTION FOR U,V,W

  REAL(RKD) ,ALLOCATABLE :: DLA(:)            ! *** DLA(NPD) INITIAL DEPTH OF DRIFTER
  REAL(RKD),ALLOCATABLE :: XCOR(:,:)          ! *** XCOR(L,1:4) X POLYGON VERTICES, X(L,5): CENTROID X
  REAL(RKD),ALLOCATABLE :: YCOR(:,:)          ! *** YCOR(L,1:4) Y POLYGON VERTICES, Y(L,5): CENTROID Y
  REAL(RKD),ALLOCATABLE :: AREA(:)            ! *** AREA OF POLYGON LIJ
  REAL(RKD),ALLOCATABLE :: HPLA(:)            ! *** TOTAL WATER DEPTH OF DRIFTERS
  REAL(RKD),ALLOCATABLE :: BELVLA(:)          ! *** BOTTOM ELEVATION OF DRIFTERS
  REAL(RKD),ALLOCATABLE :: DARE(:)            ! *** (1:NGRP) AREA OF OIL DRIFTER OF EACH GROUP   [M2]
  REAL(RKD),ALLOCATABLE :: DDEN(:)            ! *** (1:NGRP) DENSITY OF OIL SPILL OF EACH GROUP[KG/M3]
  REAL(RKD),ALLOCATABLE :: DVOL(:)            ! *** (1:NPD ) VOLUME OF EACH OIL DRIFTER [M3]
  REAL(RKD),ALLOCATABLE :: DVOL0(:)           ! *** (1:NPD ) VOLUME OF EACH OIL DRIFTER [M3]
  REAL(RKD),ALLOCATABLE :: GVOL(:)            ! *** (1:NGRP) TOTAL VOLUME OF OIL FOR EACH GROUP [M3]
  REAL(RKD),ALLOCATABLE :: DRAT(:)            ! *** (1:NGRP) BIOGRADATION RATE OF EACH OIL DRIFTER OF EACH GROUP
  REAL(RKD),ALLOCATABLE :: DTEM(:)            ! *** (1:NGRP) TEMPERATURE (C) OF EACH OIL DRIFTER OF EACH GROUP
  REAL(RKD),ALLOCATABLE :: DVAP(:)            ! *** (1:NGRP) VAPOUR PRESSURE OF THE BULK LIQUID [PA]
  REAL(RKD),ALLOCATABLE :: DVMO(:)            ! *** (1:NGRP) LIQUID'S MOLAR VOLUME [M3/MOL]
  
  INTEGER,ALLOCATABLE :: LLA(:)               ! *** LIJ(NP) INDEX OF POLYGON
  INTEGER,ALLOCATABLE :: KLA(:)               ! *** K OF DRIFTER NP
  INTEGER,ALLOCATABLE :: ISOILSPI(:)          ! *** (1:NGRP), 0: NORMAL DRIFTER/1:OIL DRIFTER
  INTEGER(4)            :: LA_ZCAL            ! *** OPTION TO CALCULATE Z
  INTEGER(4)            :: LA_PRAN            ! *** OPTION TO ADD A RANDOM MOVEMENT
  INTEGER(4)            :: LA_DIFOP           ! *** OPTION FOR DIFFUSION COEFFICIENT 
  INTEGER(4)            :: LA_FIRSTCALL
  INTEGER(4)            :: DEPOP              ! *** OPTION FOR READING DEPTH  COLMUN IN DRIFTER.INP 
  INTEGER(4)            :: XYZSCL

  REAL(8)               :: LA_BEGTI0          ! *** TIME BEGINNING FOR LAGRA
  REAL(8)               :: LA_ENDTI0          ! *** TIME ENDING FOR LAGRA
  REAL(RKD)             :: LA_FREQ            ! *** LA_FREQ IN HOURS FOR LAGRA OUTPUT
  REAL(RKD)             :: LA_HORDIF          ! *** HORIZONTAL DIFFUSION
  REAL(RKD)             :: LA_VERDIF          ! *** VERTICAL DIFFUSION
  REAL(RKD)             :: SLIPFACTOR         ! *** WALL SLIP FACTOR FOR PARTICLES NEAR WALLS (DIMENSIONLESS)  
  
  ! ISWAVE = 3
  REAL(RKD)             :: KSW                ! *** NIKURADSE ROUGHNESS (APPROXIMATE 2.5*D50)
  INTEGER(1),ALLOCATABLE :: UMASK(:)
  INTEGER(1),ALLOCATABLE :: VMASK(:)

  ! Begin MHK variables
  LOGICAL :: LMHK                                    ! Flag to indicate MHK is active
  INTEGER :: MHKTYP                                  ! number of different types of MHK devices
  INTEGER :: TCOUNT                                  ! number of cells with MHK devices
  INTEGER :: UPSTREAM                                ! flag to decide if upstream or cell velocities are used
  REAL :: BETAMHK_P,BETAMHK_D,CE4MHK,PB_COEF         ! adjustable parameters that affect wake structure through K-e terms
  INTEGER :: OUTPUTFLAG                              ! this tells the Tecplot routine what to output
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: IJLTURB    ! (TCOUNT,3) # of cells with turbines:1=I-loc, 2=J-loc, 3=L-loc
  REAL,ALLOCATABLE,DIMENSION(:)     :: CTMHK         ! (MHKTYPE) # of turbine types
  REAL,ALLOCATABLE,DIMENSION(:)     :: CDSUP         ! (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:)     :: DENMHK        ! density of MHK devices (#/cell) (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ESUP          ! energy dissipated from MHK support (LCM,TCOUNT)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: EMHK          ! energy dissipated from MHK device (LCM,TCOUNT)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FXMHK         ! (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: FXMHKE        ! (LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FXSUP         ! (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: FXSUPE        ! (LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FYMHK         ! (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: FYMHKE        ! (LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: FYSUP         ! (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: FYSUPE        ! (LCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: HEIGHTMHK     ! (MHKTYPE) # of turbine types
  REAL,ALLOCATABLE,DIMENSION(:)     :: HEIGHTSUP     ! (MHKTYPE) # of turbine types
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PMHK          ! array that accumulates MHK power (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: PSUP          ! array that accumulates vegetative power (LCM,KCM)
  REAL,ALLOCATABLE,DIMENSION(:)     :: REFELEV       ! (MHKTYPE) # of turbine types
  REAL,ALLOCATABLE,DIMENSION(:)     :: VMAXCUT       ! (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:)     :: VMINCUT       ! (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:)     :: WIDTHMHK      ! (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:)     :: WIDTHSUP      ! (MHKTYPE)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZMAXMHK       ! (MHKTYPE,LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZMAXSUP       ! (MHKTYPE,LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZMINMHK       ! (MHKTYPE,LCM)
  REAL,ALLOCATABLE,DIMENSION(:,:)   :: ZMINSUP       ! (MHKTYPE,LCM)
  ! End MHK variables

  ! *** OMP TEMPORARY VARIABLES,  LCM,KCM,NTHREADS
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FQC  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FUHUD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FVHUD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FUHVD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FVHVD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FWUU  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FWVV  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: FQCPAD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: QSUMNAD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: QSUMPAD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: POS  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: UUUU  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: VVVV  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WWWW  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: DUU  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: DVV  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CONQ
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CON2
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CMAX  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CMIN  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CONTD  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CONTMN  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: CONTMX  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQBCCON  
  REAL,ALLOCATABLE,DIMENSION(:,:,:) :: WQBCCON1  

  !NetCDF & RESTART
  INTEGER(IK4)    :: NCDFOUT           
  INTEGER(IK4)    :: DEFLEV            
  INTEGER(IK4)    :: BLK
  INTEGER(IK4)    :: IMN
  INTEGER(IK4)    :: JMN
  INTEGER(IK4)    :: IMX
  INTEGER(IK4)    :: JMX
  CHARACTER(5)  :: PROJ
  CHARACTER(10) :: BASEDATE
  CHARACTER(10) :: SDATE
  CHARACTER(8)  :: BASETIME
  CHARACTER(10) :: RSTDATE
  CHARACTER(2)  :: RSTTIME
  
  CHARACTER(120) :: NCFILE
  CHARACTER(120) :: RESFILE
  CHARACTER(120) :: RSTFILE
  CHARACTER(120) :: TEMFILE

  INTEGER(IK4)    :: HEMI
  INTEGER(IK4)    :: UTMZ
  INTEGER(IK4)    :: ROTA
  INTEGER(IK4)    :: ISGREGOR
  INTEGER(IK4)    :: ICONTINUE
  INTEGER(IK4)    :: RSTFIRST_WC
  INTEGER(IK4)    :: RSTFIRST_WS
  INTEGER(IK4)    :: RSTFIRST_VEL
  INTEGER(IK4)    :: RSTFIRST_WQ
  INTEGER(IK4)    :: RSTFIRST_SEDZLJ
  INTEGER(IK4)    :: RSTFIRST_BED
  INTEGER(IK4)    :: RSTFIRST_SD
  INTEGER(IK4)    :: RSTFIRST_BC
  INTEGER(IK4)    :: RSTFIRST_RPEM
  INTEGER(IK4)    :: ISSGLFIL
  
  REAL       :: HREST
  REAL(RKD)  :: TBEGINC
  REAL       :: TBEGNCDF
  REAL       :: TENDNCDF
  
  INTEGER(4) :: ISNCDF(12)          ! OPTION FOR NCDF OUTPUT 0:NO/1:YES
  
  REAL,   ALLOCATABLE :: XCR(:,:,:)
  REAL,   ALLOCATABLE :: YCR(:,:,:)
  REAL,   ALLOCATABLE :: ZBT(:,:  )
  REAL,   ALLOCATABLE :: WDEP(:,:)
  REAL,   ALLOCATABLE :: VX(:,:,:)
  REAL,   ALLOCATABLE :: VY(:,:,:)
  REAL,   ALLOCATABLE :: VZ(:,:,:)
  REAL,   ALLOCATABLE :: SAL3(:,:,:)
  
  ! *** FOR ICE 
  INTEGER,ALLOCATABLE :: MITLAST(:)
  
  REAL,   ALLOCATABLE :: FRAZILICE(:,:)
  REAL,   ALLOCATABLE :: FRAZILICE1(:,:)
  REAL,   ALLOCATABLE :: ICECOVER(:)
  REAL,   ALLOCATABLE :: ICERATE(:)
  REAL,   ALLOCATABLE :: ICETHICK(:)
  REAL,   ALLOCATABLE :: ICETHICK1(:)
  REAL,   ALLOCATABLE :: ICETEMP(:)
  REAL,   ALLOCATABLE :: ICEVOL(:)
  REAL,   ALLOCATABLE :: RICEWHT(:,:,:)
  REAL,   ALLOCATABLE :: TCISER(:)    
  REAL,   ALLOCATABLE :: TAISER(:)    
  REAL,   ALLOCATABLE :: RICECOVT(:)  
  REAL,   ALLOCATABLE :: RICETHKT(:)  
  REAL,   ALLOCATABLE :: RHOW(:,:)  
  
  LOGICAL(IK4), ALLOCATABLE :: ICECELL(:)
  
  ! *** FOR RPEM
  REAL, ALLOCATABLE :: WQRPS(:),     WQRPR(:),     WQRPE(:),     WQRPD(:)
  REAL, ALLOCATABLE :: PRPS(:),      RRPS(:),      RRPR(:),      PRPE(:),   RRPE(:)
  REAL, ALLOCATABLE :: WQRPSR(:),    WQRPSL(:),    WQRPER(:),    WQRPEL(:), WQRPDL(:)
  REAL, ALLOCATABLE :: WQRPSRP(:),   WQRPSLP(:),   WQRPERP(:),   WQRPELP(:)
  REAL, ALLOCATABLE :: WQRPDLP(:),   WQRPSRN(:),   WQRPSLN(:),   WQRPERN(:)
  REAL, ALLOCATABLE :: WQRPELN(:),   WQRPDLN(:),   WQRPRR(:),    WQRPRL(:)
  REAL, ALLOCATABLE :: WQRPRRP(:),   WQRPRLP(:),   WQRPRRN(:),   WQRPRLN(:)
  REAL, ALLOCATABLE :: FRPSPW(:),    FRPSNW(:),    PNRPS(:),     PNRPE(:),  RJRPRS(:)   
  REAL, ALLOCATABLE :: XLIMTPRPS(:), XLIMTPRPE(:), XLIMTRRPS(:), XLIMTRRPE(:)
  REAL, ALLOCATABLE :: XLIMTRRPR(:), XLIMNRPS(:),  XLIMNRPE(:),  XLIMLRPS(:)
  REAL, ALLOCATABLE :: XLIMLRPE(:),  RISS(:),      RISSO(:),     RISSOE(:)
  REAL, ALLOCATABLE :: RPEMTPRPS(:), RPEMTPRPE(:), RPEMTRRPS(:)
  REAL, ALLOCATABLE :: RPEMTRRPE(:), RPEMTRRPR(:)

  ! ** REAL SCALARS                                                                                                       
  REAL       :: HRPEMIC,RPSO,RPRO,RPEO,RPDO,RPSOC,RPEOC,RPSNC,RPEMMINT
  REAL       :: RPRNC,RPENC,RPSPC,RPRPC,RPEPC,PMRPS,FPRPR,RMRPS,RLRPS,FRPSD
  REAL       :: RKHNPRPS,RMRPR,RLRPR,RLRPD,RJRPRSC,RKRPORS,ROSR,RKRPRS,RISSS
  REAL       :: PMRPE,RMRPE,RLRPE,RKHNPRPE,RKHNRPS,RKHNRPR,RKHNRPE,RKHPRPS
  REAL       :: RKHPRPR,RKHPRPE,TP1RPS,TP2RPS,RKTP1RPS,RKTP2RPS,TP1RPE
  REAL       :: RKTP1RPE,RKTP2RPE,HRPS,HOPT,RKERPE,CCHLRPE,RISSOM,RISSOEM
  REAL       :: STOXS,STOXE,TR1RPS,TR2RPS,RKTR1RPS,RKTR2RPS,TR1RPR,TR2RPR
  REAL       :: RKTR1RPR,RKTR2RPR,TR1RPE,TR2RPE,RKTR1RPE,RKTR2RPE,FCRRPS
  REAL       :: FCLRPS,FCDRPS,FCRLRPS,FCLLRPS,FCDLRPS,FCRRPR,FCLRPR,FCDRPR
  REAL       :: FCRLRPR,FCLLRPR,FCDLRPR,FCRRPE,FCLRPE,FCDRPE,FCRLRPE
  REAL       :: FCLLRPE,FCDLRPE,FCRLRPD,FCLLRPD,FCDLRPD,FPRRPS,FPLRPS
  REAL       :: FPDRPS,FPIRPS,FPRLRPS,FPLLRPS,FPDLRPS,FPILRPS,FPRRPR,FPLRPR
  REAL       :: FPDRPR,FPIRPR,FPRLRPR,FPLLRPR,FPDLRPR,FPILRPR,FPRRPE,FPLRPE
  REAL       :: FPDRPE,FPIRPE,FPRLRPE,FPLLRPE,FPDLRPE,FPILRPE,FPRLRPD
  REAL       :: FPLLRPD,FPDLRPD,FPILRPD,FNRRPS,FNLRPS,FNDRPS,FNIRPS,FNRLRPS
  REAL       :: FNLLRPS,FNDLRPS,FNILRPS,FNRRPR,FNLRPR,FNDRPR,FNIRPR,FNRLRPR
  REAL       :: FNLLRPR,FNDLRPR,FNILRPR,FNRRPE,FNLRPE,FNDRPE,FNIRPE,FNRLRPE
  REAL       :: FNLLRPE,FNDLRPE,FNILRPE,FNRLRPD,FNLLRPD,FNDLRPD,FNILRPD
  REAL       :: FRPRRPG1,FRPRRPG2,FRPRRPG3
  REAL       :: RKSH,RKHI

  ! ** INTEGER ARRAYS                                                                                                     
  INTEGER, ALLOCATABLE :: IRPEMTS(:),JRPEMTS(:),LRPEMTS(:)

  ! ** INTEGER SCALARS                                                                                                    
  INTEGER   :: ISRPEM,INITRPEM,IRPEMWC,IRPEME,IJRPRS
  INTEGER   :: ISTOXRPE,JSRPEM,ISRPEMSPAC,ISRPEMSPFR,ITOXTEMP
  INTEGER   :: ISRPEMTIME,ISRPEMTIFR,ISRPEMTILC,NSRPEMSPFR
  INTEGER   :: NCRPEMRST,IRPEMSD
  INTEGER   :: NRPEM, NRPEMEE
  INTEGER   :: NRPEMSTEPS

  ! ** LOGICAL                                                                                                            
  LOGICAL(4), ALLOCATABLE :: LMASKRPEM(:)
  
  ! *** WAVES
  TYPE (WAVE), ALLOCATABLE :: WV(:)
  
  ! ** SWAN
  INTEGER(4) :: SWANGRP,ISSTEAD
  INTEGER    :: NLOC,NWVTIM,WVLCAL
  INTEGER(4) :: NHS,NPK,NRT,NWL,NHP,NDI,NCOL
  REAL(RKD), ALLOCATABLE :: WAVEDAY(:)
  TYPE (CELL) :: SWNLOC

  ! ** HIGH FREQUENCY OUTPUT
  INTEGER :: HFREOUT,NSUBSET
  REAL,        ALLOCATABLE :: UK(:),VK(:)           
  TYPE (CELL), ALLOCATABLE :: HFREGRP(:)
  INTEGER,     ALLOCATABLE :: IJHFRE(:),NPNT(:)  
  REAL(RKD),   ALLOCATABLE :: HFREDAYBG(:),HFREDAYEN(:)
  REAL(RKD),   ALLOCATABLE :: HFREDUR(:),HFREDAY(:),HFREMIN(:)

  ! *** WASP
  CHARACTER*20 HYDFIL
  INTEGER(4)    IHL_HANDLE
  
  ! *** RESTRUCTURED APPROACH FOR TIME SERIES
  INTEGER :: NSTA(8)              
  TYPE(TSR), ALLOCATABLE :: QSER(:)    
  TYPE(TSR), ALLOCATABLE :: TSSAL(:)    
  TYPE(TSR), ALLOCATABLE :: TSTEM(:)    
  TYPE(TSR), ALLOCATABLE :: TSDYE(:)    
  TYPE(TSR), ALLOCATABLE :: TSSFL(:)    
  TYPE(TSR), ALLOCATABLE :: TSICE(:)   
  TYPE(TSR), ALLOCATABLE :: TSATM(:)
  TYPE(TSR), ALLOCATABLE :: TSWND(:)
  TYPE(TSR), ALLOCATABLE :: TSTOX(:,:)  
  TYPE(TSR), ALLOCATABLE :: TSSED(:,:)  
  TYPE(TSR), ALLOCATABLE :: TSSND(:,:)  
  TYPE(TSR), ALLOCATABLE :: TSWQ(:,:)  
  
  ! *** NEW VARIABLES FOR QCTL NQCTYP=3 & 4 
  INTEGER,ALLOCATABLE,DIMENSION(:) :: NLOWCHORD
  REAL,ALLOCATABLE,DIMENSION(:)    :: LOWCHORDU
  REAL,ALLOCATABLE,DIMENSION(:)    :: LOWCHORDV
  REAL,ALLOCATABLE,DIMENSION(:)    :: HQCTLU
  REAL,ALLOCATABLE,DIMENSION(:)    :: HQCTLD
  REAL,ALLOCATABLE,DIMENSION(:,:)  :: SAVESUB
  REAL,ALLOCATABLE,DIMENSION(:,:)  :: SAVESVB

  ! *** SIGMA-Z SGZ
  INTEGER :: LAWET                                ! *** NUMBER OF ACTIVE/WET CELLS FOR CURRENT ITERATION
  INTEGER :: LADRY                                ! *** NUMBER OF FIRST TIME INACTIVE/DRY CELLS FOR CURRENT ITERATION
  INTEGER :: LASGZ1                               ! *** NUMBER OF ACTIVE/WET CELLS FOR CURRENT ITERATION WHERE KC-KSZ+1 = 1 (EQUIVALENT KC=1)
  INTEGER :: LDMWET                               ! *** NUMBER OF ACTIVE/WET CELLS PER DOMAIN
  INTEGER :: LDMDRY                               ! *** NUMBER OF ACTIVE/WET CELLS PER DOMAIN 
  INTEGER :: LDMSGZ1                              ! *** NUMBER OF ACTIVE/WET CELLS PER DOMAIN  (EQUIVALENT KC=1)
  INTEGER :: NHDMF                                ! *** NUMBER OF ACTIVE/WET HDMF CELLS
  
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLWET   ! *** NUMBER OF ACTIVE CELLS FOR EACH LAYER BY DOMAIN.  ND=0 FOR ENTIRE LAYER
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKWET   ! *** L INDEX FOR THE SPECIFIED LAYER AND DOMAIN
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLSWET  ! *** NUMBER OF ACTIVE CELLS FOR EACH LAYER BY DOMAIN FOR KSZ(L) TO KC-1 (NOT KS)   ALBERTA
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKSWET  ! *** L INDEX FOR THE SPECIFIED LAYER AND DOMAIN FOR LLSWET
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLWETZ  ! *** NUMBER OF ACTIVE CELLS WHERE KSZ/=KC FOR EACH LAYER BY DOMAIN
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKWETZ  ! *** L INDEX FOR THE SPECIFIED LAYER AND DOMAIN
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLHDMF  ! *** NUMBER OF HMDF ACTIVE CELLS FOR EACH LAYER BY DOMAIN.  ND=0 FOR ENTIRE LAYER
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKHDMF  ! *** L INDEX FOR THE HDMF CELLS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLVEG   ! *** NUMBER OF HMDF ACTIVE CELLS FOR EACH LAYER BY DOMAIN.  ND=0 FOR ENTIRE LAYER
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKVEG   ! *** L INDEX FOR THE HDMF CELLS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLSED   ! *** NUMBER OF ACTIVE SEDIMENT BED CELLS FOR EACH LAYER
  INTEGER,ALLOCATABLE,DIMENSION(:,:,:) :: LKSED   ! *** L INDEX FOR THE ACTIVE SEDIMENT BED CELLS
  INTEGER,ALLOCATABLE,DIMENSION(:,:)   :: LLSGZ1  ! *** L INDEX FOR THE WET CELLS WHOSE LAYER COUNT IS 1
  
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: LWET      ! *** L INDEX FOR THE WET CELLS
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: LDRY      ! *** L INDEX FOR THE DRY CELLS.  DRY CELLS ONLY INITIALIZED ON FIRST DRY.
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: LSGZ1     ! *** L INDEX FOR THE WET CELLS WHOSE LAYER COUNT IS 1
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZ       ! *** LAYER NUMBER OF BOTTOM MOST ACTIVE LAYER FOR THE SPECIFIED CELL
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZU      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE WEST CELL
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZV      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE SOUTH CELL
  
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZE      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE EAST CELL
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZW      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE WEST CELL
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZN      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE NORTH CELL
  INTEGER,ALLOCATABLE,DIMENSION(:)   :: KSZS      ! *** LAYER NUMBER OF ACTIVE LAYER MATCHING THE BOTTOM LAYER OF THE SOUTH CELL
  
  LOGICAL,ALLOCATABLE,DIMENSION(:,:) :: LKSZ      ! *** LOGICAL FLAG IF THE SPECIFIED CELL AND LAYER IS NOT ACTIVE (TRUE=NOT ACTIVE)
  LOGICAL,ALLOCATABLE,DIMENSION(:,:) :: LHDMF     ! *** LOGICAL FLAG IF THE SPECIFIED HDMF CELL AND LAYER IS SELECTED
  LOGICAL,ALLOCATABLE,DIMENSION(:)   :: LVEG      ! *** LOGICAL FLAG IF THE SPECIFIED VEGETATION CELL IS SELECTED

  REAL,ALLOCATABLE,DIMENSION(:)   :: BELVE
  REAL,ALLOCATABLE,DIMENSION(:)   :: BELVW
  REAL,ALLOCATABLE,DIMENSION(:)   :: BELVN
  REAL,ALLOCATABLE,DIMENSION(:)   :: BELVS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: BE
  REAL,ALLOCATABLE,DIMENSION(:,:) :: BW
  REAL,ALLOCATABLE,DIMENSION(:,:) :: BN
  REAL,ALLOCATABLE,DIMENSION(:,:) :: BS
  REAL,ALLOCATABLE,DIMENSION(:)   :: BEE
  REAL,ALLOCATABLE,DIMENSION(:)   :: BEW
  REAL,ALLOCATABLE,DIMENSION(:)   :: BEN
  REAL,ALLOCATABLE,DIMENSION(:)   :: BES
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI1E
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI1W
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI1N
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI1S
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI2E
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI2W
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI2N
  REAL,ALLOCATABLE,DIMENSION(:)   :: BI2S
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZIGSD4U
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZIGSD4V
  REAL,ALLOCATABLE,DIMENSION(:)   :: HPE
  REAL,ALLOCATABLE,DIMENSION(:)   :: HPW
  REAL,ALLOCATABLE,DIMENSION(:)   :: HPN
  REAL,ALLOCATABLE,DIMENSION(:)   :: HPS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZDU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZDV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZFU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZFV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZMU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZLU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZLV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZMV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZRU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZRV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZUU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: CDZUV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZE
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZW
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZN
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZZE
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZZW
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZZN
  REAL,ALLOCATABLE,DIMENSION(:,:) :: ZZS

  REAL,ALLOCATABLE,DIMENSION(:)   :: DZCK         ! *** DEFAULT/GLOBAL SIGMA LAYER SPLITS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZC          ! *** CELL BY CELL SIGMA LAYER SPLITS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZCU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZCV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZG
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZGU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: DZGV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SUB3D
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SUB3DO
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SVB3D
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SVB3DO
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZKE
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZKW
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZKN
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZKS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZE
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZW
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZN
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZS
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: SGZV
  REAL,ALLOCATABLE,DIMENSION(:,:) :: FSGZU
  REAL,ALLOCATABLE,DIMENSION(:,:) :: FSGZV
  
  LOGICAL,ALLOCATABLE,DIMENSION(:,:) :: LSGZU
  LOGICAL,ALLOCATABLE,DIMENSION(:,:) :: LSGZV

  REAL,ALLOCATABLE,DIMENSION(:,:) :: HPK
  REAL,ALLOCATABLE,DIMENSION(:,:) :: HPKI
  REAL,ALLOCATABLE,DIMENSION(:,:) :: H1PK
  REAL,ALLOCATABLE,DIMENSION(:,:) :: H2PK
  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDY
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDX
  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDY1
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDX1
  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDY2
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDX2

  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDYF
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDXF
  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDYF1
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDXF1
  REAL,ALLOCATABLE,DIMENSION(:,:) :: UHDYF2
  REAL,ALLOCATABLE,DIMENSION(:,:) :: VHDXF2

  ! *** LARGE ASPECT RATIO LIST
  INTEGER :: NASPECT
  LOGICAL,ALLOCATABLE,DIMENSION(:) :: LASPECT

  ! *** EVAPORATION
  INTEGER                           :: IEVAP
  REAL                              :: WINDFA      ! *** WIND FACTOR COEFFICIENT A
  REAL                              :: WINDFB      ! *** WIND FACTOR COEFFICIENT B
  REAL                              :: WINDFC      ! *** WIND FACTOR COEFFICIENT C
  REAL,ALLOCATABLE,DIMENSION(:)     :: CLEVAP
  REAL,ALLOCATABLE,DIMENSION(:)     :: EVAPGW
  REAL,ALLOCATABLE,DIMENSION(:)     :: EVAPSW
  REAL,ALLOCATABLE,DIMENSION(:)     :: EVAPT
  REAL,ALLOCATABLE,DIMENSION(:)     :: EVPGLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: EVPSLPF
  REAL,ALLOCATABLE,DIMENSION(:)     :: VPAT
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVPW
  REAL,ALLOCATABLE,DIMENSION(:)     :: SVPAT
  
  REAL,ALLOCATABLE,DIMENSION(:)     :: TDEWT       ! *** DEW POINT TEMPERATURE (DEG C)

  ! ** OMP
  INTEGER(4)  :: NTHREADS
  REAL(RKD) TIME_END
  REAL(RKD) TIME_START
  REAL(RKD) TCGRS
  
  ! ** TIME BLOCKS
  INTEGER :: NWNDMAP
  INTEGER :: NATMMAP
  INTEGER :: NICEMAP
  REAL,ALLOCATABLE,DIMENSION(:)     :: TWNDMAPBEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: TWNDMAPEND
  REAL,ALLOCATABLE,DIMENSION(:)     :: TATMMAPBEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: TATMMAPEND
  REAL,ALLOCATABLE,DIMENSION(:)     :: TICEMAPBEG
  REAL,ALLOCATABLE,DIMENSION(:)     :: TICEMAPEND
    
  ! ** HYDRAULIC STRUCTURES
  REAL,   ALLOCATABLE :: HS_FACTOR(:)           ! *** DISCHARGE DISTRIBUTION FACTOR                                           (BY CELL)
  REAL,   ALLOCATABLE :: HS_NTIMES(:)           ! *** NUMBER OF TIMES HYDRAULIC STRUCTURE DEFINITION CHANGES                  (BY CELL)
  REAL,   ALLOCATABLE :: HS_TRANSITION(:)       ! *** NUMBER OF SECONDS TO TRANSITION FROM TIME (T) TO TIME (T+1)             (BY CELL)
  REAL,   ALLOCATABLE :: HS_TIMES(:,:)          ! *** TIME (DAYS) OF WHEN TO TRANSITION TO NEW HYDRAULIC STRUCTURE DEFINITION (BY CELL)
  INTEGER,ALLOCATABLE :: HS_SERIESQ(:,:)        ! *** HYDRAULIC STRUCTURE LOOKUP TABLE OR EQUATION NUMBER (MUST MATCH NQCTYP) (BY CELL)

  INTEGER             :: NHYDST                 ! *** NUMBER OF EQUATION DEFINED HYDRAULIC STRUCTURE GROUPS
  INTEGER,ALLOCATABLE :: HS_XSTYPE(:)           ! *** CROSS-SECTION TYPE: 1:CIRCLE, 2:ELLIP, 3:RECTANGLE, 4:PARABOLA, 5:V NOTCH, 6:TRAPEZOID
  INTEGER,ALLOCATABLE :: HS_REVERSE(:)          ! *** REVERSE FLOW FLAG:  0-DON'T ALLOW REVERSE FLOW,  1-ALLOW REVERSE FLOW

  REAL,   ALLOCATABLE :: HS_WIDTH(:)            ! *** WIDTH  (DIAMETER/2*RA OF ELLIP) OF HYDRAULIC STURCTURE       [M]
  REAL,   ALLOCATABLE :: HS_HEIGHT(:)           ! *** HEIGHT (2*RB OF ELLIP) OF HYDRAULIC STURCTURE                [M]  
  REAL,   ALLOCATABLE :: HS_LENGTH(:)           ! *** LENGTH OF CULVERT                                            [M]  
  REAL,   ALLOCATABLE :: HS_MANN(:)             ! *** MANNINGS ROUGHNESS FACTOR  (METRIC)
  REAL,   ALLOCATABLE :: HS_ANGLE(:)            ! *** V NOTCH - ANGLE                                              [DEG]
  REAL,   ALLOCATABLE :: HS_USELEV(:)           ! *** UPSTREAM INVERT ELEVATION                                    [M]
  REAL,   ALLOCATABLE :: HS_DSELEV(:)           ! *** DOWNSTREAM INVERT ELEVATION                                  [M]
  REAL,   ALLOCATABLE :: HS_COEFF(:,:)          ! *** HYDRAULIC COEFFICIENT (DEPENDS ON EQUATION TYPE, I.E. NQCTYP)
  
  TYPE(STRCONTROL),SAVE,ALLOCATABLE,DIMENSION(:) :: HSCTL       ! *** HYDRAULIC SRUCTURE CONTROL
  TYPE(STRCONTROL),SAVE,ALLOCATABLE,DIMENSION(:) :: WRCTL       ! *** WITHDRAWAL/RETURN CONTROL
  TYPE(CONTROLSERIES),SAVE,ALLOCATABLE,DIMENSION(:) :: QCTLSER  ! *** CONTROL TIME-SERIES
  TYPE(CONTROLRULES),SAVE,ALLOCATABLE,DIMENSION(:) :: QCRULES   ! *** CONTROL RULES

  INTEGER :: NQCTLSER,NQCRULES
END MODULE
