Changeset 4fd4338 for enylun.f


Ignore:
Timestamp:
09/24/08 15:27:04 (16 years ago)
Author:
sandipan <sandipan@…>
Branches:
master
Children:
ba939c7
Parents:
c076b43
Message:

Array index overrun in if statements with "and" and "or" operators fixed

Also, when Lund force field is used, omega angles are declared as
fixed variables in init_molecule.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • enylun.f

    rc076b43 r4fd4338  
    347347         do iat1=iatrs1(irsml1(iml)),iatrs2(irsml2(iml))
    348348            do iat2=iat1+1,iatrs2(irsml2(iml))
    349                if ((iat2-iat1.le.mxconr).and.
    350      &                 matcon(iat2-iat1,iat1).eq.2) then
    351                   ilp=ilp+1
    352                   lcp1(ilp)=iat1
    353                   lcp2(ilp)=iat2
     349               if (iat2-iat1.le.mxconr) then
     350                  if (matcon(iat2-iat1,iat1).eq.2) then
     351                    ilp=ilp+1
     352                    lcp1(ilp)=iat1
     353                    lcp2(ilp)=iat2
     354                  endif
    354355               endif
    355356            enddo
     
    368369         enddo
    369370      enddo
    370 
    371371      print *,'finished initializing Lund force field'
    372372      end
     
    634634      dimension icell(mxat)
    635635      integer :: jx1, jy1, jz1
     636      logical doit
    636637
    637638      if (nml.eq.0) then
     
    883884
    884885               if (r2.le.exvcutg2) then
    885                   if (abs(iat2-iat1).gt.mxconr.or.
    886      &                 matcon(iat2-iat1,iat1).eq.1) then
     886                  doit=.false.
     887                  if (abs(iat2-iat1).gt.mxconr ) then
     888                    doit=.true.
     889                  else if (matcon(iat2-iat1,iat1).eq.1) then
     890                    doit=.true.
     891                  endif
     892                  if (doit) then
    887893                     iatt1=ityat(iat1)
    888894                     iatt2=ityat(iat2)
Note: See TracChangeset for help on using the changeset viewer.