C  PROGRAM TRANS TO SYMMETRY TRANSFORM COORDINATES

C  BOB SNYDER  NOV. 1968

C  TRANS READS SYMMETRY CARDS AND COORDINATED CARDS AND OUTPUTES

C  ALL SYMMETRY RELATED COORDINATES INSIDE THE UNIT CELL AND IN ALL

C  ADJACENT CELLS

C

C INPUT SET UP

C

C  ITEM 1   SYMMETRY CARDS   (3(F11.6,2I2))

C        COL 1-11  TRANSLATION FOR X                       WHERE

C        COL 13  SYMMETRY FOR X                            / = BLANK

C        COL 15  SYMMETRY FOR X (IF TWO TERMS ARE NEEDED)  X= 1

C        COL 16-26 TRANSLATION FOR Y                       -X = -1

C        COL 28  SYMMETRY FOR Y                            Y= 2

C        COL 30  SECOND SYMMETRY FOR Y(IF NEEDED)          -Y= -2

C        COL 31-41  TRANSLATION FOR Z                      Z = 3

C        COL 43 SYMMETRY FOR Z                             -Z = -3

C        COL 45 SECOND SYMMETRY FOR Z (IF NEEDED)

C

C  ITEM 2   SIGNAL LAST SYMMETRY CARD   (F11.6)

C        COL 1-11 999.0

C

C  ITEM 3  COORDINATES (X,Y,Z)  FORMAT ACCORDING TO DATA SWITCH

C

C  ITEM 4  SIGNAL LAST COORDINATE CARD

C        ENTER A 999.0 IN THE X COLUMN

C

C  DATA SWITCHES FOR INPUT FORMATS

C        SWITCH 1  ON  READ COORDINATES IN X-RAY 63 ATOM CARD FORMAT

C                       (13X,3F8.6)

C        SWITCH 2  ON  READ COORDINATES IN ZALKIN PEAK SEARCH FORMAT

C                       (27X,3F9.6)

C        SWITCH 3  ON  READ COORDINATES IN 3F10.6)

C        SWITCH 4  ON  B CARDS ALTERNATING WITH COORDINATE CARDS

C        SWITCH 4  OFF NO B CARDS

C        SWITCH 5  ON  CALCULATE TRANSFORMS ONLY IN 555 CELL

C        SWITCH 5  OFF CALCULATE IN ALL 27 ADJACENT CELLS

C

	DIMENSION C1(200),I1(200),J1(200),C2(200),I2(200),J2(200),C3(200),
	1I3(200),J3(200)

	DIMENSION  U(175),V(175),W(175),P(7)

	DIMENSION  NP(3,175),MSY(7),ORCD(3)

	DEFINE FILE 1(5000,17,U,IDSK)

	ICDI=2

	ICDO=2

	ITYP=1

C     CONSTANTS FOR ALPHABETIC +X,-X,+Y      ETC.

	MSY(4)=16448

	MSY(5)=20711

	MSY(3)=24807

	MSY(6)=20712

	MSY(2)=24808

	MSY(7)=20713

	MSY(1)=24809

C     READ SYMMETRY CARDS

	K=0

300	K=K + 1

	READ ( ICDI,75)  C1(K),I1(K),J1(K),C2(K),I2(K),J2(K),C3(K),

	1   I3(K),J3(K)

	IF(C1(K)-999.)300,305,305

305	M=K-1

	WRITE  ( ITYP,79 )

	DO  61  L=1,M

	K1=I1(L)+4

	K2=J1(L)+4

	K3=I2(L)+4

	K4=J2(L)+4

	K5=I3(L)+4

	K6=J3(L)+4

61	WRITE (ITYP,80) L,C1(L),MSY(K1),MSY(K2),C2(L),MSY(K3),MSY(K4),

	1      C3(L),MSY(K5),MSY(K6)

C  READ COORDINATE CARDS

	WRITE(ITYP,306)

306	FORMAT(//'SET SWITCHES'/'1 ON FOR X-RAY 63 COORDINATES'/'2 ON FOR

	1ZALKIN FORMAT'/'3 ON COORDINATES IN 3F10.6)'/'SWITCH 4  ON B CARDS
	2 ALTERNATING WITH COORDS.'/'  ON NO B CARDS'/'SWITCH 5  OFF CALCUL
	2ATE COORDINATES IN CENTRAL CELL AND 26 ADJACENT CELLS'/'

	3ON  CALCULATE ONLY FOR 555 CELL'//'PUSH START'//)

	PAUSE9999

	CALL DATSW(4,IB)

	CALL DATSW(5,I555)

	DO 310 K=1,3

	CALL DATSW(K,L)

	GO TO(315,310),L

