      real*8 function dmaxvec(a,n)

c  this subroutine written by alain st-amant of the
c  department of chemistry, university of ottawa, ottawa, canada.
c  all rights reserved.  this is part of the DeFT project.

      implicit real*8(a-h,o-z)

      dimension a(*)

      data zero/0.0d0/

      dmaxvec=zero

      do 1001 i=1,n
 1001 if(abs(a(i)).gt.dmaxvec) dmaxvec=abs(a(i))

      return
      end
