summaryrefslogtreecommitdiff
path: root/lib/ft8_decode.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ft8_decode.f90')
-rwxr-xr-xlib/ft8_decode.f9071
1 files changed, 67 insertions, 4 deletions
diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90
index 73d0f8c2..b3362973 100755
--- a/lib/ft8_decode.f90
+++ b/lib/ft8_decode.f90
@@ -38,6 +38,7 @@ contains
use iso_c_binding, only: c_bool, c_int
use timer_module, only: timer
use shmem, only: shmem_lock, shmem_unlock
+ use ft8_a7
include 'ft8/ft8_params.f90'
@@ -53,7 +54,8 @@ contains
logical newdat,lsubtract,ldupe,lrefinedt
logical*1 ldiskdat
logical lsubtracted(MAX_EARLY)
- character*12 mycall12,hiscall12
+ character*12 mycall12,hiscall12,call_1,call_2
+ character*4 grid4
integer*2 iwave(15*12000)
integer apsym2(58),aph10(10)
character datetime*13,msg37*37
@@ -64,13 +66,33 @@ contains
integer itone_save(NN,MAX_EARLY)
real f1_save(MAX_EARLY)
real xdt_save(MAX_EARLY)
+ data nutc0/-1/
- save s,dd,dd1,ndec_early,itone_save,f1_save,xdt_save,lsubtracted,allmessages
+ save s,dd,dd1,nutc0,ndec_early,itone_save,f1_save,xdt_save,lsubtracted,&
+ allmessages
this%callback => callback
write(datetime,1001) nutc !### TEMPORARY ###
1001 format("000000_",i6.6)
+ if(nutc0.eq.-1) then
+ msg0=' '
+ dt0=0.
+ f0=0.
+ endif
+ if(nutc.ne.nutc0) then
+! New UTC. Move previously saved 'a7' data from k=1 to k=0
+ iz=ndec(jseq,1)
+ dt0(1:iz,jseq,0) = dt0(1:iz,jseq,1)
+ f0(1:iz,jseq,0) = f0(1:iz,jseq,1)
+ msg0(1:iz,jseq,0) = msg0(1:iz,jseq,1)
+ ndec(jseq,0)=iz
+ ndec(jseq,1)=0
+ nutc0=nutc
+ dt0(:,jseq,1)=0.
+ f0(:,jseq,1)=0.
+ endif
+
if(ndepth.eq.1 .and. nzhsym.lt.50) then
ndec_early=0
return
@@ -178,7 +200,7 @@ contains
hiscall12,f1,xdt,xbase,apsym2,aph10,nharderrors,dmin, &
nbadcrc,iappass,msg37,xsnr,itone)
call timer('ft8b ',1)
- nsnr=nint(xsnr)
+ nsnr=nint(xsnr)
xdt=xdt-0.5
hd=nharderrors+dmin
if(nbadcrc.eq.0) then
@@ -198,6 +220,11 @@ contains
qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0]
if(emedelay.ne.0) xdt=xdt+2.0
call this%callback(sync,nsnr,xdt,f1,msg37,iaptype,qual)
+ call ft8_a7_save(nutc,xdt,f1,msg37) !Enter decode in table
+! ii=ndec(jseq,1)
+! write(41,3041) jseq,ii,nint(f0(ii,jseq,0)),msg0(ii,jseq,0)(1:22),&
+! nint(f0(ii,jseq,1)),msg0(ii,jseq,1)(1:22)
+!3041 format(3i5,2x,a22,i5,2x,a22)
endif
endif
call timestamp(tsec,tseq,ctime)
@@ -209,7 +236,43 @@ contains
800 ndec_early=0
if(nzhsym.lt.50) ndec_early=ndecodes
-900 return
+900 continue
+ if(nzhsym.eq.50 .and. ndec(jseq,0).ge.1) then
+ newdat=.true.
+ do i=1,ndec(jseq,0)
+ if(f0(i,jseq,0).eq.-99.0) exit
+ if(f0(i,jseq,0).eq.-98.0) cycle
+ if(index(msg0(i,jseq,0),'<').ge.1) cycle !### Temporary ###
+ msg37=msg0(i,jseq,0)
+ i1=index(msg37,' ')
+ i2=index(msg37(i1+1:),' ') + i1
+ call_1=msg37(1:i1-1)
+ call_2=msg37(i1+1:i2-1)
+ grid4=msg37(i2+1:i2+4)
+ if(grid4.eq.'RR73' .or. index(grid4,'+').gt.0 .or. &
+ index(grid4,'-').gt.0) grid4=' '
+ xdt=dt0(i,jseq,0)
+ f1=f0(i,jseq,0)
+ xbase=10.0**(0.1*(sbase(max(1,nint(f1/3.125)))-40.0))
+ msg37=' '
+ call timer('ft8_a7d ',0)
+ call ft8_a7d(dd,newdat,call_1,call_2,grid4,xdt,f1,xbase,nharderrors, &
+ dmin,msg37,xsnr)
+ call timer('ft8_a7d ',1)
+
+ if(nharderrors.ge.0) then
+ if(associated(this%callback)) then
+ nsnr=xsnr
+ iaptype=7
+ qual=1.0
+ call this%callback(sync,nsnr,xdt,f1,msg37,iaptype,qual)
+ call ft8_a7_save(nutc,xdt,f1,msg37) !Enter decode in table
+ endif
+ endif
+ enddo
+ endif
+
+ return
end subroutine decode
subroutine timestamp(tsec,tseq,ctime)