
	
	DIMENSION X(200),Y(200),Z(200),U(200),V(200),W(200),B(200),C(200),
	1D(200)

C  PROGRAM COMPC TO DETERMINE THE EQUIVILENCE OF TWO SETS OF COORDINATES
C  WITH IN CERTAIN TOLERANCES (IN ANGSTROMS)

C

C  DECK SET UP

C

CARD  1   (6F10.5)

C        COL 1-10   A IN ANGSTROMS

C        COL 11-20  B

C        COL 21-30 C

C        COL 31-40 X TOLERANCE IN ANGSTROMS

C        COL 41-50 Y TOLERANCE

C        COL 51-60  Z TOLERANCE

C  CARD 2 AND ON    COORDINATES

C        DATA SWITCH 1 ON  X-RAY 63 FORMAT  (14X3F7.5)

C                      OFF ZALKIN FORMAT  (27X3F9.6)

C

	READ(2,50)DA,DB,DC,AA,BB,CC

50	FORMAT(6F10.6)

	DA=AA/DA

	DB=BB/DB

	DC=CC/DC

C  SENSE SWITCH 1  OFF FOR ZALKIN INPUT FORMAT

C                  ON FOR X-RAY 63 INPUT FORMAT

	WRITE(1,51)

51	FORMAT('SET SWITCH 1 AND PUSH START'/)

	PAUSE9999

	CALL DATSW(1,IXR63)

	DO1 I=1,200

	GO TO (100,105),IXR63

100	READ(2,2)X(I),Y(I),Z(I)

2	FORMAT(14X,3F7.5)

	IF(X(I)-999)1,4,4

105	READ(2,106)X(I),Y(I),Z(I)

106	FORMAT(27X,3F9.6)

	IF(X(I)-999)1,4,4

1	CONTINUE

4	NX=I-1

	WRITE(1,51)

	PAUSE1111

	CALL DATSW(1,IXR63)

	DO3 I=1,200

	GO TO(200,205),IXR63

200	READ(2,2)U(I),V(I),W(I)

	IF(U(I)-999.)3,20,20

205	READ(2,106)U(I),V(I),W(I)

	IF(U(I)-999.)3,20,20

3	CONTINUE

20	NU=I-1

	READ(2,50)

	WRITE(2,52)

52	FORMAT('MAP1=MPA2     X1     X2     Y1     Y2     Z1     Z2    XBA
	1R   YBAR   ZBAR'/)

	DO 30 I=1,NU

	U(I)=U(I)+DA

	 B(I)=U(I)-2.*DA

	V(I)=V(I)+DB

	C(I)=V(I)-2.*DB

	W(I)=W(I)+DC

30	D(I)=W(I)-2.*DC

	DO5 I=1,NX

	DO 6 J=1,NU

	IF(X(I)-U(J))7,8,6

7	IF(X(I)-B(J))6,8,8

8	IF(Y(I)-V(J))9,10,6

9	IF(Y(I)-C(J))6,10,10

10	IF(Z(I)-W(J))11,12,6

11	IF(Z(I)-D(J))6,12,12

12	AU=U(J)-DA

	AV=V(J)-DB

	AW=W(J)-DC

	AVX=(X(I)+AU)/2.

	AVY=(Y(I)+AV)/2.

	AVZ=(Z(I)+AW)/2.

	WRITE(2,15)I,J,X(I),AU,Y(I),AV,Z(I),AW,AVX,AVY,AVZ

15	FORMAT(2I4,2X9F7.4)

6	CONTINUE

5	CONTINUE

	CALL EXIT

	END

// XE	Q

