- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a third party developing a C++ program which will be calling some of my IVF programs.
In order to facilitate the exchange of information, what is proposed is to share a memory space so when my DLL updates the shared space then it is immediately available to the C++ program AND the data is stored between calls to the DLL. (the specific details of this situation havent been worked out yet, I am just preparing my code in anticipation)
One issue/question I have is:
Does using Equivalence statements have any significant penalties/issues?
For economy of coding, I propose using Equivalence statements in modules to permit passing of arrays rather than the individual variables.
For example, lets say my IVF has all letters of the alphabet A-Z used in code.
In the module, I create an array
Real, Dimension(24) :: Alphabet
And then use equivalence to store the alphabet
Equivalence (Alphabet(1), A)
Equivalence (Alphabet(2), B)
Equivalence (Alphabet(24), Z)
Now we simply set up the 'shared storage' for Alphabet bymy passingeither a pointer to Alphabet, the array or however we ultimately decide to accomplish the task. The use of simple arrays reduces significantly the setup for exchange of information.
Does anyone see possible issues which may occur?
There are a hundred or so common blocks (from back in mainframe days) which were movedto modules (years ago) and now the question is how best to share the data in the modules with C++?
They are all standard real, logical & integer variables and so no C++/IVF related character/complex/etc issues.
The reason for the array, etc is most of the variables will only be used by IVF so no need to pass them all by name but we want the storage to remain static between calls to IVF.
Thanks for any assistance.
Brian
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One important tip - the shared variable(s) must be data-initialized (at least in part) to some non-zero value to make sure they get placed in the correct image section.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page