From d3b1f7e5606b9cc247ac60a6a1616eb54fac0264 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Sun, 27 Jan 2019 19:28:41 -0600 Subject: [PATCH] Prevent some out-of-bounds problems. --- lib/ft4/ft4_decode.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ft4/ft4_decode.f90 b/lib/ft4/ft4_decode.f90 index 27b9922b7..ed7e8275d 100644 --- a/lib/ft4/ft4_decode.f90 +++ b/lib/ft4/ft4_decode.f90 @@ -64,7 +64,7 @@ subroutine ft4_decode(cdatetime0,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line) candidate=0.0 ncand=0 - fa=375.0 + fa=400.0 fb=3000.0 syncmin=1.2 maxcand=100 @@ -311,8 +311,8 @@ subroutine ft4_downsample(iwave,f0,c) do i=1,NFFT2/2 arg=(i-1)*df/bw win=exp(-arg*arg) - c1(i)=cx(i0+i)*win - c1(NFFT2-i)=cx(i0-i)*win + if(i0+i.le.NMAX/2) c1(i)=cx(i0+i)*win + if(i0-i.ge.0) c1(NFFT2-i)=cx(i0-i)*win enddo c1=c1/NFFT2 call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain