AIF_OPFIO

Opens a Fortran sequential file by name

Description:

This routine opens a sequential file via FIO_OPEN. Up to four attempts may be made to open the file. If a null response is supplied the file is not opened, and the flag returned indicates this fact.

Invocation

CALL AIF_OPFIO( FILNAM, ACMODE, FORM, RECSZ, FD, OPEN, STATUS )

Arguments

FILNAM = CHARACTER()
The name of the file to be opened.
ACMODE = CHARACTER()
Expression giving the required access mode. Valid modes are: READ , WRITE , UPDATE and APPEND . For details, see FIO_OPEN.
FORM = CHARACTER()( READ )
Expression giving the required formatting of the file. Valid formats are: FORTRAN , LIST , NONE and UNFORMATTED . For details, see FIO_OPEN.
RECSZ = INTEGER( READ )
Expression giving the maximum record size in bytes. Set it to zero if the Fortran default is required.
FD = INTEGER( WRITE )
Variable to contain the file descriptor.
OPEN = LOGICAL( WRITE )
If true the file has been opened.
STATUS = INTEGER( READ, WRITE )
Global status value

Method

Check for error on entry - return if not o.k. Initialise looping flag Do while no error obtaining the name and opening the output file and maximum number of attempts not exceeded Get file name and open file If error occurred then If abort requested, do so Increment loop counter If maximum number of attempts not exceeded then Report error Else Set looping flag to exit Endif Else Set flag to indicate that the file has been opened Set looping flag to false Endif Enddo If error then Report and abort Endif Return

Bugs:

None known.