MargaretKahn
10-13-2009, 08:44 PM
I'm having a problem with totalview showing the order of dimensions of fortran arrays incorrectly. E.g. with the following program
program test
real, dimension(3,2) :: x
x = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/3, 2 /) )
print*, x
end program test
When I compile this with ifort (either 11.1.046 or 11.1.056) totalview shows the array dimensions as (2,3) rather than (3,2). The following is from the CLI, but it's the same from the GUI.
d1.<> dwhat x
In thread 1.1:
Name: x; Type: REAL(4)(2,3); Size: 24 bytes; Addr: 0x006aadf0
Scope: ##/short/p73/mrd599/a.out#junk.f90#MAIN_ (Scope class: Any)
Address class: proc_static_var (Routine static variable)
d1.<> dprint x
x = {
(1,1) = 1
(2,1) = 2
(1,2) = 3
(2,2) = 4
(1,3) = 5
(2,3) = 6
}
d1.<>
If I compile it with intel-fc/11.0.083 (or gfortran) the array order is correct.
d1.<> dwhat x
In thread 1.1:
Name: x; Type: REAL*4(3,2); Size: 24 bytes; Addr: 0x006a7db0
Scope: ##/short/p73/mrd599/a.out#junk.f90#test (Scope class: Any)
Address class: proc_static_var (Routine static variable)
d1.<> dprint x
x = {
(1,1) = 1
(2,1) = 2
(3,1) = 3
(1,2) = 4
(2,2) = 5
(3,2) = 6
}
d1.<>
program test
real, dimension(3,2) :: x
x = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/3, 2 /) )
print*, x
end program test
When I compile this with ifort (either 11.1.046 or 11.1.056) totalview shows the array dimensions as (2,3) rather than (3,2). The following is from the CLI, but it's the same from the GUI.
d1.<> dwhat x
In thread 1.1:
Name: x; Type: REAL(4)(2,3); Size: 24 bytes; Addr: 0x006aadf0
Scope: ##/short/p73/mrd599/a.out#junk.f90#MAIN_ (Scope class: Any)
Address class: proc_static_var (Routine static variable)
d1.<> dprint x
x = {
(1,1) = 1
(2,1) = 2
(1,2) = 3
(2,2) = 4
(1,3) = 5
(2,3) = 6
}
d1.<>
If I compile it with intel-fc/11.0.083 (or gfortran) the array order is correct.
d1.<> dwhat x
In thread 1.1:
Name: x; Type: REAL*4(3,2); Size: 24 bytes; Addr: 0x006a7db0
Scope: ##/short/p73/mrd599/a.out#junk.f90#test (Scope class: Any)
Address class: proc_static_var (Routine static variable)
d1.<> dprint x
x = {
(1,1) = 1
(2,1) = 2
(3,1) = 3
(1,2) = 4
(2,2) = 5
(3,2) = 6
}
d1.<>