I seems that it makes more sense to put WRAP first and using polling input in element 33.
If element 33 sees WRAP it just ignores it. So no problem. So something like this
In the input file
mate 1
user,33 ! or 1
wrap 33 0.1 21
data1 3e6 1e6 00
data2 1e6 3e6 00
data3 00 00 1e6
end
Element 01
if (isw.eq.1)
call tinput(text(1),1,td,3) to get the wrap stuff
call element 33 with isw.eq.1 to read the remaining lines (you will of course have to manage the storage for the parameters, but I assume your wrapper does that already)
The in Element 33
if(isw.eq.1)
text(1) = 'xxxxx'
do while (.not.pcomp(text(1),'end',3))
errck = tinput(text,1,td,3)
if (pcomp(text(1),'data1',5)) then
d(1) = td(1)
d(2) = td(2)
d(3) = td(3)
elseif (pcomp(text(1),'data2',4)) then
d(4) = td(1)
d(5) = td(2)
d(6) = td(3)
elseif (pcomp(text(1),'data3',5)) then
d(7) = td(1)
d(8) = td(2)
d(8) = td(3)
end if
end do
I would name data1 etc. something more meaningful.