The open statement shown lives in some code which can be built into either a .exe or a DLL. The open behaves as expected when running the .exe and returns a iostat of 0 in normal circumstances (the file exists and is not open elsewhere).
open(32, file='file.bin', form='unformatted', access='transparent', status='old', iostat=ios)
Sometimes, when the code is running as a DLL (invoked by a C# .NET process), an iostat value of 1 comes back. This result is consistent in that if I run the test again the same iostat value is returned. It also seems spurious in that if I make a completely unrelated change to some other part of the code, the problem can go away, only to return again later when I make some other unrelated change to some other part of the code.
Apart from asking for ideas on how I can investigate this further, I do have two specific questions:
Is there a genuine set of circumstances in which this open can return an iostat value of 1? According to FTN95 help this code translates to 'Floating point arithmetic over flow'.
Are there some rules and guidelines I ought to be aware of in order to get a FORTRAN DLL involving I/O to work reliably when invoked by a .NET process?
Thanks, John