I built a model several years ago using Visual FORTRAN Standard Edition 6.0.A. I wanted to reuse the model again, but the software I am using now is Visual Studios 2015 with the Intel(R) Visual FORTRAN Compiler 16.0 [IA-32].
The project I built is no longer compiling. For example, I had to change
in order to get the project to compile.
Even after I am getting the solution to compile, the project is giving different output when being fed the same input.
What changes has the new compiler made? Can I change any settings to get the new compiler to emulate the previous version of FORTRAN? Is there a difference in the ways variables are being initialized?
The code change you made is correcting a bug in your code. Some old compilers would check the logical terms in order and maybe terminate early I>1 but that is not standard conforming behaviour.
It is pointless to ask what might have changes, the list would be endless.What do you mean by different output? Is it slightly different real numbers e.g.1.000000 cf 1.000001 or is it totally different numbers?
It is best to avoid confusing between different compiler versions (IVF 16, CVF) and language versions (Fortran 95, Fortran 77, etc.).
One major difference between CVF and Intel Fortran is that the former applied an implicit SAVE attribute to local variables. If local variables in your program need initialization, you have to provide code to do that yourself, or consider using the SAVE attribute for the variables concerned or consider the /Qsave compiler option. Another significant difference is in the way that the lengths of character arguments are passed to subprograms.
For the specific code extract that you showed, you could have written the more clear equivalent statement:
RPEAK = MAXVAL(RINI)
@andrew_4619 The output (real numbers) are totally different. One issue I noticed, which could be a potential cause of this issue, is that variable that are uninitialized are given extremely high negative numbers.
@mecej4 I recognized that I would need to initialize local variables that were previously uninitialized. Due to the massive number of local variables in the program, it would be very time-consuming to provide code to initialize. How can I implement the /Qsave compiler option through visual studios 2015?