Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

2013 --> 2015 change in reading reals?

Bradley_P_1
Beginner
588 Views

I'm sure this is just a compiler setting or something, but I'm rusty!  When we moved from 2013 to 2015, our applications stopped working properly.  We tracked it down to the fact that we were trying to read integers (or a delimited integer - e.g. '1') into a real.  In 2013 this worked.  In 2015 it's blowing up on us.  Any ideas?

Thanks!

Brad.

0 Kudos
2 Replies
mecej4
Honored Contributor III
588 Views

In general, newer versions of the compiler do a better job of catching errors in Fortran programs, and it is best to use the new diagnostics to fix the bugs in the program. Similarly, the behavior of programs with errors is often not "defined", and this behavior may change from compiler to compiler, and any specific behavior should not be depended upon.

I do not have at hand the versions that you mentioned, but here is a small program that attempts reading an incorrect list-directed input record. The Intel 7.0 compiler does not catch the error, but the 16.0 compiler does, as do the Gfortran and NAG compilers.

program tst
   character(len=11) :: line = '''1'',1.5,2.5'
   real ::x,y,z
   read(line,*)x,y,z
   write(*,10)x,y,z
 10 format(3F12.4)
end program

 

0 Kudos
Steven_L_Intel1
Employee
588 Views

There is an option that controls this behavior - /check:format (in Visual Studio, Run-time > Check Edit Descriptor Data Type)

0 Kudos
Reply