can't be this simple, can it?
Had you not said you are "totally new to Fortran" i'd remain silent because i'm totally rusty on it.
I think a Fortran "read" of an already dimensioned variable will try to fill the whole array.
so line 6 tells line 15 how much reading he has to do.
my last Fortran was about 1986 - maybe somebody who's fresher can confirm or correct.
i would have used at least an implied do , for sake of next guy, or commented.