- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include "../lib/probeLocations.H" int main(int argc, char *argv[]) { probeLocations(argc, argv); return 0; }
I need to call the C++ function probeLocations from f90 main code. How do I pass argc and argv from F90?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't - those are strictly C/C++ notions, though it might be possible to construct equivalents with some effort.
The Fortran language provides extensive C interoperability features, extended in Fortran 2015 - Intel Fortran supports those. Note that I said C and not C++; you can use C++ as long as you restrict that side to what looks like C (extern "C", etc.)
There's no point in talking about "F90". Say "Fortran" instead.
What does this probeLocations do? You may be able to accomplish this from Fortran directly. Does it actually use argc and argv?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
albert k. wrote:
.. How do I pass argc and argv from F90? ..
I concur, please just refer to Fortran.
Also, you can look into Fortran standard intrinsic functions of GET_COMMAND_ARGUMENT and COMMAND_ARGUMENT_COUNT
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page