- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm trying to make a pointer point to an array subsection resolved by a vector subscript, but I found it
not to be possible.
Given
rows 1 to 3, but I get the error
Thanks.
PS: I'm not using a triplet on the second index because, in practice, I'll select more columns without a
regular stride.
not to be possible.
Given
[fortran]DOUBLE PRECISION, DIMENSION(5,5), TARGET :: arrA DOUBLE PRECISION, DIMENSION(:,:), POINTER :: ptr1 [/fortran]the assignment
[fortran]ptr1 => arrA(1:3,(/2,4/)) [/fortran]was intended to make pointer ptr1 point to the subsection of arrA constituted of its columns 2 and 4 for
rows 1 to 3, but I get the error
[fortran]#6797: A vector subscript is not permitted in an array section target subobject[/fortran]Is it possible to do something like this?
Thanks.
PS: I'm not using a triplet on the second index because, in practice, I'll select more columns without a
regular stride.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No - the standard explicitly forbids data-target from being an array section with a vector subscript. (Constraint C724 in Fortran 2008).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. I'll work some bypass.
Thanks.
Thanks.
![](/skins/images/06022F5BB6D2F28C8F102671A0F06E85/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