Here is a simple example of a polling input structure. It uses keyword,value pairs in any order. It continues reading until it finds a blank line. The pairs are CP,# ; CS,# ; AX , where the presence of AX simply flips the value of UD(3).
character*15 text(1)
real*8 td(1),ud(*)
text = 'start'
ud(3) = 0.d0 ! default value for ud(3) flag
do while (.not.pcomp(text,' ',4))
errck = tinput(text,1,td,1)
if (pcomp(text,'cp',2)) then
ud(1) = td(1)
elseif (pcomp(text,'cs',2)) then
ud(2) = td(1)
elseif (pcomp(text,'ax',2)) then
ud(3) = 1
endif
end do