Reading Fortran Data

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

Carl Banks wrote:


> >   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


More information about the Python-list mailing list