1 (edited by akhuller 2023-01-03 18:35:47)

Topic: Best Compiler Options for case when Debug Results Differ from Release

Hi!

I am trying to translate a large Fortran-77 model into Matlab. Simply Fortran has been incredibly helpful.

But recently I've noticed that for some important sets of input conditions, the values of variables in Debug mode are quite different than those obtained in a normal execution, and the number of iterations the programs runs through is lower by one order of magnitude.

Are there any compiler/project setup options I can use for the debug values to match the normal execution results?

Thank you for your help!

P.S. My guess (I am new to Fortran-77) is that these differences arise due to: (1) the program's use of equivalence statements in the file of arrays that are read using 'include' in most subroutines or (2) the use of 'return 1' in some subroutines to go to different parts of the program from a subroutine.

Re: Best Compiler Options for case when Debug Results Differ from Release

Usually when you're seeing differences between results when debugging is on or off, there is likely some sort of memory violation occurring.  I would first try enabling runtime diagnostics in Project Options under the Fortran category, then rebuilding your executable (being sure to Clean first).  It might be able to catch a memory violation or two that is leading to the differences.

Jeff Armstrong
Approximatrix, LLC

Re: Best Compiler Options for case when Debug Results Differ from Release

Thank you so much!