- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can C++ program access data in allocatable array defined in Fortran Module? My C++ program can access scalar values defined in Fortran module, but got error "symbol not found" when tried to access fixed-size & dynamic arrays. Please help!
Thanks!
Can C++ program access data in allocatable array defined in Fortran Module? My C++ program can access scalar values defined in Fortran module, but got error "symbol not found" when tried to access fixed-size & dynamic arrays. Please help!
Thanks!
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an interesting question, and I haven't seen a full answer to it. You are more likely to get that answer on the Fortran linux forum.
Legacy programs are likely to use the Cray pointer facility for dynamic arrays to be shared between C++ and Fortran, but I certainly don't advocate that. Fixed size single subscripted Fortran arrays are seen in C as a pointer to the first element of the array. When you say "symbol not found," do you mean a link error?
Legacy programs are likely to use the Cray pointer facility for dynamic arrays to be shared between C++ and Fortran, but I certainly don't advocate that. Fixed size single subscripted Fortran arrays are seen in C as a pointer to the first element of the array. When you say "symbol not found," do you mean a link error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi tcprince,
Thank you for your reply!
"Symbol ... not found" was shown when I ran debugger. I made some progress after I posted my question yesterday. Now my C++ program can access scalar data, data of fixed-size arrays. But it still cann't access data of dynamic arrays, meaning values are worng.
I would appreciate any ideas, suggestions.
Thanks,
Wendy
Thank you for your reply!
"Symbol ... not found" was shown when I ran debugger. I made some progress after I posted my question yesterday. Now my C++ program can access scalar data, data of fixed-size arrays. But it still cann't access data of dynamic arrays, meaning values are worng.
I would appreciate any ideas, suggestions.
Thanks,
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
are they multi dimensional arrays?
fortran accesses data column wise (ie first index is cycled through first)
C accesses data row wise (ie cycles through last index of the array)
fortran accesses data column wise (ie first index is cycled through first)
C accesses data row wise (ie cycles through last index of the array)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DAVE!
Nice to see you here. Keep up those great questions and answers!
cheers
jdg
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