summaryrefslogtreecommitdiff
path: root/lib/jt9.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jt9.f90')
-rw-r--r--lib/jt9.f9092
1 files changed, 39 insertions, 53 deletions
diff --git a/lib/jt9.f90 b/lib/jt9.f90
index 7656f51e..a08a20cb 100644
--- a/lib/jt9.f90
+++ b/lib/jt9.f90
@@ -17,19 +17,20 @@ program jt9
integer(C_INT) iret
type(wav_header) wav
real*4 s(NSMAX)
+ real*8 TRperiod
character c
character(len=500) optarg, infile
character wisfile*80
!### ndepth was defined as 60001. Why???
integer :: arglen,stat,offset,remain,mode=0,flow=200,fsplit=2700, &
- fhigh=4000,nrxfreq=1500,ntrperiod=1,ndepth=1,nexp_decode=0
+ fhigh=4000,nrxfreq=1500,ndepth=1,nexp_decode=0,nQSOProg=0
logical :: read_files = .true., tx9 = .false., display_help = .false., &
bLowSidelobes = .false.
- type (option) :: long_options(26) = [ &
+ type (option) :: long_options(29) = [ &
option ('help', .false., 'h', 'Display this help message', ''), &
option ('shmem',.true.,'s','Use shared memory for sample data','KEY'), &
- option ('tr-period', .true., 'p', 'Tx/Rx period, default MINUTES=1', &
- 'MINUTES'), &
+ option ('tr-period', .true., 'p', 'Tx/Rx period, default SECONDS=60', &
+ 'SECONDS'), &
option ('executable-path', .true., 'e', &
'Location of subordinate executables (KVASD) default PATH="."', &
'PATH'), &
@@ -52,13 +53,17 @@ program jt9
'THREADS'), &
option ('jt4', .false., '4', 'JT4 mode', ''), &
option ('ft4', .false., '5', 'FT4 mode', ''), &
- option ('jt65', .false.,'6', 'JT65 mode', ''), &
+ option ('jt65', .false.,'6', 'JT65 mode', ''), &
+ option ('fst4', .false., '7', 'FST4 mode', ''), &
+ option ('fst4w', .false., 'W', 'FST4W mode', ''), &
option ('ft8', .false., '8', 'FT8 mode', ''), &
option ('jt9', .false., '9', 'JT9 mode', ''), &
option ('qra64', .false., 'q', 'QRA64 mode', ''), &
+ option ('QSOprog', .true., 'Q', 'QSO progress (0-5), default PROGRESS=1',&
+ 'QSOprogress'), &
option ('sub-mode', .true., 'b', 'Sub mode, default SUBMODE=A', 'A'), &
option ('depth', .true., 'd', &
- 'JT9 decoding depth (1-3), default DEPTH=1', 'DEPTH'), &
+ 'Decoding depth (1-3), default DEPTH=1', 'DEPTH'), &
option ('tx-jt9', .false., 'T', 'Tx mode is JT9', ''), &
option ('my-call', .true., 'c', 'my callsign', 'CALL'), &
option ('my-grid', .true., 'G', 'my grid locator', 'GRID'), &
@@ -74,12 +79,14 @@ program jt9
character(len=6) :: mygrid='', hisgrid='EN37'
common/patience/npatience,nthreads
common/decstats/ntry65a,ntry65b,n65a,n65b,num9,numfano
- data npatience/1/,nthreads/1/
+ data npatience/1/,nthreads/1/,wisfile/' '/
+ iwspr=0
nsubmode = 0
+ TRperiod=60.d0
do
- call getopt('hs:e:a:b:r:m:p:d:f:w:t:98654qTL:S:H:c:G:x:g:X:', &
+ call getopt('hs:e:a:b:r:m:p:d:f:w:t:987654WqTL:S:H:c:G:x:g:X:Q:', &
long_options,c,optarg,arglen,stat,offset,remain,.true.)
if (stat .ne. 0) then
exit
@@ -101,7 +108,7 @@ program jt9
case ('m')
read (optarg(:arglen), *) nthreads
case ('p')
- read (optarg(:arglen), *) ntrperiod
+ read (optarg(:arglen), *) TRperiod
case ('d')
read (optarg(:arglen), *) ndepth
case ('f')
@@ -114,20 +121,28 @@ program jt9
read (optarg(:arglen), *) fhigh
case ('q')
mode = 164
+ case ('Q')
+ read (optarg(:arglen), *) nQSOProg
case ('4')
mode = 4
case ('5')
mode = 5
case ('6')
if (mode.lt.65) mode = mode + 65
- case ('9')
- if (mode.lt.9.or.mode.eq.65) mode = mode + 9
+ case ('7')
+ mode = 240
+ iwspr=0
case ('8')
mode = 8
+ case ('9')
+ if (mode.lt.9.or.mode.eq.65) mode = mode + 9
case ('T')
tx9 = .true.
case ('w')
read (optarg(:arglen), *) npatience
+ case ('W')
+ mode = 241
+ iwspr=1
case ('c')
read (optarg(:arglen), *) mycall
case ('G')
@@ -182,7 +197,6 @@ program jt9
allocate(shared_data)
nflatten=0
-
do iarg = offset + 1, offset + remain
call get_command_argument (iarg, optarg, arglen)
infile = optarg(:arglen)
@@ -197,34 +211,16 @@ program jt9
endif
go to 2
1 nutc=0
-2 nsps=0
- if(ntrperiod.eq.1) then
- nsps=6912
- shared_data%params%nzhsym=181
- else if(ntrperiod.eq.2) then
- nsps=15360
- shared_data%params%nzhsym=178
- else if(ntrperiod.eq.5) then
- nsps=40960
- shared_data%params%nzhsym=172
- else if(ntrperiod.eq.10) then
- nsps=82944
- shared_data%params%nzhsym=171
- else if(ntrperiod.eq.30) then
- nsps=252000
- shared_data%params%nzhsym=167
- endif
- if(nsps.eq.0) stop 'Error: bad TRperiod'
-
+2 nsps=6912
+ npts=TRperiod*12000.d0
kstep=nsps/2
k=0
+ nhsym=0
nhsym0=-999
- npts=(60*ntrperiod-6)*12000
if(iarg .eq. offset + 1) then
call init_timer (trim(data_dir)//'/timer.out')
call timer('jt9 ',0)
endif
-
shared_data%id2=0 !??? Why is this necessary ???
if(mode.eq.5) npts=21*3456
do iblk=1,npts/kstep
@@ -244,18 +240,18 @@ program jt9
ingain=0
call timer('symspec ',0)
nminw=1
- call symspec(shared_data,k,ntrperiod,nsps,ingain,bLowSidelobes,nminw,pxdb, &
- s,df3,ihsym,npts8,pxdbmax)
+ call symspec(shared_data,k,Tperiod,nsps,ingain, &
+ bLowSidelobes,nminw,pxdb,s,df3,ihsym,npts8,pxdbmax)
call timer('symspec ',1)
endif
nhsym0=nhsym
- if(nhsym.ge.181) exit
+ if(nhsym.ge.181 .and. mode.ne.240 .and. mode.ne.241) exit
endif
enddo
close(unit=wav%lun)
shared_data%params%nutc=nutc
shared_data%params%ndiskdat=.true.
- shared_data%params%ntr=60
+ shared_data%params%ntr=TRperiod
shared_data%params%nfqso=nrxfreq
shared_data%params%newdat=.true.
shared_data%params%npts8=74736
@@ -264,23 +260,18 @@ program jt9
shared_data%params%nfb=fhigh
shared_data%params%ntol=20
shared_data%params%kin=64800
- shared_data%params%nzhsym=181
+ if(mode.eq.240) shared_data%params%kin=720000 !### 60 s periods ###
+ shared_data%params%nzhsym=nhsym
+ if(mode.eq.240 .and. iwspr.eq.1) ndepth=ior(ndepth,128)
shared_data%params%ndepth=ndepth
shared_data%params%lft8apon=.true.
shared_data%params%ljt65apon=.true.
shared_data%params%napwid=75
shared_data%params%dttol=3.
-
-! shared_data%params%minsync=0 !### TEST ONLY
-! shared_data%params%nfqso=1500 !### TEST ONLY
-! mycall="G3WDG " !### TEST ONLY
-! hiscall="VK7MO " !### TEST ONLY
-! hisgrid="QE37 " !### TEST ONLY
if(mode.eq.164 .and. nsubmode.lt.100) nsubmode=nsubmode+100
-
shared_data%params%naggressive=0
shared_data%params%n2pass=2
-! shared_data%params%nranera=8 !### ntrials=10000
+ shared_data%params%nQSOprogress=nQSOProg
shared_data%params%nranera=6 !### ntrials=3000
shared_data%params%nrobust=.false.
shared_data%params%nexp_decode=nexp_decode
@@ -334,13 +325,8 @@ program jt9
999 continue
! Output decoder statistics
call fini_timer ()
-! open (unit=12, file=trim(data_dir)//'/timer.out', status='unknown', position='append')
-! write(12,1100) n65a,ntry65a,n65b,ntry65b,numfano,num9
-!1100 format(58('-')/' JT65_1 Tries_1 JT65_2 Tries_2 JT9 Tries'/ &
-! 58('-')/6i8)
-
-! Save wisdom and free memory
- iret=fftwf_export_wisdom_to_filename(wisfile)
+! Save FFTW wisdom and free memory
+ if(len(trim(wisfile)).gt.0) iret=fftwf_export_wisdom_to_filename(wisfile)
call four2a(a,-1,1,1,1)
call filbig(a,-1,1,0.0,0,0,0,0,0) !used for FFT plans
call fftwf_cleanup_threads()