	SUBROUTINE CUBE
C	INITIALIZE CUBE
C----------------------standard common block----------------------------
C 
	COMMON ICR(8,12),IPARM(10),IS1,IS2,NT,ICU(10,10,10,2),CLEAR(8)
	COMMON MARKER(4,3,3)
	LOGICAL*1 ICU,CLEAR
C 
C-----------------------------------------------------------------------
	DO 25 I=1,10
	DO 25 J=1,10
	DO 25 K=1,10
	ICU(I,J,K,1)=' ' ! CLEAR CUBE
	ICU(I,J,K,2)=2 ! SET ENERGY LEVELS TO 2
25	CONTINUE
C 
C	PLACE DOORWAYS, 4 ON A FACE:
C	FIRST, INIT RANDOM NUMBER STREAMS
	T=SECNDS(0.0)
600	IF(T.LT.10050.) GOTO 601
	T=T-9999
	GOTO 600
601	J=T
	IS1=0
	IS2=0
	DO 602 I=1,J
	X=RAN(IS1,IS2)
602	CONTINUE
C 
	DO 11 N=1,4
12	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(I,J,1,1).EQ.'[') GOTO 12
	ICU(I,J,1,1)='['
11	CONTINUE
	DO 13 N=1,4
14	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(I,J,10,1).EQ.'[') GOTO 14
	ICU(I,J,10,1)='['
13	CONTINUE
	DO 15 N=1,4
16	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(I,1,J,1).EQ.'[') GOTO 16
	ICU(I,1,J,1)='['
15	CONTINUE
	DO 17 N=1,4
18	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(I,10,J,1).EQ.'[') GOTO 18
	ICU(I,10,J,1)='['
17	CONTINUE
	DO 19 N=1,4
20	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(1,I,J,1).EQ.'[') GOTO 20
	ICU(1,I,J,1)='['
19	CONTINUE
	DO 21 N=1,4
22	I=RAN(IS1,IS2)*7.99+2   ! NUMBER BETWEEN 2 AND 9 INCLUSIVE
	J=RAN(IS1,IS2)*7.99+2
	IF(ICU(10,I,J,1).EQ.'[') GOTO 22
	ICU(10,I,J,1)='['
21	CONTINUE
C 
C	PLACE TRANSMITTERS IN CRAWLERS:
	DO 23 I=1,4
	DO 23 J=1,3
	MARKER(I,1,J)=-1
23	CONTINUE
	RETURN
	END
