Re: Possible F77 Code Improvement ??



Gus Gassmann wrote:
On Mar 4, 5:42 pm, monir <mon...@xxxxxxxxxxxx> wrote:

DO 35 NB= 1, NB !max 8

DO 25 JVORT= 1, NF !max 62
Kount = Kount + 1
C.......my code 2
SSX= valueXX
SSR= valueRR
SST= valueTT
C.......my code 3
ValX(Kount) = SSX*GAM(JVORT)*R(JVORT,1)
ValAbsX(Kount)=ABS(ValX(Kount))
ValR(Kount) = SSR*GAM(JVORT)*R(JVORT,1)
ValAbsR(Kount)=ABS(ValR(Kount))
ValT(Kount) = SST*GAM(JVORT)*R(JVORT,1)
ValAbsT(Kount)=ABS(ValT(Kount))

25 CONTINUE

35 CONTINUE

I came to this thread late, but nobody has yet commented on the fact
that GAM(JVORT) and R(JVORT,1) do not depend on the outer loop
counter, NB. It would therefore make sense to switch the order of
these two loops. Are optimisers clever enough these days to figure
that out?

That would rearrange the order of the values stored in ValX, ValR, and ValT, which might or might not be an issue depending on what ends up being done with them.
.