      subroutine steb0(n,x,xm,xv,xe) ! bernd berg, feb 12 1990.	
c  input:   array x(n) with (gaussian) data.
c  output:  mean value xm, unbiased variance xv and error bar xe.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension x(n)
      if(n.lt.2) stop 'steb0: n has to be .ge. 2!'
c mean value:
      xm=zero
      do i=1,n
        xm=xm+x(i)
      end do
      xm=xm/n
c estimator for the variance:
      xv=zero
      do i=1,n
        xv=xv+(x(i)-xm)**2
      end do
      xv=xv/(n-1)
c error bar:
      xe=sqrt(xv/(n*one))
      return
      end
