Automatically Opening Files [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
Automatically Opening Files
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 designators FTN01 throught FTN99, respectively. OPEN statements are
not required for these files, though a :FILE equation is usually
required. If no :FILE equation is used, and the first executed I/O
statement to that unit is not READ or WRITE, the file will be opened with
direct unformatted attributes.
If the first I/O to a unit is READ or WRITE, the format of the file is
based on the attributes of the READ/WRITE specified by the user. If the
READ is a sequential formatted READ, the file will be opened with
sequential formatted attributes.
PROGRAM main
C Write to a unit without explicitly opening it.
WRITE(50,*) 'hello world'
STOP
END
In the above program, the formal file FTN50 is opened with sequential
formatted attributes because no explicit OPEN of unit 50 is encountered
prior to the WRITE and no :FILE equation is present for FTN50.
For more information on the OPEN statement, see chapter 3, "FORTRAN
Statements".
MPE/iX 5.0 Documentation