From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25287 invoked by alias); 18 Sep 2009 16:59:16 -0000 Received: (qmail 25279 invoked by uid 22791); 18 Sep 2009 16:59:15 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_31,J_CHICKENPOX_92,UPPERCASE_50_75 X-Spam-Check-By: sourceware.org Received: from web110506.mail.gq1.yahoo.com (HELO web110506.mail.gq1.yahoo.com) (67.195.8.254) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 18 Sep 2009 16:59:09 +0000 Received: (qmail 68258 invoked by uid 60001); 18 Sep 2009 16:59:08 -0000 Message-ID: <153502.68203.qm@web110506.mail.gq1.yahoo.com> Received: from [216.165.126.113] by web110506.mail.gq1.yahoo.com via HTTP; Fri, 18 Sep 2009 09:59:07 PDT Date: Fri, 18 Sep 2009 16:59:00 -0000 From: Z F Subject: Re: Column Major To: "Hickey Rob \(ED/ETS4-Wm\)" , gsl-discuss@sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00056.txt.bz2 Yes, that is exactly my point. No difference at all. It is all in correct addressing of the memory locations (i.e. the index "L" in your example). --- On Fri, 9/18/09, Hickey Rob (ED/ETS4-Wm) wrot= e: > From: Hickey Rob (ED/ETS4-Wm) > Subject: Column Major > To: mail4me9999@yahoo.com > Date: Friday, September 18, 2009, 12:07 PM >=20 >=20 >=20 >=20=20 >=20=20 > Column Major >=20 >=20=20 >=20 >=20 > =A0=A0=A0=A0 CALL COLUMN_MAJOR_TEST() >=20 >=20 > =A0=A0=A0=A0 END >=20 >=20 > ! > ********************************************************************** >=20 >=20 > =A0=A0=A0=A0=A0 SUBROUTINE COLUMN_MAJOR_TEST() >=20 >=20 > ! > **********************************************************************=A0= =A0=A0=A0=A0 >=20 >=20 >=20 > ! > DEMONSTRATE COLUMN MAJOR >=20 >=20 > ! > ---------------------------------------------------------------------- >=20 >=20 > =A0=A0=A0=A0=A0 IMPLICIT NONE >=20 >=20 > =A0=A0=A0=A0=A0 INTEGER I, J, K, L=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0=A0 INTEGER, PARAMETER :: NI =3D 2, NJ =3D 3, NK =3D > 4 >=20 >=20 > =A0=A0=A0=A0=A0 INTEGER, DIMENSION(NI,NJ,NK) :: MAT >=20 >=20 > =A0=A0=A0=A0=A0 INTEGER, DIMENSION(NI*NJ*NK) :: VEC >=20 >=20 > =A0=A0=A0=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0 =A0 DO I =3D 1,NI >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0 DO J =3D > 1,NJ >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0 > DO K =3D > 1,NK >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 MAT(I,J,K) =3D > 100*I + 10*J + > K=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 >=20 >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0 > ENDDO >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0 ENDDO >=20 >=20 > =A0=A0=A0=A0 =A0 ENDDO=20 >=20 >=20 > =A0=A0=A0=A0=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0=A0 VEC(:) =3D RESHAPE (MAT, (/NI*NJ*NK/))=20 >=20 >=20 > =A0=A0=A0=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0 =A0 DO I =3D 1,NI >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0 DO J =3D > 1,NJ >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0 > DO K =3D > 1,NK=20 >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 L =3D I > + NI*((J-1) + NJ*((K-1) + NK*(0)))=A0=A0 ! > ...etc=A0=A0=A0=A0=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 > WRITE(*,'(8(1X,I4))') I,J,K,L, MAT(I,J,K), > VEC(L) >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0=A0=A0 > ENDDO >=20 >=20 > =A0=A0=A0=A0 =A0=A0=A0 ENDDO >=20 >=20 > =A0=A0=A0=A0 =A0 ENDDO=20 >=20 >=20 > =A0=A0=A0=A0=A0=20 >=20 >=20 > =A0=A0=A0=A0=A0 END SUBROUTINE COLUMN_MAJOR_TEST >=20 >=20 >=20=20 >=20