	SUBROUTINE SEINDX (LFULL)
C READ AND COMPARE THE ELEMENT INDEX WITH THE DESIRED ELEMENTS
C
C	LFULL		FLAG RETURNED IF OUTPUT FILE IS FULL
C
C	CALLED BY:	FSRCH
C	CALLS:		SERSRC,SEIBIT
C
	INCLUDE 'SEARCH.INC'
	INTEGER*2 SEBCNT,SEIBIT
	DIMENSION INDEX(6,42),IBUF(6)
	IBLOCK = IRFRST			!SET TO FIRST RSPACE RECORD
	LFULL = .FALSE.			!CLEAR FULL FLAG
	DO 100 IR=1,IBLAST		!READ RECORDS
	  WRITE (ILUO,10) IR,IBLAST-IR+1
10	  FORMAT ('+INDEX RECORD: ',I3,' # LEFT: ',I3)
	  IREC = IR
	  READ (ILUD'IREC) INDEX	!READ INDEX
	  INRKNT = INRKNT + 1		!COUNT # INDEX REC CHECKED
C SEARCH EACH ENTRY
	  DO 50 IN=1,42
C MAKE SURE THERE ARE ENOUGH ELEMENT HITS
	    IF (NEHITS .GT. 0) THEN	!SEE IF ANY HITS ARE REQUIRED
C ALL ELEMENT MATCHES ARE SAVED IN IBUF
	      DO 25 I=1,6
25	      IBUF(I) = INDEX(I,IN) .AND. IELDET(I)
C COUNT # BITS SET IN IBUF, AND SEE IF THERE ARE ENOUGH
	      IF (SEBCNT(IBUF,6) .LT. NEHITS) GOTO 50	!NOT ENOUGH
	    END IF
C ENOUGH ELEMENT HITS, NOW TEST RSPACES
	    INPKNT = INPKNT + 1			!COUNT # RSPACES CHECKED
	    CALL SERSRC (LFULL)				!MATCH RSPACES
	    IF (LFULL) RETURN			!TEST IF OUTPUT IS FULL
C THE RSPACE RECORD SPAN TWO BLOCKS
50	    IBLOCK = IBLOCK + 2	
C THE SEARCH FILE IS SORTED ACCORDING TO ELEMENT NUMBER.  IF THE FIRST
C ELEMENT IN THE SEARCH FILE IS PAST THE LAST ELEMENT DETECTED, THE
C SEARCH CAN BE TERMINATED.
C SEE IF THE LAST ELEMENT IS PAST THE INDEX
	  IF (NEHITS .LE. 0) GOTO 100
	  IF (SEIBIT(INDEX(1,42),6) .GT. IELAST) RETURN
100	  CONTINUE
	RETURN
	END
