*******************************************************************************
      subroutine zdistobsv(z,zdist)
      include 'pimc_sqr3sc.dcl'
      real z(2*m,nat),zdist(nhistz)

      zmin=0.0
      zmax=zdim
      dz=(zmax-zmin)/float(nhistz)
      do i=1,m
         do j=1,nat
           do ihist=1,nhistz
              zlow=zmin+float(ihist-1)*dz
              zup=zmin+float(ihist)*dz
              if(z(i,j).gt.zlow.and.z(i,j).le.zup) then
                 zdist(ihist)=zdist(ihist)+1.
                 goto 10
              end if                 
           end do
 10        continue
         end do
      end do
      end
         
