Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

unit number

intelhelp2009
Beginner
747 Views
How to find which unit number represents which device? For example, in

open (unit =8, ...)

what does "8" represent?

Thanks!
0 Kudos
2 Replies
TimP
Honored Contributor III
747 Views
Quoting - intelhelp2009
How to find which unit number represents which device? For example, in

open (unit =8, ...)

what does "8" represent?

A few brands of Fortran (not Intel) would pre-assign unit 8, perhaps as error output, or a shell command might have assigned it. OPEN normally would over-ride any pre-connection. Otherwise, choice of 8 or some other number would be arbitrary, but OPEN would have to specify a device or file name. Fortran INQUIRE gives your program some facilities to find out the properties associated with a unit.
0 Kudos
Steven_L_Intel1
Employee
747 Views
The intrinsic module ISO_FORTRAN_ENV defines constants for the default input, output and error units. However, if you OPEN the unit, that is overridden, Unit 8 has no special meaning in Intel Fortran. You can use INQUIRE to see if a file is opened on a unit and, if so, what its name is.
0 Kudos
Reply