[Numpy-discussion] example reading binary Fortran file
Fri Jan 30 16:53:06 CST 2009
ok for f2py!
> Otherwise, you will have to figure out how your Fortran program writes the
>file. I.e. what padding, metainformation, etc. that are used. If you
>switch Fortran compiler, or even compiler version from the same vendor,
>you must start over again.
In my experience, I never had this kind of problem. I just have to convert
files between big/little endian with uswap (http://linux.die.net/man/1/uswap),
but I never see, in my experience, a Fortran program writting data
differently given the compilator.
>For my own work, I just makes sure NEVER to do any I/O in Fortran! It is
>asking for trouble. I leave the I/O to Python or C, where it belongs. That
>way I know what data are written and what data are read.
Unfortunately., binary files are mandatory in the contex I work. I use a
scientific code written in Fortran to compute fluid dynamics. Typically the
simulation is run on supercalculator and generate giga and giga of datum, so
we must use the binary format, which recquire less memory for the stockage.
Then, I like to post-trait the datum using Python and Gnuplot.py.
That's why I'm looking for a performantant, easy and 'standard' way to read
binary Fortran files. (I think many people have the same need).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion