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

Change? in Namelist

mattsdad
Einsteiger
1.781Aufrufe

We have a simulator written in Fortran95 which uses Namelists for input. The engineers that use the simulatorhave beendebugging their namelist inputs by using a variable (that has no significance to the simulator) in multiple places in their input namelist with different values. When a namelist fails on input, that variable would have a value which would identify where in the namelist the failure occured. That worked fine when we were compiling with 8.1, but after the upgrade to 10.0 that debug technique no longer works.

Has there been a change to the way the Namelist feature works?

Is there a way to identify a misspelled variable in a Namelist input after the Namelist fails to be read? "IOSTAT=19" is not very helpful for finding an error in a Namelist that goes on for 20 pages.

0 Kudos
3 Antworten
Steven_L_Intel1
Mitarbeiter
1.781Aufrufe
I don't quite understand your first paragraph, Can you show an example? There probably have been bugs fixed in namelist support, but I can't tell from your description exactly what you're doing. I tried some examples doing what I thought you described, and it worked as I expected.

As for identifying a misspelled variable, if you catch the error with IOSTAT or ERR=, no, but if you let the error display, you'll get something like this:

forrtl: severe (19): invalid reference to variable in NAMELIST input, unit -4, file CONIN$, line 1, position 27
mattsdad
Einsteiger
1.780Aufrufe

Is there a way to let the error display AND obtain a flag (in place of IOSTAT or ERR) that can be used to determine how to proceed? INQUIRE?

OR, Will allowing the error display, end the application?

Steven_L_Intel1
Mitarbeiter
1.780Aufrufe
At present, it's an either-or situation. This may change in the future with support for the IOMSG= keyword from Fortran 2003 (whenever we start supporting that.)

For a "debugging" situation, it doesn't seem unreasonable to me to remove the IOSTAT=.
Antworten