Fortran运行时错误'列表输入中项3的错误整数'

时间:2016-06-11 06:04:34

标签: fortran fortran90

我正在尝试使用open命令打开现有文件。程序编译成功但在执行时我得到此错误,表示列表输入中的项目0的错误整数。这是我用过的代码。

CHARACTER*10,DIMENSION(5) :: FN,LN
INTEGER, DIMENSION(5) :: RNO,CLASS
REAL, DIMENSION(5) :: PHY,CHEM,MATH,COMP,ENG
REAL, DIMENSION(5) :: TOT,P 
OPEN (10, FILE = 'SDA', STATUS = 'OLD')

DO I=1,5,1
READ(10,*),FN(I),LN(I),RNO(I),CLASS(I)
READ(10,*)PHY(I),CHEM(I),MATH(I),COMP(I),ENG(I)
END DO 

OPEN(21, FILE = 'FILEN', STATUS='NEW')

WRITE(21,*),'FNAME    LNAME     RNO   CLASS' 

DO I=1,5,1
WRITE(21,*),FN(I),LN(I),RNO(I),CLASS(I)
END DO    

文件内容

FNAME     LNAME      RNO   CLASS
 ALOK      TATA       4531 12
 SAMAY     SONI       4532 12
 ARJUN     MANI       4533 12
 TATWA     DAS        4534 12
 BRUCE     WAYNE      4535 12

 PHY CHE MAT COM ENG
 90. 90. 90. 80. 99.
 80. 80. 80. 70. 80.
 70. 60. 60. 70. 60.
 60. 70. 80. 90. 90.
 80. 80. 80. 80. 80. 

0 个答案:

没有答案