      SUBROUTINE ONLY_OVERFLOW1(SURF,DEM,RUN_Y,RUN_X,
     &RUN_LAK,OUT_I,OUT_J,DEST_I,DEST_J,CMARK,LAK_NO_INC,MARK,RUNOFF,
     &CHN_DEC,XIND,YIND,ROWS,COLS,SX,PP,QQ,K1,K2,K3,K4)

      ! THIS SUBROUTINE AMOUNT OF WATER THAT HAS OVERFLOWED. THIS KIND
      ! OF OVERFLOW DOES NOT INCISE ANY MELTWATER CHANNEL

      ! DESCRIPTION OF VARIABLES:

      ! SX: CONSTANT

      ! K1,K2,K3,K4: STORES THE EXTENT OF THE LAKE. REMAINS UNMODIFIED
      ! IN THIS SUBROUTINE

      ! PP,QQ: STORES THE COORDINATES OF THE LAKE NUCLEUS. REMAINS
      ! UNMODIFIED IN THIS SUBROUTINE

      ! MARK: STORES THE DELINEATED LAKE. SHOWS 1 FOR LAKE PIXELS AND 0
      ! OTHERWISE. REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! SURF: CONTAINS SURFACE HEIGHT (IN METERS) OF EVERY GRID CELL.
      ! REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! DEM: CONTAINS DEM SURFACE ELEVATION (IN METERS) FOR EVERY GRID
      ! CELL. REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! RUN_X: STORES THE RUNOFF THAT HAS BEEN TRANFERRED FROM A LAKE TO
      ! A NON-CREVASSED, NON-LAKE DEM CELL. THIS TRANSFER TAKES PLACE
      ! DURING LAKE OVERFLOW. GETS MODIFIED IN THIS SUBROUTINE

      ! RUN_Y: STORES THE RUNOFF THAT HAS BEEN TRANFERRED FROM A LAKE TO
      ! A CREVASSED, NON-LAKE DEM CELL. THIS TRANSFER TAKES PLACE
      ! DURING LAKE OVERFLOW. GETS MODIFIED IN THIS SUBROUTINE

      ! RUN_LAK: STORES THE RUNOFF THAT HAS BEEN TRANSFERRED FROM A LAKE
      ! TO ANOTHER EXISTING LAKE. THIS TRANSFER TAKES PLACE
      ! DURING LAKE OVERFLOW. GETS MODIFIED IN THIS SUBROUTINE

      ! OUT_I,OUT_J: STORES THE COORDINATES OF CATCHMENT OUTLET. REMAINS
      ! UNMODIFIED IN THIS SUBROUTINE

      ! DEST_I,DEST_J: STORES THE COORDINATES OF THE DESTINATION OF
      ! OVERFLOWING WATER. REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! CHN_DEC: STORES DEPTH OF SUPRAGLACIAL MELTWATER CHANNELS.
      ! REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! XIND,YIND: 1D ARRAYS THAT STORE THE COORDINATES OF THE MELTWATER
      ! PATH CELLS. REMAINS UNMODIFIED IN THIS SUBROUTINE

      ! ROWS,COLS: ROWS AND COLUMNS OF THE STUDY AREA. REMAINS
      ! UNMODIFIED IN THIS SUBROUTINE

      ! CMARK: SHOWS 1 FOR CREVASSED CELL AND 0 FOR NON CREVASSED CELL.
      ! UPDATED EVERY TIMESTEP IN THE CREV_CELLS1.F SUBROUTINE. REMAINS
      ! UNMODIFIED IN THIS SUBROUTINE

      ! LAK_NO_INC: STORES THE EXTENT OF THE LAKES THAT HAVE OVERFLOWN
      ! BUT WITHOUT CHANNEL INCISION. SHOWS 1 FOR LAKE PIXELS AND 0
      ! OTHERWISE. GETS MODIFIED IN THIS SUBROUTINE

      ! RUNOFF: CONTAINS RUNOFF MELTWATER (IN METERS) FOR EVERY GRID
      ! CELL. REMAINS UNMODIFIED IN THIS SUBROUTINE

      IMPLICIT NONE

      INTEGER :: SX,ROWS,COLS,OUT_I,OUT_J,DEST_I,DEST_J,CMARK(COLS,ROWS)
     &,LAK_NO_INC(COLS,ROWS),MARK(COLS,ROWS),XIND(SX),YIND(SX),
     &NUM1,A,B,A11,B11,I,PP,QQ,K1,K2,K3,K4,I1,J1
      DOUBLE PRECISION :: LAKE_DEPTH(COLS,ROWS),SURF(COLS,ROWS),
     &DEM(COLS,ROWS),RUN_O_LAK(COLS,ROWS),RUNOFF(COLS,ROWS),RUN_VOL,
     &RUN_X(COLS,ROWS),RUN_Y(COLS,ROWS),RUN_LAK(COLS,ROWS),
     &CHN_DEC(COLS,ROWS)

      LAKE_DEPTH=SURF-DEM
      A=OUT_I
      B=OUT_J
      A11=DEST_I
      B11=DEST_J
      RUN_O_LAK=0.
      RUN_O_LAK=RUNOFF     

      RUN_VOL=(SUM(RUNOFF,MASK=MARK.EQ.1))*100*100 ! TOTAL RUNOFF VOLUME IN THE LAKE

      DO 200 I1=PP-K1,PP+K2
      DO 300 J1=QQ-K3,QQ+K4
      IF (MARK(I1,J1).EQ.1) THEN
              LAK_NO_INC(I1,J1)=1 ! NO CHANNEL INCISION
      END IF
300   CONTINUE
200   CONTINUE

      ! TRANSFERRING THE LAKE RUNOFF FROM THE LAKE TO THE DESTINATION

      IF (LAKE_DEPTH(A11,B11).EQ.0) THEN
              IF (CMARK(A11,B11).EQ.1) THEN
                      RUN_Y(A11,B11)=RUN_Y(A11,B11)+RUN_VOL/10000
              ELSE
                      RUN_X(A11,B11)=RUN_X(A11,B11)+RUN_VOL/10000
              END IF
      ELSE
              RUN_LAK(A11,B11)=RUN_LAK(A11,B11)+RUN_VOL/10000
      END IF

      NUM1=COUNT(XIND.NE.0)

      RETURN

      END SUBROUTINE ONLY_OVERFLOW1
