Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28991 Discussions

An error with FOR_DESCRIPTOR_ASSIGN subroutine

Tetsuzin
Beginner
699 Views

Hi, I'm using intel fortran compiler 10.1.13 and VS2005 and I currently have a problem in using FOR_DESCRIPTOR_ASSIGN subroutine. Take a look on this simply example:

use ifcore
implicit none
integer(4), pointer :: a(:)
integer(4), allocatable::buffer(:)
type(FOR_DIMS_INFO) dims_info(1)

integer::i, N

N=10

allocate(buffer(1:N))

do i=1,N
buffer(i)=i
enddo

dims_info(1)%LOWERBOUND = 0
dims_info(1)%UPPERBOUND = N-1
dims_info(1)%STRIDE = 1

call FOR_DESCRIPTOR_ASSIGN(&
a, &
LOC(buffer(1)), &
4, &
FOR_DESCRIPTOR_ARRAY_DEFINED .or. &
FOR_DESCRIPTOR_ARRAY_NODEALLOC .or. &
FOR_DESCRIPTOR_ARRAY_CONTIGUOUS, &
1, &
dims_info)

print *,a(0)

end

The resuls of this programm is:

forrtl: severe (408): fort: (3): Subscript #1 of the array A has value 0 which is less than the lower bound of 1

But lower bound of a must be 0 and upper bound must be 9

What do I do wrong?

PS. Sorry for my English.

0 Kudos
5 Replies
Tetsuzin
Beginner
699 Views

Well, I think I am doing everything right and this is BUG offortran compiler.

The same error on x64 platform.

0 Kudos
Steven_L_Intel1
Employee
699 Views
There is more than just the bounds being wrong - the array location is wrong too. I'll analyze this and see what is going on.
0 Kudos
Steven_L_Intel1
Employee
699 Views
It is just the bounds - no matter what you say for the lower bound, it sets the descriptor lower bound to 1. I'll report this to the developers.
0 Kudos
Tetsuzin
Beginner
699 Views

Thank you for help and analyze. I'll be waiting for the compiler updates.

0 Kudos
Steven_L_Intel1
Employee
699 Views
I would recommend that you submit a problem report to Intel Support and reference T83625-CP. I can probably come up with an alternative for you in the next couple of days.
0 Kudos
Reply