Topic: Opening binary file

Dear friends,

I tried to open binary file with

open(unit=9,file='data/Grid_3D.dat',form='binary')

and got an Error message

"Form specifier in OPEN statement has invalid value 'binary'".

Why?

Re: Opening binary file

Like the error says, 'binary' is not a valid value for FORM.  Some compilers may have implemented this in the past, but it definitely isn't standards-compliant.

If you have a Fortran binary file, you can instead use:

open(unit=9,file='data/Grid_3D.dat',form='formatted')

and just read/write as you need.

More information might be helpful, though.  Are you attempting to read or write the file?  Do you happen to know what the file should contain?

Jeff Armstrong
Approximatrix, LLC