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

Fortran Breaking File Output Lines Automatically

eleteroboltz
Beginner
600 Views
I'm using Intel Visual Fortran 11.1 x64 with Microsoft Visual Studio 2008.

I'm having a simple issue that I cannot solve.
When I write a lot of things in a single 'write', it just break the output line at certain point.

For Example, when I write the code:

write(1,*) 'aaaaaaaaa ','aaaaaaaaa ','aaaaaaaaa ', 'aaaaaaaaa ',&
& 'aaaaaaaaa ', 'aaaaaaaaa ', 'aaaaaaaaa ', 'aaaaaaaaa ',&
& 'aaaaaaaaa' ,'aaaaaaaaa ', 'aaaaaaaaa'



The output file 'fort.1' is with 2 lines instead of one continuous line.

fort.1:
aaaaaaaaa aaaaaaaaa aaaaaaaaa aaaaaaaaa aaaaaaaaa aaaaaaaaa
aaaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa aaaaaaaaa


I don't remember this happening with other compilers that I used in the past.
Does any one know how to fix this problem???

This is crucial for making output data tables.

Thanks in advance.
0 Kudos
1 Solution
IDZ_A_Intel
Employee
600 Views
Either (and perhaps both):

- Use an explicit format specification (such as "(11A)" for your very specific example) rather than list directed formatting (the *). If the formatting is crucial then it is crucial that you specify it, so this is what I'd recommend.

- Change the record length for the unit (use the RECL specifier in the OPEN statement) to something bigger than your longest line.

List directed formatting gives the processor a fair bit of of freedom in how it writes the output, including starting new records between items.

IanH

View solution in original post

0 Kudos
2 Replies
IDZ_A_Intel
Employee
601 Views
Either (and perhaps both):

- Use an explicit format specification (such as "(11A)" for your very specific example) rather than list directed formatting (the *). If the formatting is crucial then it is crucial that you specify it, so this is what I'd recommend.

- Change the record length for the unit (use the RECL specifier in the OPEN statement) to something bigger than your longest line.

List directed formatting gives the processor a fair bit of of freedom in how it writes the output, including starting new records between items.

IanH

0 Kudos
eleteroboltz
Beginner
600 Views
Thank you very much!!!
I increased the RECL in the OPEN statment....
0 Kudos
Reply