What is the best way to optimise loops like the following, which are from Steam and Water property calculations:
DUMMY=0 DO i = 1,34 DUMMY = DUMMY - nreg1(i) * ireg1(i) * (7.1D0 - pi) ** (ireg1(i) - 1) * & (tau - 1.222D0) ** jreg1(i) END DO gammapireg1 = DUMMY
ireg1 has values from 0 to 32 and jreg1 from 17 to -41
ireg1 and jreg1 are INTEGER PARAMETER arrays, and nreg1 is a REAL*8 PARAMETER array
Is it more efficient to calculate all the elements of the array result and sum at the end?