Reading Fortran Data
Beliavsky
beliavsky at aol.com
Sun Jan 21 22:26:17 EST 2007
Carl Banks wrote:
<snip>
> > A Fortran
> > list-directed write can print results in an almost arbitrary format,
> > depending on the compiler. Many compilers will separate integers by
> > several spaces, not just one, and they could use commas instead of
> > spaces if they wanted.
>
> 1. Hardly any compiler will produce a line of two integers, or reals,
> that another compiler couldn't read back.
Yes, but for more than three numbers, the statement is wrong. Intel
Fortran prints four double precision random n
as
0.555891433847495 0.591161642339424 0.888434673900224
0.487293557925127
but g95 prints them on a single line. I advise against using
list-directed Fortran writes to create files that other programs will
read, and I think most experienced Fortran programmers would agree.
More information about the Python-list
mailing list