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