Changeset 4fd4338


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

Files:
2 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)
  • init_molecule.f

    rc076b43 r4fd4338  
    105105 2       write(*,*) ' '
    106106         
     107! If Lund force field is in use, keep omega angles fixed
     108      if (ientyp.eq.2) then
     109         do iv=1,nvrml(ntlml)
     110            if (nmvr(iv).eq.'omg') then
     111                print *, 'Fixed variable ',iv,nmvr(iv),vlvr(iv)
     112                fxvr(iv)=.true.
     113            endif
     114         enddo
     115      endif
     116
    107117!     -------------------- get: nvr,idvr, vlvr, olvlvr
    108118         nvr = 0
Note: See TracChangeset for help on using the changeset viewer.