Output formatting: too much whitespace in gfortran
Solution 1:
List-directed IO, i.e, write (*, *)
is meant as a convenience. There are no settings to change its behavior. Different compilers will produce different output. Instead you can, as you have identified, use formatted IO. In this case you can use I0
as the format, which will produce the required number of digits, while I1
will only output single-digit integers. Which is OK if those are the largest values that will be output.
WRITE(*, '( "integer i is ", I0, ", and j is ", I0, "." )' ) i, j
Solution 2:
You may try some more universal format and re-use it
fmt = "(*(1x,g0))"
write(*,fmt) whatever1, whatever2