- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to assign an array to an array section with a vector subscript:
program test integer, dimension(3) :: model, mesh integer, dimension(1, 3) :: permutation permutation(1,:) = [1, 2, 2] mesh(:) = model(permutation(1,:)) end program test
Compiling with -check, I get:
test.f90(6): error #5581: Shape mismatch: The extent of dimension 1 of array MESH is 3 and the corresponding extent of array MODEL is 1 mesh = model(permutation(1,:)) ---------^ compilation aborted for test.f90 (code 1)
My suspicion is that in this context, the array section I've selected from permutation is incorrectly rank 2. If, however, I force it to rank 1 with reshape(permutation(1,:), [3]), no error is raised.
I've tried ifort versions 19.1.0.166 and 19.0.3.199
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It has nothing to do with rank. The compiler's new shape checking feature is getting confused, thinking that the extent of model(permutation(1,:)) is 1 instead of 3. Please report this bug using the Intel Online Service Center.
For now you can disable shape checking, a new feature in compiler 19.1.
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