diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 74928a33e..f71f7f5e3 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -79,7 +79,7 @@ contains idec=-1 idf=0 idt=0 - irc=0 + nrc=-2 mode_q65=2**nsubmode npts=ntrperiod*12000 nfft1=ntrperiod*12000 @@ -172,7 +172,6 @@ contains call timer('q65loops',0) call q65_loops(c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) -! idec=-1 !### TEMPORARY ### call timer('q65loops',1) if(idec.ge.0) then dtdec=xdt1 @@ -241,12 +240,13 @@ contains if(c6.eq.' ') c6=' ' c4=hisgrid(1:4) if(c4.eq.' ') c4=' ' - fmt='(i6.4,1x,a4,5i2,3i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & + fmt='(i6.4,1x,a4,5i2,4i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & '1x,a6,1x,a6,1x,a4,1x,a)' if(ntrperiod.le.30) fmt(5:5)='6' + if(idec.eq.3) nrc=0 write(22,fmt) nutc,cmode,nQSOprogress,idec,idf,idt,ibw,nused, & - icand,ncand,xdt,f0,snr1,snr2,tdecode,mycall(1:6),c6,c4, & - trim(decoded) + icand,ncand,nrc,xdt,f0,db(snr1),snr2,tdecode,mycall(1:6), & + c6,c4,trim(decoded) close(22) endif else @@ -321,12 +321,13 @@ contains if(c6.eq.' ') c6=' ' c4=hisgrid(1:4) if(c4.eq.' ') c4=' ' - fmt='(i6.4,1x,a4,5i2,3i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & + fmt='(i6.4,1x,a4,5i2,4i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & '1x,a6,1x,a6,1x,a4,1x,a)' if(ntrperiod.le.30) fmt(5:5)='6' + if(idec.eq.3) nrc=0 write(22,fmt) nutc,cmode,nQSOprogress,idec,idf,idt,ibw,nused, & - icand,ncand,xdt,f0,snr1,snr2,tdecode,mycall(1:6),c6,c4, & - trim(decoded) + icand,ncand,nrc,xdt,f0,db(snr1),snr2,tdecode,mycall(1:6), & + c6,c4,trim(decoded) close(22) endif endif diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index 106df8a3c..195b07d3e 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -12,7 +12,7 @@ module q65 integer codewords(63,206) integer ibwa,ibwb,ncw,nsps,mode_q65,nfa,nfb integer idf,idt,ibw - integer istep,nsmo,lag1,lag2,npasses,nused,iseq,ncand + integer istep,nsmo,lag1,lag2,npasses,nused,iseq,ncand,nrc integer i0,j0 integer navg(0:1) logical lnewdat @@ -71,6 +71,7 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & ! Set some parameters and allocate storage for large arrays irc=-2 + nrc=-2 idec=-1 snr1=0. dat4=0 @@ -263,6 +264,7 @@ subroutine q65_dec_q3(s1,iz,jz,s3,LL,ipk,jpk,snr2,dat4,idec,decoded) b90=1.72**ibw b90ts=b90/baud call q65_dec1(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) + nrc=irc if(irc.ge.0) then snr2=esnodb - db(2500.0/baud) + 3.0 !Empirical adjustment idec=3 @@ -314,6 +316,7 @@ subroutine q65_dec_q012(s3,LL,snr2,dat4,idec,decoded) b90=1.72**ibw b90ts=b90/baud call q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) + nrc=irc if(irc.ge.0) then snr2=esnodb - db(2500.0/baud) + 3.0 !Empirical adjustment idec=iaptype @@ -486,6 +489,7 @@ subroutine q65_dec1(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) else irc=-1 endif + nrc=irc return end subroutine q65_dec1 @@ -506,6 +510,7 @@ subroutine q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob) call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) if(sum(dat4).le.0) irc=-2 + nrc=irc if(irc.ge.0) then write(c77,1000) dat4(1:12),dat4(13)/2 1000 format(12b6.6,b5.5) diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 092997e69..dfa190d5a 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -64,6 +64,7 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & b90ts = b90/baud call timer('dec2 ',0) call q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) + nrc=irc call timer('dec2 ',1) ! irc > 0 ==> number of iterations required to decode ! -1 = invalid params