      SUBROUTINE READ_STEB0(nrpt,iud,n0,nlink,ha,ham,hae,act)
C Copyright, Bernd Berg, FSU Physics, Dec 13, 2000.
C Reads nrpt times the array ha() from unit iud and calculates the
C       histogram mean values ham() and their error bars hae().
C Further, the nrpt action variable averages are calculated.
      include 'implicit.sta'
      include 'constants.par'
      dimension ha(n0:nlink),ham(n0:nlink),hae(n0:nlink),act(nrpt)
C
      call razero(ham,0,nlink)
      do irpt=1,nrpt
        read(iud) ha
        act(irpt)=potts_actm(nlink,ha)
        do ilink=0,nlink
          ham(ilink)=ham(ilink)+ha(ilink)
        end do
      end do
      do ilink=0,nlink
        ham(ilink)=ham(ilink)/nrpt
      end do
C
      do irpt=1,nrpt
        backspace iud
      end do
C
      call razero(hae,0,nlink)
      do irpt=1,nrpt
        read(iud) ha
        do ilink=0,nlink
          hae(ilink)=hae(ilink)+(ha(ilink)-ham(ilink))**2
        end do
      end do
      do ilink=0,nlink
        hae(ilink)=sqrt(hae(ilink)/(nrpt*(nrpt-1)))
      end do
C
      return
      end
