	SUBROUTINE OSCAN1(ID,I0,J0)
C	RETURNS SURFACE COORDINATES (X&Y RELATIVE TO ARR) OF CRAWLER
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-----------------------------------------------------------------------
C	DETERMINE COORDINATES OF CRAWLER (I0,J0)
C 
C	PROGRAM LOGIC:
C	ARR IS A "SQUASHED" VERSION OF THE CUBE USED FOR COMPUTING
C	DISTANCES AND DIRECTIONS TO DOORWAYS.
C 
C	FOR THIS ROUTINE, THREE DIFFERENT "SQUASHES" WERE USED TO GIVE
C	3 POSSIBLE SCANNING DIRECTIONS.  THE OTHER THREE ARE IMPOSED BY
C	OSCAN2 WHICH SIMPLY INVERTS THE WAY IT CHECKS ARR FOR DOORS.
C 
C	THREE SQUASHED PLANES FOLLOW.  I0=1 IN UPPER LEFT, 40 IN LOWER
C	LEFT.  J0=1 IN UPPER LEFT, 30 IN UPPER RIGHT.
C 
C	    --------- --------- ---------      --------- --------- ---------
C	10 | 10 Y  1 | 10 Z  1 | 1  Y 10 | 10 | 10 Z  1 | 10 X  1 | 1  Z 10 |
C	 X |   (5)   |   (4)   |   (6)   |  Y |   (1)   |   (6)   |   (3)   |
C	 1 |  Z=10   |   Y=1   |   Z=1   |  1 |  X=10   |   Z=1   |   X=1   |
C	    --------- --------- ---------      --------- --------- ---------
C	 1 | 10 X  1 | 10 Z  1 | 1  X 10 |  1 | 10 Y  1 | 10 X  1 | 1  Y 10 |
C	 Y |   (5)   |   (3)   |   (6)   |  Z |   (1)   |   (4)   |   (3)   |
C	10 |  Z=10   |   X=1   |   Z=1   | 10 |  X=10   |   Y=1   |   X=1   |
C	    --------- --------- ---------      --------- --------- ---------
C	 1 | 1  Y 10 | 10 Z  1 | 10 Y  1 |  1 | 1  Z 10 | 10 X  1 | 10 Z  1 |
C	 X |   (5)   |   (2)   |   (6)   |  Y |   (1)   |   (5)   |   (3)   |
C	10 |  Z=10   |  Y=10   |   Z=1   | 10 |  X=10   |  Z=10   |   X=1   |
C	    --------- --------- ---------      --------- --------- ---------
C	10 | 1  X 10 | 10 Z  1 | 10 X  1 | 10 | 1  Y 10 | 10 X  1 | 10 Y  1 |
C	 Y |   (5)   |   (1)   |   (6)   |  Z |   (1)   |   (2)   |   (3)   |
C	 1 |  Z=10   |  X=10   |   Z=1   |  1 |  X=10   |  Y=10   |   X=1   |
C	    --------- --------- ---------      --------- --------- ---------
C 
C	    --------- --------- ---------
C	10 | 10 Z  1 | 1  Y 10 | 1  Z 10 |      (5) MEANS FACE 5, ETC.
C	 X |   (4)   |   (6)   |   (2)   |     10 Z 1 means to get J0
C	 1 |   Y=1   |   Z=1   |  Y=10   |     coordinates from ICU(*,*,Z,1)
C	    --------- --------- ---------      indexing Z from 10 to 1.
C	 1 | 10 X  1 | 1  Y 10 | 1  X 10 |
C	 Z |   (4)   |   (3)   |   (2)   |     Y=1 MEANS Y=1 ON THAT FACE.
C	10 |   Y=1   |   X=1   |  Y=10   |
C	    --------- --------- ---------
C	 1 | 1  Z 10 | 1  Y 10 | 10 Z  1 |
C	 X |   (4)   |   (5)   |   (2)   |
C	10 |   Y=1   |  Z=10   |  Y=10   |
C	    --------- --------- ---------
C	10 | 1  X 10 | 1  Y 10 | 10 X  1 |
C	 Y |   (4)   |   (1)   |   (2)   |
C	 1 |   Y=1   |  X=10   |  Y=10   |
C	    --------- --------- ---------
C 
	CALL DIREC(ID,'a',1,JF)  !  GET FORWARD DIRECTION
	CALL DIREC(ID,'a',5,JU)  !  GET UP DIRECTION
	IX=ICR(ID,10)
	IY=ICR(ID,11)
	IZ=ICR(ID,12)
	IF(JU.EQ.1) GOTO 41
	IF(JU.EQ.2) GOTO 42
	IF(JU.EQ.3) GOTO 43
	IF(JU.EQ.4) GOTO 44
	IF(JU.EQ.5) GOTO 45
C	JU=6:
	IF(JF.EQ.2.OR.JF.EQ.4) GOTO 60
C	JF=1 OR 3:
	I0=11-IX
	J0=10+IY
	GOTO 50
C	JF=2 OR 4:
60	I0=11-IY
	J0=21-IX
	GOTO 50
C	JU=1:
41	IF(JF.EQ.5.OR.JF.EQ.6) GOTO 46
C	JF=2 OR 4:
	I0=41-IY
	J0=21-IZ
	GOTO 50
C	JF=5 OR 6:
46	I0=41-IZ
	J0=10+IY
	GOTO 50
C	JU=2
42	IF(JF.EQ.1.OR.JF.EQ.3) GOTO 47
C	JF=5 OR 6:
	I0=41-IZ
	J0=21-IX
	GOTO 50
C	JF=1 OR 3:
47	I0=20+IX
	J0=21-IZ
	GOTO 50
C	JU=3
43	IF(JF.EQ.2.OR.JF.EQ.4) GOTO 48
C	JF=5 OR 6:
	I0=10+IZ
	J0=10+IY
	GOTO 50
C	JF=2 OR 4:
48	I0=10+IY
	J0=21-IZ
	GOTO 50
C	JU=4
44	IF(JF.EQ.1.OR.JF.EQ.3) GOTO 49
C	JF=5 OR 6:
	I0=10+IZ
	J0=21-IX
	GOTO 50
C	JF=1 OR 3:
49	I0=11-IX
	J0=21-IZ
	GOTO 50
C	JU=5
45	IF(JF.EQ.1.OR.JF.EQ.3) GOTO 51
C	JF=2 OR 4:
	I0=20+IY
	J0=21-IX
	GOTO 50
C	JF=1 OR 3:
51	I0=20+IX
	J0=10+IY
50	RETURN
	END
