      program snbref
      character file*80
      write (6,6100)
 6100 format ('0Enter input file name.')
      read (5,5000) file
 5000 format (a)
      open (unit=1,file=file,status='old',form='unformatted')
      write (6,6200)
 6200 format ('0Enter output file name.')
      read (5,5000) file
      open (unit=2,file=file,status='new',form='formatted')
      write (6,6300)
 6300 format ('0Enter E/sigma(E) cutoff.  (Default:  cutoff = 3)')
      read (5,*) cutoff
      if (cutoff.eq.0) cutoff=3
      m=0
      n=0
 10   read (1,end=20) j,k,l,fsq,sigfsq,f,sigf,e,sige
      m=m+1
      if (e.lt.cutoff*sige) go to 10
      write (2,6000) j,k,l,e,f,sigf
 6000 format (3i5,f7.3,f9.2,f8.2,f6.3)
      n=n+1
      if (n.le.100) write (6,6000) j,k,l,e,f,sigf
      go to 10
 20   continue
      write (6,6001) m,n
 6001 format ('0m = ',i6/' n = ',i6)
      stop 'Finis!'
      end

