      subroutine bound(n,x,y,z,x1,x2,y1,y2,z1,z2)

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 x(*),y(*),z(*)

      data hugepos,hugeneg/+1.0d+35,-1.0d+35/

      x1=hugepos
      x2=hugeneg
      y1=hugepos
      y2=hugeneg
      z1=hugepos
      z2=hugeneg

      do 1001 i=1,n
      if(x(i).lt.x1) x1=x(i)
      if(x(i).gt.x2) x2=x(i)
      if(y(i).lt.y1) y1=y(i)
      if(y(i).gt.y2) y2=y(i)
      if(z(i).lt.z1) z1=z(i)
 1001 if(z(i).gt.z2) z2=z(i)

      return
      end
