character(:), allocatable :: word
word = ""
read (*,*) word
write (*,*) word, len(word)
end
It seems "word" is not reallocated
when READ statement is executed.
len(word) always returns 0.
16-007 in 6.7.3.2p7 says "When an intrinsic assignment
statement (7.2.1.3) is executed, any noncoarray
allocated allocatable subobject is deallocated."
I cannot see from 7.2.1.2 or 7.2.1.3
whether reading character variable
from input_unit is an intrinsic assignment or not?
Thanks
Anton
|