Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Reading more data than recl should allow

$
0
0

Say I have the following code (saved as mf.f90, so it's reading itself)

program recltest ! this is a longer string
  implicit none

  integer :: ios
  character(len=100) :: line

  open(unit=101, iostat=ios, action='READ', form='FORMATTED', recl=4, file='mf.f90')

  read(101, '(A)', iostat=ios) line
  print *, line

end program recltest

I would expect "prog" to be printed, which is what gfortran-compiled binary does. But when compiled with the newest Intel Visual Fortran compiler, I get the whole line. Can you please explain if I'm misunderstanding the 'recl' argument?

Thank you!


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>