Revert "Save a more-or-less working read_tf2()."

This reverts commit 1257b87118.
This commit is contained in:
Joe Taylor 2021-07-16 12:38:23 -04:00
parent 2ac5518057
commit 2fe6cb617b

View File

@ -1,50 +1,27 @@
subroutine read_tf2(k) subroutine read_tf2(k)
parameter (NFFT=32768) parameter (NFFT=32768)
integer*8 ms !ms since epoch
integer k !data sample pointer integer k !data sample pointer
integer*2 id2(4,174) integer*2 id2(4,174)
character*80 fname(100) logical lopen
logical first,eof
real*8 fcenter real*8 fcenter
common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(38) common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(38)
data first/.true./,n1/0/ data lopen/.false./
save save lopen
if(first) then
open(27,file='mockRTfiles.txt',status='old',err=999)
do i=1,100
read(27,1000,end=10) fname(i)
1000 format(a)
enddo
10 nfiles=i-1
ifile=0
close(27)
endif
if(k.eq.0) then if(k.eq.0) then
ifile=ifile+1 inquire(27,opened=lopen)
if(ifile.eq.2 .and. n1.eq.1) ifile=1 if(lopen) then
if(ifile.eq.1) n1=n1+1 rewind 27
if(ifile.gt.nfiles) ifile=1 else
if(.not.first) close(27) open(27,file='000000_0000.tf2',status='old',access='stream')
first=.false. endif
i1=index(fname(ifile),'.tf2')
read(fname(ifile)(i1-4:i1-1),*) nutc
open(27,file=fname(ifile),status='old',access='stream',err=999)
print*,ifile,n1,nutc,trim(fname(ifile))
eof=.false.
read(27) fcenter read(27) fcenter
endif endif
if(eof) then read(27,end=999) id2
id2=0 do i=1,174
else
read(27,end=20) id2
endif
go to 30
20 eof=.true.
id2=0
30 do i=1,174
k=k+1 k=k+1
dd(1,k)=id2(1,i) dd(1,k)=id2(1,i)
dd(2,k)=id2(2,i) dd(2,k)=id2(2,i)