      INTEGER FUNCTION MATCH(HEAD, INCR, N)
      INTEGER PLAT, HEAD
      COMMON /GRAPH/ LLAT, PLAT, LAT(6000)
C
C     ROUTINE READS DOEN A LINEAR LINKED LIST IN LAT TO FIND ENTRY
C     WHOSE FIRST WORD CONTAINS N;  EACH LIST ELEMENT IS INCR+1 LONG;
C     HEAD IS POINTER TO FIRST LIST ELEMENT
C     RETURNS 0 FOR NO MATCH ON LIST OR THE EMPTY LIST
C
      IF (HEAD) 40, 40, 10
   10 MATCH = HEAD
   20 IF (LAT(MATCH).EQ.N) GO TO 50
      MATCH = MATCH + INCR
      IF (LAT(MATCH)) 40, 40, 30
   30 MATCH = LAT(MATCH)
      GO TO 20
   40 MATCH = 0
   50 RETURN
      END
