- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have a code that I'm migrating from gfortran to ifort.
After a number of time steps I write a vector (~ 500 lines) to a file using:
WRITE (unit, *) Time_Steps, vector(:)
In gfortran this gives me the, output file:
Time_1, vector(1), vector(2), .... vector(end)
Time_2, vector(1), vector(2), .... vector(end)
Time_3, vector(1), vector(2), .... vector(end)
....
When running with ifort the output is messed up, with a line break every 5 columns.
Any idea what's happening ?
thanks, jp
p.s I already tried specifying the format but it didn't work...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you most certainly need an edit descriptor if you want the format to have line breaks where you want them. (With an edit descriptor you can specify the number of entities per line by either typing an edit descriptor for each column or using repeat counts, or, if the number of columns is only known at runtime, you can dynamically build an edit descriptor.) The exact output of the default * edit descriptor is processor dependent (processor in the sense as defined by the fortran standard, to mean hardware, compiler etc.) and for ifort, it will put elements on a new line if the line length starts to become too long.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's an implementation difference in the default record length for list-directed output. Intel Fortran and its predecessors DEC/Compaq Fortran have used 80 columns for decades. Back in the 1970s this made sense, not so much today.
In compiler version 14 we added the option -wrap-margin- to allow indefinitely long record lengths for list-directed output. There is also an environment variable that can control this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
Thanks for your comment but.... it didn't work.
I'm compiling with -fast -wrap-margin and the output is still exactly the same... Any other sugestions ?
thanks for that.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show me a small example program that demonstrates the problem, along with the output you get from gfortran. Also, the option I mentioned is new in version 14. In older versions you can open the file with a larger RECL= value and it will use that as the margin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
joao n. wrote:The option you wanted is -wrap-margin-, not -wrap-margin (note the '-' at the end; think -wrap-margin+).
Thanks for your comment but.... it didn't work.
I'm compiling with -fast -wrap-margin and the output is still exactly the same... Any other sugestions ?
thanks for that.
JP
As Steve said, this option is available with the Version 14 compiler. Older versions will complain that -wrap-margin- is not a recognized option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ops...
my mistake, now working perfectly. tks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Linux, the correct spelling is -no-wrap-margin
The trailing hyphen is a Windows-ism, and was accidentally accepted by the Linux version of "ifort".
In other words, please update your makefile to use -no-wrap-margin instead.
thanks!
--Lorri
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page