      SUBROUTINE MATCH (CSTR, IBEG, ILEN, CLIST, NLIST, NLEN, IMATCH)
C
C     SEARCH FOR STRING CSTR BEGINNING AT POSITION
C     IBEG AND ILEN CHARACTERS LONG.  IN CLIST
C     WHICH HAS NLIST ENTRIES EACH OF SIZE NLEN.
C     RETURN IMATCH - POSITION IN CLIST; 0 = NOT FOUND
C
      CHARACTER CSTR*(*), CLIST(NLIST)*(*)
C
C
      IF (ILEN.LE.0) GO TO 20
      IEND = IBEG + ILEN - 1
      IF (IBEG.GT.IEND) GO TO 20
C
      DO 10 I=1,NLIST
      IF(CSTR(IBEG:IEND).EQ.CLIST(I)(1:ILEN)) THEN
      IMATCH  =  I
      RETURN
      ENDIF
 10   CONTINUE
C
 20   IMATCH = 0
      RETURN
      END
