      function stmean(n,x) ! bernd berg, feb 12 1990.
c calculation of the mean value for n data in x(n).
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension x(n)
      xm=zero
      do i=1,n
        xm=xm+x(i)
      end do
      stmean=xm/n
      return
      end
