4 INCLUDE 'COMMON.CLUSTER'
5 COMMON /HISTORY/ NCUR(MAX_CUT),IBACK(MAXGR,MAX_CUT)
6 COMMON /PREVIOUS/ NGRP,LICZP(MAXGR),NCONFP(MAXGR,MAXINGR)
8 C Find out what of the previous families the current ones came from.
13 IF (NCI1.EQ.NCONFP(JGR,K)) THEN
22 C Save current partition for subsequent backtracking.
28 NCONFP(IGR,K)=NCONF(IGR,K)
33 C------------------------------------------------------------------------------
36 INCLUDE 'sizesclu.dat'
37 INCLUDE 'COMMON.CLUSTER'
38 include 'COMMON.IOUNITS'
39 COMMON /HISTORY/ NCUR(MAX_CUT),IBACK(MAXGR,MAX_CUT)
40 COMMON /PREVIOUS/ NGRP,LICZP(MAXGR),NCONFP(MAXGR,MAXINGR)
41 DIMENSION IPART(MAXGR/5,MAXGR/5)
43 c write (iout,'(a,f10.5)') 'Cut-off',rcutoff(icut)
44 c write (iout,'(16i5)') (iback(k,icut),k=1,ncur(icut))
47 C Print the partition history.
52 cd print *,'icut=',icut,' ncu=',ncu,' ncur=',ncur
53 WRITE(iout,'(A,f10.5,A,f10.5)')
54 & 'Partition of families obtained at cut-off',RCUTOFF(ICUT-1),
55 & ' at cut-off',RCUTOFF(ICUT)
60 IF (IBACK(J,ICUT).EQ.I) THEN
64 cd print *,'j=',j,' iback=',IBACK(J,ICUT),' npart=',npart
66 WRITE (iout,'(16I5)') I,(IPART(K,I),K=1,NPART)
71 C------------------------------------------------------------------------------
74 INCLUDE 'sizesclu.dat'
75 INCLUDE 'COMMON.CLUSTER'
76 include 'COMMON.IOUNITS'
77 COMMON /HISTORY/ NCUR(MAX_CUT),IBACK(MAXGR,MAX_CUT)
78 COMMON /PREVIOUS/ NGRP,LICZP(MAXGR),NCONFP(MAXGR,MAXINGR)
79 DIMENSION Y(MAXGR,MAX_CUT)
80 DIMENSION ITREE(MAXGR,MAX_CUT),IFIRST(MAXGR,MAX_CUT),
81 &ILAST(MAXGR,MAX_CUT),IFT(MAXGR),ILT(MAXGR),ITR(MAXGR)
85 C Generate the image of the tree (tentatively for LaTeX picture environment).
88 C First untangle the branches of the tree
95 C Determine the order of families for the (icut)th partition.
102 IF (I.GT.1) ILAST(I-1,ICUT-1)=NPART
104 IF (IBACK(J,ICUT).EQ.I) THEN
108 IFIRST(I,ICUT-1)=NPART
114 ILAST(NCUP,ICUT-1)=NPART
115 cd print *,'i=',i,' ncup=',ncup,' ncu=',ncu,' npart=',npart
117 c diagnostic printout
119 cd write (iout,*) 'Cut-off',icut,' = ',rcutoff(icut)
120 cd write (iout,*) 'ITREE'
121 cd write (iout,*) (itree(i,icut),i=1,ncur(icut))
122 cd write (iout,*) 'IFIRST, ILAST'
123 cd write (iout,*) (ifirst(i,icut),ilast(i,icut),i=1,ncur(icut))
126 C Propagate the order of families from cut-off #2 to cut-off #n.
130 IFT(J)=IFIRST(J,ICUT)
134 ITR(J)=ITREE(J,ICUT+1)
138 c write (iout,*) 'icut=',icut,' i=',i,' iti=',iti
146 Cd write (iout,*) 'jf1=',jf1,' jl1=',jl1,' jf2=',jf2,
148 Cd write (iout,*) 'jr1=',jr1,' jr2=',jr2
149 C Update IFIRST and ILAST.
150 ILAST(I,ICUT)=IFIRST(I,ICUT)+JR2-1
151 IFIRST(I+1,ICUT)=ILAST(I,ICUT)+1
154 Cd write(iout,*) 'jf11=',jf11
156 Cd write (iout,*) j,JF11+J-JF2,ITR(J)
157 ITREE(JF11+J-JF2,ICUT+1)=ITR(J)
159 Cd write (iout,*) (ifirst(k,icut),ilast(k,icut),k=1,i)
160 Cd write (iout,*) (itree(k,icut+1),k=1,ilast(i,icut))
164 c diagnostic printout
166 cd write (iout,*) 'Cut-off',icut,' = ',rcutoff(icut)
167 cd write (iout,*) 'ITREE'
168 cd write (iout,*) (itree(i,icut),i=1,ncur(icut))
169 cd write (iout,*) 'IFIRST, ILAST'
170 cd write (iout,*) (ifirst(i,icut),ilast(i,icut),i=1,ncur(icut))
173 C Generate the y-coordinates of the branches.
178 deltx=0.5*(xlen-xbox)
193 Y(J,ICUT)=YY/(KL-KF+1)
198 cd write(iout,*) 'Cut-off=',rcutoff(icut)
199 cd write(iout,'(8f10.3)') (y(j,icut),j=1,ncur(icut))
202 C Generate LaTeX script for tree plot
210 write(jplot,'(80(1h%))')
211 write(jplot,'(a)') '% LaTeX code for minimal-tree plotting.'
212 write(jplot,'(3a)') '% Created by UNRES_CLUST on ',
214 write(jplot,'(2a)') '% To change the dimensions use the LaTeX',
215 & ' \\unitlength=number command.'
216 write(jplot,'(a)') '% The default dimensions fit an A4 page.'
217 write(jplot,'(80(1h%))')
218 write(jplot,'(a,i5,a)') '\\begin{picture}(1,1)(0,',iylen,')'
222 write(jplot,'(a,f6.1,a,f6.1,a,f4.2,a)')
223 & ' \\put(',xcur,',',ycur,'){',rcutoff(icut),' \\AA}'
228 write(jplot,'(a,i3,a)') '% Begin cut-off',1,'.'
233 write(jplot,'(4(a,f6.1),a,i3,a)')
234 & ' \\put(',xcur,',',ycur,'){\\framebox(',xbox,',',ybox,'){',
236 write(jplot,'(2(a,f6.1),2(a,i5),a,f6.1,a)')
237 & ' \\put(',xdraw,',',ydraw,'){\\line(',ideltx,
238 & ',',0,'){',deltx,'}}'
241 write(jplot,'(a,i3,a)') '% Begin cut-off',icut,'.'
244 cd print *,'icut=',icut,' xlen=',xlen,' deltx=',deltx,
245 cd & ' xcur=',xcur,' xdraw=',xdraw
248 ydraw=y(ifirst(j,icut-1),icut)
249 delty=y(ilast(j,icut-1),icut)-y(ifirst(j,icut-1),icut)
251 write(jplot,'(2(a,f6.1),2(a,i5),a,f6.1,a)')
252 & ' \\put(',xdraw,',',ydraw,'){\\line(',0,
253 & ',',idelty,'){',delty,'}}'
261 write(jplot,'(2(a,f6.1),2(a,i5),a,f6.1,a)')
262 & ' \\put(',xdraw,',',ydraw,'){\\line(',ideltx,
263 & ',',0,'){',deltx,'}}'
264 write(jplot,'(4(a,f6.1),a,i3,a)')
265 & ' \\put(',xcur,',',ycur,'){\\framebox(',xbox,',',ybox,'){',
267 if (icut.lt.ncut) then
269 write(jplot,'(2(a,f6.1),2(a,i5),a,f6.1,a)')
270 & ' \\put(',xdraw,',',ydraw,'){\\line(',ideltx,
271 & ',',0,'){',deltx,'}}'
275 write(jplot,'(a)') '\\end{picture}'