I understand, that a Fortran 95 program, when ending, gives up all its allocated memory to the system, so no deallocation is necessary and memory leaks cannot occur at that time.
Is this also true for Fortran DLL's called from, f.i., C# at returning to the calling program?
I have Fortran routines in a DLL called from C#, and I use the "deallocate" command in the Fortran routines to make sure that all local arrays in the Fortran routines have been deallocated before exiting back to the C#. Deallocating the Fortran arrays allows changes in the C# GUI to the input values so that the Fortran routines can be called again. Is this what you want to do? I also avoid using the "stop" command in the Fortran DLL routines as that can freeze the program. I've found it is better to return an error message or flag from the Fortran DLL to the C# code.