C	PROGRAM CREATE_IT
C
C	CREATES A TABLE OF HITS 
C
C	ISIZE=NUMBER OF ENTRIES (INORGANIC OR ORGANIC)
C	NSIZE=NUMBER OF *4 INTEGERS NECESSARY TO STORE THE TABLE
C	     =ISIZE/31, PROBABLY +1
D       NOV 18, 1987 HARLOW SAYS ISIZE/32
C	NOTE: IF ONE ATTEMPTS TO SET ALL BITS (0-31) TO 1, AN
C	INTEGER OVERFLOW ERROR OCCURS.  I HAVE DECIDED TO AVOID
C	THIS PROBLEM FOR NOW BY ONLY USING THE FIRST 31 BITS OF 
C	EACH INTEGER.

C
C	MISS=0, HIT=1, EACH ENTRY HAS ONE BIT ASSOCIATED WITH IT
C
	INTEGER*4 TABLE(2000)
	DATA ISIZEI/59613/,ISIZEO/56140/

	DO 10 N=1,2000
10	TABLE(N)=0
      WRITE(6,123)
123   FORMAT(' VAX VERSION SEPT 12, 1987'/
     1  10X,'GERALD G. JOHNSON JR., MRL/PSU'/
     2	10X,'RICHARD L. HARLOW, I, DUPONT'/
     2  10x,'THIS USES THE 1986 RELEASE OF THE FILE "CRYSTAL DATA"'/
     1  15X,'WHICH CONTAINS ABOUT 115,000 ENTRIES FROM 1900-1984.'//
     3  10X,'PROGRAM TO CREATE "LOGIC FILE" FOR SEARCHING'/)
125   WRITE(6,124)
124   FORMAT(' YOU HAVE THE FOLLOWING CHOICES'/
     1    10X,'0 EXIT'/
     2    10X,'1 INORGANIC FILE (59,613 ENTRIES)'/
     3    10X,'2 ORGANIC FILE   (56,140 ENTRIES)'/
     4    10X,'PLEASE ENTER YOUR CHOICE [1]  ',$)
      READ(5,126,ERR=125,END=20) NCR,KEY
126   FORMAT(Q,I10)
      IF(NCR.EQ.0) KEY=1
      IF(KEY.LT.0.OR.KEY.GT.2) GO TO 125
      IF(KEY.EQ.0) STOP 'JOB ABORTED--START AGAIN'
      IF(KEY.EQ.1) THEN
	NSIZE=ISIZEI/32
	DO 30 N=1,NSIZE
30	TABLE(N)=-1
	LAST=MOD(ISIZEI,32)
	IF (LAST.NE.0) THEN
	NSIZE=NSIZE+1
	DO 40 J=0,(LAST-1)
40	TABLE(NSIZE)=IBSET(TABLE(NSIZE),J)
	ENDIF
	CALL PUT(TABLE,ISIZEI,NSIZE)
      ENDIF
      IF(KEY.EQ.2) THEN
	NSIZE=ISIZEO/32
	DO 50 N=1,NSIZE
50	TABLE(N)=-1
	LAST=MOD(ISIZEO,32)
	IF (LAST.NE.0) THEN
	NSIZE=NSIZE+1
	DO 60 J=0,(LAST-1)
60	TABLE(NSIZE)=IBSET(TABLE(NSIZE),J)
	ENDIF
	CALL PUT(TABLE,ISIZEO,NSIZE)
      ENDIF
C
C
C
20    STOP 'END OF SETUP OF "LOGIC FILE"' 
      END
