I get different behavior between Portland and Intel Fortran compilers when evaluating a simple expression with an exponent followed by multiplication. I am pretty sure that pgf90 (and gfortran) work correctly based on my understanding of operator precedence, but I would like to get a second opinion, as these things can be a little tricky.
Here is my code simplified to a very simple form. When launched using ifort, an expression of the form is d1=a**-2*binterpreted as d1=a**(-2*b)if ifort is equal d1=(a**-2)*bto pgf90 and gfortran. If I remove the negative sign from the exponent, all three compilers interpret this as d1=(a**2)*b. If I change * b to + b, I also get good behavior from all three.
program badvals
implicit none
real :: a, b, c1, c2, d1, d2
a = 2.
b = 4.
c1 = a**-2+b
c2 = a**(-2)+b
d1 = a**-2*b
d2 = a**(-2)*b
print*, "c1, d1 = ",c1, d1
print*, "c2, d2 = ",c1, d2
print*, "c2-c1, d2-d1 = ",c2-c1, d2-d1
end program badvals
, ""? Intel?