summaryrefslogtreecommitdiff
path: root/qmap/libqmap
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-06-22 12:03:44 +0200
committerChristoph Berg <myon@debian.org>2026-06-22 12:03:44 +0200
commitd83a420f0517d7fc47aeb288a6a0cf4891784fcc (patch)
tree6d9c83527c56458a8360ba080bf5f4ca73d526dc /qmap/libqmap
parent4b089ae3f7e9e2d5662f718f663b26a4e8ee63ca (diff)
New upstream version 3.0.2+dfsgupstream/3.0.2+dfsg
Diffstat (limited to 'qmap/libqmap')
-rw-r--r--qmap/libqmap/CMakeLists.txt5
-rw-r--r--qmap/libqmap/cacb_mod.f9023
-rw-r--r--qmap/libqmap/fftbig.f908
-rw-r--r--qmap/libqmap/q65b.f9011
4 files changed, 38 insertions, 9 deletions
diff --git a/qmap/libqmap/CMakeLists.txt b/qmap/libqmap/CMakeLists.txt
index 2eb3a0bb..7ecc22ef 100644
--- a/qmap/libqmap/CMakeLists.txt
+++ b/qmap/libqmap/CMakeLists.txt
@@ -1,5 +1,6 @@
set (libq65_FSRCS
# Modules come first:
+ cacb_mod.f90
# Non-module Fortran routines:
astro.f90
@@ -53,5 +54,5 @@ set_property (SOURCE ${libq65_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CM
# build our targets
#
add_library (qmap_impl STATIC ${libq65_FSRCS} ${libq65_CSRCS} ${libq65_CXXSRCS})
-target_link_libraries (qmap_impl wsjt_fort wsjt_cxx Qt5::Core)
-
+target_link_libraries (qmap_impl PUBLIC Qt5::Core)
+wsjt_link_common_fortran (qmap_impl)
diff --git a/qmap/libqmap/cacb_mod.f90 b/qmap/libqmap/cacb_mod.f90
new file mode 100644
index 00000000..ed4af75c
--- /dev/null
+++ b/qmap/libqmap/cacb_mod.f90
@@ -0,0 +1,23 @@
+module cacb_mod
+ implicit none
+
+ complex, allocatable :: ca(:) ! FFT of raw I/Q data from Linrad
+
+contains
+
+ subroutine init_cacb(n)
+ integer, intent(in) :: n
+
+ if (allocated(ca)) then
+ if (size(ca) >= n) return
+ deallocate(ca)
+ endif
+
+ allocate(ca(n))
+ end subroutine init_cacb
+
+ subroutine free_cacb()
+ if (allocated(ca)) deallocate(ca)
+ end subroutine free_cacb
+
+end module cacb_mod
diff --git a/qmap/libqmap/fftbig.f90 b/qmap/libqmap/fftbig.f90
index 085fd39f..5fc2af6e 100644
--- a/qmap/libqmap/fftbig.f90
+++ b/qmap/libqmap/fftbig.f90
@@ -6,13 +6,12 @@ subroutine fftbig(dd,nmax)
use FFTW3
use timer_module, only: timer
+ use cacb_mod, only: ca, init_cacb, free_cacb
parameter (MAXFFT1=5376000)
real*4 dd(2,nmax) !Input data
- complex ca(MAXFFT1) !FFT of input
real*8 df
type(C_PTR) :: plan1 !Pointer to FFTW plan
logical first
- common/cacb/ca
equivalence (rfilt,cfilt)
data first/.true./,npatience/0/
save
@@ -20,6 +19,7 @@ subroutine fftbig(dd,nmax)
if(nmax.lt.0) go to 900
nfft1=MAXFFT1
+ call init_cacb(nfft1)
if(first) then
nflags=FFTW_ESTIMATE
if(npatience.eq.1) nflags=FFTW_ESTIMATE_PATIENT
@@ -50,7 +50,9 @@ subroutine fftbig(dd,nmax)
call timer('FFTbig ',1)
go to 999
-900 call fftwf_destroy_plan(plan1)
+900 if(.not.first) call fftwf_destroy_plan(plan1)
+ call free_cacb()
+ first=.true.
999 return
end subroutine fftbig
diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90
index 8409b798..4ac1bd1e 100644
--- a/qmap/libqmap/q65b.f90
+++ b/qmap/libqmap/q65b.f90
@@ -6,20 +6,22 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
! This routine provides an interface between QMAP and the Q65 decoder
! in WSJT-X. All arguments are input data obtained from the QMAP GUI.
! Raw Rx data are available as the 96 kHz complex spectrum ca(MAXFFT1)
-! in common/cacb. Decoded messages are sent back to the GUI.
+! in cacb_mod. Decoded messages are sent back to the GUI.
use q65_decode
use wavhdr
use timer_module, only: timer
+ use map65_mmdec_mod, only: map65_mmdec
+ use iso_fortran_env, only: int16
+ use cacb_mod, only: ca, init_cacb
parameter (MAXFFT1=5376000) !56*96000
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
parameter (NMAX=60*12000)
parameter (RAD=57.2957795)
type(hdr) h
- integer*2 iwave(60*12000)
+ integer(int16) iwave(300*12000)
integer offset
- complex ca(MAXFFT1) !FFT of raw I/Q data from Linrad
complex cx(0:MAXFFT2-1),cz(0:MAXFFT2)
real*8 fcenter,freq0,freq1
logical*1 bClickDecode
@@ -36,9 +38,10 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
nWTransmitting,kHzRequested,result(50)
common/decodes2/result2(50) !liveCQ
- common/cacb/ca
data ifile/0/
save
+
+ call init_cacb(MAXFFT1)
if(mycall0(1:1).ne.' ') mycall=mycall0
if(hiscall0(1:1).ne.' ') hiscall=hiscall0