1 | ! **************************************************************
|
---|
2 | !
|
---|
3 | ! This file contains the subroutines: enyshe
|
---|
4 | !
|
---|
5 | ! Copyright 2003-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 |
|
---|
13 | real*8 function enyshe(nml)
|
---|
14 |
|
---|
15 | ! ............................................................................
|
---|
16 | !
|
---|
17 | ! PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
|
---|
18 | !
|
---|
19 | ! CALLS: none
|
---|
20 | !
|
---|
21 | ! The function loops over all moving sets within the molecule. Within
|
---|
22 | ! this loop it loops over the van-der-Waals domains of each atom in the
|
---|
23 | ! moving set and finally over the atoms that belong to the 1-4 interaction
|
---|
24 | ! set.
|
---|
25 | ! ............................................................................
|
---|
26 |
|
---|
27 | include 'INCL.H'
|
---|
28 |
|
---|
29 | ! If nml == 0 calculate the interaction between all pairs.
|
---|
30 | if (nml.eq.0) then
|
---|
31 | ntlvr = nvr
|
---|
32 | else
|
---|
33 | ntlvr=nvrml(nml)
|
---|
34 | endif
|
---|
35 |
|
---|
36 | if (ntlvr.eq.0) then
|
---|
37 | write (*,'(a,i4)')
|
---|
38 | & ' enyshe> No variables defined in molecule #',nml
|
---|
39 | return
|
---|
40 | endif
|
---|
41 |
|
---|
42 | enyshe=0.0
|
---|
43 | eyel=0.0
|
---|
44 | eyvw=0.0
|
---|
45 | eyhb=0.0
|
---|
46 | eyvr=0.0
|
---|
47 | if (nml.eq.0) then
|
---|
48 | ifivr = ivrml1(1)
|
---|
49 | i1s = imsml1(ntlml) + nmsml(ntlml)
|
---|
50 | else
|
---|
51 | ! Index of first variable in molecule.
|
---|
52 | ifivr=ivrml1(nml)
|
---|
53 | ! Index of last moving set in molecule
|
---|
54 | i1s=imsml1(nml)+nmsml(nml)
|
---|
55 | endif
|
---|
56 | ! Loop over moving sets/variables in reverse order
|
---|
57 | do io=ifivr+ntlvr-1,ifivr,-1
|
---|
58 | ! The array iorvr contains the variables in an "apropriate" order.
|
---|
59 | iv=iorvr(io)
|
---|
60 | ! Index of the primary moving atom for the variable with index iv
|
---|
61 | ia=iatvr(iv)
|
---|
62 | ! Get the type of variable iv (valence length, valence angle, dihedral angle)
|
---|
63 | it=ityvr(iv)
|
---|
64 | ! Class of variable iv's potential (Q: What are they)
|
---|
65 | ic=iclvr(iv)
|
---|
66 | ! If iv is a dihedral angle ...
|
---|
67 | if (it.eq.3) then
|
---|
68 | ! Barrier height * 1/2 of the potential of iv.
|
---|
69 | e0=e0to(ic)
|
---|
70 | ! Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
|
---|
71 | ! the periodicity and toat is torsion angle(?) associate with atom ia.
|
---|
72 | if (e0.ne.0.)
|
---|
73 | & eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
|
---|
74 | ! else if iv is a valence angle ...
|
---|
75 | elseif (it.eq.2) then
|
---|
76 | ! vr is the valence angle of ia
|
---|
77 | vr=baat(ia)
|
---|
78 | ! else if iv is a valence length...
|
---|
79 | elseif (it.eq.1) then
|
---|
80 | ! vr is the length of the valence bond
|
---|
81 | vr=blat(ia)
|
---|
82 | endif
|
---|
83 |
|
---|
84 | ! ============================================ Energies & Atomic forces
|
---|
85 | ! index of next to last moving set
|
---|
86 | i2s=i1s-1
|
---|
87 | ! index of first moving set associated with iv
|
---|
88 | i1s=imsvr1(iv)
|
---|
89 | ! Loop over all moving sets starting from the one associated with vr to the end.
|
---|
90 | do ims=i1s,i2s
|
---|
91 | ! First atom of the current moving set
|
---|
92 | i1=latms1(ims)
|
---|
93 | ! Last atom of the current moving set
|
---|
94 | i2=latms2(ims)
|
---|
95 | ! Loop over all atoms of the current moving set.
|
---|
96 | do i=i1,i2
|
---|
97 | ! Atom class of current atom
|
---|
98 | ity=ityat(i)
|
---|
99 | ! Point charge at current atom
|
---|
100 | cqi=conv*cgat(i)
|
---|
101 | ! Cartesian coordinates of current atom
|
---|
102 | xi=xat(i)
|
---|
103 | yi=yat(i)
|
---|
104 | zi=zat(i)
|
---|
105 | ! Loop over the atoms of the van der Waals domain belonging to atom i
|
---|
106 | do ivw=ivwat1(i),ivwat2(i)
|
---|
107 | ! Loop over the atoms of the van der Waals domain of the atoms of the
|
---|
108 | ! van der Waals domain of atom i
|
---|
109 | ! Q: Which atoms are in these domains?
|
---|
110 | do j=lvwat1(ivw),lvwat2(ivw)
|
---|
111 | ! Atom type of partner
|
---|
112 | jty=ityat(j)
|
---|
113 | ! Differences in cartesian coordinates
|
---|
114 | xij=xat(j)-xi
|
---|
115 | yij=yat(j)-yi
|
---|
116 | zij=zat(j)-zi
|
---|
117 | ! Cartesian distance and higher powers
|
---|
118 | rij2=xij*xij+yij*yij+zij*zij
|
---|
119 | rij4=rij2*rij2
|
---|
120 | rij6=rij4*rij2
|
---|
121 | rij=sqrt(rij2)
|
---|
122 | ! Are we using a distance dependent dielectric constant?
|
---|
123 | if(epsd) then
|
---|
124 | sr=slp*rij
|
---|
125 | ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0
|
---|
126 | else
|
---|
127 | ep = 1.0d0
|
---|
128 | end if
|
---|
129 | ! Coulomb interaction
|
---|
130 | eyel=eyel+cqi*cgat(j)/(rij*ep)
|
---|
131 | ! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
|
---|
132 | if (ihbty(ity,jty).eq.0) then
|
---|
133 | eyvw=eyvw+aij(ity,jty)/(rij6*rij6)
|
---|
134 | & -cij(ity,jty)/rij6
|
---|
135 | else
|
---|
136 | ! For hydrogen bonding use 10-12 Lennard-Jones potential
|
---|
137 | eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
|
---|
138 | & -chb(ity,jty)/(rij6*rij4)
|
---|
139 | endif
|
---|
140 |
|
---|
141 | enddo
|
---|
142 | enddo
|
---|
143 |
|
---|
144 | ! Loop over 1-4 interaction partners
|
---|
145 | ! The interactions between atoms that are three bonds apart in the protein are
|
---|
146 | ! dominated by quantum mechanical effects. They are treated separately.
|
---|
147 | do i14=i14at1(i),i14at2(i)
|
---|
148 | j=l14at(i14)
|
---|
149 |
|
---|
150 | jty=ityat(j)
|
---|
151 |
|
---|
152 | xij=xat(j)-xi
|
---|
153 | yij=yat(j)-yi
|
---|
154 | zij=zat(j)-zi
|
---|
155 | rij2=xij*xij+yij*yij+zij*zij
|
---|
156 | rij4=rij2*rij2
|
---|
157 | rij6=rij4*rij2
|
---|
158 | rij = sqrt(rij2)
|
---|
159 | ! Are we using a distance dependent dielectric constant?
|
---|
160 | if(epsd) then
|
---|
161 | sr=slp*rij
|
---|
162 | ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0
|
---|
163 | else
|
---|
164 | ep=1.0d0
|
---|
165 | end if
|
---|
166 |
|
---|
167 | eyel=eyel+cqi*cgat(j)/(rij*ep)
|
---|
168 | ! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
|
---|
169 | if (ihbty(ity,jty).eq.0) then
|
---|
170 | eyvw=eyvw+a14(ity,jty)/(rij6*rij6)
|
---|
171 | & -cij(ity,jty)/rij6
|
---|
172 | else
|
---|
173 | ! Use 10-12 Lennard-Jones potential for hydrogen bonds.
|
---|
174 | eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
|
---|
175 | & -chb(ity,jty)/(rij6*rij4)
|
---|
176 | endif
|
---|
177 |
|
---|
178 | enddo ! ... 1-4-partners of i
|
---|
179 |
|
---|
180 | enddo ! ... atoms i
|
---|
181 | enddo ! ... m.s.
|
---|
182 |
|
---|
183 | enddo ! ... variables
|
---|
184 |
|
---|
185 | eysm = eyel + eyvw + eyhb + eyvr
|
---|
186 |
|
---|
187 | enyshe=eysm
|
---|
188 | return
|
---|
189 | end
|
---|
190 |
|
---|