In my main program I have a double precision array: FPROPS_OLD(9).
This array is NOT included in the arguments that are sent to the DLL's
subroutine. However, everytime the subroutine is called it changes
FPROPS_OLD(1) to exactly zero.
FPROPS_OLD is not declared in any modules. I have also searched the
DLLs source code to check for any variable also named FPROPS_OLD
(which shouldn't matter anyway right?). I have even changed the name
of the variable in the calling program - and the DLL still changes the
first value to zero.
If I change FPROPS_OLD to an allocatable array - the first value does
not get changed and everything works fine. However, I still want to
find out what's going on - since it may be accessing and changing
other variables that I don't know about yet.
Any ideas on what can be going on? For what it's worth the DLL and the
calling program were both compiled on the same machine using Intel 9.1
Thank you
W/O anything to look at, my guess is your DLL and the calling program
have a mismatch in the argument/calling protocol somewhere.
Have to see the definition of the DLL interface and the calling program
to be able to diagnose the precise problem.
I'd recommend going back to the sample DLL projects w/ the Intel
compiler and building it to confirm you have project settings correct.
Then either modify that interface for your needs or compare the working
sample w/ your project to find and fix the incompatibility.
--
Which variable is declared just before FROPS? Is it passed as an
argument to the DLL? It sounds as though something in the DLL is
writing out of bounds, either due to a bug in the DLL or due to an
argument mismatch between the DLL and the calling program.
I suspect that an allocatable array is not going to be stored in
memory contiguous to your main memory variables.
You also mention double precision. If you pass a single precision
array to a routine which is expecting a double precision array, then
in bounds access to the subroutine's double array will effectively be
out of bounds access to a single precision array.
---- e
If debugging was easy, there would be no computer bugs!
Stack misalignment?
Then what would we spend all our time doing?