compile question---about code

I have an odd question, the following code:

tmpu(i)=dreal(out(i+1))/real(mz)
enddo
! write(,)out(6),dreal(out(6))
! write(,)in(5),out(6) line 124
write(,)out(6) line 125
tmpu(0)=tmpu(0)/2.0
tmpu(mz)=tmpu(mz)/2.0

this code gives out fault result, NAN, but if I comment line 125 and uncomment line 124, the result is correct, isn’t it weird??

Can anyone help me and tell me why?

thansk!!!

Hi,

Can you tell us which PGI release you use, what compiler options? Is NAN you get from tmpu(0) or all of them?

Hongyon

My pgi is 7.2CDK, Nan is out(6), if comment line125, the line 124 gives out correct in(5),out(6) .

Thank you.

sad

Hi,

Can you please try 9.0 release to see if this behavior is gone? If it is still there, can you print it in hex to see what the actual values are.
If the answer is still incorrect, you can send us a small test case so we can look at it to trs@pgroup.com.

Thank you,
Hongyon