Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
4 Views

2013 --> 2015 change in reading reals?

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
Highlighted
Black Belt
4 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
Highlighted
4 Views

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

0 Kudos