f90_preconn_io— Module controlling automatic file preconnection
Note that in the descriptions below,
LOGICAL(*) means any kind of
Also, note that although the
VERBOSE argument is an optional argument,
the actual argument is not permitted to be a non-present optional dummy
SUBROUTINE GET_PCIO_OPTIONS(BLANK,POSITION,PREFIX,VERBOSE) CHARACTER(*),OPTIONAL,INTENT(OUT) :: BLANK,POSITION,PREFIX LOGICAL(*),OPTIONAL,INTENT(OUT) :: VERBOSE
Returns the current settings for file preconnection; the meanings for these
settings are described under the
POSITION values are returned in upper case,
even if lower case was used in a call to
IOINIT to set them.
SUBROUTINE IOINIT(BLANK,POSITION,PREFIX,VERBOSE) CHARACTER(*),OPTIONAL,INTENT(IN) :: BLANK,POSITION,PREFIX LOGICAL(*),OPTIONAL,INTENT(IN) :: VERBOSE
This procedure controls automatic file preconnection. Files can be automatically preconnected when a logical unit is initially referenced without an OPEN statement; preconnection does not occur again after file CLOSE.
The name of the file to be preconnected is determined first by searching
for an environment variable of the form
FORTnn where nn is the
two-digit logical unit number; e.g.
If this environment variable is found its value is used as the filename;
otherwise the name “
fort.n” is used; e.g.
The file is opened either with
FORM='UNFORMATTED' depending on whether the initial reference is with
a formatted or unformatted i/o statement.
POSITION arguments control the
POSITION= keywords in the implied
OPEN statement when the file is
initially these are set to
Note that these have no meaning (and no effect) for unformatted files.
PREFIX argument changes the prefix used to find the environment
variable containing the preconnected file name.
Initially this is ‘
Only the first 30 characters of
PREFIX are used.
VERBOSE argument controls activity reporting; if it is
.TRUE., subsequent preconnection activity will produce informative
messages on the standard error unit.
USE F90_PRECONN_IO CALL IOINIT(BLANK='ZERO',PREFIX='MYFILE') READ (99,10) I,J,K,L,M 10 FORMAT(I3,I1,I3,I1,I3)When the READ statement is executed, the environment variable
MYFILE99is interrogated to discover which file is to be automatically preconnected to unit 99. The unit will be connected with
BLANK='ZERO'. If no environment variable is found the file ‘
fort.99’ will be opened.
Please report any bugs found to ‘email@example.com’ or ‘firstname.lastname@example.org’, along with any suggestions for improvements.