Predefined Units and Files [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Programmer's Guide
Predefined Units and Files
Units five and six are the predefined I/O units for FORTRAN 77. These
units are opened by the I/O library before the first I/O statement is
executed. Unit five is opened as formal file designator FTN05, which
defaults to $STDINX. ($STDIN is not the default; this prevents logging
off if an input line of :EOF is entered and allows input of lines
containing a colon in the first position.) The formal designator for
unit 6 is FTN06, which defaults to $STDLIST. Both FTN05 and FTN06 are
first opened by FOPEN as MPE/iX OLD or TEMP files so they can be
redirected by a :FILE equation. If no file or file equation exists for
FTN05 or FTN06, another FOPEN is executed to open the files as NEW MPE/iX
files.
For example, using the equation
:FILE FTN06 = outfile
with the FORTRAN 77 statement
WRITE(6,*) " This will be diverted into the file 'outfile'."
causes the output to be written to the file outfile instead of to the
terminal.
FTN05
Unit five is first opened with FOPTIONS of octal 157, which opens $STDINX
as an OLD or TEMP ASCII file with variable length records. If there is
no existing file (or file equation) for FTN05, the first FOPEN fails and
another FOPEN is attempted with FOPTIONS of octal 154. Octal 154 has the
same file characteristics as octal 157, except a NEW file is requested.
The AOPTIONS for both calls are octal 300, requesting read-only, shared
access to the file. Shared access is requested in case FORTRAN 77 I/O is
performed from subprograms called from another language that might have
already opened $STDINX. Access is denied if exclusive access was
requested.
FTN06
Unit six is first opened with FOPTIONS of octal 517, which opens $STDLIST
as an OLD or TEMP ASCII file with variable length records and with
carriage control. If there is no existing file (or file equation) for
FTN06, the first FOPEN call fails and another FOPEN is attempted with
FOPTIONS of octal 514. Octal 514 has the same file characteristics as
octal 517, except a NEW file is requested. The AOPTIONS for both calls
are octal 301, requesting write-only, shared access to the file.
FTN01 Through FTN99 (Excluding FTN05 and FTN06)
For compatibility with FORTRAN 66/V, the FORTRAN 77 I/O library
automatically opens units 1 through 99 (excluding 5 and 6) to the formal
file desginators FTN01 through FTN99, respectively. OPEN statements are
not required for these files, though a :FILE equation is usually required
(as it is in FORTRAN 66/V).
Units 0 and those greater than 99 must be opened with an OPEN statement
before being used.
MPE/iX 5.0 Documentation