I\'m writing my code and using input and output feature in Fortran. The code looks like this (only for simplification):
PROGRAM TEST
REAL, DIMENSION(
I've found the answers. Actually the code I've posted above will run well on Gfortran 5.3, since I used OPEN(UNIT=1,...)
and OPEN(UNIT=2,...)
which is there will be no problem since I am using 1
and 2
. I just wrote this simple case to represent my real code without checking it first. But actually in my real code, I used two statements that OPEN(UNIT=5,...)
and OPEN(UNIT=6,...)
existed, which are not allowed in Fortran, since:
UNIT=5
declares Standard In
which is used to read in data from the keyboard.UNIT=6
declares Standard Out
which is used to print general output to the screen.UNIT=0
declares Standard Error
which is used to print error messages to the screen.I didn't realize before since I'm working on quite old code, so O need to rewrite it into a newer version one. So, in order to avoid the problems, just don't use UNIT=5
, UNIT=6
and UNIT=0
.