summaryrefslogtreecommitdiff
path: root/qmap/libqmap
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
commit059831534c7e884f0a607ed86b582fd00d821731 (patch)
tree76bcb67a78f8aa2654fd34c2ad801a62136b0170 /qmap/libqmap
parentd83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff)
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'qmap/libqmap')
-rw-r--r--qmap/libqmap/CMakeLists.txt13
-rw-r--r--qmap/libqmap/decode0.f904
-rw-r--r--qmap/libqmap/getcand2.f901
-rw-r--r--qmap/libqmap/q65b.f9015
-rw-r--r--qmap/libqmap/q65c.f906
-rw-r--r--qmap/libqmap/qmap_decode_ipc.f9018
-rw-r--r--qmap/libqmap/qmapa.f906
-rw-r--r--qmap/libqmap/read_qm.f9011
-rw-r--r--qmap/libqmap/save_qm.f902
9 files changed, 50 insertions, 26 deletions
diff --git a/qmap/libqmap/CMakeLists.txt b/qmap/libqmap/CMakeLists.txt
index 7ecc22ef..5480486b 100644
--- a/qmap/libqmap/CMakeLists.txt
+++ b/qmap/libqmap/CMakeLists.txt
@@ -1,5 +1,6 @@
set (libq65_FSRCS
# Modules come first:
+ qmap_decode_ipc.f90
cacb_mod.f90
# Non-module Fortran routines:
@@ -49,10 +50,20 @@ set (libq65_C_and_CXXSRCS
set_property (SOURCE ${libq65_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h")
set_property (SOURCE ${libq65_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/wsjtx_config.h)
+# These carry dummy arguments that are genuine QMAP-GUI-supplied state
+# (see qmap/mainwindow.cpp) which the current Fortran implementation
+# doesn't happen to reference; removing them would mean touching the
+# GUI call sites too, so we suppress the warning instead.
+set_source_files_properties (chkstat.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument")
+set_source_files_properties (symspec.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument")
+set_source_files_properties (q65b.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument")
+
#
# build our targets
#
add_library (qmap_impl STATIC ${libq65_FSRCS} ${libq65_CSRCS} ${libq65_CXXSRCS})
-target_link_libraries (qmap_impl PUBLIC Qt5::Core)
+if (NOT APPLE)
+ target_link_libraries (qmap_impl PUBLIC Qt5::Core)
+endif ()
wsjt_link_common_fortran (qmap_impl)
diff --git a/qmap/libqmap/decode0.f90 b/qmap/libqmap/decode0.f90
index d119fdcb..901da861 100644
--- a/qmap/libqmap/decode0.f90
+++ b/qmap/libqmap/decode0.f90
@@ -1,6 +1,7 @@
subroutine decode0(dd,ss,savg)
use timer_module, only: timer
+ use qmap_decode_ipc, only: nQDecoderDone
parameter (NSMAX=60*96000,NFFT=32768)
real*4 dd(2,NSMAX),ss(400,NFFT),savg(NFFT)
@@ -10,9 +11,6 @@ subroutine decode0(dd,ss,savg)
logical*1 bAlso30
character mycall*12,hiscall*12,mygrid*6,hisgrid*6,datetime*20
character mycall0*12,hiscall0*12,hisgrid0*6
- character*72 result
- common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
- nWTransmitting,kHzRequested,result(50)
common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, &
ndepth,ndiskdat,ntx60,newdat,nfa,nfb,nfcal,nfshift, &
ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,ndop58,nmode, &
diff --git a/qmap/libqmap/getcand2.f90 b/qmap/libqmap/getcand2.f90
index 521f97f6..c98c3088 100644
--- a/qmap/libqmap/getcand2.f90
+++ b/qmap/libqmap/getcand2.f90
@@ -16,6 +16,7 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
type(candidate) :: cand(MAX_CANDIDATES)
real ss(400,NFFT) !Symbol spectra
real savg0(NFFT),savg(NFFT) !Average spectra over whole Rx sequence
+ save savg !Keep this big array off the stack
integer ipk1(1) !Peak index of local portion of spectrum
logical sync_ok !True if sync pattern is present
logical*1 bAlso30
diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90
index 4ac1bd1e..619f785d 100644
--- a/qmap/libqmap/q65b.f90
+++ b/qmap/libqmap/q65b.f90
@@ -12,6 +12,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
use wavhdr
use timer_module, only: timer
use map65_mmdec_mod, only: map65_mmdec
+ use qmap_decode_ipc, only: max_decode_rows, decode_row_length, &
+ ndecodes, result, result2
use iso_fortran_env, only: int16
use cacb_mod, only: ca, init_cacb
@@ -31,18 +33,13 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
character*4 grid4
character*3 csubmode
character*17 fname
- character*72 result,ctmp
- character*8 result2 !liveCQ
+ character(len=decode_row_length) ctmp
character*20 datetime,datetime1
- character*1 c1
- common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
- nWTransmitting,kHzRequested,result(50)
- common/decodes2/result2(50) !liveCQ
data ifile/0/
save
-
- call init_cacb(MAXFFT1)
+ call init_cacb(MAXFFT1)
+
if(mycall0(1:1).ne.' ') mycall=mycall0
if(hiscall0(1:1).ne.' ') hiscall=hiscall0
if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4)
@@ -164,7 +161,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal
fsked=frx - 0.001*ndop00/2.0 - 0.001*offset
ctmp=csubmode//' '//trim(msg0)
- ndecodes=min(ndecodes+1,50)
+ ndecodes=min(ndecodes+1,max_decode_rows)
write(result(ndecodes),1120) nhhmmss,frx,fsked,xdt0,nsnr0,trim(ctmp)
1120 format(i6.6,f9.3,f7.1,f7.2,i5,2x,a)
write(result2(ndecodes),1125) fsked !liveCQ
diff --git a/qmap/libqmap/q65c.f90 b/qmap/libqmap/q65c.f90
index 51b4335e..eadf53d7 100644
--- a/qmap/libqmap/q65c.f90
+++ b/qmap/libqmap/q65c.f90
@@ -6,6 +6,7 @@ subroutine q65c
use FFTW3
use q65
use q65_decode
+ use qmap_decode_ipc, only: ndecodes
parameter (NFFT=32768)
include 'njunk.f90'
@@ -20,11 +21,6 @@ subroutine q65c
character*12 mycall,hiscall
character*6 mygrid,hisgrid
character*20 datetime
- character*72 result
- character*8 result2 !liveCQ
- common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
- nWTransmitting,kHzRequested,result(50)
- common/decodes2/result2(50) !liveCQ
common/datcom2/dd(2,5760000),ss(400,NFFT),savg(NFFT),nparams0
common/savecom/revision,fname
!### REMEMBER that /npar/ is not updated until nparams=nparams0 is executed. ###
diff --git a/qmap/libqmap/qmap_decode_ipc.f90 b/qmap/libqmap/qmap_decode_ipc.f90
new file mode 100644
index 00000000..0f8d5d5e
--- /dev/null
+++ b/qmap/libqmap/qmap_decode_ipc.f90
@@ -0,0 +1,18 @@
+module qmap_decode_ipc
+ implicit none
+
+ ! Keep row dimensions in sync with qmap/decode_ipc.h.
+ integer, parameter :: max_decode_rows = 50
+ integer, parameter :: decode_row_length = 80
+ integer, parameter :: live_cq_row_length = 8
+
+ integer ndecodes,ncand2,nQDecoderDone,nWDecoderBusy
+ integer nWTransmitting,kHzRequested
+ character(len=decode_row_length) result(max_decode_rows)
+ character(len=live_cq_row_length) result2(max_decode_rows)
+
+ common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
+ nWTransmitting,kHzRequested,result
+ common/decodes2/result2
+
+end module qmap_decode_ipc
diff --git a/qmap/libqmap/qmapa.f90 b/qmap/libqmap/qmapa.f90
index 7c299885..2b785622 100644
--- a/qmap/libqmap/qmapa.f90
+++ b/qmap/libqmap/qmapa.f90
@@ -6,6 +6,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
! Processes timf2 data received from Linrad to find and decode Q65 signals.
use timer_module, only: timer
+ use qmap_decode_ipc, only: ndecodes, ncand2
type candidate
real :: snr !Relative S/N of sync detection
@@ -33,12 +34,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
character mycall*12,hiscall*12,hisgrid*6
type(candidate) :: cand(MAX_CANDIDATES)
type(good_decode) found(MAX_CANDIDATES)
- character*72 result
- character*8 result2 !liveCQ
character*20 datetime
- common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
- nWTransmitting,kHzRequested,result(50)
- common/decodes2/result2(50) !liveCQ
save
tsec0=sec_midn()
diff --git a/qmap/libqmap/read_qm.f90 b/qmap/libqmap/read_qm.f90
index 67e3a0cd..30b02eda 100644
--- a/qmap/libqmap/read_qm.f90
+++ b/qmap/libqmap/read_qm.f90
@@ -7,21 +7,28 @@ subroutine read_qm(fname,iret)
real*8 fcenter
integer nxtra(15) !For possible future additions
integer*1 id1(2,NMAX)
+ save id1 !Keep this big array off the stack
common/datcom/dd(2,5760000),ss(400,NFFT),savg(NFFT), &
fcenter,nutc,fselected,mousedf,mousefqso,nagain, &
ndepth,ndiskdat,ntx60,newdat,nn1,nn2,nfcal,nfshift, &
ntx30a,ntx30b !...
open(28,file=trim(fname),status='old',access='stream',err=900)
- read(28,end=910) prog_id,mycall,mygrid,fcenter,nutc,ntx30a, &
+ read(28,end=910,err=910) prog_id,mycall,mygrid,fcenter,nutc,ntx30a, &
ntx30b,ndop00,ndop58,ia,ib,fac0,nxtra
+
+ if(.not. ((ia.eq.1 .and. ib.eq.NMAX) .or. &
+ (ia.eq.1 .and. ib.eq.NMAX/2) .or. &
+ (ia.eq.NMAX/2+1 .and. ib.eq.NMAX) .or. &
+ (ia.eq.NMAX/2+1 .and. ib.eq.NMAX/2))) go to 910
+
iret=3
if(ib.eq.NMAX/2) iret=1
if(ia.eq.NMAX/2+1) iret=2
fac=1.0
if(fac0.gt.0.0) fac=1.0/fac0
id1=0
- read(28,end=910) id1(1:2,ia:ib)
+ read(28,end=910,err=910) id1(1:2,ia:ib)
dd=0.
dd(1:2,ia:ib)=fac*id1(1:2,ia:ib) !Boost back to previous level
go to 999
diff --git a/qmap/libqmap/save_qm.f90 b/qmap/libqmap/save_qm.f90
index 282f29b8..94a32b0b 100644
--- a/qmap/libqmap/save_qm.f90
+++ b/qmap/libqmap/save_qm.f90
@@ -15,6 +15,7 @@ subroutine save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, &
ib=NMAX
if(ntx30a.gt.5) ia=NMAX/2+1
if(ntx30b.gt.5) ib=NMAX/2
+ if(ia.gt.ib) return
sq=0.
do i=ia,ib
@@ -60,4 +61,3 @@ subroutine save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, &
return
end subroutine save_qm
-