Jaehoon Seol writes:
> > ! write ( unit=10,fmt=* ) myarray. <=========== 1
> > write (unit=10, fmt="(f10.0,2f20.5,e15.3)") myarray <===== 2
>
> If the size of myarray is 10, statement (1) will print all the entries in
> a single line.
Not true. The compiler is allowed a lot of freedom in line splitting
with list-directed output. Some compilers might write it all on one
line, but this certainly isn't required.
> Byt (2) will print in 3 different lines. What I want to
> know is if there is any SIMPLE way to print all the entries in a single
> line in f10.2 format, for instance.
Yes. The simplest is
write (10, "(10f10.2)") myarray
If you want it to work with larger arrays, then make the repeat count
larger than any realistic array. Perhaps something like
write (10, "(99f10.2)") myarray
Presumably, you are unlikely to need to write more than 99 values on
a single line. (That would make for a bit of a longish line).
Some compilers may run into limits if you try to put unreasonably
much on a single line, but 10 fields of 10 characters each doesn't
sound like much of a problem.
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|