Changeset bd2278d for enyshe_p.f


Ignore:
Timestamp:
09/05/08 11:49:42 (16 years ago)
Author:
baerbaer <baerbaer@…>
Branches:
master
Children:
fafe4d6
Parents:
2ebb8b6
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • enyshe_p.f

    r2ebb8b6 rbd2278d  
    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 **************************************************************
     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! **************************************************************
    1111
    1212
    1313      real*8 function enyshe(nml)
    1414
    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     ............................................................................
     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!     ............................................................................
    2626
    2727      include 'INCL.H'
     
    3030
    3131
    32 c If nml == 0 calculate the interaction between all pairs.
     32! If nml == 0 calculate the interaction between all pairs.
    3333      if (nml.eq.0) then
    3434         ntlvr = nvr
     
    3939      if (ntlvr.eq.0) then
    4040         write (*,'(a,i4)')
    41      #        ' enyshe> No variables defined in molecule #',nml
     41     &        ' enyshe> No variables defined in molecule #',nml
    4242         return
    4343      endif
     
    5757         i1s = imsml1(ntlml) + nmsml(ntlml)
    5858      else
    59 c     Index of first variable in molecule.
     59!     Index of first variable in molecule.
    6060         ifivr=ivrml1(nml)
    61 c     Index of last moving set in molecule
     61!     Index of last moving set in molecule
    6262         i1s=imsml1(nml)+nmsml(nml)
    6363      endif
    64 c     Loop over variables in reverse order     
    65 c     This is the first loop to parallize. We'll just split the moving sets
    66 c     over the number of available processors and sum the energy up in the end.
    67 
    68 c     Number of moving sets per processor
     64!     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
    6969      iend = ifivr
    7070      istart = ifivr + ntlvr - 1
     
    7272      startwtime = MPI_Wtime()
    7373      loopcounter = 0
    74 c      do io=ifivr+ntlvr-1,ifivr,-1 
     74!      do io=ifivr+ntlvr-1,ifivr,-1 
    7575      do io = workPerProcessor(nml, myrank) - 1,
    7676     &        workPerProcessor(nml, myrank+1), -1
     
    7878            i1s = imsvr1(iorvr(io + 1))
    7979         endif
    80 c     The array iorvr contains the variables in an "apropriate" order.
     80!     The array iorvr contains the variables in an "apropriate" order.
    8181         iv=iorvr(io)       
    82 c     Index of the primary moving atom for the variable with index iv
     82!     Index of the primary moving atom for the variable with index iv
    8383         ia=iatvr(iv)       
    84 c     Get the type of variable iv (valence length, valence angle, dihedral angle)
     84!     Get the type of variable iv (valence length, valence angle, dihedral angle)
    8585         it=ityvr(iv)       
    86 c     Class of variable iv's potential  (Q: What are they)
     86!     Class of variable iv's potential  (Q: What are they)
    8787         ic=iclvr(iv)       
    88 c     If iv is a dihedral angle ...
     88!     If iv is a dihedral angle ...
    8989         if (it.eq.3) then     
    90 c     Barrier height * 1/2 of the potential of iv.
     90!     Barrier height * 1/2 of the potential of iv.
    9191            e0=e0to(ic)
    92 c     Calculate the periodic potential term. sgto is the sign of the barrier, rnto is
    93 c     the 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.
    9494            if (e0.ne.0.)
    95      #           teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))
    96 c     else 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 ...
    9797         elseif (it.eq.2) then 
    98 c     vr is the valence angle of ia
     98!     vr is the valence angle of ia
    9999            vr=baat(ia)
    100 c     else if iv is a valence length...
     100!     else if iv is a valence length...
    101101         elseif (it.eq.1) then 
    102 c     vr is the length of the valence bond
     102!     vr is the length of the valence bond
    103103            vr=blat(ia)
    104104         endif
    105105
    106 c     ============================================ Energies & Atomic forces
    107 c     index of next to last moving set
     106!     ============================================ Energies & Atomic forces
     107!     index of next to last moving set
    108108         i2s=i1s-1
    109 c     index of first moving set associated with iv
     109!     index of first moving set associated with iv
    110110         i1s=imsvr1(iv)
    111 c     Loop 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.
    112112         do ims=i1s,i2s 
    113 c     First atom of the current moving set
     113!     First atom of the current moving set
    114114            i1=latms1(ims)
    115 c     Last atom of the current moving set
     115!     Last atom of the current moving set
    116116            i2=latms2(ims)
    117 c     Loop over all atoms of the current moving set.
     117!     Loop over all atoms of the current moving set.
    118118            do i=i1,i2 
    119 c     Atom class of current atom
     119!     Atom class of current atom
    120120               ity=ityat(i)
    121 c     Point charge at current atom
     121!     Point charge at current atom
    122122               cqi=conv*cgat(i)
    123 c     Cartesian coordinates of current atom
     123!     Cartesian coordinates of current atom
    124124               xi=xat(i)
    125125               yi=yat(i)
    126126               zi=zat(i)
    127 c     Loop over the atoms of the van der Waals domain belonging to atom i
     127!     Loop over the atoms of the van der Waals domain belonging to atom i
    128128               do ivw=ivwat1(i),ivwat2(i) 
    129 c     Loop over the atoms of the van der Waals domain of the atoms of the
    130 c     van der Waals domain of atom i
    131 c     Q: 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?
    132132                  do j=lvwat1(ivw),lvwat2(ivw) 
    133133
    134134                     loopcounter = loopcounter + 1
    135 c     Atom type of partner
     135!     Atom type of partner
    136136                     jty=ityat(j)
    137 c     Differences in cartesian coordinates
     137!     Differences in cartesian coordinates
    138138                     xij=xat(j)-xi
    139139                     yij=yat(j)-yi
    140140                     zij=zat(j)-zi
    141 c     Cartesian distance and higher powers
     141!     Cartesian distance and higher powers
    142142                     rij2=xij*xij+yij*yij+zij*zij
    143143                     rij4=rij2*rij2
    144144                     rij6=rij4*rij2
    145145                     rij=sqrt(rij2)
    146 c     Are we using a distance dependent dielectric constant?
     146!     Are we using a distance dependent dielectric constant?
    147147                     if(epsd) then
    148148                        sr=slp*rij
     
    151151                        ep = 1.0d0
    152152                     end if
    153 c     Coulomb interaction
     153!     Coulomb interaction
    154154                     teyel=teyel+cqi*cgat(j)/(rij*ep)
    155 c     If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
     155!     If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential
    156156                     if (ihbty(ity,jty).eq.0) then
    157157                        teyvw=teyvw+aij(ity,jty)/(rij6*rij6)
    158      #                       -cij(ity,jty)/rij6
     158     &                       -cij(ity,jty)/rij6
    159159                     else
    160 c     For hydrogen bonding use 10-12 Lennard-Jones potential
     160!     For hydrogen bonding use 10-12 Lennard-Jones potential
    161161                        teyhb=teyhb+ahb(ity,jty)/(rij6*rij6)
    162      #                       -chb(ity,jty)/(rij6*rij4)
     162     &                       -chb(ity,jty)/(rij6*rij4)
    163163                     endif
    164164
     
    166166               enddo 
    167167               
    168 c     Loop over 1-4 interaction partners
    169 c     The interactions between atoms that are three bonds apart in the protein are
    170 c     dominated 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.
    171171               do i14=i14at1(i),i14at2(i)   
    172172                  loopcounter = loopcounter + 1
     
    182182                  rij6=rij4*rij2
    183183                  rij = sqrt(rij2)
    184 c     Are we using a distance dependent dielectric constant?
     184!     Are we using a distance dependent dielectric constant?
    185185                  if(epsd) then
    186186                     sr=slp*rij
     
    191191
    192192                  teyel=teyel+cqi*cgat(j)/(rij*ep)
    193 c     If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
     193!     If hydrogen bonding is not possible use 6-12 Lennard-Jones potential.
    194194                  if (ihbty(ity,jty).eq.0) then
    195195                     teyvw=teyvw+a14(ity,jty)/(rij6*rij6)
    196      #                    -cij(ity,jty)/rij6
     196     &                    -cij(ity,jty)/rij6
    197197                  else
    198 c     Use 10-12 Lennard-Jones potential for hydrogen bonds.
     198!     Use 10-12 Lennard-Jones potential for hydrogen bonds.
    199199                     teyhb=teyhb+ahb(ity,jty)/(rij6*rij6)
    200      #                    -chb(ity,jty)/(rij6*rij4)
     200     &                    -chb(ity,jty)/(rij6*rij4)
    201201                  endif
    202202               enddo            ! ... 1-4-partners of i
     
    209209      endwtime = MPI_Wtime()
    210210
    211 c     Collect energies from all nodes and sum them up
     211!     Collect energies from all nodes and sum them up
    212212      call MPI_ALLREDUCE(teysm, eysmsum, 1, MPI_DOUBLE_PRECISION, 
    213213     &     MPI_SUM, my_mpi_comm, ierror)
Note: See TracChangeset for help on using the changeset viewer.