title: Fortran runtime error: End of file in gfortran
body: <p>When I run this program using gfortran test.f95, it shows an error</p>
  
  <pre><code>At line 10 of file test.f95 (unit = 15, file = 'open.dat')
  
  Fortran runtime error: End of file
  </code></pre>
  
  <p>Can someone tell me what is wrong here?</p>
  
  <pre><code>implicit none
  integer:: a,b,c,ios
  
  open(unit=15,file="open.dat",status='unknown', action='readwrite',iostat=ios)
  open(unit=16,file="open.out",status="unknown",action='write')
  
  do a=1,100
    write(15,*)a
  end do
  
  do c=1,45,1
    read(15,*)
    read(15,*)b
    write(16,*)b
  end do
  
  stop
  end
  </code></pre>