0

I am using gfortran on Ubuntu 16.04 to compile a main file and a bunch of subroutine files written in Fortran 77. They are compiled without any error or warning but after running the executable file, I get "zero" and "NaN" everywhere in the result which is unexpected according to the released output of the original code.

After running the exe I get this note:

"Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DENORMAL"

I also used the following flags in my makefile but they didn't make any difference:

FCFLAGS= -c -g -fbacktrace -ffpe-trap=zero,overflow,underflow
Nasakh
  • 1
  • 1
  • 1
    Welcome. Please take the [tour] and read [ask] and [mcve]. We need to see the code to see why it returns zeros and NaNs. Regarding the `EEE_INVALID_FLAG IEEE_DENORMAL` note, see https://stackoverflow.com/questions/44308577/ieee-underflow-flag-ieee-denormal-in-fortran-77 it is not very important message for you. – Vladimir F Героям слава Dec 15 '17 at 17:18
  • Also, I *seriously* doubt you are actually using fortran 77. More likely, your file extension is `.f77` or `.f`, which only means fixed form, the syntax of source files. – Ross Dec 15 '17 at 18:39
  • Possible duplicate of [IEEE\_UNDERFLOW\_FLAG IEEE\_DENORMAL in Fortran 77](https://stackoverflow.com/questions/44308577/ieee-underflow-flag-ieee-denormal-in-fortran-77) – agentp Dec 15 '17 at 19:57
  • What is your concern? You'll need to show us code for us to advise on what may be invalid operations, or where numbers become denormal. Note, though, that in your `-ffpe-trap` list you haven't invald or denormal so I wouldn't expect the compiler to abort with those. – francescalus Dec 15 '17 at 21:55
  • @agentp I have actually closed it as a duplicate of that function first. And then I re-opened, because it is not just about this note, but about the *"I get "zero" and "NaN" everywhere in the result"* which unfortunately cannot be answered without the relevant code. But not a duplicate in my opinion, that's why I re-opened. – Vladimir F Героям слава Dec 15 '17 at 22:41

0 Answers0