end of file statement

I’m trying to compile a f90 program with EOF(1) statement, which “1” stands for the reference file, but PGI doesn’t recognize it. Why? Is there any other intrinsic command that I can use to refer an end of file?

PS. I have PGI Visual Fortran 10.9 VS 2010 Shell

Hi mariospapa10,

EOF isn’t standard Fortran. Try using the end or istat qualifiers to indicate the end of a file. Something like:

       read(unit, end=100) ... 
      ... processing code
100   do something else


   read(unit, iostat=stat) 
   if(stat /= 0) exit 
   .... processing code 
end do

Hope this helps,