      function vec_norm(nd,v) ! bb june 17 2008.
c calculates euclidean square root norm of vector v in nd dimension.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension v(nd)
      vec_norm=zero
      do id=1,nd
        vec_norm=vec_norm+v(id)**2
      enddo
      vec_norm=sqrt(vec_norm)
      return
      end

