Open pchk and gen files for msk40 from platform-independent directories. Recompute MSK40 hash codes when mycall or hiscall has changed.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6976 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-07-30 18:46:29 +00:00
parent 4e163f1ec1
commit ccee9ab53b
4 changed files with 29 additions and 21 deletions

View File

@ -1,19 +1,21 @@
subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00)
use timer_module, only: timer
subroutine detectmsk40(cbig,n,pchk_file,mycall,hiscall,lines,nmessages, &
nutc,ntol,t00)
use timer_module, only: timer
parameter (NSPM=240, NPTS=3*NSPM, MAXSTEPS=7500, NFFT=3*NSPM, MAXCAND=15)
character*4 rpt(0:63)
character*6 mycall,hiscall
character*6 mycall,hiscall,mycall0,hiscall0
character*22 hashmsg,msgreceived
character*80 lines(100)
character*40 pchk_file,gen_file
character*512 pchk_file,gen_file
character*512 pchk_file40,gen_file40
complex cbig(n)
complex cdat(NPTS) !Analytic signal
complex cdat2(NPTS)
complex c(NSPM)
complex ctmp(NFFT)
complex cb(42) !Complex waveform for sync word
complex cbr(42) !Complex waveform for reversed sync word
complex cbr(42) !Complex waveform for reversed sync word
complex cfac,cca,ccb
complex ccr(NPTS)
complex ccr1(NPTS)
@ -43,6 +45,7 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00)
real*8 lratio(32)
logical first
data first/.true./
data mycall0/'dummy'/,hiscall0/'dummy'/
data s8/0,1,1,1,0,0,1,0/
data s8r/1,0,1,1,0,0,0,1/
! codeword for the message <K9AN K1JT> RRR
@ -97,22 +100,26 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00)
enddo
rpt(62)='RRR '
rpt(63)='73 '
first=.false.
endif
if(mycall.ne.mycall0 .or. hiscall.ne.hiscall0) then
do i=0,63
hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i)
call fmtmsg(hashmsg,iz)
call hash(hashmsg,22,ihash)
nhashes(i)=iand(ihash,1023)
enddo
first=.false.
mycall0=mycall
hiscall0=hiscall
endif
! Temporarily hardwire filenames and init on every call
pchk_file="peg-32-16-reg3.pchk"
i=index(pchk_file,".pchk")
gen_file=pchk_file(1:i-1)//".gen"
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
i=index(pchk_file,"128-80")
pchk_file40=pchk_file(1:i-1)//"32-16"//pchk_file(i+6:)
i=index(pchk_file40,".pchk")
gen_file40=pchk_file40(1:i-1)//".gen"
call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
! Fill the detmet, detferr arrays
nstepsize=60 ! 5ms steps

View File

@ -82,7 +82,7 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
enddo
if(message(1:1).eq.'<') then
call genmsk40(message,msgsent,ichk,i4tone,itype)
call genmsk40(message,msgsent,ichk,i4tone,itype,pchk_file)
if(itype.lt.0) go to 999
i4tone(41)=-40
go to 999

View File

@ -1,11 +1,12 @@
subroutine genmsk40(msg,msgsent,ichk,itone,itype)
subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
use hashing
character*22 msg,msgsent,hashmsg
character*32 cwstring
character*2 cwstrbit
character*4 crpt,rpt(0:63)
character*40 pchk_file,gen_file
character*512 pchk_file,gen_file
character*512 pchk_file40,gen_file40
logical first
integer itone(144)
integer*1 message(16),codeword(32),bitseq(40)
@ -29,12 +30,12 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype)
first=.false.
endif
!####### TEMPORARILY HARDWIRE PCHK AND GEN FILES ##################
!These files will need to be installed.
pchk_file="peg-32-16-reg3.pchk"
gen_file="peg-32-16-reg3.gen"
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
! Temporarily hardwire filenames and init on every call
i=index(pchk_file,"128-80")
pchk_file40=pchk_file(1:i-1)//"32-16"//pchk_file(i+6:)
i=index(pchk_file40,".pchk")
gen_file40=pchk_file40(1:i-1)//".gen"
call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
itype=-1
msgsent='*** bad message ***'
itone=0

View File

@ -47,7 +47,7 @@ subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,mycall,hiscall, &
if(nline.eq.0 .and. bShMsgs) then
call timer('detect40',0)
call detectmsk40(c,npts,mycall,hiscall,line,nline,nutc,ntol,t0)
call detectmsk40(c,npts,pchk_file,mycall,hiscall,line,nline,nutc,ntol,t0)
call timer('detect40',1)
if( nprint .ne. 0 ) then
do i=1,nline