source: enyshe.f@ 6012d3f

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

Reformatting comments and continuation marks.

Fortran 90 and higher use ! to mark comments no matter where they are in the
code. The only valid continuation marker is &.
I also added the SMMP.kdevelop.filelist to the repository to make it easier
to use kdevelop.

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

  • Property mode set to 100644
File size: 6.2 KB
RevLine 
[bd2278d]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! **************************************************************
[e40e335]11
12
13 real*8 function enyshe(nml)
14
[bd2278d]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! ............................................................................
[e40e335]26
27 include 'INCL.H'
28
[bd2278d]29! If nml == 0 calculate the interaction between all pairs.
[e40e335]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)')
[bd2278d]38 & ' enyshe> No variables defined in molecule #',nml
[e40e335]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
[bd2278d]51! Index of first variable in molecule.
[e40e335]52 ifivr=ivrml1(nml)
[bd2278d]53! Index of last moving set in molecule
[e40e335]54 i1s=imsml1(nml)+nmsml(nml)
55 endif
[bd2278d]56! Loop over moving sets/variables in reverse order
[e40e335]57 do io=ifivr+ntlvr-1,ifivr,-1
[bd2278d]58! The array iorvr contains the variables in an "apropriate" order.
[e40e335]59 iv=iorvr(io)
[bd2278d]60! Index of the primary moving atom for the variable with index iv
[e40e335]61 ia=iatvr(iv)
[bd2278d]62! Get the type of variable iv (valence length, valence angle, dihedral angle)
[e40e335]63 it=ityvr(iv)
[bd2278d]64! Class of variable iv's potential (Q: What are they)
[e40e335]65 ic=iclvr(iv)
[bd2278d]66! If iv is a dihedral angle ...
[e40e335]67 if (it.eq.3) then
[bd2278d]68! Barrier height * 1/2 of the potential of iv.
[e40e335]69 e0=e0to(ic)
[bd2278d]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.
[e40e335]72 if (e0.ne.0.)
[bd2278d]73 & eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
74! else if iv is a valence angle ...
[e40e335]75 elseif (it.eq.2) then
[bd2278d]76! vr is the valence angle of ia
[e40e335]77 vr=baat(ia)
[bd2278d]78! else if iv is a valence length...
[e40e335]79 elseif (it.eq.1) then
[bd2278d]80! vr is the length of the valence bond
[e40e335]81 vr=blat(ia)
82 endif
83
[bd2278d]84! ============================================ Energies & Atomic forces
85! index of next to last moving set
[e40e335]86 i2s=i1s-1
[bd2278d]87! index of first moving set associated with iv
[e40e335]88 i1s=imsvr1(iv)
[bd2278d]89! Loop over all moving sets starting from the one associated with vr to the end.
[e40e335]90 do ims=i1s,i2s
[bd2278d]91! First atom of the current moving set
[e40e335]92 i1=latms1(ims)
[bd2278d]93! Last atom of the current moving set
[e40e335]94 i2=latms2(ims)
[bd2278d]95! Loop over all atoms of the current moving set.
[e40e335]96 do i=i1,i2
[bd2278d]97! Atom class of current atom
[e40e335]98 ity=ityat(i)
[bd2278d]99! Point charge at current atom
[e40e335]100 cqi=conv*cgat(i)
[bd2278d]101! Cartesian coordinates of current atom
[e40e335]102 xi=xat(i)
103 yi=yat(i)
104 zi=zat(i)
[bd2278d]105! Loop over the atoms of the van der Waals domain belonging to atom i
[e40e335]106 do ivw=ivwat1(i),ivwat2(i)
[bd2278d]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?
[e40e335]110 do j=lvwat1(ivw),lvwat2(ivw)
[bd2278d]111! Atom type of partner
[e40e335]112 jty=ityat(j)
[bd2278d]113! Differences in cartesian coordinates
[e40e335]114 xij=xat(j)-xi
115 yij=yat(j)-yi
116 zij=zat(j)-zi
[bd2278d]117! Cartesian distance and higher powers
[e40e335]118 rij2=xij*xij+yij*yij+zij*zij
119 rij4=rij2*rij2
120 rij6=rij4*rij2
121 rij=sqrt(rij2)
[bd2278d]122! Are we using a distance dependent dielectric constant?
[e40e335]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
[bd2278d]129! Coulomb interaction
[e40e335]130 eyel=eyel+cqi*cgat(j)/(rij*ep)
[bd2278d]131! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
[e40e335]132 if (ihbty(ity,jty).eq.0) then
133 eyvw=eyvw+aij(ity,jty)/(rij6*rij6)
[bd2278d]134 & -cij(ity,jty)/rij6
[e40e335]135 else
[bd2278d]136! For hydrogen bonding use 10-12 Lennard-Jones potential
[e40e335]137 eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
[bd2278d]138 & -chb(ity,jty)/(rij6*rij4)
[e40e335]139 endif
140
141 enddo
142 enddo
143
[bd2278d]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.
[e40e335]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)
[bd2278d]159! Are we using a distance dependent dielectric constant?
[e40e335]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)
[bd2278d]168! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
[e40e335]169 if (ihbty(ity,jty).eq.0) then
170 eyvw=eyvw+a14(ity,jty)/(rij6*rij6)
[bd2278d]171 & -cij(ity,jty)/rij6
[e40e335]172 else
[bd2278d]173! Use 10-12 Lennard-Jones potential for hydrogen bonds.
[e40e335]174 eyhb=eyhb+ahb(ity,jty)/(rij6*rij6)
[bd2278d]175 & -chb(ity,jty)/(rij6*rij4)
[e40e335]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.