Reshape halt

0 views
Skip to first unread message

PGK

unread,
Aug 20, 2008, 6:55:32 AM8/20/08
to gg95
Hi,

I was playing with g95's (v0.91) reshape intrinsic, and found that the
following code stalls the program. The last, "order", parameter is
being set to something unusual.

...
integer, dimension(6) :: source1 = (/ 1, 2, 3, 4, 5, 6 /)
integer, dimension(2) :: shape1 = (/ 2, 5/)
integer, dimension(2) :: pad1 = (/ 0, 0/)

write (unit=*,fmt=*) reshape(source1, shape1, pad1, (/2,1/)) ! Runs
fine
write (unit=*,fmt=*) reshape(source1, shape1, pad1, (/2,2/)) ! Stalls
the program
...

Paul

Steven Winfield

unread,
Aug 20, 2008, 7:02:32 AM8/20/08
to gg...@googlegroups.com
Hi,

Metcalf, Reid and Cohen's book states that 'order' *must* be a
permutation of (1,2,...,n) so setting order = (/2,2/) is not allowed.

Steve.

Reply all
Reply to author
Forward
0 new messages