- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been trying to resize a vector into a two dimensional array but at compile time I keep getting the same error message
Here is the program and the output
program prog2
integer::b(6)
b=(/ 1,2,3,4,5,6 /)
RESHAPE (b, (/2, 3/))
print 10, b
10 format (3(2X, I3))
end program prog2
# ifc -w reshape.f90 -o reshape
program PROG2
RESHAPE (b, (/2, 3/))
^
Error 395 at (4:reshape.f90) : This entity is not an array and must not be subscripted
1 Error
Here is the program and the output
program prog2
integer::b(6)
b=(/ 1,2,3,4,5,6 /)
RESHAPE (b, (/2, 3/))
print 10, b
10 format (3(2X, I3))
end program prog2
# ifc -w reshape.f90 -o reshape
program PROG2
RESHAPE (b, (/2, 3/))
^
Error 395 at (4:reshape.f90) : This entity is not an array and must not be subscripted
1 Error
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RESHAPE is a function, not a statement. The message is a bit obscure, but then again, the compiler was quite perplexed as to what you wanted.
CVF's message is essentially a syntax error...
You need to assign the result of RESHAPE to something, or use it in some context that requires an array.
Steve
CVF's message is essentially a syntax error...
You need to assign the result of RESHAPE to something, or use it in some context that requires an array.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve, I'll figure out my bum from my head one of these days
![](/skins/images/2E08A100FB92911314A240D1EAFB2828/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page