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

Cray Integer Pointer Rank2 array?

Darrell
Beginner
614 Views
The Intel Fortran documentation on Mixed Language Programming, Handling Integer Pointers shows an example C++ program calling Fortran passing in a 1 dimensional array. How do I specify a 2-dimensional array? Starting with the following 1D example that seems to work:

integer ptr
real, dimension(*) :: data
pointer(ptr, data)

The F90 pointer code had dimension(:,:) but the compiler doesn't like that any more if I understand the error message below:
Error: If a deferred-shape array is intended, then the ALLOCATABLE or POINTER attribute is missing; if an assumed-shape array is intended, the array must be a dummy argument.

Is it possible to Reshape or Equivilance? Is there a book Dummy Arguments for Dummies? :-)

Current project requirements are preventing me from using F90 pointers or Fortran 2003 ISO_C_BINDING. I feel like I'm trapped in 1978, I'm starting to hear disco music! I could have bought new compilers for everyone in the time wasted on this. Thanks for all your help!

0 Kudos
1 Reply
Steven_L_Intel1
Employee
614 Views

You can explicitly dimenion the array, such as (10,20), but you can't use (:.:) (which implies that a descriptor was passed) nor (*,*), as the compiler would have no idea how to index the array. You can do (10,*) or the like. You can't EQUIVALENCE a Cray pointee and can't RESHAPE an assumed-size array.
0 Kudos
Reply