*======================================================================* subroutine ver_parse_rec(line, line2, jvol) *----------------------------------------------------------------------* * bla.. *----------------------------------------------------------------------* implicit none character*(*) line, line2 integer jx,nd,ne,nf,ng,dummy common /slate/nd,ne,nf,ng,dummy(36) include 'ver_geom.inc' integer jdate, i, icnext, j, ixyz, ivol, ilast, lnblnk, & icopy_seen, icopy_req, jvol, nmedtmp, last character*80 comment, frmt character*7 nametmp character*4 shapetmp integer luntty data luntty / 6 / *----------------------------------------------------------------------* jx = icnext(line,1,132) ! cern M432 read(line(jx:ne),'(i6)') jdate ! read the timestamp jx = icnext(line,ne,132) read(line(jx:jx+3),'(a4)') nametmp(1:4) ! read the volume name call cltou(nametmp) jx = icnext(line,ne,132) ! read shape read(line(jx:jx+3),'(a4)') shapetmp jx = icnext(line,ne,132) ! and medium read(line(jx:ne),*) nmedtmp jx = icnext(line,ne,132) read(line(jx:ne),*) icopy_seen ! read the copy number write (nametmp(5:7),'(i3)') icopy_seen ! add it to the name ! ivol = (index(all_names,nametmp)+6)/7 ! Fast search c write (6,*)' ivol=', ivol if (ivol.le.0) return !---------------! no request for this name ! else: name(ivol) = nametmp(1:4) ! copy to common call cltou(shapetmp) shape(ivol) = shapetmp ! what we've already read icopy(ivol) = icopy_seen ! '' nmed(ivol) = nmedtmp ! '' ! Now get the rest: jx = icnext(line,ne,132) read(line(jx:jx+3),'(a4)') mother(ivol) call cltou(mother(ivol)) jx = icnext(line,ne,132) read(line(jx:ne),*) position(1,ivol) jx = icnext(line,ne,132) read(line(jx:ne),*) position(2,ivol) jx = icnext(line,ne,132) read(line(jx:ne),*) position(3,ivol) jx = icnext(line,ne,132) read(line(jx:ne),*) irota(ivol) ! not irot_id jx = icnext(line,ne,132) read(line(jx:ne),'(a4)') only(ivol) jx = icnext(line,ne,132) read(line(jx:ne),*) iseen(ivol) jx = icnext(line,ne,132) read(line(jx:ne),*) icol(ivol) jx = icnext(line,ne,132) ! If comment display if (jx.lt.132) then if (line(jx:jx).eq.'+') then ! is requested, show it. ilast = max(lnblnk(line),jx+1) read(line(jx+1:ilast),'(a80)') comment last = lnblnk(comment) + 1 write (frmt,10) last 10 format('(i4,2x,a4,i4,'' : ''a',i2.2,')') write (luntty,frmt) ivol, name(ivol), icopy(ivol), comment endif ! end comment endif ! more items on the line if (shape(ivol).eq.'BOX ') then ! pick up box parameters ne = 1 ! from the next line do ixyz = 1,3 jx = icnext(line2,ne,132) read(line2(jx:ne),*) par(ixyz,ivol) enddo npars(ivol) = 3 elseif (shape(ivol).eq.'TUBE') then ! pick up tube parameters ne = 1 ! from the next line do ixyz = 1,3 jx = icnext(line2,ne,132) read(line2(jx:ne),*) par(ixyz,ivol) enddo npars(ivol) = 3 elseif (shape(ivol).eq.'PGON') then ! pgon parameters. pgon has ne = 1 ! 4+3n pars, but so far, we do ixyz = 1,10 ! only have 10. Protect jx = icnext(line2,ne,132) ! against more for now. read(line2(jx:ne),*) par(ixyz,ivol) enddo npars(ivol) = 10 if (par(4,ivol).gt.2) then write (luntty,'('' ** ERROR ** Increase dimension of par() & in ver_geom to accomodate PGON named '',a4)') name(ivol) endif elseif (shape(ivol).eq.'PARA') then ne = 1 do ixyz = 1,6 jx = icnext(line2,ne,132) read(line2(jx:ne),*) par(ixyz,ivol) enddo npars(ivol) = 6 else write (luntty,'(''*** ERROR *** add shape '',a4, & '' to parse_rec'')') shape(ivol) endif end ! parse_rec *======================================================================*