PROGRAM READTEST
  
  IMPLICIT NONE
  INTEGER(8),PARAMETER :: NX=2,NY=3,NZ=4
  INTEGER(8) :: I,J,K
  REAL(8) :: A(0:NX-1,0:NY-1,0:NZ-1)
  INTEGER(8) :: B(0:NX-1,0:NY-1,0:NZ-1)

  OPEN(1,FILE='data.dat',FORM='UNFORMATTED',ACCESS='STREAM',ACTION='READ')
  READ(1) A
  READ(1) B  
  CLOSE(1)

  DO I=0,NX-1
     DO J=0,NY-1
        PRINT*, A(I,J,:)
     END DO
  END DO

  DO I=0,NX-1
     DO J=0,NY-1
        PRINT*, B(I,J,:)
     END DO
  END DO

END PROGRAM READTEST
