1 | ! **************************************************************
|
---|
2 | !
|
---|
3 | ! This file contains the subroutines: cnteny
|
---|
4 | !
|
---|
5 | ! Copyright 2005 Frank Eisenmenger, U.H.E. Hansmann,
|
---|
6 | ! Shura Hayryan, Chin-Ku
|
---|
7 | ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
|
---|
8 | ! Jan H. Meinke, Sandipan Mohanty
|
---|
9 | !
|
---|
10 | ! **************************************************************
|
---|
11 |
|
---|
12 | subroutine cnteny(nml)
|
---|
13 |
|
---|
14 | ! ................................................................................
|
---|
15 | ! PURPOSE: Calculate atomic contact energy of molecule 'nml' with ECEPP parameters
|
---|
16 | !
|
---|
17 | ! CALLS: nursat
|
---|
18 | ! ................................................................................
|
---|
19 |
|
---|
20 | include 'INCL.H'
|
---|
21 |
|
---|
22 | double precision coeycn, coey, eyatcn, cqi, xi, yi, zi, xij, yij
|
---|
23 | double precision zij, rij2, rij4, rij6, rij, sr, ep, ey
|
---|
24 |
|
---|
25 | integer ieyel, ntlvr, nml, iat1, nat, i, ifivr, i1s, io, iv, ia
|
---|
26 | integer it, ic, i2s, ims, i1, i2, ii, ity, ivw, j, jj, jty, i14
|
---|
27 | integer nbc, ir, nursat, idxat
|
---|
28 |
|
---|
29 | parameter (coeycn=2.d0) ! min. cont. energy to display
|
---|
30 |
|
---|
31 | dimension eyatcn(mxat),idxat(mxat)
|
---|
32 |
|
---|
33 |
|
---|
34 | ieyel=0 ! =1, if count electrost. energy
|
---|
35 |
|
---|
36 | ntlvr=nvrml(nml)
|
---|
37 |
|
---|
38 | if (ntlvr.eq.0) then
|
---|
39 | write (logString, '(a,i4)')
|
---|
40 | & ' cnteny> No variables defined in molecule #',nml
|
---|
41 | return
|
---|
42 | endif
|
---|
43 |
|
---|
44 | if (ieyel.eq.1) then
|
---|
45 | coey=5.d0*coeycn
|
---|
46 | else
|
---|
47 | coey=coeycn
|
---|
48 | endif
|
---|
49 |
|
---|
50 | iat1=iatrs1(irsml1(nml))-1 ! last atom before 'nml'
|
---|
51 | nat=iatrs2(irsml2(nml))-iat1 ! no. of atoms in 'nml'
|
---|
52 |
|
---|
53 | do i=1,nat
|
---|
54 | eyatcn(i)=0.d0
|
---|
55 | enddo
|
---|
56 |
|
---|
57 |
|
---|
58 | ifivr=ivrml1(nml)
|
---|
59 | i1s=imsml1(nml)+nmsml(nml)
|
---|
60 |
|
---|
61 | do io=ifivr+ntlvr-1,ifivr,-1 ! ______ over variables in desc. order
|
---|
62 | iv=iorvr(io) ! index of var.
|
---|
63 |
|
---|
64 | ia=iatvr(iv) ! prim.mv.at
|
---|
65 | it=ityvr(iv) ! type
|
---|
66 | ic=iclvr(iv) ! class
|
---|
67 |
|
---|
68 | i2s=i1s-1 ! last m.s per 'iv'
|
---|
69 | i1s=imsvr1(iv) ! 1st m.s
|
---|
70 |
|
---|
71 | do ims=i1s,i2s ! __ loop over m.s
|
---|
72 | i1=latms1(ims)
|
---|
73 | i2=latms2(ims)
|
---|
74 |
|
---|
75 | do i=i1,i2 ! __ over atoms i ===================
|
---|
76 |
|
---|
77 | ii=i-iat1
|
---|
78 |
|
---|
79 | ity=ityat(i)
|
---|
80 | cqi=conv*cgat(i)
|
---|
81 |
|
---|
82 | xi=xat(i)
|
---|
83 | yi=yat(i)
|
---|
84 | zi=zat(i)
|
---|
85 |
|
---|
86 | do ivw=ivwat1(i),ivwat2(i) ! vdW-domains of 'i'
|
---|
87 | do j=lvwat1(ivw),lvwat2(ivw) ! atoms j
|
---|
88 |
|
---|
89 | jj=j-iat1
|
---|
90 |
|
---|
91 | jty=ityat(j)
|
---|
92 |
|
---|
93 | xij=xat(j)-xi
|
---|
94 | yij=yat(j)-yi
|
---|
95 | zij=zat(j)-zi
|
---|
96 |
|
---|
97 | rij2=xij*xij+yij*yij+zij*zij
|
---|
98 | rij4=rij2*rij2
|
---|
99 | rij6=rij4*rij2
|
---|
100 |
|
---|
101 | if (ieyel.eq.1) then
|
---|
102 |
|
---|
103 | rij=sqrt(rij2)
|
---|
104 |
|
---|
105 | if (epsd) then
|
---|
106 | sr=slp*rij
|
---|
107 | ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0
|
---|
108 | else
|
---|
109 | ep = 1.0d0
|
---|
110 | endif
|
---|
111 |
|
---|
112 | ey=cqi*cgat(j)/(rij*ep)
|
---|
113 |
|
---|
114 | eyatcn(ii)=eyatcn(ii)+.5d0*ey
|
---|
115 | eyatcn(jj)=eyatcn(jj)+.5d0*ey
|
---|
116 |
|
---|
117 | endif ! eyel
|
---|
118 |
|
---|
119 | if (ihbty(ity,jty).eq.0) then
|
---|
120 | ey=aij(ity,jty)/(rij6*rij6)-cij(ity,jty)/rij6
|
---|
121 | else ! HB
|
---|
122 | ey=ahb(ity,jty)/(rij6*rij6)-chb(ity,jty)/(rij6*rij4)
|
---|
123 | endif
|
---|
124 |
|
---|
125 | eyatcn(ii)=eyatcn(ii)+.5d0*ey
|
---|
126 | eyatcn(jj)=eyatcn(jj)+.5d0*ey
|
---|
127 |
|
---|
128 | enddo ! ... atoms j
|
---|
129 | enddo ! ... vdW-domains of i
|
---|
130 |
|
---|
131 | do i14=i14at1(i),i14at2(i) ! over 1-4 partn. of 'i'
|
---|
132 | j=l14at(i14)
|
---|
133 |
|
---|
134 | jj=j-iat1
|
---|
135 |
|
---|
136 | jty=ityat(j)
|
---|
137 |
|
---|
138 | xij=xat(j)-xi
|
---|
139 | yij=yat(j)-yi
|
---|
140 | zij=zat(j)-zi
|
---|
141 | rij2=xij*xij+yij*yij+zij*zij
|
---|
142 | rij4=rij2*rij2
|
---|
143 | rij6=rij4*rij2
|
---|
144 |
|
---|
145 | if (ieyel.eq.1) then
|
---|
146 |
|
---|
147 | rij = sqrt(rij2)
|
---|
148 |
|
---|
149 | if (epsd) then
|
---|
150 | sr=slp*rij
|
---|
151 | ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0
|
---|
152 | else
|
---|
153 | ep=1.0d0
|
---|
154 | endif
|
---|
155 |
|
---|
156 | ey=cqi*cgat(j)/(rij*ep)
|
---|
157 |
|
---|
158 | eyatcn(ii)=eyatcn(ii)+.5d0*ey
|
---|
159 | eyatcn(jj)=eyatcn(jj)+.5d0*ey
|
---|
160 |
|
---|
161 | endif ! eel
|
---|
162 |
|
---|
163 | if (ihbty(ity,jty).eq.0) then
|
---|
164 | ey=a14(ity,jty)/(rij6*rij6)-cij(ity,jty)/rij6
|
---|
165 | else
|
---|
166 | ey=ahb(ity,jty)/(rij6*rij6)-chb(ity,jty)/(rij6*rij4)
|
---|
167 | endif
|
---|
168 |
|
---|
169 | eyatcn(ii)=eyatcn(ii)+.5d0*ey
|
---|
170 | eyatcn(jj)=eyatcn(jj)+.5d0*ey
|
---|
171 |
|
---|
172 | enddo ! ... 1-4-partners of i
|
---|
173 |
|
---|
174 | enddo ! ... atoms i
|
---|
175 | enddo ! ... m.s.
|
---|
176 |
|
---|
177 | enddo ! ... variables
|
---|
178 |
|
---|
179 | nbc=0
|
---|
180 |
|
---|
181 | do i=1,nat
|
---|
182 | ey=eyatcn(i)
|
---|
183 | if (ey.gt.coey) then
|
---|
184 | nbc=nbc+1
|
---|
185 | ir=nursat(i)
|
---|
186 | write (logString, '(1x,i4,1x,a4,1x,a4,a2,e11.4)') ir,seq(ir),
|
---|
187 | & nmat(i), ': ',ey
|
---|
188 | endif
|
---|
189 | enddo
|
---|
190 |
|
---|
191 | return
|
---|
192 | end
|
---|
193 |
|
---|