Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fortran implicit open

netphilou31
New Contributor III
585 Views

Hi all,

I would like to know if it is possible to disable the 'implicit open' feature of CVF and IVF languages. I explain; when doing I/O operations on unopened files, the runtime library automatically createsa file named 'fort.n' (n being the logical unit to be accessed and I don't want to use the FORTn environment variable because n can take many values). I would prefer to get an error message instead of this behavior. Is it possible ? (my goal is to build a dll in which I don't want to have problems with Vista in case of the file to be accessed has been disconnected for any reason and when I am not sure where the implicit file will be created).

Thanks.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
585 Views
That's a feature of the Fortran language, not any specific compiler, and you can't disable it.

I'd think that a simple check (using INQUIRE) when your DLL first wants to access the unit should be sufficient. Once the first I/O is done, the unit won't become disconnected without being closed first.
0 Kudos
netphilou31
New Contributor III
585 Views

Thank you steve,

This is what I was thinking but I wanted to be sure. My main concern is about how to manage I/O operations to a file that has been (for any reason) disconnect by a unwanted close.

Regards.

0 Kudos
Steven_L_Intel1
Employee
585 Views
If this is a concern for you, then start out every routine with an INQUIRE (UNIT=n,OPENED=logvar) , and make sure that the unit is opened.
0 Kudos
Reply