      SUBROUTINE QEFFUN
     I                  (MESSFL)
C
C     + + + PURPOSE + + +
C     edit forcing function functional parameters
C
C     + + + DUMMY ARGUMENTS + + ++ 
      INTEGER   MESSFL
C
C     + + + ARGUMENT DEFINITIONS + + +
C     MESSFL - Fortran unit number for message file
C
C     + + + COMMON BLOCKS + + +
      INCLUDE 'CQ2VAL.INC'
C
C     + + + LOCAL VARIABLES + + +
      INTEGER      I,I1,SCLU,SGRP,LCLU,RESP,RNUM,IVAL(1,MXRCH),
     1             CVAL(1,3,MXRCH),LEN
      CHARACTER*1  TBUFF(80,MXRCH),BLNK
      CHARACTER*19 SCNAME
C
C     + + + EXTERNALS + + +
      EXTERNAL     QRESP, QRESCN, QEINFL, QEINCO
      EXTERNAL     QEHEAD, QEPTLD, QEDSBD, ZWNSET
C
C     + + + END SPECIFICATIONS + + +
C
      I1  = 1
      SCLU= 10
      LCLU= 15
      BLNK= ' '
C
 5    CONTINUE
C
        SGRP= 1
        CALL QRESP (MESSFL,SCLU,SGRP,RESP)
C
        GO TO (10,20,30,40,50,60,70),RESP
C
 10     CONTINUE
C         headwaters
          SCNAME= 'Headwater-1 (EFFH)'
          CALL QEHEAD (MESSFL,NUMHDW,METFLG,SCNAME,
     M                 HDWNAM,DAT10,DAT10A)
          GO TO 100
C
 20     CONTINUE
C         point loads
          SCNAME= 'Point Load-1 (EFFP)'
          CALL QEPTLD (MESSFL,NUMPTL,METFLG,SCNAME,
     M                 PTLNAM,DAT11,DAT11A)
          GO TO 100
C
 30     CONTINUE
C         incremental loads
          SCNAME= 'IFlow-1 (EFFIF)'
          DO 35 I= 1,NUMRCH
            DAT8(1,I) = DAT2(1,I)
            DAT8A(1,I)= DAT2(1,I)
 35       CONTINUE
          CALL QEINFL (MESSFL,NUMRCH,METFLG,SCNAME,
     M                 DAT8,DAT8A)
          GO TO 100
C
 40     CONTINUE
C         dam reaeration
          RNUM= 7
          SGRP= 11+ METFLG
          CALL QRESCN (MESSFL,SCLU,SGRP,I1,RNUM,I1,MXDAM,I1,
     M                 IVAL,DAT12,CVAL,TBUFF)
          GO TO 100
C
 50     CONTINUE
C         downstream boundaries
          SCNAME= 'Boundary-1 (EFFB)'
          IF (PCIVL(1).NE.1) THEN
C           downstream boundary option not on, does user want it on?
            CALL ZWNSET (SCNAME)
            SGRP= 8
            CALL QRESP (MESSFL,LCLU,SGRP,I)
            IF (I.EQ.1) PCIVL(1)= 1
          ELSE
C           downstream boundary option on, allow modifications
            I= 1
          END IF
          IF (I.EQ.1) THEN
C           modify downstream boundary condition data
            CALL QEDSBD (MESSFL,METFLG,SCNAME,
     M                   DAT13,DAT13A)
          END IF
          GO TO 100
C
 60     CONTINUE
C         initial conditions
          SCNAME= 'INitial-1 (EFFIN)'
          DO 65 I= 1,NUMRCH
            DAT7(1,I) = DAT2(1,I)
            DAT7A(1,I)= DAT2(1,I)
 65       CONTINUE
          CALL QEINCO (MESSFL,NUMRCH,METFLG,SCNAME,
     M                 DAT7,DAT7A)
          GO TO 100
C
 70     CONTINUE
C         all done
          GO TO 100
C
 100    CONTINUE
C
      IF (RESP.NE.7) GO TO 5
C
      RETURN
      END
