Reading binary files

Hi!

I try to read some binary data, but I failed.
The binary file “dump.bin” first contains two 4-BYTE integers NX and
NY and then a grid of NXNY REAL4 samples.
In my case NX=69 (=45 HEX) and NY=81 (=51 HEX).
When I put the binary file in my HEX-editor, I get a first line of:

45 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00

Recognize the NX and NY values in HEX!
The file contains rain data, and often it doesn’t rain.
Indeed the first few samples after NX and NY are zero.

Then I tried to make an ASCII dump of dump.bin by running the
executable made with pgf90 from:

PROGRAM ReadBinFile
INTEGER(4) :: i,NX,NY,NxNy
REAL(4) :: Dum
OPEN(13,FILE=‘dump.bin’,FORM=‘UNFORMATTED’)
READ(13) NX
READ(13) NY
WRITE(,) Nx,’ ',Ny
NxNy = NXNY
DO i=1,NXNY
READ(13) Dum
WRITE(
,*) Dum
ENDDO
CLOSE(13)
END

All I got was a message:

PGFIO-F-201/OPEN/unit=13/illegal value for specifier.
File name = dump.bin
In source file readbinny.f90, at line number 4

At home, where I don’t have a pc with Portland F90 license, I had a similar problem under g95. There it was solved by adding ACCESS=‘STREAM’ in the open statement.

How to proceed from here with pgf90?

Thanks!

Arjan

What happens if you use
FORM=‘BINARY’

If failure persists, send your program and a version of the file you
are trying to read to trs@pgroup.com

dave