Last week I created a post on this forum describing a "floating invalid" error message I am getting.
Through some trial and error, I believe I have found the "smoking gun", or at least something that is contributing to the "(65) floating invalid" error.
I have recreated my code with a very simple example (see below). I first initialize a large table array at zero. Then I fill rows 1 and 2 of the table with some numbers. I then simply divide the value in column 1 with the value in column 2, but only if the value in column 2 is positive. I put the result in column 3.
I get the error if I compile using the compiler option "/Qinit:snan", as in:
ifort /libs:dll /traceback /Qinit:snan /c test2.f90
The program runs fine if I remove the compiler option, as in:
ifort /libs:dll /traceback /c test2.f90
Also, what is strange is that if I write out the values of column 1 and 2 before doing the divide, the program runs fine, even with the /Qinit:snan option.
In my example below, I have commented out this write statement.
-------------------------------------------------------------------------------------------------------------------------
program test2
double precision xa(3,3,100000)
data xa /900000*0./
xa(1,01,1) = 0.
xa(1,02,1) = 0.
xa(2,01,1) = 40000000.
xa(2,02,1) = 100.
xa(3,01,1) = 10000000.
xa(3,02,1) = 5.
do 800 i=1,3
! write(6,50) i, xa(i,01,1), xa(i,02,1)
! 50 format(1x,'check here',i4,2f10.0)
if (xa(i,02,1) > .01) xa(i,03,1) = xa(i,01,1) / xa(i,02,1)
800 continue
do 810 i=1,3
write(6,100) i, xa(i,01,1), xa(i,02,1), xa(i,03,1)
100 format(1x,'results',i4,3f10.0)
810 continue
end
-------------------------------------------------------------------------------------------------------------------------
I am running Visual Fortran Intel(R) 64 Compiler XE .... Version 15.0.7.287
So, thoughts experts? Why is this compiler option causing problems? Is removing this compiler option something I should be worried about?
Thanks in advance.
Jim