Re: forall and do loop



"highegg" <highegg@xxxxxxxxx> wrote in message
news:1185545688.715089.193180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

! transpose 2D array of vectors
forall(i=1:size(a,2),j=1:size(a,3)) a(:,i,j) = a(:,j,i)

C:\Program Files\Microsoft Visual Studio 8\James\clf\transpose_2>type
transpose_
2.f90
program transpose_2
integer a(2,2,2), b(2,2,2)
integer i, j

b = reshape((/(i,i=1,size(b))/),shape(b))
a = b
forall(i=1:size(a,2),j=1:size(a,3)) a(:,i,j) = a(:,j,i)
write(*,*) a
a = b
a = reshape(a,shape(a),order=(/1,3,2/))
write(*,*) a
end program transpose_2

C:\Program Files\Microsoft Visual Studio 8\James\clf\transpose_2>ifort /O3
/QxT
/stand:f95 transpose_2.f90
Intel(R) Fortran Compiler for Intel(R) EM64T-based applications, Version 9.1
Build 20061104
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

C:\Program Files\Microsoft Visual Studio
8\James\clf\transpose_2\transpose_2.f90
(5) : (col. 4) remark: LOOP WAS VECTORIZED.
C:\Program Files\Microsoft Visual Studio
8\James\clf\transpose_2\transpose_2.f90
(5) : (col. 4) remark: LOOP WAS VECTORIZED.
C:\Program Files\Microsoft Visual Studio
8\James\clf\transpose_2\transpose_2.f90
(6) : (col. 4) remark: LOOP WAS VECTORIZED.
C:\Program Files\Microsoft Visual Studio
8\James\clf\transpose_2\transpose_2.f90
(9) : (col. 4) remark: LOOP WAS VECTORIZED.
C:\Program Files\Microsoft Visual Studio
8\James\clf\transpose_2\transpose_2.f90
(10) : (col. 4) remark: LOOP WAS VECTORIZED.
Microsoft (R) Incremental Linker Version 8.00.40310.39
Copyright (C) Microsoft Corporation. All rights reserved.

-out:transpose_2.exe
-subsystem:console
transpose_2.obj

C:\Program Files\Microsoft Visual Studio 8\James\clf\transpose_2>transpose_2
1 2 5 6 3 4
7 8
1 2 5 6 3 4
7 8

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


.



Relevant Pages

  • Re: Windows array allocation problem
    ... Copyright 1985-2006 Intel Corporation. ... Copyright Microsoft Corporation. ...
    (comp.lang.fortran)
  • Re: Windows Media Player Plug-in Wizard
    ... The wizard should now appear in Visual Studio. ... Microsoft Corporation ... Please do not send email directly to this alias as this alias is for ... >> looking for the folder in every possible place, I checked few times in every ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Issues with C and Fortran, loadlibrary() and getprocaddress()
    ... end subroutine my_dll_sub ... Copyright 1985-2006 Intel Corporation. ... Copyright Microsoft Corporation. ... Directory of C:\Program Files\Microsoft Visual Studio ...
    (comp.lang.fortran)
  • Re: newbie: using xsd.exe
    ... Microsoft Xml Schemas/DataTypes support utility ... Copyright Microsoft Corporation 2001-2005. ... you have a database in a dll ...
    (microsoft.public.dotnet.framework.adonet)
  • Problem with cdoexm.tlb in ad
    ... Microsoft.NET Framework Type Library to Assembly Converter 2.0.50727.42 ... Copyright Microsoft Corporation. ...
    (microsoft.public.exchange2000.development)