      subroutine ftest(eb1,ndat1,eb2,ndat2,q) ! bernd berg, feb 6 2000.
c variance ratio test (f-test): comparision of two variances.
      include '../../libs/fortran/implicit.sta' 
      include '../../libs/fortran/constants.par'
      common /parft/ nf1,nf2
c degrees of freedom:
      nf1=ndat1-1
      nf2=ndat2-1
c f-ratio:
      va1=eb1**2*ndat1
      va2=eb2**2*ndat2
      f=va1/va2  !  definitions take per degree of freedom already into account!
      q=two*f_df(f)
      if(q.gt.one) q=two-q
      return
      end
