1 subroutine elecont(lprint,ncont,icont,ist,ien)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.COMPAR'
6 include 'COMMON.IOUNITS'
8 include 'COMMON.INTERACT'
9 include 'COMMON.FFIELD'
10 include 'COMMON.NAMES'
11 include 'COMMON.LOCAL'
13 integer i,j,k,ist,ien,iteli,itelj,ind,i1,i2,it1,it2,ic1,ic2
14 double precision rri,xi,yi,zi,dxi,dyi,dzi,xmedi,ymedi,zmedi,
15 & xj,yj,zj,dxj,dyj,dzj,aaa,bbb,ael6i,ael3i,rrmij,rmij,r3ij,r6ij,
16 & vrmij,cosa,cosb,cosg,fac,ev1,ev2,fac3,fac4,evdwij,el1,el2,
18 double precision elpp6c(2,2),elpp3c(2,2),ael6c(2,2),ael3c(2,2),
20 double precision elcutoff,elecutoff_14
21 integer ncont,icont(2,maxcont)
22 double precision econt(maxcont)
24 * Load the constants of peptide bond - peptide bond interactions.
25 * Type 1 - ordinary peptide bond, type 2 - alkylated peptide bond (e.g.
26 * proline) - determined by averaging ECEPP energy.
30 c data epp / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
31 c data rpp / 4.5088d0, 4.5395d0, 4.5395d0, 4.4846d0/
32 data elpp6c /-0.2379d0,-0.2056d0,-0.2056d0,-0.0610d0/
33 data elpp3c / 0.0503d0, 0.0000d0, 0.0000d0, 0.0692d0/
34 data elcutoff /-0.3d0/,elecutoff_14 /-0.5d0/
37 if (lprint) write (iout,'(a)')
38 & "Constants of electrostatic interaction energy expression."
42 appc(i,j)=epp(i,j)*rri*rri
43 bppc(i,j)=-2.0*epp(i,j)*rri
44 ael6c(i,j)=elpp6c(i,j)*4.2**6
45 ael3c(i,j)=elpp3c(i,j)*4.2**3
47 & write (iout,'(2i2,4e15.4)') i,j,appc(i,j),bppc(i,j),ael6c(i,j),
66 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
67 if (iteli.eq.2 .and. itelj.eq.2
68 & .or.iteli.eq.0 .or.itelj.eq.0) goto 4
71 ael6i=ael6c(iteli,itelj)
72 ael3i=ael3c(iteli,itelj)
76 xj=c(1,j)+0.5*dxj-xmedi
77 yj=c(2,j)+0.5*dyj-ymedi
78 zj=c(3,j)+0.5*dzj-zmedi
79 rrmij=1.0/(xj*xj+yj*yj+zj*zj)
84 cosa=(dxi*dxj+dyi*dyj+dzi*dzj)*vblinv2
85 cosb=(xj*dxi+yj*dyi+zj*dzi)*vrmij
86 cosg=(xj*dxj+yj*dyj+zj*dzj)*vrmij
87 fac=cosa-3.0*cosb*cosg
93 el1=fac3*(4.0+fac*fac-3.0*(cosb*cosb+cosg*cosg))
96 if (j.gt.i+2 .and. eesij.le.elcutoff .or.
97 & j.eq.i+2 .and. eesij.le.elecutoff_14) then
108 write (iout,*) 'Total average electrostatic energy: ',ees
109 write (iout,*) 'VDW energy between peptide-group centers: ',evdw
111 write (iout,*) 'Electrostatic contacts before pruning: '
117 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
118 & i,restyp(it1),i1,restyp(it2),i2,econt(i)
121 c For given residues keep only the contacts with the greatest energy.
123 do while (i.lt.ncont)
129 do while (j.lt.ncont)
131 if (ic1.eq.icont(1,j).and.iabs(icont(2,j)-ic2).le.2 .or.
132 & ic2.eq.icont(2,j).and.iabs(icont(1,j)-ic1).le.2) then
133 c write (iout,*) "i",i," j",j," ic1",ic1," ic2",ic2,
134 c & " jc1",icont(1,j)," jc2",icont(2,j)," ncont",ncont
135 if (econt(j).lt.ene .and. icont(2,j).ne.icont(1,j)+2) then
136 if (ic1.eq.icont(1,j)) then
138 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.icont(2,j)
139 & .and. iabs(icont(1,k)-ic1).le.2 .and.
140 & econt(k).lt.econt(j) ) goto 21
142 else if (ic2.eq.icont(2,j) ) then
144 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.icont(1,j)
145 & .and. iabs(icont(2,k)-ic2).le.2 .and.
146 & econt(k).lt.econt(j) ) goto 21
151 icont(1,k-1)=icont(1,k)
152 icont(2,k-1)=icont(2,k)
157 c write (iout,*) "ncont",ncont
159 c write (iout,*) icont(1,k),icont(2,k)
162 else if (econt(j).gt.ene .and. ic2.ne.ic1+2)
164 if (ic1.eq.icont(1,j)) then
166 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.ic2
167 & .and. iabs(icont(1,k)-icont(1,j)).le.2 .and.
168 & econt(k).lt.econt(i) ) goto 21
170 else if (ic2.eq.icont(2,j) ) then
172 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.ic1
173 & .and. iabs(icont(2,k)-icont(2,j)).le.2 .and.
174 & econt(k).lt.econt(i) ) goto 21
179 icont(1,k-1)=icont(1,k)
180 icont(2,k-1)=icont(2,k)
184 c write (iout,*) "ncont",ncont
186 c write (iout,*) icont(1,k),icont(2,k)
197 write (iout,*) 'Electrostatic contacts after pruning: '
203 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
204 & i,restyp(it1),i1,restyp(it2),i2,econt(i)