Parallel Studio reads real number input as integer value

Parallel Studio reads real number input as integer value

I have FORTRAN program that is being rebuilt on a 32bit Linux O/S platform using the Intel 10.1.013 FORTRAN complier  and on a 64bit Linux O/S platform using the Intel parallel_studio_xe_2011_spl_update3_intel64 Fortran compiler. The program reads some of its input from a namelist file.  One value read in from the namelist file is the month of the year (mn).  The program defines this value as an integer. 

When testing, I am having trouble with an ERROR test case where the value of mn in the namelist file is set to a real (ex. 6.2).  The program is supposed to recognize that this value is not the correct format and error out.  But, for some reason when running the 64bit parallel studio version, the entry for the variable mn is still read in as an integer even though the value in the namelist file is real.  So, the program keeps running and doesn’t error out. Everything after the decimal seems to be ignored when an integer is expected. The 32bit intel 10.1.013 version of the program performs as expected and errors out because the format of the entry value is incorrect.

I wrote a small sample program to demonstrate this problem.  I compiled and ran it using the INTEL 10.1.013 Fortran compiler on a 32bit Linux O/S.  I then compiled and ran it using the parallel_studio_xe_update3_intel64 Fortran compiler on a 64bit Linux compiler.    

The program is attached (test.txt) and input file (namelist.txt) as are the procedures I followed and results from both versions (procedures_results.txt).

 

AttachmentSize
Downloadtext/plain test.txt774 bytes
Downloadtext/plain namelist.txt73 bytes
Downloadtext/plain procedures-results.txt2.65 KB
2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This is correct behavior of Intel Fortran. As an extension, we provide free conversion among numeric types in list-directed and NAMELIST input, similar to what the language provides for intrinsic assignment. The Fortran standard allows an implementation to extend the language in this manner. We don't offer an option to restrict the behavior in this area.

You should not rely on list-directed or NAMELIST input for error checking, as the implementation is almost certainly more forgiving than you want it to be.

Retired 12/31/2016

Leave a Comment

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