Write statements without format

Write statements without format

I have some Fortran 90 using statements like

WRITE (6,*) string1

WRITE (6,*) string1, string2

On output, if string1 is reasonably long it is written over multiple lines. string1 and string2 would always be output on different lines.

With other compilers (e.g. Lahey Linux) I don't get this behaviour. string1 would always be fully output on one line. string1 and string2 would be output on the same line. I can reproduce this behaviour with the intel compiler by using formats in the write statements. Is there an intel compiler flag that can be used to the same effect, without having to insert formats into all my writes (this would mean a LOT of code changes!)?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Read about the environment variable FORT_FMT_RECL in the documentation. Alternatively, specify a RECL= clause in an OPEN statement for the formatted output file.

You are using list-directed output, which gives the implementation a lot of flexibiliy in when to start new records. The current default line length of 80 dates back to when we supported character-cell terminals. In the next version we will have a compile option that changes the behavior to be what you want,

That said, you still give up control with list-directed.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today