310	CONTINUE

315	L=0

316	L=L + 1

	GO TO(320,325,330),K

320	READ(ICDI,321)U(L),V(L),W(L)

321	FORMAT(13X,3F8.6)

	GO TO (322,340),IB

322	READ(ICDI,321)

	GO TO 340

325	READ(ICDI,326)U(L),V(L),W(L)

326	FORMAT(27X,3F9.6)

	GO TO (327,340),IB

327	READ(ICDI,321)

	GO TO 340

330	READ(ICDI,331)U(L),V(L),W(L)

331	FORMAT(3F10.6)

	GO TO (332,340),IB

332	READ(ICDI,321)

340	IF(U(L)-999.)316,345,345

345	N=L-1

C     FEED OUT THE LAST CARD

	READ(ICDI,321)

	GO TO(347,346),I555

C     ADJUST THE COORDINATES TO WITHIN ONE HALF
346	DO  39  L=1,N

	NP(1,L)=0

	NP(2,L)=0

	NP(3,L)=0

	IF  ( ABS(U(L) )-0.5  )  64,  64,  63

63	NP(1,L)=SIGN(1.0,U(L))

	IF   (U(L))   65,  64,  66

65	U(L)=U(L)+1.
	GO TO 64                                      871 2468        A
MRS	                                          ASSOC. PROF. OF CERAMIC
	              M                               /FINCH
ERNES	T B.       MCHENRY VALLEY      ALMOND N Y      14804   607 276 6195
	                    E   DR      DR
	  PROFESSOR OF ENGLISH            EMER
ITUS	
	                                                  
	              +BURNETT             ROBERT S.       32 1/2 CHURC
ELL	Y     14843   607 324 5130MARY LOU    r    871 2220
SGM	MRS                                           CHIEF INSTRUCTOR
	                                          
S	MITH
O	LLENE          ELM VAL
EY RO	AD     ALFRED STA
Y	14803   607 587 3202            x
8	71 2188        I   MRS
M	RS
	      CUS
ODIAN	
	      
	      F
	      &B
YCKI	
LONGI	N L.       2
AST A	VENUE  87
ARKPO	RT N Y     1
7	607 295 7577ELLIE       \    871 24
	  M   MR
MR	MRS
	      ELECT
ICS T	ECHNICIAN
	                          
	      M
	BUTLER
L	EWIS C.        8 TERRACE ST
1155A	LFRED N Y      14802   607 587 35
MARGA	RET    p
871 2	141  (  IJ )  115,  115,  114

114	NPY=NPY+NP(IJ,K)*ISIGN(1,I2(I))

115	IJ=IABS(J2(I))

	IF  ( IJ )  117,  117,  116

116	NPY=NPY+NP(IJ,K)*ISIGN(1,J2(I))

117	IJ=IABS(I3(I))

	IF  ( IJ )  119,  119,  118

118	NPZ=NPZ+NP(IJ,K)*ISIGN(1,I3(I))

119	IJ=IABS(J3(I))

	IF  ( IJ )  121,  121,  120

120	NPZ=NPZ+NP(IJ,K)*ISIGN(1,J3(I))

121	X=C1(I)+P(M1)+P(N1)

	Y=C2(I)+P(M2)+P(N2)
	Z=C3(I)+P(M3)+P(N3)
	E=X

	R=Y
	G=Z
	NTRR=555

	GO TO (338,349),I555

349	DO 350 J=1,27

	IF (J-25) 10,10,4
4	IF (J-26) 36,36,5
5	IF (J-27) 37,37,62
10	GO TO (11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
	1,31,32,33,34,35),J
11	GO TO 45

12	E=1.+X
	NTRR=655

	GO TO 45
13	E=X
	R=1.+Y
	NTRR=565

	GO TO 45
14	R=Y
	G=1.+Z
	NTRR=556

	GO TO 45
15	E=-1.+X
	G=Z
	NTRR=455

	GO TO 45
16	E=X
	R=-1.+Y
	NTRR=545

	GO TO 45
17	R=Y
	G=-1.+Z
	NTRR=554

	GO TO 45
18	E=1.+X
	R=1.+Y
	G=Z
	NTRR=665

	GO TO 45
19	E=X
	G=1.+Z
	NTRR=566

	GO TO 45
20	E=1.+X
	R=Y
	NTRR=656

	GO TO 45
21	E=-1.+X
	R=-1.+Y
	G=Z
	NTRR=445

	GO TO 45
