program xetlista c **20-Oct-92** exabyte event tape file event list **rev.17-Jul-00** c input file names from tpflist **12-Feb-01** c detect time gaps >10 min **16-Feb-01 c %f77 xetlista.f Ntimex.f implicit integer (a-z) integer*2 hdr(8) character stn*4,fn*3,fname*12 real ssec,esec common data(4864),tsave(2),sdhm(2),sms,edhm(2),ems equivalence (data(1),hdr(1)) data tgap/37500/ tim(j)=and(data(j),'7fffffff'x) c 10 write(*,"('st.n: '$)") read(*,'(a)') stn if (stn(1:1).eq.' ') stop open(2,file='elist.a'//stn(1:2)//'-et'//stn(4:4)) write(*,"('Number of files: '$)") read(*,*) mf do nf=1,mf write(fn,'(i3)') nf if (fn(2:2).eq.' ') then fn=fn(3:3)//' ' else if (fn(1:1).eq.' ') then fn=fn(2:3)//' ' end if fname='et.a'//stn//'.'//fn write (2,*) 'File: ',fname open (1,file='../etdata/'//fname,access='direct',form='unformatted' & ,recl=19456) read (1,rec=1) data if (hdr(6).eq.1) write (2,'(a)') 'New format' nsb=(hdr(6)+1)*3 nbb=4860/nsb nub=54/nsb nlb=nbb-nub crec=1 it=0 c 20 do n=1,nsb p=(n-1)*nbb+5 ct=tim(p) dt=(ct-it) if (iabs(dt).gt.tgap) then if (it.gt.0) then eblk=n-1 erec=crec if (eblk.eq.0) then eblk=nsb erec=crec-1 call time03(tsave,edhm) else pp=p-nub do while (data(pp).eq.0) pp=pp-nub end do call time03(data(pp),edhm) end if ssec=sms/1000. esec=ems/1000. write(2,2) srec,sblk,erec,eblk,year,sdhm,ssec,edhm,esec 2 format(i3,'/',i1,'-',i3,'/',i1,':',3i5,f7.3,' -',2i5,f7.3) end if srec=crec sblk=n year=hdr(5) if (dt.lt.-225000.and.n.gt.1) year=year+1 call time03(data(p),sdhm) end if it=tim(p) pp=p+nlb do while (data(pp).eq.0) pp=pp-nub end do tsave(1)=data(pp) tsave(2)=data(pp+1) end do crec=crec+1 read (1,rec=crec,end=30) data go to 20 c 30 if (it.gt.0) then eblk=nsb erec=crec-1 call time03(tsave,edhm) ssec=sms/1000. esec=ems/1000. write(2,2) srec,sblk,erec,eblk,year,sdhm,ssec,edhm,esec end if close (1) end do close(2) go to 10 end