subroutine qspuped(lunit) * * Read QSPU data file to get pedestal values * integer lunit vector ped * nrec=0 ndata=0 ndtot=0 ndet=1 10 continue read(lunit,*,err=100,end=900)volts nrec=nrec+1 ndtot=ndtot+1 if(nrec.gt.47)then ndata=ndata+1 if(ndata.le.10)then ped(ndet)=ped(ndet)+volts endif if(ndata.eq.1000) then * skip 9 records between detector traces do i=1,9 read(lunit,*,err=100,end=900) nrec=nrec+1 enddo ndata = 0 ndet = ndet+1 goto 10 endif else goto 10 endif 100 continue nrec=nrec+1 2000 format(1x,a4) * print *, ' Error found in record ',nrec goto 10 900 continue do i=1,2 ped(i)=ped(i)/10. enddo rewind lunit * print *,' Rtn QSPUPED found ',ndtot,' data lines in ', & nrec,' records' print *,' Pedestal values are ',ped(1),' ',ped(2) * end