      INTEGER FUNCTION TABIND (MESSFL,TABTYP,NUMVAL,TAB)
C
C     + + + PURPOSE + + +
C     determine the index of a table member specified by user
C
C     + + + DUMMY ARGUMENTS + + +
      INTEGER   MESSFL,TABTYP,NUMVAL
      REAL      TAB(NUMVAL)
C
C     + + + ARGUMENT DEFINITIONS + + +
C     MESSFL - unit number for message file
C     TABTYP - table type
C     NUMVAL - number of values
C     TAB    - table number
C
C     + + + LOCAL VARIABLES + + +
      REAL      TVAL
      INTEGER   SCLU,SGRP,I,J,K
C
C     + + + INTRINSICS + + +
      INTRINSIC   ABS
C
C     + + + EXTERNALS + + +
      EXTERNAL   PRNTXT, QRESPR
C
C     + + + END SPECIFICATIONS + + +
C
      SCLU= 7
      SGRP= 12
      TVAL= 0.0
C
 10   CONTINUE
        CALL QRESPR (MESSFL,SCLU,TABTYP,TVAL)
        K= TVAL
        IF (K.GT.0) THEN
C         an actual value was supplied, check the table
          I= 0
          J= 0
 20       CONTINUE
            I= I+ 1
            IF (ABS(TVAL-TAB(I)).LT.1.0E-3) J= I
          IF (J.EQ.0.AND.I.LT.NUMVAL) GO TO 20
          IF (J.EQ.0) THEN
C           the specified value is not in the table
            CALL PRNTXT (MESSFL,SCLU,SGRP)
          ELSE
            K= J
          END IF
        ELSE
C         we want all values or none, set j to exit
          J= 1
        END IF
      IF (J.EQ.0) GO TO 10
C
      TABIND= K
C
      RETURN
      END
