Description:
Translate the
value of IOSTAT to an FIO error code and report the corresponding error message.
Invocation
CALL FIO_REP( UNIT, FNAME, IOSTAT, MESS, STATUS )
Arguments
UNIT = INTEGER (Given)
The Fortran I/O unit number.
FNAME = CHARACTER
(
) (Given)
The
name of the data file.
IOSTAT = INTEGER (Given)
The value of IOSTAT from a Fortran I/O statement.
MESS
= CHARACTER
( )
(Given)
An error message to be output.
STATUS = INTEGER (Given and Returned)
The global
status.
Examples:
CALL FIO_REP( UNIT, ’ ’
, IOSTAT, ’ ’
, STATUS )
This will inquire the name
of the file that is connected to UNIT and report an error message containing the unit number file
name and which error occurred. CALL FIO_REP( UNIT, ’ ’
, IOSTAT, ’Failed to open
FNAME’,
STATUS )
This example provides an explicit error message containing the token FNAME. Notes:
-
This routine sets the message tokens UNIT, FNAME and IOSTAT. They can be given in the text of the
error message.
-
FNAME can be a general character string, a hyphen or blank. If FNAME is a general character string,
it is used as the name of the file when reporting the error message. If FNAME is blank, then this
routine uses INQUIRE to find the name of the file. If FNAME is a hyphen, then this routine does not
set the token FNAME. It should be set before calling this routine if a sensible error message is to be
produced.
Copyright © 2000 Council for the Central Laboratory of the Research Councils