From 1bcbca4634251920bfa363f1f6c0abf948c539a1 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sun, 23 Oct 2022 16:48:21 -0500 Subject: [PATCH] FT8: Avoid a crash when a wav file is processed multiple times. --- lib/ft8/sync8.f90 | 2 +- lib/ft8_decode.f90 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ft8/sync8.f90 b/lib/ft8/sync8.f90 index a4e74a161..f048eb394 100644 --- a/lib/ft8/sync8.f90 +++ b/lib/ft8/sync8.f90 @@ -88,7 +88,7 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,maxcand,s,candidate, & red=0. red2=0. mlag=20 - mlag2=62 + mlag2=JZ do i=ia,ib ii=maxloc(sync2d(i,-mlag:mlag)) - 1 - mlag jpeak(i)=ii(1) diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90 index cc4b90a5a..9804a6aea 100644 --- a/lib/ft8_decode.f90 +++ b/lib/ft8_decode.f90 @@ -80,7 +80,9 @@ contains dt0=0. f0=0. endif - if(nutc.ne.nutc0) then +!Added 41==nzhsym to force a reset if the same wav file is processed twice or more in a row, +!in which case nutc.eq.nutc0 and ndec(jseq,1) doesn't get reset + if(nzhsym==41 .or. (nutc.ne.nutc0)) then ! New UTC. Move previously saved 'a7' data from k=1 to k=0 iz=ndec(jseq,1) dt0(1:iz,jseq,0) = dt0(1:iz,jseq,1)