Reading Fortran Data

Beliavsky beliavsky at aol.com
Mon Jan 22 02:36:49 CET 2007


Carl Banks wrote:

<snip>

> >   WRITE(90,*) nfault,npoint
>
> Fortran writes this as two arbitrary integers separated by a space.

I wrote a paragraph in my reply explaining why this is wrong. 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. The number of items printed before a new line is
started is also compiler-dependent. For more control, one uses a
formatted write, for example

write (90,"(2(1x,i0))") nfault,npoint

<snip>




More information about the Python-list mailing list