The following program should print “1”:
program main
integer :: x
character(len=10) :: s
s = ' ' // achar(10) // '1'
read(s, *) x
print *, x
end program main
However, when I try to compile this with PGI 17.4 community edition, I get the following error:
FIO-F-217/list-directed read/internal file/attempt to read past end of file.
In source file readnl.f90, at line number 5
This example works fine with both gfortran and ifort.