As the following test program illustrates, list-directed input of data works correctly with integer and real data, but fails with logical data when the input data contains items with the r*v (value v, repeat count r) format.
program ListRead
implicit none
integer i,ijk(5)
logical :: ljk(5)
real :: rjk(5)
character(len=9) :: iolog = 't 2*f 2*t', ioint = '2 2*3 2*5'
character(len=15) :: ioreal = '2.0 2*3.0 2*5.0'
!
read(ioint,*)ijk
write(*,'(1x,I4,2x,I3)')(i,ijk(i),i=1,5)
read(ioreal,*)rjk
write(*,'(1x,I4,2x,F6.1)')(i,rjk(i),i=1,5)
read(iolog,*)ljk
write(*,'(1x,I4,2x,L1)')(i,ljk(i),i=1,5)
end program
The runtime error is 'Error 52. Invalid character in field. LISTREAD - in file lio.f90 at line 13 [+02d3]' The same problem occurs when data is read from a file using list-directed input when the input contains, for example, the following record:
t 2*f 2*t