C******************** START FILE IUFKEY.FOR ; GROUP UFILS0 ******************
C------------------------------------------------------
C  IUFKEY  IDENTIFY INDEX TO ASSOCIATED SCALAR BY
C          KEYWORD
C
      INTEGER FUNCTION IUFKEY(ZKEYI,ZSCLIS,NSC)
C
C  ZKEY-- 10 CHARACTER KEYWORD
C  ZSCLIS-- LIST OF 30 CHARACTER LABELS ASSOCIATED WITH SCALAR
C    QUANTITIES.  THE FIRST 10 CHARACTERS ARE RESERVED KEYWORD
C  NSC-- NUMBER OF ENTRIES IN LIST
C	DO NOT CALL IF NSC=0
C
C  IUFKEY=INDEX TO LIST ENTRY MATCHING KEYWORD
C        =INDEX TO CORRESPONDING SCALAR QUANTITY
C        =0 IF NOT FOUND
C
      CHARACTER*(*) ZKEYI
      CHARACTER*10 ZKEY
      CHARACTER*30 ZSCLIS(NSC)
C
C  CAPITALIZE INPUT KEYWORD (UFILES KEYWORDS CAPITILIZED AT UREAD
C  FILE READ TIME)
C
      CALL UF0CAP(ZKEYI)
C
      ILEN=LEN(ZKEYI)
      ICLN=INDEX(ZKEYI,':')
      IF(ICLN.GT.0) THEN
        ZKEY=ZKEYI(1:ICLN)
      ELSE
 15     CONTINUE
          IF((ILEN.GT.1).AND.ZKEYI(ILEN:ILEN).EQ.' ') THEN
            ILEN=ILEN-1
            GO TO 15
          ENDIF
        ZKEY=ZKEYI(1:ILEN)
        ILP1=ILEN+1
        IF(ILP1.LE.10) ZKEY(ILP1:ILP1)=':'
      ENDIF
C
      DO 17 I=1,NSC
        IF(ZKEY.EQ.ZSCLIS(I)(1:10)) GO TO 20
 17   CONTINUE
C  NOT FOUND
      IUFKEY=0
      RETURN
C  FOUND
 20   CONTINUE
      IUFKEY=I
      RETURN
      	END
C******************** END FILE IUFKEY.FOR ; GROUP UFILS0 ******************
