Hello,(adsbygoogle = window.adsbygoogle || []).push({});

In Fortran 90, will the performance (in terms of computational efficiency) of the following two be the same. If not, which one will be faster. Please advise with the reasoning:

(i)

do i = imin,imax

do j = jmin,jmax

do k = kmin,kmax

Several statements (rigorous arithmetic manipulation) involving a(i,j,k) and b(1,i,j,k)

end do

end do

end do

(ii)

do k = kmin,kmax

do j = jmin,jmax

do i = imin,imax

Several statements (rigorous arithmetic manipulation) involving a(i,j,k) and b(1,i,j,k)

end do

end do

end do

Thank you very much.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# (Fortran) Does order of accessing a matrix affect the performance?

**Physics Forums | Science Articles, Homework Help, Discussion**