1 parameter (maxmodel=20)
2 parameter (maxres=1000)
3 character*32 model(maxmodel)
4 integer imodel(maxmodel)
5 integer ifragpair(maxres,maxmodel,maxmodel),
6 & ifragpair_new(maxres,maxmodel,maxmodel),
7 & iflag(maxres),isumfmax(maxmodel),kmax(maxmodel),
8 & isumf(maxmodel),isumfmaxmin(maxmodel),kmaxmin(maxmodel),
9 & jmaxmin(maxmodel),isump(maxmodel),ifragpair_temp(maxres),
10 & ifragpair_temp1(maxres),ninclust(maxmodel),nlenclust(maxmodel),
11 & icluster(maxmodel,maxmodel),ifrag(maxres,maxmodel)
22 read(*,'(a32,33x,1000i1)')model(i),(ifragpair(k,i,j),k=1,nres)
27 write(*,'(2a32,1000i1)')model(i),model(j),
28 & (ifragpair(k,i,j),k=1,nres)
33 DO WHILE (isumcut.ge.lencut)
34 c search the longest fragment (number 1)
40 c write(*,'(2a32,1000i1)')model(i),model(j),(ifragpair(k,i,j)
41 c & -ifragpair(k,j,i),k=1,nres)
45 if (kk.gt.0) isump(kk)=isump(kk)+1
46 if (kk.gt.nfrag) nfrag=kk
50 if (isump(k).gt.isum) then
55 c write(*,'(2a32,i10)')model(i),model(j),isum
56 if (isum.gt.isummax) then
64 write (*,*) "nfrag",nfrag," kfmax",kfmax
65 c icut = max0(isummax*2/3,lencut)
71 c write(*,'(2a32,i10)')model(imodel(1)),model(imodel(2)),isummax
78 if (iflag(i).gt.0) cycle
83 kk = ifragpair(k,i,jj)
84 if (ifragpair(k,i1,i2).ne.kfmax .or. kk.eq.0) cycle
89 if (isumf(k).gt.isumfmax(j)) then
99 if (isumfmax(j).lt.isumfmaxmin(i)) then
100 isumfmaxmin(i)=isumfmax(j)
111 if (iflag(i).gt.0) cycle
112 if (isumfmaxmin(i).gt.isumfmaxminmax) then
113 isumfmaxminmax=isumfmaxmin(i)
115 kmaxminmax=kmaxmin(i)
116 jmaxminmax=jmaxmin(i)
119 print *,"isumfmaxminmax",isumfmaxminmax," icut",icut
120 if (isumfmaxminmax.lt.icut) then
123 isumcut = isumfmaxminmax
128 iflag(imaxminmax)=imaxminmax
129 imodel(nflag)=imaxminmax
130 c write(*,'(2a32,i10)')model(imodel(1)),model(imodel(2)),isummax
131 c write(*,'(1000i1)')(ifragpair(k,imodel(1),imodel(2)),k=1,nres)
132 write(*,*) "isumfmaxminmax",isumfmaxminmax
133 print *,"kmaxminmax",kmaxminmax
134 write(*,'(a32)')(model(imodel(i)),i=1,nflag)
136 & (ifragpair(k,imaxminmax,jmaxminmax),k=1,nres)
138 ifragpair_temp(k)=ifragpair(k,imaxminmax,jmaxminmax)
139 ifragpair_temp1(k)=ifragpair(k,i1,i2)
146 if (ifragpair_temp(k).eq.kmaxminmax .and.
147 & ifragpair_temp1(k).eq.kfmax) then
156 write(*,'(2a32,1000i1)')model(i),model(j),
157 & (ifragpair(k,i,j),k=1,nres)
162 print *,"iimod",iimod," jjmod",jjmod," kkmod",kkmod,
164 if (isumcut.ge.icut) then
166 print *,"cluster",nclust
167 ninclust(nclust)=nflag
168 nlenclust(nclust)=isumcut
170 icluster(i,nclust)=imodel(i)
174 if (ifragpair_temp(k).eq.kkmod .and.
175 & ifragpair_temp1(k).eq.kfmax) then
181 if (ii.ne.nlenclust(nclust)) write(*,*) "CHUJ NASTAPIL!!!",
182 & ii,nlenclust(nclust)
186 if (ifragpair_temp(k).eq.kkmod .and.
187 & ifragpair_temp1(k).eq.kfmax) then
188 ifragpair_new(k,imodel(i),imodel(j))=nclust
189 ifragpair_new(k,imodel(j),imodel(i))=nclust
198 write(*,'(2a32,1000i1)')model(i),model(j),
199 & (ifragpair_new(k,i,j),k=1,nres)
202 write (*,*) "nclust",nclust
204 write(*,*) "Cluster",i," ninclust",ninclust(i)
205 write(*,'(a32)') (model(icluster(j,i)),j=1,ninclust(i))
206 write(*,'(i5)') (ifrag(j,i),j=1,nlenclust(i))