22	E=X
	G=-1.+Z
	NTRR=544

	GO TO 45
23	E=-1.+X
	R=Y
	NTRR=454

	GO TO 45
24	E=1.+X
	R=-1.+Y
	G=Z
	NTRR=645

	GO TO 45
25	E=-1.+X
	R=1.+Y
	NTRR=465

	GO TO 45
26	E=X
	G=-1.+Z
	NTRR=564

	GO TO 45
27	R=-1.+Y
	G=1.+Z
	NTRR=546

	GO TO 45
28	E=-1.+X
	R=Y
	NTRR=456

	GO TO 45
29	E=1.+X
	G=-1.+Z
	NTRR=654

	GO TO 45
30	R=1.+Y
	G=1.+Z
	NTRR=666

	GO TO 45
31	G=-1.+Z
	NTRR=664

	GO TO 45
32	R=-1.+Y
	G=1.+Z
	NTRR=646

	GO TO 45
33	E=-1.+X
	R=1.+Y
	NTRR=466

	GO TO 45
34	E=1.+X
	R=-1.+Y
	G=-1.+Z
	NTRR=644

	GO TO 45
35	E=-1.+X
	R=1.+Y
	NTRR=464

	GO TO 45
36	R=-1.+Y
	G=1.+Z
	NTRR=446

	GO TO 45
37	G=-1.+Z
	NTRR=444

45	IF  ( NP(1,L) ) 130,  132,  131

130	E=E-1.0

	GO TO 132

131	E=E+1.0

132	IF  ( NP(2,L) )  133,  135,  134

133	R=R-1.0

	GO TO 135

134	R=R+1.0

135	IF  ( NP(3,L) )  136,  138,  137

136	G=G-1.0

	GO TO 138

137	G=G+1.0

138	NTRR=NTRR+(NP(1,L)-NPX)*100+(NP(2,L)-NPY)*10+NP(3,L)-NPZ

338	MTX=C1(I)*100.

	MTY=C2(I)*100.

	MTZ=C3(I)*100.

	GO TO(351,352),I555

351	WRITE(ICDO,77)           E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

	GO TO 354

352	WRITE(1'IDSK)            E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

350	CONTINUE

354	CONTINUE

	GO TO(62,353),I555

353	LIM = M - 1

	JJ = 0

360	JJ = JJ + 1

	IF(JJ-27)365,365,62

365	READ(1'JJ)               E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

	MM=JJ + 27

	FIND(1'MM)

	WRITE (ICDO,77)          E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

	LL = JJ

	DO 370 KK = 1,LIM

	LL = LL + 27

	MM = LL + 27

	READ(1'LL)               E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

	FIND(1'MM)

370	WRITE (ICDO,77)          E,R,G,MTX,MSY(M1),MSY(N1),MTY,MSY(M2),

	1    MSY(N2),MTZ,MSY(M3),MSY(N3),I,NTRR

	GO TO 360

62	FIND(1'1)

	WRITE  ( ITYP,94 )

	CALL EXIT

72	FORMAT (//                     6X1HX,8X1HY,8X1HZ,10X8HSYMMETRY,

	1     12X5HTRLN.     /   )

75	FORMAT  ( F11.6, 2I2,F11.6,2I2,F11.6, 2I2  )

76	FORMAT(/I4,2X,3F10.5/)

77	FORMAT (             2X3F9.5,1XI3,2A2,I3,2A2,I3,2A2,1XI3,2XI3   )

79	FORMAT  ( // 2X 3HNO., 24X,8HSYMMETRY  /  )

80	FORMAT ( I4,F12.6,2XA3,A3,F12.6,2XA3,A3,F12.6,2XA3,A3    )

94	FORMAT  ( // 4HEND.  // )

	END

// DU	P

*STOR	E      WS  UA  TRANS

// XE	Q TRANS

	      1              2        A2  DR
D	R & MRS
	      DEAN OF GRADUATE SCHOOL
DEAN 	OF SPECIAL PROGRAMS        PROFESSOR OF
MATH	
TICS	
	  M                               CABLE               BETH E.
	      701 ANDOVER N Y     14806   716 478 3625            s
	  K   MISS    MISS
OPERA	TOR
	                                                          
	                      CAIRNS              JOHN B.         RD 1
A	LFRED STA,NY   14803   607 587 2194            
    871 2218
MR	  MR                                                  INSTRUCTOR I
	                                                      M
	          CAMERON             SANDRA L.       212 WATERWELLS
TA	Y  14803   607 587 8300DONALD      q    871 2188        D
MRS	                                          SUPERVISOR OF NURSES
	                                          F
