      program test
	integer ierr
	real dd(100),ee(100)
	character outfl*32,title*32,cdate*32,vname*32

	outfl='test.out'
      
      open(1,file=outfl,form='UNFORMATTED',err=99)
	
	do k=1,10
      do i=1,10
	do j=1,10
            n=(k-1)*100+(i-1)*10+j
	      dd(n)=k
c	      write(*,*) n,dd(n)
	end do
	end do
	end do
      do i=1,1000
            write(1) dd(i)
	end do
      title='testing this stuff'
      write(1) title
c	cdate='today'
c	vname='grade'
c            call bmwrite(1,title,cdate,vname,1,1,10,10,1,
c     +             dd,1,100,1,1,ierr)
      close(1)
	write(*,*) 'Closed'
      write(*,*) 'Opening and writing out first 10 numbers'
 
      open(1,file=outfl,form='UNFORMATTED',err=99)

c      call bmopen(1,outfl,ierr)
c      call bmread (1,title,cdate,vname,1,1,10,1,1,
c     +             ee,1,10,1,1,ierr)
      do i=1,1000
            read(1) ee(i)
	end do
      do i=1,100
	      write(*,*) ee(i)
	end do
	read(1) cdate
	write(*,*) cdate
	close(1)
99    write(*,*) 'error'
	end



