source: enyshe.f@ e40e335

Last change on this file since e40e335 was e40e335, checked in by baerbaer <baerbaer@…>, 16 years ago

Initial import to BerliOS corresponding to 3.0.4

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@1 26dc1dd8-5c4e-0410-9ffe-d298b4865968

  • Property mode set to 100644
File size: 6.2 KB
Line 
1c **************************************************************
2c
3c This file contains the subroutines: enyshe
4c
5c Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,
6c Shura Hayryan, Chin-Ku
7c Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
8c Jan H. Meinke, Sandipan Mohanty
9c
10c **************************************************************
11
12
13 real*8 function enyshe(nml)
14
15c ............................................................................
16c
17c PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
18c
19c CALLS: none
20c
21c The function loops over all moving sets within the molecule. Within
22c this loop it loops over the van-der-Waals domains of each atom in the
23c moving set and finally over the atoms that belong to the 1-4 interaction
24c set.
25c ............................................................................
26
27 include 'INCL.H'
28
29c 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
51c Index of first variable in molecule.
52 ifivr=ivrml1(nml)
53c Index of last moving set in molecule
54 i1s=imsml1(nml)+nmsml(nml)
55 endif
56c Loop over moving sets/variables in reverse order
57 do io=ifivr+ntlvr-1,ifivr,-1
58c The array iorvr contains the variables in an "apropriate" order.
59 iv=iorvr(io)
60c Index of the primary moving atom for the variable with index iv
61 ia=iatvr(iv)
62c Get the type of variable iv (valence length, valence angle, dihedral angle)
63 it=ityvr(iv)
64c Class of variable iv's potential (Q: What are they)
65 ic=iclvr(iv)
66c If iv is a dihedral angle ...
67 if (it.eq.3) then
68c Barrier height * 1/2 of the potential of iv.
69 e0=e0to(ic)
70c Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
71c 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)))
74c else if iv is a valence angle ...
75 elseif (it.eq.2) then
76c vr is the valence angle of ia
77 vr=baat(ia)
78c else if iv is a valence length...
79 elseif (it.eq.1) then
80c vr is the length of the valence bond
81 vr=blat(ia)
82 endif
83
84c ============================================ Energies & Atomic forces
85c index of next to last moving set
86 i2s=i1s-1
87c index of first moving set associated with iv
88 i1s=imsvr1(iv)
89c Loop over all moving sets starting from the one associated with vr to the end.
90 do ims=i1s,i2s
91c First atom of the current moving set
92 i1=latms1(ims)
93c Last atom of the current moving set
94 i2=latms2(ims)
95c Loop over all atoms of the current moving set.
96 do i=i1,i2
97c Atom class of current atom
98 ity=ityat(i)
99c Point charge at current atom
100 cqi=conv*cgat(i)
101c Cartesian coordinates of current atom
102 xi=xat(i)
103 yi=yat(i)
104 zi=zat(i)
105c Loop over the atoms of the van der Waals domain belonging to atom i
106 do ivw=ivwat1(i),ivwat2(i)
107c Loop over the atoms of the van der Waals domain of the atoms of the
108c van der Waals domain of atom i
109c Q: Which atoms are in these domains?
110 do j=lvwat1(ivw),lvwat2(ivw)
111c Atom type of partner
112 jty=ityat(j)
113c Differences in cartesian coordinates
114 xij=xat(j)-xi
115 yij=yat(j)-yi
116 zij=zat(j)-zi
117c 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)
122c 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
129c Coulomb interaction
130 eyel=eyel+cqi*cgat(j)/(rij*ep)
131c 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
136c 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
144c Loop over 1-4 interaction partners
145c The interactions between atoms that are three bonds apart in the protein are
146c 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)
159c 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)
168c 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
173c 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
Note: See TracBrowser for help on using the repository browser.