! ---------------------------------------------------------------------
SUBROUTINE aloca!(nrf, ncf, incf, inrf, nmons)
!-----------------------------------------------------------------------
!     Allocate variables
!---------------------------Code history--------------------------------
! ---------------------------------------------------------------------
      use comvar

      implicit none

      print *, 'NMONS no ALOCA: ', nmons2
      ALLOCATE (area(nrf))
      ALLOCATE (latscale(nrf))
      ALLOCATE (lonscale(ncf))

      ALLOCATE (sillh(ncf,nrf))
      ALLOCATE (larea(ncf,nrf))
      ALLOCATE (outi(ncf,nrf))
      ALLOCATE (outj(ncf,nrf))
      ALLOCATE (alat(nrf))
      ALLOCATE (alon(ncf))
!
      ALLOCATE (sfluxin(incf,inrf))
      ALLOCATE (fluxout(incf,inrf))
      ALLOCATE (laream(incf,inrf))
      ALLOCATE (volb(incf,inrf))
      ALLOCATE (volr(incf,inrf))
      ALLOCATE (areat(incf,inrf))
      ALLOCATE (temp(incf,inrf))
      ALLOCATE (tempdr(incf,inrf))
      ALLOCATE (tempdl(incf,inrf))
      ALLOCATE (tempdw(incf,inrf))
      ALLOCATE (volt(incf,inrf))
      ALLOCATE (basin2(incf,inrf))
      ALLOCATE (fluxoutw(incf,inrf))
      ALLOCATE (sfluxinw(incf,inrf))
      ALLOCATE (velocity(incf,inrf))
      ALLOCATE (vollm(incf,inrf))
      ALLOCATE (grid2(incf,inrf))
      ALLOCATE (stddev(incf,inrf))
      ALLOCATE (dvoll(incf,inrf))
      ALLOCATE (outelv(incf,inrf))
      ALLOCATE (voll(incf,inrf))
      ALLOCATE (dvolw(incf,inrf))
      ALLOCATE (volw(incf,inrf))
      ALLOCATE (sflux(incf,inrf))
      ALLOCATE (height(incf,inrf))
      ALLOCATE (warea(incf,inrf))
      ALLOCATE (af(incf,inrf))
      ALLOCATE (waream(incf,inrf))
      ALLOCATE (outdir(incf,inrf))
      ALLOCATE (heightm(incf,inrf))
      ALLOCATE (tmpdir(incf,inrf))
      ALLOCATE (ddist(incf,inrf))
      ALLOCATE (sinuos(incf,inrf))
      ALLOCATE (dummy(incf,inrf))
      ALLOCATE (uparea(incf,inrf))
      ALLOCATE (wetmask(incf,inrf))

      ALLOCATE (drainin(inc,inr,nmons2))
      ALLOCATE (runin(inc,inr,nmons2))
      ALLOCATE (prcpi(inc,inr,nmons2))
      ALLOCATE (evapi(inc,inr,nmons2))

      ALLOCATE (alatg(inrf))
      ALLOCATE (along(incf))

      ALLOCATE (vollir(incf,inrf)) !Height Correction
      ALLOCATE (warear(incf,inrf)) !Height Correction


      END SUBROUTINE ALOCA


