From f9a078dd8bf71a1312e5e90c1f7768f2623263b8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 28 Nov 2016 15:11:00 +0000 Subject: [PATCH] Revert to displaying Nico's return code with QRA64 messages. Suppress a few false decodes that cannot be correct messages. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7342 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 1 + lib/badmsg.f90 | 25 +++++++++++++++++++++++++ lib/decoder.f90 | 10 ++++------ lib/qra64a.f90 | 1 + 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 lib/badmsg.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 83b451918..738110e6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,6 +308,7 @@ set (wsjt_FSRCS lib/avecho.f90 lib/averms.f90 lib/azdist.f90 + lib/badmsg.f90 lib/bpdecode40.f90 lib/bpdecode144.f90 lib/baddata.f90 diff --git a/lib/badmsg.f90 b/lib/badmsg.f90 new file mode 100644 index 000000000..56366f9d2 --- /dev/null +++ b/lib/badmsg.f90 @@ -0,0 +1,25 @@ +subroutine badmsg(irc,dat,nc1,nc2,ng2) + +! Get rid of a few QRA64 false decodes that cannot be correct messages. + + integer dat(12) !Decoded message (as 12 integers) + + ic1=ishft(dat(1),22) + ishft(dat(2),16) + ishft(dat(3),10)+ & + ishft(dat(4),4) + iand(ishft(dat(5),-2),15) + +! Test for "......" or "CQ 000" + if(ic1.eq.262177560 .or. ic1.eq.262177563) then + irc=-1 + return + endif + + ic2=ishft(iand(dat(5),3),26) + ishft(dat(6),20) + & + ishft(dat(7),14) + ishft(dat(8),8) + ishft(dat(9),2) + & + iand(ishft(dat(10),-4),3) + + ig=ishft(iand(dat(10),15),12) + ishft(dat(11),6) + dat(12) + + if(ic1.eq.nc1 .and. ic2.eq.nc2 .and. ng.ne.32401 .and. ig.ne.ng) irc=-1 + + return +end subroutine badmsg diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 94ccdaaf2..630e15fc8 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -236,10 +236,9 @@ contains integer, intent(in) :: nsum integer, intent(in) :: minsync - integer i,nft,iirc,nap(-1:11) + integer i,nft logical is_deep,is_average character decoded*22,csync*2,cflags*3 - data nap/-1,0,2,3,2,3,4,2,3,6,4,6,6/ if(width.eq.-9999.0) stop !Silence compiler warning !$omp critical(decode_results) @@ -249,17 +248,16 @@ contains if(ft.ge.80) then !QRA64 mode nft=ft-100 - iirc=max(-1,min(nft,11)) csync=': ' if(sync.ge.float(minsync) .or. nft.ge.0) csync=':*' if(nft.lt.0) then write(*,1009) params%nutc,snr,dt,freq,csync,decoded else - write(*,1009) params%nutc,snr,dt,freq,csync,decoded,nap(iirc),nft -1009 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,i2,i3) + write(*,1009) params%nutc,snr,dt,freq,csync,decoded,nft +1009 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,i2) endif write(13,1011) params%nutc,nint(sync),snr,dt,float(freq),drift, & - decoded,nap(iirc),nft + decoded,nft 1011 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' QRA64',i3) go to 100 endif diff --git a/lib/qra64a.f90 b/lib/qra64a.f90 index 9db64eebc..d37f17ba4 100644 --- a/lib/qra64a.f90 +++ b/lib/qra64a.f90 @@ -96,6 +96,7 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, & call timer('qra64_de',1) if(abs(snr2).gt.30.) snr2=-30.0 if(irc.eq.0) go to 10 + if(irc.gt.0) call badmsg(irc,dat4,nc1,nc2,ng2) if(irc.lt.0) cycle iirc=max(0,min(irc,11)) if(irc.gt.0 .and. nap(iirc).le.napmin) then