2008-09-18 10:58:59 -04:00
|
|
|
subroutine savetf2(id,fnamedate,savedir)
|
2007-07-09 16:36:44 -04:00
|
|
|
|
2007-06-25 19:51:09 -04:00
|
|
|
parameter (NZ=60*96000)
|
|
|
|
parameter (NSPP=174)
|
|
|
|
parameter (NPKTS=NZ/NSPP)
|
|
|
|
integer*2 id(4,NZ)
|
2007-07-09 16:36:44 -04:00
|
|
|
character*80 savedir,fname
|
2008-09-18 10:58:59 -04:00
|
|
|
character cdate*8,ctime2*10,czone*5,fnamedate*6
|
|
|
|
integer itt(8)
|
|
|
|
|
|
|
|
call date_and_time(cdate,ctime2,czone,itt)
|
|
|
|
nh=itt(5)-itt(4)/60
|
|
|
|
nm=itt(6)
|
|
|
|
ns=itt(7)
|
|
|
|
if(ns.lt.50) nm=nm-1
|
|
|
|
if(nm.lt.0) then
|
|
|
|
nm=nm+60
|
|
|
|
nh=nh-1
|
|
|
|
endif
|
|
|
|
if(nh.lt.0) nh=nh+24
|
|
|
|
if(nh.ge.24) nh=nh-24
|
|
|
|
write(fname,1001) fnamedate,nh,nm
|
|
|
|
1001 format('/',a6,'_',2i2.2,'.tf2')
|
|
|
|
do i=80,1,-1
|
|
|
|
if(savedir(i:i).ne.' ') go to 1
|
|
|
|
enddo
|
|
|
|
1 iz=i
|
|
|
|
fname=savedir(1:iz)//fname
|
2007-12-21 13:40:47 -05:00
|
|
|
#ifdef CVF
|
2008-09-18 10:58:59 -04:00
|
|
|
open(17,file=fname,status='unknown',form='binary',err=998)
|
2007-07-09 16:36:44 -04:00
|
|
|
#else
|
2008-09-18 10:58:59 -04:00
|
|
|
open(17,file=fname,status='unknown',access='stream',err=998)
|
2007-07-09 16:36:44 -04:00
|
|
|
#endif
|
2008-10-27 15:20:07 -04:00
|
|
|
|
|
|
|
! write(17,err=997) id
|
|
|
|
do i=1,1024
|
|
|
|
i0=(i-1)*5625 + 1
|
|
|
|
call w17(id(1,i0),ierr)
|
|
|
|
if(ierr.ne.0) print*,'Error writing tf2 file'
|
|
|
|
enddo
|
|
|
|
|
2008-09-18 10:58:59 -04:00
|
|
|
close(17)
|
|
|
|
go to 999
|
2007-07-09 16:36:44 -04:00
|
|
|
|
2008-10-27 15:20:07 -04:00
|
|
|
!997 print*,'Error writing tf2 file'
|
|
|
|
! print*,fname
|
|
|
|
! go to 999
|
2007-07-09 16:36:44 -04:00
|
|
|
|
|
|
|
998 print*,'Cannot open file:'
|
|
|
|
print*,fname
|
2007-06-25 19:51:09 -04:00
|
|
|
|
2007-07-09 16:36:44 -04:00
|
|
|
999 return
|
2007-06-25 19:51:09 -04:00
|
|
|
end subroutine savetf2
|
2008-10-27 15:20:07 -04:00
|
|
|
|
|
|
|
subroutine w17(id,ierr)
|
|
|
|
integer*2 id(4,5625)
|
|
|
|
write(17,err=998) id
|
|
|
|
ierr=0
|
|
|
|
go to 999
|
|
|
|
998 ierr=1
|
|
|
|
999 return
|
|
|
|
end subroutine w17
|