| [Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode Program t
  Implicit None
  Integer, Parameter :: row = 3
  Integer, Parameter :: col = 4
  Real :: a(1:row,1:col)   
  Integer :: i,j  
  Open(11,file='in.txt')
   Do i = 1,row
    Do j = 1,col
      a(i,j) = 10*i+j
      Write(11,*) a(i,j)
    Enddo
  Enddo
  ! read the array==============================================
  Do i = 1,row
    Do j = 1,col
      Read(11,*) a(i,1)
    Enddo
  Enddo
  Close(11)
End Program t我甚至直接读入刚写进去的数组,编译通过,执行错误报错如下:
 “At line 17 of file testofarray01.f95 (unit = 11, file = 'in.txt')
 Fortran runtime error: End of file”
 
 
 |