! Is ifort destorying 0x1fff-0x2000 character in nonadvancing stream?
! the file has 84 lines, on each line 99 'a' characters + 0x0A new line
program fread_test
  implicit none
  integer, parameter            :: nin=55
  character(30), parameter      :: fname='ifort1fff_test3.txt'
  character(len=101)            :: buffer
  integer                       :: i, j, readlen
  continue

  write(*,*) 'Reading ', fname

  Open (nin,File=fname,Access='STREAM',Form='FORMATTED', &
            Status='OLD',Action='READ')
  
  do i=0,82
    Read (Unit=nin,Fmt='(A)',Advance='no',Size=readlen,eor=120,End=100) buffer
    120 continue

    j = verify(buffer(1:99),'a')
    if (j/=0) then
      write(*,*) 'error at reading section starting at ',i*100
      write(*,*) 'wrong character at ',j,' with iachar=',iachar(buffer(j:j))
      write(*,'(1x,A,A,A)') 'read : >',buffer(1:readlen),'<'
    else
      write(*,*) 'Section ',i,' ok, read ', readlen
      !write(*,*) '>',buffer(1:readlen),'<'
    end if
  end do

  close(unit=nin)

  100 continue
end program fread_test

