summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/77bit/packjt77.f9066
-rw-r--r--lib/decoder.f901
-rw-r--r--lib/ft8var/cwfilter.f907
-rw-r--r--lib/get_q3list.f904
-rw-r--r--lib/jt9.f904
-rw-r--r--lib/jt9a.f901
-rw-r--r--lib/map65_mmdec.f9013
-rw-r--r--lib/refspectrum.f9011
8 files changed, 89 insertions, 18 deletions
diff --git a/lib/77bit/packjt77.f90 b/lib/77bit/packjt77.f90
index 35236b37..eab4ff6c 100644
--- a/lib/77bit/packjt77.f90
+++ b/lib/77bit/packjt77.f90
@@ -90,22 +90,63 @@ end subroutine hash22
integer function ihashcall(c0,m)
+ implicit none
- integer*8 n8
- character*13 c0
+ character(len=13), intent(in) :: c0
+ integer, intent(in) :: m
+ integer(kind=8) :: n8
+ integer :: i,j
character*38 c
data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/
- n8=0
+ n8=0_8
do i=1,11
j=index(c,c0(i:i)) - 1
- n8=38*n8 + j
+ n8=38_8*n8 + j
enddo
- ihashcall=ishft(47055833459_8*n8,m-64)
+
+ ihashcall=ihashcall_from_n8(n8,m)
return
end function ihashcall
+integer function ihashcall_from_n8(n8,m)
+ implicit none
+
+ integer(kind=8), intent(in) :: n8
+ integer, intent(in) :: m
+ integer(kind=8), parameter :: hash_factor(0:3) = (/2419_8, 62655_8, 10_8, 0_8/)
+ integer(kind=8) :: b(0:3), p(0:3)
+ integer(kind=8) :: carry, term
+ integer(kind=8) :: x
+ integer :: i,j
+
+ x=n8
+ do i=0,3
+ b(i)=mod(x,65536_8)
+ x=x/65536_8
+ enddo
+
+ ! Return the top m bits of the low 64 bits of 47055833459*n8.
+ carry=0_8
+ do i=0,3
+ term=carry
+ do j=0,i
+ term=term+hash_factor(j)*b(i-j)
+ enddo
+ p(i)=mod(term,65536_8)
+ carry=term/65536_8
+ enddo
+
+ if(m.le.16) then
+ ihashcall_from_n8=int(p(3)/(2_8**(16-m)))
+ else
+ ihashcall_from_n8=int(p(3)*(2_8**(m-16)) + p(2)/(2_8**(32-m)))
+ endif
+
+ return
+end function ihashcall_from_n8
+
subroutine save_hash_call(c13,n10,n12,n22)
character*13 c13,cw
@@ -1765,18 +1806,21 @@ subroutine hash22var(n22,c13,nthr)
end subroutine hash22var
integer function ihashcallvar(c0,m)
+ implicit none
- integer*8 n8
- character*13 c0
- character*38 c
+ character(len=13), intent(in) :: c0
+ integer, intent(in) :: m
+ integer(kind=8) :: n8
+ integer :: i,j
+ character*38 :: c
data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/
- n8=0
+ n8=0_8
do i=1,11
j=index(c,c0(i:i)) - 1
- n8=38*n8 + j
+ n8=38_8*n8 + j
enddo
- ihashcallvar=ishft(47055833459_8*n8,m-64)
+ ihashcallvar=ihashcall_from_n8(n8,m)
return
end function ihashcallvar
diff --git a/lib/decoder.f90 b/lib/decoder.f90
index 6d8e2fe0..4dbb0515 100644
--- a/lib/decoder.f90
+++ b/lib/decoder.f90
@@ -23,7 +23,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
use packjt77, only : lcommonft8b,ihash22var,calls12var,calls22var
include 'jt9com.f90'
- include 'timer_common.inc'
type, extends(jt4_decoder) :: counting_jt4_decoder
integer :: decoded
diff --git a/lib/ft8var/cwfilter.f90 b/lib/ft8var/cwfilter.f90
index 913c7e3e..d3ec35fb 100644
--- a/lib/ft8var/cwfilter.f90
+++ b/lib/ft8var/cwfilter.f90
@@ -17,7 +17,12 @@ subroutine cwfilter(first)
!note that with new, larger ALLCALL7.TXT files, dimensions of various ncall arrays may need to be increased in jt65_mod9.f90
!on 20250709 callj dim was increased from 9000 to 10000 when updated ALLCALL7.TXT file was added
if(first) then
- open(24,file='ALLCALL7.TXT',status='unknown') ! accepting Australian 7-char callsigns
+ ! Open the shipped read-only ALLCALL7.TXT for reading only. status='old' with
+ ! action='read' makes a missing/unreadable file degrade cleanly to an empty
+ ! callsign DB (handled by the count check below) instead of status='unknown'
+ ! attempting a create in the read-only app bundle, which aborts the decoder.
+ open(24,file=trim(share_dir)//'/ALLCALL7.TXT',status='old',action='read',iostat=ios) ! accepting Australian 7-char callsigns
+ if(ios.ne.0) go to 20
do i=1,MAXC
read(24,1004,end=20) line
1004 format(a80)
diff --git a/lib/get_q3list.f90 b/lib/get_q3list.f90
index a6b6de81..0b483759 100644
--- a/lib/get_q3list.f90
+++ b/lib/get_q3list.f90
@@ -127,6 +127,8 @@ end subroutine rm_q3list
subroutine jpl_setup(fname)
character*256 fname,jpleph_file_name
common/jplcom/jpleph_file_name
- jpleph_file_name=fname
+ j=index(fname,char(0))
+ jpleph_file_name(1:j)=fname(1:j)
+ jpleph_file_name(j:)=' '
return
end subroutine jpl_setup
diff --git a/lib/jt9.f90 b/lib/jt9.f90
index 64901c09..c6c80164 100644
--- a/lib/jt9.f90
+++ b/lib/jt9.f90
@@ -134,6 +134,8 @@ program jt9
exe_dir = optarg(:arglen)
case ('a')
data_dir = optarg(:arglen)
+ case ('r')
+ share_dir = optarg(:arglen) ! read-only shipped-data dir (cty.dat, ALLCALL7.TXT, ...)
case ('b')
nsubmode = ichar (optarg(:1)) - ichar ('A')
case ('t')
@@ -220,7 +222,7 @@ program jt9
print *, 'Usage: jt9 [OPTIONS] file1 [file2 ...]'
print *, ' Reads data from *.wav files.'
print *, ''
- print *, ' jt9 -s <key> [-w patience] [-m threads] [-e path] [-a path] [-t path]'
+ print *, ' jt9 -s <key> [-w patience] [-m threads] [-e path] [-a path] [-t path] [-r path]'
print *, ' Gets data from shared memory region with key==<key>'
print *, ''
print *, 'OPTIONS:'
diff --git a/lib/jt9a.f90 b/lib/jt9a.f90
index 35f8c0c2..f45661c7 100644
--- a/lib/jt9a.f90
+++ b/lib/jt9a.f90
@@ -120,6 +120,7 @@ subroutine jt9a()
endif
elseif (local_params%nmode.eq.8 .and. local_params%lmultift8 .and. .not. &
local_params%ndiskdat) then
+ npts1=180000
dd(1:npts1)=shared_data%id2(1:npts1)
rms=sum(abs(dd(1:10))) + sum(abs(dd(76001:76010))) + sum(abs(dd(151670:151680)))
dd8(1:npts1)=dd(1:npts1)
diff --git a/lib/map65_mmdec.f90 b/lib/map65_mmdec.f90
index 14871857..3d7512a9 100644
--- a/lib/map65_mmdec.f90
+++ b/lib/map65_mmdec.f90
@@ -1,20 +1,28 @@
+module map65_mmdec_mod
+ implicit none
+contains
+
subroutine map65_mmdec(nutc,id2,nqd,ntrperiod, nsubmode,nfa,nfb,nfqso, &
ntol,newdat,nagain,max_drift,ndepth,mycall,hiscall,hisgrid)
use prog_args
use timer_module, only: timer
use q65_decode
+ use iso_fortran_env, only: int16
include 'jt9com.f90'
- include 'timer_common.inc'
type, extends(q65_decoder) :: counting_q65_decoder
integer :: decoded
end type counting_q65_decoder
logical single_decode,bVHF,lnewdat,lagain,lclearave,lapcqonly
- integer*2 id2(300*12000)
+ integer(int16) id2(300*12000)
integer nqf(20)
+ integer nutc,nqd,ntrperiod,nsubmode,nfa,nfb,nfqso,ntol
+ integer newdat,nagain,max_drift,ndepth,navg0,ncontest
+ integer nqsoprogress,ntr0
+ real emedelay
! type(params_block) :: params
character(len=12) :: mycall, hiscall
character(len=6) :: hisgrid
@@ -88,3 +96,4 @@ contains
end subroutine q65_decoded
end subroutine map65_mmdec
+end module map65_mmdec_mod \ No newline at end of file
diff --git a/lib/refspectrum.f90 b/lib/refspectrum.f90
index 68b514f9..862d38f0 100644
--- a/lib/refspectrum.f90
+++ b/lib/refspectrum.f90
@@ -35,7 +35,16 @@ subroutine refspectrum(id2,bclear,brefspec,buseref,fname)
xs=0.
first=.false.
endif
- if(bclear) s=0.
+ if(bclear) then
+ s=0.
+ fil=1.0
+ ref=0.0
+ filter=0.0
+ cfil=0.0
+ xs=0.0
+ nsave=0
+ blastuse=.false.
+ endif
if(brefspec) then
x(0:NH-1)=0.001*id2(1:NH)