      subroutine normalize(a)

      implicit none

      real,dimension(3)::a
      real::norm

      norm=sqrt(a(1)**2+a(2)**2+a(3)**2)

      if(norm.ne.0)then
       a=a/norm
      endif

      end subroutine normalize


