I am having unexpected results (NaN) when running a program, but these are solved by using -Mbounds at the compilation time. Removing -O2 also works fine, which I find strange as I thought that O2 was the default optimization level.
No warning or error is issued on array bounds being overun so I would like some ideas on how to debug this. The code is mostly f90 with a c function thrown in. Linux 64 (RHE 3), opteron.
pgcc -c -O2 -B *.f90
pgf90 -c -O2 *.c
pgf90 -o a.x *.o
Runs as expected with the following options:
-c -O2 -Mbounds
I was having a runtime error executing the following read assignment:
real :: pa(k2,k3) # k3 = 1
read (nsurunit,’(8E12.6)’) pa(1:k1,:)
until it was changed to:
read (nsurunit,’(8E12.6)’) pa(1:k1,1)
The original line seems perfectly acceptable. any ideas why pgf90 was geting confused?