Changeset bd2278d for enyshe_p.f
- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
enyshe_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enyshe4 c 5 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,6 cShura Hayryan, Chin-Ku7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty9 c 10 c**************************************************************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 11 12 12 13 13 real*8 function enyshe(nml) 14 14 15 c............................................................................16 c17 cPURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters18 c19 cCALLS: none20 c21 cThe function loops over all moving sets within the molecule. Within22 cthis loop it loops over the van-der-Waals domains of each atom in the23 cmoving set and finally over the atoms that belong to the 1-4 interaction24 cset.25 c............................................................................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 26 27 27 include 'INCL.H' … … 30 30 31 31 32 cIf nml == 0 calculate the interaction between all pairs.32 ! If nml == 0 calculate the interaction between all pairs. 33 33 if (nml.eq.0) then 34 34 ntlvr = nvr … … 39 39 if (ntlvr.eq.0) then 40 40 write (*,'(a,i4)') 41 #' enyshe> No variables defined in molecule #',nml41 & ' enyshe> No variables defined in molecule #',nml 42 42 return 43 43 endif … … 57 57 i1s = imsml1(ntlml) + nmsml(ntlml) 58 58 else 59 cIndex of first variable in molecule.59 ! Index of first variable in molecule. 60 60 ifivr=ivrml1(nml) 61 cIndex of last moving set in molecule61 ! Index of last moving set in molecule 62 62 i1s=imsml1(nml)+nmsml(nml) 63 63 endif 64 cLoop over variables in reverse order65 cThis is the first loop to parallize. We'll just split the moving sets66 cover the number of available processors and sum the energy up in the end.67 68 cNumber of moving sets per processor64 ! Loop over variables in reverse order 65 ! This is the first loop to parallize. We'll just split the moving sets 66 ! over the number of available processors and sum the energy up in the end. 67 68 ! Number of moving sets per processor 69 69 iend = ifivr 70 70 istart = ifivr + ntlvr - 1 … … 72 72 startwtime = MPI_Wtime() 73 73 loopcounter = 0 74 cdo io=ifivr+ntlvr-1,ifivr,-174 ! do io=ifivr+ntlvr-1,ifivr,-1 75 75 do io = workPerProcessor(nml, myrank) - 1, 76 76 & workPerProcessor(nml, myrank+1), -1 … … 78 78 i1s = imsvr1(iorvr(io + 1)) 79 79 endif 80 cThe array iorvr contains the variables in an "apropriate" order.80 ! The array iorvr contains the variables in an "apropriate" order. 81 81 iv=iorvr(io) 82 cIndex of the primary moving atom for the variable with index iv82 ! Index of the primary moving atom for the variable with index iv 83 83 ia=iatvr(iv) 84 cGet the type of variable iv (valence length, valence angle, dihedral angle)84 ! Get the type of variable iv (valence length, valence angle, dihedral angle) 85 85 it=ityvr(iv) 86 cClass of variable iv's potential (Q: What are they)86 ! Class of variable iv's potential (Q: What are they) 87 87 ic=iclvr(iv) 88 cIf iv is a dihedral angle ...88 ! If iv is a dihedral angle ... 89 89 if (it.eq.3) then 90 cBarrier height * 1/2 of the potential of iv.90 ! Barrier height * 1/2 of the potential of iv. 91 91 e0=e0to(ic) 92 cCalculate the periodic potential term. sgto is the sign of the barrier, rnto is93 cthe periodicity and toat is torsion angle(?) associate with atom ia.92 ! Calculate the periodic potential term. sgto is the sign of the barrier, rnto is 93 ! the periodicity and toat is torsion angle(?) associate with atom ia. 94 94 if (e0.ne.0.) 95 #teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))96 celse if iv is a valence angle ...95 & teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic))) 96 ! else if iv is a valence angle ... 97 97 elseif (it.eq.2) then 98 cvr is the valence angle of ia98 ! vr is the valence angle of ia 99 99 vr=baat(ia) 100 celse if iv is a valence length...100 ! else if iv is a valence length... 101 101 elseif (it.eq.1) then 102 cvr is the length of the valence bond102 ! vr is the length of the valence bond 103 103 vr=blat(ia) 104 104 endif 105 105 106 c============================================ Energies & Atomic forces107 cindex of next to last moving set106 ! ============================================ Energies & Atomic forces 107 ! index of next to last moving set 108 108 i2s=i1s-1 109 cindex of first moving set associated with iv109 ! index of first moving set associated with iv 110 110 i1s=imsvr1(iv) 111 cLoop over all moving sets starting from the one associated with vr to the end.111 ! Loop over all moving sets starting from the one associated with vr to the end. 112 112 do ims=i1s,i2s 113 cFirst atom of the current moving set113 ! First atom of the current moving set 114 114 i1=latms1(ims) 115 cLast atom of the current moving set115 ! Last atom of the current moving set 116 116 i2=latms2(ims) 117 cLoop over all atoms of the current moving set.117 ! Loop over all atoms of the current moving set. 118 118 do i=i1,i2 119 cAtom class of current atom119 ! Atom class of current atom 120 120 ity=ityat(i) 121 cPoint charge at current atom121 ! Point charge at current atom 122 122 cqi=conv*cgat(i) 123 cCartesian coordinates of current atom123 ! Cartesian coordinates of current atom 124 124 xi=xat(i) 125 125 yi=yat(i) 126 126 zi=zat(i) 127 cLoop over the atoms of the van der Waals domain belonging to atom i127 ! Loop over the atoms of the van der Waals domain belonging to atom i 128 128 do ivw=ivwat1(i),ivwat2(i) 129 cLoop over the atoms of the van der Waals domain of the atoms of the130 cvan der Waals domain of atom i131 cQ: Which atoms are in these domains?129 ! Loop over the atoms of the van der Waals domain of the atoms of the 130 ! van der Waals domain of atom i 131 ! Q: Which atoms are in these domains? 132 132 do j=lvwat1(ivw),lvwat2(ivw) 133 133 134 134 loopcounter = loopcounter + 1 135 cAtom type of partner135 ! Atom type of partner 136 136 jty=ityat(j) 137 cDifferences in cartesian coordinates137 ! Differences in cartesian coordinates 138 138 xij=xat(j)-xi 139 139 yij=yat(j)-yi 140 140 zij=zat(j)-zi 141 cCartesian distance and higher powers141 ! Cartesian distance and higher powers 142 142 rij2=xij*xij+yij*yij+zij*zij 143 143 rij4=rij2*rij2 144 144 rij6=rij4*rij2 145 145 rij=sqrt(rij2) 146 cAre we using a distance dependent dielectric constant?146 ! Are we using a distance dependent dielectric constant? 147 147 if(epsd) then 148 148 sr=slp*rij … … 151 151 ep = 1.0d0 152 152 end if 153 cCoulomb interaction153 ! Coulomb interaction 154 154 teyel=teyel+cqi*cgat(j)/(rij*ep) 155 cIf the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential155 ! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential 156 156 if (ihbty(ity,jty).eq.0) then 157 157 teyvw=teyvw+aij(ity,jty)/(rij6*rij6) 158 #-cij(ity,jty)/rij6158 & -cij(ity,jty)/rij6 159 159 else 160 cFor hydrogen bonding use 10-12 Lennard-Jones potential160 ! For hydrogen bonding use 10-12 Lennard-Jones potential 161 161 teyhb=teyhb+ahb(ity,jty)/(rij6*rij6) 162 #-chb(ity,jty)/(rij6*rij4)162 & -chb(ity,jty)/(rij6*rij4) 163 163 endif 164 164 … … 166 166 enddo 167 167 168 cLoop over 1-4 interaction partners169 cThe interactions between atoms that are three bonds apart in the protein are170 cdominated by quantum mechanical effects. They are treated separately.168 ! Loop over 1-4 interaction partners 169 ! The interactions between atoms that are three bonds apart in the protein are 170 ! dominated by quantum mechanical effects. They are treated separately. 171 171 do i14=i14at1(i),i14at2(i) 172 172 loopcounter = loopcounter + 1 … … 182 182 rij6=rij4*rij2 183 183 rij = sqrt(rij2) 184 cAre we using a distance dependent dielectric constant?184 ! Are we using a distance dependent dielectric constant? 185 185 if(epsd) then 186 186 sr=slp*rij … … 191 191 192 192 teyel=teyel+cqi*cgat(j)/(rij*ep) 193 cIf hydrogen bonding is not possible use 6-12 Lennard-Jones potential.193 ! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential. 194 194 if (ihbty(ity,jty).eq.0) then 195 195 teyvw=teyvw+a14(ity,jty)/(rij6*rij6) 196 #-cij(ity,jty)/rij6196 & -cij(ity,jty)/rij6 197 197 else 198 cUse 10-12 Lennard-Jones potential for hydrogen bonds.198 ! Use 10-12 Lennard-Jones potential for hydrogen bonds. 199 199 teyhb=teyhb+ahb(ity,jty)/(rij6*rij6) 200 #-chb(ity,jty)/(rij6*rij4)200 & -chb(ity,jty)/(rij6*rij4) 201 201 endif 202 202 enddo ! ... 1-4-partners of i … … 209 209 endwtime = MPI_Wtime() 210 210 211 cCollect energies from all nodes and sum them up211 ! Collect energies from all nodes and sum them up 212 212 call MPI_ALLREDUCE(teysm, eysmsum, 1, MPI_DOUBLE_PRECISION, 213 213 & MPI_SUM, my_mpi_comm, ierror)
Note:
See TracChangeset
for help on using the changeset viewer.