- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am having trouble using CSHIFT with a sub-array. Maybe an example would explain this better:
*** START PROGRAM ****
INTEGER,ALLOCATABLE,DIMENSION(:)::indice
INTEGER::i
ALLOCATE(indice(0:10))
DO i=0,10
indice(i) = i
END DO
WRITE(*,*) indice
indice(3:10) = CSHIFT(indice(3:10), 1)
WRITE(*,*) indice
DEALLOCATE(indice)
**** END PROGRAM ****
I want to cshift the end of the vector so that 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 becames 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 3. But I am getting the following output:
**** BEGIN OUTPUT ****
0 1 2 3 4 5 6 7 8 9 10
0 1 2 9 9 9 9 9 9 9 9
*** END OUTPUT ***
I am using Intel Fortran Compiler for Linux (i32) 9.0
*** START PROGRAM ****
INTEGER,ALLOCATABLE,DIMENSION(:)::indice
INTEGER::i
ALLOCATE(indice(0:10))
DO i=0,10
indice(i) = i
END DO
WRITE(*,*) indice
indice(3:10) = CSHIFT(indice(3:10), 1)
WRITE(*,*) indice
DEALLOCATE(indice)
**** END PROGRAM ****
I want to cshift the end of the vector so that 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 becames 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 3. But I am getting the following output:
**** BEGIN OUTPUT ****
0 1 2 3 4 5 6 7 8 9 10
0 1 2 9 9 9 9 9 9 9 9
*** END OUTPUT ***
I am using Intel Fortran Compiler for Linux (i32) 9.0
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like a bug in early 9.0 compilers. I can see that it works properly on ifort-9.0.024 and newer compilers, including any 9.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
madmdelliot, thanks for the tip. I updated to the latest 9.1 compiler and the problem is gone. Now that was a strange one.
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