- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a problem with a program, and reduced it to this mini-program:
program SEC_TEST
! To test passing array sections to a procedure.
implicit none
integer :: i, N=8
real,allocatable :: X(:)
ALLOCATE (X(0:N))
do i = 1, N
X(i) = i
enddo
print '(" X values stride 1:", 9f6.1)', X(0:N)
print '(" X values stride 2:", 9f6.1)', X(0:N:2)
print '(" X values stride 4:", 9f6.1)', X(0:N:4)
print *
call SUB (X(0:N), N)
call SUB (X(0:N:2), N/2)
call SUB (X(0:N:4), N/4)
DEALLOCATE (X)
end program SEC_TEST
subroutine SUB (X, N)
integer :: N
real :: X(0:N)
print '(" Passed X values :", 9f6.1)', X(0:N)
end subroutine SUB
The output is this:
X values stride 1: 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0
X values stride 2: 0.0 2.0 4.0 6.0 8.0
X values stride 4: 0.0 4.0 8.0
Passed X values : 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0
Passed X values : 0.0 1.0 2.0 3.0 4.0
Passed X values : 0.0 1.0 2.0
This is not what is supposed to happen. What is wrong?
Dieter Britz britzchem.au.dk
program SEC_TEST
! To test passing array sections to a procedure.
implicit none
integer :: i, N=8
real,allocatable :: X(:)
ALLOCATE (X(0:N))
do i = 1, N
X(i) = i
enddo
print '(" X values stride 1:", 9f6.1)', X(0:N)
print '(" X values stride 2:", 9f6.1)', X(0:N:2)
print '(" X values stride 4:", 9f6.1)', X(0:N:4)
print *
call SUB (X(0:N), N)
call SUB (X(0:N:2), N/2)
call SUB (X(0:N:4), N/4)
DEALLOCATE (X)
end program SEC_TEST
subroutine SUB (X, N)
integer :: N
real :: X(0:N)
print '(" Passed X values :", 9f6.1)', X(0:N)
end subroutine SUB
The output is this:
X values stride 1: 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0
X values stride 2: 0.0 2.0 4.0 6.0 8.0
X values stride 4: 0.0 4.0 8.0
Passed X values : 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0
Passed X values : 0.0 1.0 2.0 3.0 4.0
Passed X values : 0.0 1.0 2.0
This is not what is supposed to happen. What is wrong?
Dieter Britz britz
Link Copied
13 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like a good case for a problem report on you premier.intel.com account. I got the same result with ifort 10.0.026 32-bit, while it works correctly with gfortran 4.3.0 20070824.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was hoping that Steve Lionel would see this and react. How do I make
a problem report? I can log in, but where do I go from there?
a problem report? I can log in, but where do I go from there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Britz,
The following is a work around (until the bug is fixed)
program
SEC_TEST! To test passing array sections to a procedure.
implicit noneinterfacesubroutine SUB (X, N)integer :: Nreal :: X(:)end subroutine SUBend interfaceinteger :: i, N=8real,allocatable :: X(:)ALLOCATE (X(0:N))do i = 0, NX(i) = i
enddoprint '(" X values stride 1:", 9f6.1)', X(0:N)print '(" X values stride 2:", 9f6.1)', X(0:N:2)print '(" X values stride 4:", 9f6.1)', X(0:N:4)print *call SUB (X(0:N:1), N)call SUB (X(0:N:2), N/2)call SUB (X(0:N:4), N/4)DEALLOCATE (X)end
program SEC_TESTsubroutine
SUB (X, N)integer :: Nreal :: X(:)print '(" Passed X values :", 9f6.1)', Xend subroutine
SUBUse an inteface block for the subroutine and defered shape
*** Note that the subscripts inside the SUB
are 1:N+1. So you may have to muck around with
with the indexing
integer :: SliceHack = 1
do I=0, N
X(I+SliceHack) = ...
or
do I=0+SliceHack,N+SliceHack
X(I) = ...
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You submit problem reports to Intel Premier Support, as described in the product documentation. You can start here.
This problem sounds vaguely familiar to me but I can't readily find it in our tracking system.
This problem sounds vaguely familiar to me but I can't readily find it in our tracking system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you report this, please reference T80051-CP. Curiously, replacing ALLOCATABLE with POINTER makes it behave correctly. The developers here are very puzzled by this bug and are looking at it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aaargh, sorry, I didn't see the bit about the reference number until after
I submitted the problem.
Dieter
I submitted the problem.
Dieter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attach a comment to your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dieter,
I can't see any recent submission from you. What's the issue number?
I can't see any recent submission from you. What's the issue number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This bug has been fixed in our sources - it affects allocatable arrays only. The fix will appear in a future update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A workaround is to add the switch "-switch fe_not_contig".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am told that the issue has now been resolved (quick action!). But when I
check up on the latest update, it seems to be from 24. August. So I had
better wait a bit before updating.
I carefully read the documentation that came with the installation, and I do
not find instructions on how to update. How do I do it, please? Is it a new
installation, which replaces the one already in place, or is it a simpler process?
check up on the latest update, it seems to be from 24. August. So I had
better wait a bit before updating.
I carefully read the documentation that came with the installation, and I do
not find instructions on how to update. How do I do it, please? Is it a new
installation, which replaces the one already in place, or is it a simpler process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lately, the linux compiler update installations have been independent of previous ones. Each update suggests installing in a new directory, so that the old ones remain available until removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is resolved only in the sense that a fix has been checked in to the compiler sources. You won't see it until a future update - the support engineer who is handling your issue is supposed to let you know when the update with the fix is available.

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