5 include "COMMON.INTERACT"
6 include "COMMON.IOUNITS"
7 integer nchain,i,ii,ipi,ipj,ipmin,j,jmin,k,ix,iy,iz,
10 integer ichain(2,20),iper(20),iaux
11 double precision dchain,dchainmin,cmchain(3,20)
16 if (itype(i).eq.ntyp1) then
17 if (.not.newchain) then
19 if (i.lt.nres) nchain=nchain+1
28 write (iout,*) "Chains"
30 write (iout,*) i,ichain(1,i),ichain(2,i)
36 do j=ichain(1,i),ichain(2,i)
37 if (itype(j).eq.ntyp1) cycle
40 cmchain(k,i)=cmchain(k,i)+c(k,j)
44 cmchain(k,i)=cmchain(k,i)/ii
58 dchain=(cmchain(1,ipj)-cmchain(1,ipi)+ix*boxxsize)**2+
59 & (cmchain(2,ipj)-cmchain(2,ipi)+iy*boxysize)**2+
60 & (cmchain(3,ipj)-cmchain(3,ipi)+iz*boxzsize)**2
61 c write (iout,*) "i",i," ipi",ipi," j",j," ipj",ipj," d",
62 c & dsqrt(dchain)," dmin",dsqrt(dchainmin)," jmin",jmin
63 if (dchain.lt.dchainmin) then
74 if (ixmin.eq.0 .and. iymin.eq.0 .and. izmin.eq.0) cycle
76 cmchain(1,ipj)=cmchain(1,ipj)+ixmin*boxxsize
77 cmchain(2,ipj)=cmchain(2,ipj)+iymin*boxysize
78 cmchain(3,ipj)=cmchain(3,ipj)+izmin*boxzsize
79 do k=ichain(1,ipj),ichain(2,ipj)
80 c(1,k)=c(1,k)+ixmin*boxxsize
81 c(2,k)=c(2,k)+iymin*boxysize
82 c(3,k)=c(3,k)+izmin*boxzsize
83 c(1,k+nres)=c(1,k+nres)+ixmin*boxxsize
84 c(2,k+nres)=c(2,k+nres)+iymin*boxysize
85 c(3,k+nres)=c(3,k+nres)+izmin*boxzsize
87 c write (iout,*) "jmin",jmin," ipj",ipj,
88 c & " ixmin",ixmin," iymin",iymin," izmin",izmin