[SciPy-User] FortranFile and large records

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Fri Jan 20 07:29:38 EST 2012


On 01/20/2012 11:25 AM, Sturla Molden wrote:
> Den 19.01.2012 17:16, skrev Vincent Favre-Nicolin:
>>           Hi,
>>
>>       This week I had to import large data from a Fortran 'record' file.
>> For this I naturally used FortranFile
>> (http://www.scipy.org/Cookbook/FortranIO/FortranFile).
>>
>
>
> Why? The FortranFile cookbook receipe is based on fundamentally wrong
> assumptions. If it works it is by pure accident. I suggest it is removed
> from the wiki.
>
> Fortran does not specify a binary layout for record files. It is
> implementation dependent.  Consequently, a Fortran record file should be
> read by a Fortran program -- compiled with the same Fortran
> implementation that was used by the program that wrote the file.

It would be good with a Python package that took care of this by 
interfacing with compiled Fortran code though (generating and compiling 
it on the fly if necesarry). I do remember reading about something like 
that here, but I don't have time to look it up myself.

Dag Sverre



More information about the SciPy-User mailing list