	program readFile

!
! fortran 77
! This read in a binary file with lists of records (double, 
! double, integer*4, integer*4, double)
!
!
	 double precision Lx, Ly, gama, Rx, Ry, radius, temp
	 integer Nlx, Nly, fid, row, col, i, j, nRec

      fid = 10

	  open (fid, FILE="P0.700000id1.d1", FORM="UNFORMATTED", ACCESS="DIRECT", STATUS="OLD", RECL=8)

! read the title line in
      do i=1,4
       read (UNIT=fid, REC=i) temp
      end do

! read in the records,      
      j=4 
      nRec=0
      do i=1,10000
       j=j+1
       read (UNIT=fid, REC=j, ERR=20) Rx

       j=j+1
       read (UNIT=fid, REC=j, ERR=20) Ry

       j=j+1
       read (UNIT=fid, REC=j, ERR=20) radius 

       j=j+1
       read (UNIT=fid, REC=j, ERR=20) temp
 
       j=j+1
       read (UNIT=fid, REC=j, ERR=20) temp
 
       nRec=nRec+1

       print *, Rx, Ry, radius 
       
      END do

20    print *, "ERR of file, Number of records found: ", nRec
	end program readFile
