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

Array pointers

David_DiLaura1
New Contributor I
475 Views
I have these declarations:

real(4) , target :: scriptL1(0:361,-361:361,50)
real(4), pointer:: scriptL1p(:,:)

(much) later in the routine I have

scriptL1p => scriptL1(0:361,-361:361,k)

No errors/warnings on compiling and linking. When the code is excuted I get an error flagging the second subscript in the pointer array as < 1 which (it says) is the minium value. Negative values are possible but my pointer assignment is evidently not picking that up. I am trying to point to 2D pages in a 3D array, the second subscript of which ranges into the negative. It isn't clear why I can't do this.

Thanks for any help,
David



0 Kudos
4 Replies
abhimodak
New Contributor I
475 Views
Hi David

The compiler is conforming to the standard. When you specify the the section subscripts, the pointer bounds (on each dimension) will be 1 and the appropriate upper bound. You can find out the bounds using LBOUND and UBOUND. Thus, you will get, LBOUND(scriptL1p,1) = 1,UBOUND(scriptL1p,1) = 362, and LBOUND(scriptL1p,2) = 1, UBOUND(scriptL1p,2) = 723.

Please see my post made earlier today. (http://software.intel.com/en-us/forums/showthread.php?t=67515). I think, the compiler currently cannot handle possible re-mapping of the bounds as required by the standard.

Abhi
p.s. good to see someone from "colorado.edu" :)





0 Kudos
jimdempseyatthecove
Honored Contributor III
475 Views

David, Abhi,

You might be able to use FOR_DESCRIPTOR_ASSIGN to construct the pointer you desire (non-1 based lower bounds).

Jim Dempsey
0 Kudos
David_DiLaura1
New Contributor I
475 Views
Abhi & Jim,

Thanks! Both for pointers to The Standard and toFOR_DESCRIPTOR_ASSIGN. The latter gets me what I originally wanted.

David
0 Kudos
Steven_L_Intel1
Employee
475 Views
Abhi is correct that we do not yet implement the bounds remapping feature of pointer assignment from F2003.
0 Kudos
Reply