open() and ifc

open() and ifc


I got a question about the open() statement in ifc. the situation: when opening an unformatted file with no filename specified all works fine if one requires
status='unknown' BUT if one asks for status='new' the
command returns with an error even if that file does not exist in the filesystem. This might be subtle, but
I would expect no error condition. Is this a feature of ifc? g77 in comparison reacts identical for both cases
with no error condition.

anton empl

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

STATUS='NEW' imposes a positive requirement that the file being opened not exist already. The Intel Programmer's Reference says for STATUS = 'NEW'
"Creates a new file. FILE= must also be specified and the named file must exist."
A file parameter is similarly required for status of OLD or REPLACE. There is no positive requirement on the file status for STATUS='UNKNOWN', so FILE can be omitted and a processor-dependent filename used.
FILE= must be omitted when STATUS='SCRATCH'.

This closely parallels the language in the Fortran 95 standard. Apparently, g77 has implemented an extension.


thanks for the quick response - I did check and requiring the file= seems to be standard fortran 77 as you said in case of both NEW and OLD.

I do have another quick question. Is it possible to trigger
a coredump for ifc compiled programs? I tried with arguments
to the compiler but only achieved to get plenty of output
(that was a few versions ago though) on the screen rather than a file one good inspect using the debugger.

thanks again for the answer,
anton empl

Correction, I have just learned (from Steve) that you can get a core dump by CALL ABORT. The catch is, the shell default maximum size for a coredump is zero, which suppresses the dump. You must reset it, eg. ulimit -c 100000000 (bash) or limit coredumpsize 100000 (csh). You must also build your app with -Vaxlib , to link in the portability library.


Leave a Comment

Please sign in to add a comment. Not a member? Join today