- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1 integer, allocatable :: a(:,:)[:], b(:,:)[:], c(:,:)[:] 2 3 allocate (a(10,10)
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Answering my own question - I've forgotten
that if coarray syntax is used [], for a non-zero
rank coarray, then subscript syntax (), *must*
be used too, so
allocate (c, source=b)
is not a standard comliant code.
I think the compiler should've issued
an error at this point.
Anton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's not true for ALLOCATE. I also note that Corrigendum 2 to F2008 splits constraint C633 so it now reads as follows:
C633 (R626) If an allocate-object is an array, either allocate-shape-spec-list shall appear in its allocation or source-expr shall appear in the ALLOCATE statement and have the same rank as the allocate-object.
C633a (R626) If allocate-object is scalar, allocate-shape-list shall not appear.
The syntax you have for the allocation of c is correct. I can reproduce the run-time error and will investigate. Issue ID is DPD200250387
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for the 15.0 release later this year.

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