Few additional precisions:
- 7 is a UNIT number in FORTRAN terminology but CHANNEL is probably more understandable
- do not use file units between 1 and 7 : they are often used for special devices (6 was associated to the printer which is replaced today by the console). 7 was reserved to card punch (the old days of computer science). 1 is often the standard output unit (<=> 6), 2 is often the error unit, 5 is the input unit.
In the past, the maximum unit index was 99. This is not true anymore but I continue to apply that limit.
It is better to use * instead of 5 (in READ statement) and 6 (in WRITE statements) because neither 5 and 6 are defined by the FORTRAN norm (but 5 and 6 are accepted by all the FORTRAN compilers).
If you do not open a unit explicitely, then the compiler may (or not) open a file with a predefined name. For instance, as the punch card device does not exist anymore, the compiler may create a file with the name fort007.dat (for instance)