1 subroutine contacts_between_fragments(lprint,is,ncont,icont,
2 & ncont_interfrag,icont_interfrag,mask_res,ib,iprot)
5 include 'DIMENSIONS.ZSCOPT'
6 include 'DIMENSIONS.COMPAR'
7 include 'COMMON.INTERACT'
8 include 'COMMON.COMPAR'
9 include 'COMMON.IOUNITS'
10 include 'COMMON.CHAIN'
11 include 'COMMON.NAMES'
12 integer icont(2,maxcont),ncont_interfrag(mmaxfrag),
13 & icont_interfrag(2,maxcont,mmaxfrag),mask_res(nres)
14 integer i,j,k,l,i1,i2,it1,it2,ic1,ic2,iprot,ind,nc,is,ncont,
16 logical OK1,OK2,lprint
17 c Determine the contacts that occur within a fragment and between fragments.
22 c write (iout,*) "i",i,(ifrag(1,k,i,ib,iprot),
23 c ifrag(2,k,i,ib,iprot)
24 c & ,k=1,npiece(i,1,ib,iprot))
25 c write (iout,*) "j",j,(ifrag(1,k,j,ib,iprot),
26 c ifrag(2,k,j,ib,iprot)
27 c & ,k=1,npiece(j,1,ib,iprot))
28 c write (iout,*) "ncont",ncont
33 if (mask_res(ic1)*mask_res(ic2).gt.0) then
37 do while (.not.OK1 .and. l.lt.npiece(j,1,ib,iprot))
39 OK1=ic1.ge.ifrag(1,l,j,ib,iprot)-is .and.
40 & ic1.le.ifrag(2,l,j,ib,iprot)+is
44 do while (.not.OK2 .and. l.lt.npiece(i,1,ib,iprot))
46 OK2=ic2.ge.ifrag(1,l,i,ib,iprot)-is .and.
47 & ic2.le.ifrag(2,l,i,ib,iprot)+is
49 c write(iout,*) "k",k," ic1",ic1," ic2",ic2," OK1",OK1,
53 icont_interfrag(1,nc,ind)=ic1
54 icont_interfrag(2,nc,ind)=ic2
55 c write (iout,*) "nc",nc," ic1",ic1," ic2",ic2
61 ncont_interfrag(ind)=nc
62 c do k=1,ncont_interfrag(ind)
63 c i1=icont_interfrag(1,k,ind)
64 c i2=icont_interfrag(2,k,ind)
67 c write (iout,'(i3,2x,a,i4,2x,a,i4)')
68 c & i,restyp(it1),i1,restyp(it2),i2
73 write (iout,*) "Contacts within fragments:"
75 write (iout,*) "Fragment",i," (",(ifrag(1,k,i,ib,iprot),
76 & ifrag(2,k,i,ib,iprot),k=1,npiece(i,1,ib,iprot)),")"
78 do k=1,ncont_interfrag(ind)
79 i1=icont_interfrag(1,k,ind)
80 i2=icont_interfrag(2,k,ind)
83 write (iout,'(i3,2x,a,i4,2x,a,i4)')
84 & i,restyp(it1),i1,restyp(it2),i2
88 write (iout,*) "Contacts between fragments:"
92 write (iout,*) "Fragments",i," (",(ifrag(1,k,i,ib,iprot),
93 & ifrag(2,k,i,ib,iprot),k=1,npiece(i,1,ib,iprot)),") and",j,
94 & " (",(ifrag(1,k,j,ib,iprot),ifrag(2,k,j,ib,iprot),
95 & k=1,npiece(j,1,ib,iprot)),")"
96 write (iout,*) "Number of contacts",
97 & ncont_interfrag(ind)
99 do k=1,ncont_interfrag(ind)
100 i1=icont_interfrag(1,k,ind)
101 i2=icont_interfrag(2,k,ind)
104 write (iout,'(i3,2x,a,i4,2x,a,i4)')
105 & i,restyp(it1),i1,restyp(it2),i2