AIF_ASFIO

Opens a sequential file via a parameter

Description:

This routine opens a sequential file via FIO_ASSOC. 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_ASFIO( PNFILE, ACMODE, FORM, RECSZ, FD, OPEN, STATUS )

Arguments

PNFILE = CHARACTER()
Parameter name by which file is 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 null returned then Set flag so that a log file will not be created Annul the error Exit from the loop Else 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 Cancel parameter used to get filename 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.