Set dimension of loop variable.
Throw if input file does not exist.