Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Write statements without format

Glynn_H_
Beginner
448 Views

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!)?

0 Kudos
2 Replies
mecej4
Honored Contributor III
448 Views

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.

0 Kudos
Steven_L_Intel1
Employee
448 Views

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.

0 Kudos
Reply