Note that every function starting with "DB" is a call to the SILO library. I've double-checked the SILO documentation and as far as I can tell I am invoking these methods properly (I've also double-checked that against some sample SILO code, which when on its own compiles and runs fine).
There are no compile or runtime errors. But when I watch the contents of the private variable "data", they mysteriously change. I've pinpointed the line at which they change, and it is the line I have commented above with the !!!! (ie: it's the DBCreate line). Strangely, the DBCreate line is passed NO information pertaining to "data", and there are no pointers to "data" or any other way in which "data" could be in scope inside the function DBCreate().
However, when I run it in a debugger, just before calling DBCreate I have:
(gdb) p data[614]
$1 = 0.904355466
And immediately after the DBCreate line I have:
(gdb) p data[614]
$2 = 4.17010799e-34
I just used the index 614 as an example... some entries in the "data" array change, and some don't. 614 happens to be one of those that changes.
How could the data at this memory location be changing? I get no errors, no seg faults, or anything like that. And the DBCreate() routine should have nothing to do with the "data" array, as far as I can tell, and yet according to the debugger it seems to be the line that is causing the memory contents to change.
Hopefully I am just overlooking something simple, but right now I am quite baffled by this. Any insights would be very helpful!
The data is initialized by the class. It is passed to DBPutQuadvar1 because DBPutQuadvar1 is the routine that outputs the data to a file. If you are interested, I have more code and more discussion on this here:
iharrold: I was wondering the same thing. If that were the case, though, how would I fix it? And, wouldn't I receive a runtime error?
kbw: Thanks for posting the link. That code is doing essentially the exact same thing my code is doing. That will be helpful for a side-by-side comparison.