From 07553fa11777f0c7bf152857c38d5841a39e083b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 11 Mar 2016 16:26:06 +0000 Subject: [PATCH] Further progress on average and smoothed decodes. Not finished, though! git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6524 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decode65a.f90 | 5 +++-- lib/decode65b.f90 | 6 +----- lib/jt65_decode.f90 | 14 ++++++++++---- lib/jt65_mod.f90 | 2 ++ lib/setup65.f90 | 2 +- lib/xcor.f90 | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/decode65a.f90 b/lib/decode65a.f90 index e350f6760..60aef1242 100644 --- a/lib/decode65a.f90 +++ b/lib/decode65a.f90 @@ -111,18 +111,19 @@ subroutine decode65a(dd,npts,newdat,nqd,f0,nflip,mode65,ntrials, & call decode65b(s2,nflip,mode65,ntrials,naggressive,ndepth, & mycall,hiscall,hisgrid,nexp_decode,nqd,nft,qual,nhist,decoded) + if(nft.eq.1) then nsmo=ismo + param(9)=nsmo + nsum=1 exit else if(nft.eq.2) then -!### Should also deal with nft=2 solutions if(qual.gt.qualbest) then decoded_best=decoded qualbest=qual nnbest=nn nsmobest=ismo endif -! print*,'A',nn,ndepth,ntrials,ismo,qual,decoded endif enddo diff --git a/lib/decode65b.f90 b/lib/decode65b.f90 index 4c761de65..ec503c8e6 100644 --- a/lib/decode65b.f90 +++ b/lib/decode65b.f90 @@ -1,18 +1,14 @@ subroutine decode65b(s2,nflip,mode65,ntrials,naggressive,ndepth, & mycall,hiscall,hisgrid,nexp_decode,nqd,nft,qual,nhist,decoded) + use jt65_mod real s2(66,126) real s3(64,63) logical first,ltext character decoded*22 character mycall*12,hiscall*12,hisgrid*6 - common/prcom/pr(126),mdat(126),mref(126,2),mdat2(126),mref2(126,2) - data first/.true./ save - if(first) call setup65 - first=.false. - do j=1,63 k=mdat(j) !Points to data symbol if(nflip.lt.0) k=mdat2(j) diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index d0abe59d8..f900064e9 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -157,6 +157,7 @@ contains decoded0="" freq0=0. prtavg=.false. + nsum=0 do icand=1,ncand freq=ca(icand)%freq @@ -169,6 +170,8 @@ contains naggressive,ndepth,mycall,hiscall,hisgrid,nexp_decode, & sync2,a,dtx,nft,qual,nhist,nsmo,decoded) call timer('decod65a',1) + if(nft.eq.1) nsum=1 +! write(*,'("a",3i3,a6)') nft,nsum,nsmo,decoded(1:6) ! ncandidates=param(0) nhard_min=param(1) @@ -210,6 +213,7 @@ contains endif endif + if(nftt.eq.1) then nft=1 decoded=avemsg @@ -217,7 +221,7 @@ contains endif n=naggressive rtt=0.001*nrtt1000 - if(nft.lt.2) then + if(nft.lt.2 .and. minsync.ge.0) then if(nhard_min.gt.50) cycle if(nhard_min.gt.h0(n)) cycle if(ntotal_min.gt.d0(n)) cycle @@ -284,8 +288,8 @@ contains integer nfsave(MAXAVE) integer listutc(10) integer nflipsave(MAXAVE) - real s1b(-255:256,126) - real s1save(-255:256,126,MAXAVE) +! real s1b(-255:256,126) +! real s1save(-255:256,126,MAXAVE) real s3save(64,63,MAXAVE) real s3b(64,63) real dtsave(MAXAVE) @@ -314,7 +318,7 @@ contains dtsave(nsave)=dtxx nfsave(nsave)=nfreq nflipsave(nsave)=nflip - s1save(-255:256,1:126,nsave)=s1 +! s1save(-255:256,1:126,nsave)=s1 s3save(1:64,1:63,nsave)=s3a 10 syncsum=0. @@ -355,6 +359,7 @@ contains write(14,1000) cused(i),iutc(i),syncsave(i),dtsave(i),nfsave(i),csync 1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1) enddo + if(nsum.lt.2) go to 900 rewind 62 sqt=0. @@ -389,6 +394,7 @@ contains call extract(s3b,nadd,mode65,ntrials,naggressive,ndepth,mycall, & hiscall,hisgrid,nexp_decode,ncount,nhist,avemsg,ltext,nftt,qual) +900 continue return end subroutine avg65 diff --git a/lib/jt65_mod.f90 b/lib/jt65_mod.f90 index 3e78b21f9..8a7f01a3a 100644 --- a/lib/jt65_mod.f90 +++ b/lib/jt65_mod.f90 @@ -3,8 +3,10 @@ module jt65_mod integer param(0:9) integer mrs(63) integer mrs2(63) + integer mdat(126),mref(126,2),mdat2(126),mref2(126,2) !From prcom real s1(-255:256,126) real s3a(64,63) + real pr(126) end module jt65_mod diff --git a/lib/setup65.f90 b/lib/setup65.f90 index 608b41b91..42274ce00 100644 --- a/lib/setup65.f90 +++ b/lib/setup65.f90 @@ -3,8 +3,8 @@ subroutine setup65 ! Defines arrays related to the JT65 pseudo-random synchronizing pattern. ! Executed at program start. + use jt65_mod integer nprc(126) - common/prcom/pr(126),mdat(126),mref(126,2),mdat2(126),mref2(126,2) ! JT65 data nprc/ & diff --git a/lib/xcor.f90 b/lib/xcor.f90 index b09bcc6e5..3f95f768a 100644 --- a/lib/xcor.f90 +++ b/lib/xcor.f90 @@ -5,12 +5,12 @@ subroutine xcor(ss,ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust) ! CCF peak may be either positive or negative, with negative implying ! the "OOO" message. + use jt65_mod parameter (NHMAX=3413) !Max length of power spectra parameter (NSMAX=322) !Max number of half-symbol steps real ss(NSMAX,NHMAX) !2d spectrum, stepped by half-symbols real a(NSMAX) real ccf(-11:540) - include 'prcom.f90' data lagmin/0/ !Silence g77 warning save