Recall that unit 5 (by default) is the keyboard. But what is unit 7? Look above the DO loop, and you will see the statement
OPEN(UNIT=7, FILE='filename')
What this says is to use the file 'filename' as unit 7. After this statement is executed, when we read from unit 7 we are reading from the file 'filename'.