Arrays: Under the Bonnet

Memory

Array Element Ordering

Nevertheless, there is, in practice, array element ordering:
    REAL, DIMENSION(1:3,1:3) :: A
corresponds to
    A(1,1), A(2,1), A(3,1), A(1,2), A(2,2), A(3,2), A(1,3), A(2,3), A(3,3) 
so that
    DO J=1, 5000
        DO I=1, 5000
            A(I,J) = I * (J-1)
        END DO
    END DO
is much more efficient than
    DO I=1, 5000
        DO J=1, 5000
            A(I,J) = I * (J-1)
        END DO
    END DO


...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_course_fortran_90/_reml_grp/index.reml
On: 10/2/2003 at 10:33:52
Options: reml2 -i noindex -l long -o html -p multiple