      program binary
c
c     Learn and test some stuff related to storing information
c     in binary format.
c
      real*4 a,b,c,x(10),y(10),z(10)
      real*8 jd
      integer*4 l,m,n
      integer*2 i,j,k
      character*2 nam
c
      integer*2 ia(50)
c
      equivalence (ia( 1),  jd),
     $            (ia( 5),   i),
     $            (ia( 6),   l),
     $            (ia( 8),x(1)),
     $            (ia(28),y(1)),
     $            (ia(48),   a),
     $            (ia(50), nam)
c
c     a=3.1415
c     do i=1,10
c      x(i)=real(i-1)
c      y(i)=x(i)+10.0
c     enddo
c     jd=2447880.123456789d0
c     l=100000
c     nam='a'
c
      open(1,file='bin.dat',access="DIRECT",
     $       form="UNFORMATTED",recl=100)
c
      do i=1,10
       read(1,rec=i)ia
       write(6,*)jd,i,l,a
       write(6,'(1x,a2)')nam
       write(6,'(10(1x,f5.2))')x
       write(6,'(10(1x,f5.2))')y
      enddo
c
      close(1)
      end

