C...program ortin.for................................................. C C...reads a shelx .RES file (does not need any editing) and generates C....ORT files. Hydrogen atoms are collected at the end. C...The size of atom spheres can be changed C...by changing SIZHV (non-H) and SIZHY (H atoms) in the DATA statement C...1.ort is for circle or sphere drawing; 2.ort for ellipsoids. The H- C...atoms are circles or spheres in both files. 3.ort contains atoms in C...the same order as the .RES file. C...Serial numbers of atoms are included on atom cards for convenience. C C...The .ORT files should be edited : C...(i) check and add/delete/correct symmetry cards C...(ii) check atom card, 404 instruction may be deleted, if C...triclinic box of atoms is not required C...(iii)enter data under 511, 811, 812, 813 instructions C.................mvr/1992/modified.'98.............................. C DIMENSION DC(76),SS(4) CHARACTER*20 FI,FO CHARACTER*70 TITLE CHARACTER*76 FLINE CHARACTER*4 S CHARACTER*1 DC,APQ,BL,SS DATA SIZHV,SIZHY/0.2,0.1/ DATA X,L1,M1,N1,Y,L2,M2,N2,Z,L3,M3,N3/0.,1,0,0,0.,0,1,0, 1 0.,0,0,1/ APQ='''' BL=' ' OPEN (3,FILE='TEMP',STATUS='NEW') OPEN (2,FILE='3.ORT',STATUS='NEW') DO 56 J=1,2 READ(1,51)DC DO 55 I=1,4 55 DC(I)=BL WRITE(3,51)DC 56 CONTINUE 52 READ(1,51,END=99)DC 51 FORMAT(76A1) DO 57 J=71,76 IF(DC(J).EQ.'=') GOTO 58 57 CONTINUE GOTO 59 58 CONTINUE DC(6)=APQ DC(5)=DC(4) DC(4)=DC(3) DC(3)=DC(2) DC(2)=DC(1) DC(1)=APQ DC(71)=BL WRITE(3,51)DC READ(1,51)DC WRITE(3,51)DC GOTO 52 59 CONTINUE IF((DC(1).EQ.'H').AND.(DC(2).NE.'K'))THEN DC(6)=APQ DC(5)=DC(4) DC(4)=DC(3) DC(3)=DC(2) DC(2)=DC(1) DC(1)=APQ DO 54 IDC=52,65 54 DC(IDC)=BL DC(55)='.' DC(56)='1' DC(66)='0' DC(67)='.' WRITE(3,51)DC DO 53 IDC=1,76 53 DC(IDC)=BL DC(10)='0' DC(11)='.' DC(13)='0' DC(14)='.' DC(16)='0' DC(17)='.' DC(19)='0' DC(20)='.' WRITE(3,51)DC GOTO 52 ENDIF GOTO 52 99 DO 61 IDC=1,76 61 DC(IDC)=BL DC(1)=APQ DC(6)=APQ DC(8)='0' DC(10)='0' DC(11)='.' DC(13)='0' DC(14)='.' DC(16)='0' DC(17)='.' DC(19)='0' DC(20)='.' DC(22)='0' DC(23)='.' DC(25)='0' DC(26)='.' WRITE(3,51)DC DO 62 IDC=1,76 62 DC(IDC)=BL DC(10)='0' DC(11)='.' DC(13)='0' DC(14)='.' DC(16)='0' DC(17)='.' DC(19)='0' DC(20)='.' WRITE(3,51)DC CLOSE (1) CLOSE (3) OPEN(1,FILE='TEMP') READ(1,12) TITLE WRITE(2,12) TITLE READ(1,*) DUMY,A,B,C,D,E,F WRITE(2,10) A,B,C,D,E,F AC=A BC=B CC=C N=0 10 FORMAT(6F9.4) 11 FORMAT(A20) 12 FORMAT(A70) I=0 DO 31 J=1,3 31 WRITE(2,13) I,X,L1,M1,N1,Y,L2,M2,N2,Z,L3,M3,N3 I=1 WRITE(2,13) I,X,L1,M1,N1,Y,L2,M2,N2,Z,L3,M3,N3 13 FORMAT(I1,F14.10,3I3,2(F15.10,3I3)) K=0 J=8 33 READ(1,*) S,I,A,B,C,D,E,F IF(S.EQ.' ')GOTO 32 N=N+1 READ(1,*) G,H,P,Q IF(A.GE.10.) A=A-10. IF(B.GE.10.) B=B-10. IF(C.GE.10.) C=C-10. IF(D.GE.10.) D=D-10. IF(E.GE.10.) E=E-10. IF(F.GE.10.) F=F-10. IF(G.GE.10.) G=G-10. IF(H.GE.10.) H=H-10. IF(P.GE.10.) P=P-10. IF(Q.GE.10.) Q=Q-10. CALL W1(S,N,A,B,C,K,E,F,G,Q,P,H,J) GOTO 33 32 CALL IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) A=.5 B=.5 C=.5 S='CENT' E=.1 J=7 NP1=N+1 CALL W1(S,NP1,A,B,C,K,E,F,G,Q,P,H,J) A=0. B=0. C=0. S='ORGN' E=.03 J=7 K=1 NP2=N+2 CALL W1(S,NP2,A,B,C,K,E,F,G,Q,P,H,J) K=0 I=201 CALL W2(K,I,A,B,C,D,E,F,G) I=301 A=10. B=8. C=0. D=1.5 CALL W3(K,I,A,B,C,D,E,F,G) I=303 CALL W2(K,I,A,B,C,D,E,F,G) I=401 A=155501. B=-FLOAT(N*100000+55501) CALL W2(K,I,A,B,C,D,E,F,G) A=FLOAT((N+2)*100000+55501) B=-FLOAT((N+2)*100000+66601) CALL W2(K,I,A,B,C,D,E,F,G) I=404 A=FLOAT(N+1) B=A C=1 D=FLOAT(N) E=.5 F=.5 G=.5 CALL W3(K,I,A,B,C,D,E,F,G) I=501 A=FLOAT((N+2)*100000+55501) B=A C=A+10000 D=A E=A+100 CALL W2(K,I,A,B,C,D,E,F,G) I=502 CALL W2(K,I,A,B,C,D,E,F,G) I=604 D=1.54 CALL W3(K,I,A,B,C,D,E,F,G) K=2 I=511 CALL W2(K,I,A,B,C,D,E,F,G) C=0.04 L5=4 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) I=714 F=.6 G=.7 CALL W3(K,I,A,B,C,D,E,F,G) K=2 I=813 CALL W2(K,I,A,B,C,D,E,F,G) K=2 L1=N+2 L2=L1 L3=L1 L4=L1 A=AC-.1 B=AC+.1 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) L1=N+2 L2=L1 L3=L1 L4=L1 A=BC-.1 B=BC+.1 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) L1=N+2 L2=L1 L3=L1 L4=L1 A=CC-.1 B=CC+.1 K=0 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) K=2 I=812 CALL W2(K,I,A,B,C,D,E,F,G) C=.04 L5=4 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) K=2 I=811 CALL W2(K,I,A,B,C,D,E,F,G) C=.04 L5=4 CALL W4(K,L1,L2,L3,L4,L5,A,B,C) I=-1 CALL W2(K,I,A,B,C,D,E,F,G) CLOSE(2) CLOSE(3) OPEN(1,FILE='3.ORT') OPEN(3,FILE='1.ORT',STATUS='NEW') OPEN(2,FILE='2.ORT',STATUS='NEW') DO 70 I=1,6 READ(1,71)FLINE WRITE(2,71)FLINE WRITE(3,71)FLINE 70 CONTINUE N=0 72 READ(1,73) SS,ND,A,B,C,K,D,E,F,G,H,P,L IF(SS(1).EQ.'H') GOTO 72 IF(ND.EQ.NP1)GOTO 81 N=N+1 WRITE(2,73)SS,N,A,B,C,K,D,E,F,G,H,P,L D=SIZHV L=7 WRITE(3,75)SS,N,A,B,C,K,D,L GOTO 72 81 CLOSE(1) OPEN(1,FILE='3.ORT') DO 78 I=1,6 78 READ(1,71)FLINE 76 READ(1,73) SS,ND,A,B,C,K,D,E,F,G,H,P,L IF(SS(1).NE.'H') GOTO 74 N=N+1 L=7 D=SIZHY WRITE(2,75)SS,N,A,B,C,K,D,L WRITE(3,75)SS,N,A,B,C,K,D,L 74 IF(ND.LT.NP1)GOTO 76 WRITE(2,75)SS,ND,A,B,C,K,D,L WRITE(3,75)SS,ND,A,B,C,K,D,L READ(1,73) SS,ND,A,B,C,K,D,E,F,G,H,P,L WRITE(2,75)SS,ND,A,B,C,K,D,L WRITE(3,75)SS,ND,A,B,C,K,D,L DO 77 I=1,21 READ(1,71)FLINE WRITE(2,71)FLINE WRITE(3,71)FLINE 77 CONTINUE 71 FORMAT(A76) 73 FORMAT(4A1,2X,I3,18X,3F9.6/I1,F8.6,5F9.6,8X,I1) 75 FORMAT(4A1,2X,I3,18X,3F9.6/I1,F4.2,57X,I1) STOP END SUBROUTINE IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) A=0. B=0. C=0. D=0. E=0. F=0. G=0. H=0. P=0. Q=0. L1=0 L2=0. L3=0. L4=0. L5=0. RETURN END SUBROUTINE W1(S,N,A,B,C,K,E,F,G,Q,P,H,J) CHARACTER*4 S 10 FORMAT(A4,2X,I3,18X,3F9.6) 20 FORMAT(I1,F8.6,5F9.6,8X,I1) WRITE(2,10) S,N,A,B,C WRITE(2,20) K,E,F,G,Q,P,H,J CALL IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) RETURN END SUBROUTINE W2(K,I,A,B,C,D,E,F,G) 10 FORMAT(I3,I6,7F9.0) WRITE(2,10) K,I,A,B,C,D,E,F,G CALL IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) K=0 RETURN END SUBROUTINE W3(K,I,A,B,C,D,E,F,G) 10 FORMAT(I3,I6,7F9.2) WRITE(2,10) K,I,A,B,C,D,E,F,G CALL IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) K=0 RETURN END SUBROUTINE W4(K,L1,L2,L3,L4,L5,A,B,C) 10 FORMAT(I3,6X,5I3,3F6.3) WRITE(2,10) K,L1,L2,L3,L4,L5,A,B,C CALL IN(A,B,C,D,E,F,G,H,P,Q,L1,L2,L3,L4,L5) RETURN END