- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
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!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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