Actems: I would say, start a new thread so that more users might benefit from it. I would reenter my answer to it.
Xwb: if this is a free format fortran file, length of line would not matter (at least not at this length).
Actems again:
check the actual size of your file 'upas_test.bin'. There might be a pitfall that is very confusing. Opening a file in your program without the status='old' clause would cause a file with this name to be entered in your directory if it was not listed allready. If you check the content of your directory after the faulty execution of your prog you will see the entry in your directory and you might overlook its actual size indicating it has no content.
So
(1) Check on the size of the file in your directory and delete it if it is 0
(2) open your files you want to read from with status='old' or action='read' only to prevent the directory entry
(3) see what happens.
Norbert.