'Old' style namelists

'Old' style namelists

Using -f77rtl corrects some namelist differences with AIX (it uses $namelist, $end), but is it possible to disable the use of the '*' and force the output of each value individually?

An example:

On AIX: a = 0, 0, 0
On Linux: a = 3*0

In certain cases, the 'new' output style reduces human readability. It would be nice to have an option to change this. Any help is appreciated.

Thanks,

Chris

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

That isn't an old vs. new difference. The standard allows for the repeated value, and that's the way we implement it. There's no switch to select the output of the individual values.

You must not be using xlf90 on AIX, or are using it in a mode that does not follow the F90 standard.

Steve - Intel Developer Support

xlf90 outputs each value by default...but we are using f77.

Also, why does Intel accept namelist input that occurs without carriage returns, but always output by default one variable per line?

As an aside, g77 outputs each value.

NAMELIST, as originally defined by IBM in the 1970s, specified that two or more consecutive values can be represented as a repeated value. We implemented it that way in VAX-11 FORTRAN 2.0 in 1980 (in fact, I was the one who wrote the library support for it back then), and have kept that behavior ever since. The F90 standard codified this as an allowable behavior and we don't have an option to change it.

g77 came much later, and is not generally considered an example to follow in the Fortran world.

As for outputting one variable per-line - why not? Again, the standard permits this and I, for one, find it more readable.

There are quite a few areas, especially in the form of formatted output, where the language gives compilers some freedom. Nowhere is this more evident than in list-directed (and hence NAMELIST) output. If you have strict format requirements, I would recommend the use of explicitly formatted output (though even there is room for variation, such as whether one puts a leading zero on an F format value that is less than 1.)

Steve - Intel Developer Support

Obviously g77 isn't a great FORTRAN compiler, or I wouldn't work at a company that purchased a license for the Intel FORTRAN compiler. That said, having to move legacy code from AIX to Linux presents many challenges. I hope you can understand my desire to find ways to compensate for compiler differences without the need for code changes in that there is a significant amount of red tape involved in certifying code changes to stuff that has been running untouched on AIX for 8 years, and on other platforms for 20. In an ideal world, I'd have the freedom to fix all this code, but in the business world there is a lot of pressure to not make changes.

As always, I appreciate your responses and feedback.

Thanks,

Chris

Message Edited by cjosefy on 04-07-2005 07:46 AM

NAMELIST and list-directed output is intended for human consumption, and implementations have great flexibility in how they choose to format the output. If we tried to match implementation A, then users of implementation B might complain. You will have to accept some formatting changes across implementations.

Steve - Intel Developer Support

Leave a Comment

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