1 subroutine contacts_between_fragments(lprint,is,ncont,icont,
2 & ncont_interfrag,icont_interfrag)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.COMPAR'
6 include 'COMMON.INTERACT'
7 include 'COMMON.COMPAR'
8 include 'COMMON.IOUNITS'
10 include 'COMMON.NAMES'
11 integer icont(2,maxcont),ncont_interfrag(mmaxfrag),
12 & icont_interfrag(2,maxcont,mmaxfrag)
13 logical OK1,OK2,lprint
14 c Determine the contacts that occur within a fragment and between fragments.
19 c write (iout,*) "i",i,(ifrag(1,k,i),ifrag(2,k,i)
21 c write (iout,*) "j",j,(ifrag(1,k,j),ifrag(2,k,j)
23 c write (iout,*) "ncont",ncont
29 do while (.not.OK1 .and. l.lt.npiece(j,1))
31 OK1=ic1.ge.ifrag(1,l,j)-is .and.
32 & ic1.le.ifrag(2,l,j)+is
36 do while (.not.OK2 .and. l.lt.npiece(i,1))
38 OK2=ic2.ge.ifrag(1,l,i)-is .and.
39 & ic2.le.ifrag(2,l,i)+is
41 c write(iout,*) "k",k," ic1",ic1," ic2",ic2," OK1",OK1,
45 icont_interfrag(1,nc,ind)=ic1
46 icont_interfrag(2,nc,ind)=ic2
47 c write (iout,*) "nc",nc," ic1",ic1," ic2",ic2
50 ncont_interfrag(ind)=nc
51 c do k=1,ncont_interfrag(ind)
52 c i1=icont_interfrag(1,k,ind)
53 c i2=icont_interfrag(2,k,ind)
56 c write (iout,'(i3,2x,a,i4,2x,a,i4)')
57 c & i,restyp(it1),i1,restyp(it2),i2
62 write (iout,*) "Contacts within fragments:"
64 write (iout,*) "Fragment",i," (",(ifrag(1,k,i),
65 & ifrag(2,k,i),k=1,npiece(i,1)),")"
67 do k=1,ncont_interfrag(ind)
68 i1=icont_interfrag(1,k,ind)
69 i2=icont_interfrag(2,k,ind)
72 write (iout,'(i3,2x,a,i4,2x,a,i4)')
73 & i,restyp(it1),i1,restyp(it2),i2
77 write (iout,*) "Contacts between fragments:"
81 write (iout,*) "Fragments",i," (",(ifrag(1,k,i),
82 & ifrag(2,k,i),k=1,npiece(i,1)),") and",j," (",
83 & (ifrag(1,k,j),ifrag(2,k,j),k=1,npiece(j,1)),")"
84 write (iout,*) "Number of contacts",
85 & ncont_interfrag(ind)
87 do k=1,ncont_interfrag(ind)
88 i1=icont_interfrag(1,k,ind)
89 i2=icont_interfrag(2,k,ind)
92 write (iout,'(i3,2x,a,i4,2x,a,i4)')
93 & i,restyp(it1),i1,restyp(it2),i2