diff --git a/map65/libm65/four2a.f90 b/map65/libm65/four2a.f90 index 57c7239e1..fc46109e5 100644 --- a/map65/libm65/four2a.f90 +++ b/map65/libm65/four2a.f90 @@ -19,9 +19,10 @@ subroutine four2a(a,nfft,ndim,isign,iform) ! This version of four2a makes calls to the FFTW library to do the ! actual computations. + use fftw3 parameter (NPMAX=2100) !Max numberf of stored plans parameter (NSMALL=16384) !Max size of "small" FFTs - complex a(nfft) !Array to be transformed + complex a(nfft+1) !Array to be transformed complex aa(NSMALL) !Local copy of "small" a() integer nn(NPMAX),ns(NPMAX),nf(NPMAX) !Params of stored plans integer*8 nl(NPMAX),nloc !More params of plans @@ -29,7 +30,6 @@ subroutine four2a(a,nfft,ndim,isign,iform) logical found_plan data nplan/0/ !Number of stored plans common/patience/npatience,nthreads !Patience and threads for FFTW plans - include 'fftw3.f90' !FFTW definitions save plan,nplan,nn,ns,nf,nl if(nfft.lt.0) go to 999 diff --git a/map65/libm65/q65b.f90 b/map65/libm65/q65b.f90 index 0ab383f2a..9da1b8430 100644 --- a/map65/libm65/q65b.f90 +++ b/map65/libm65/q65b.f90 @@ -8,7 +8,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & type(hdr) h !Header for the .wav file integer*2 iwave(60*12000) complex ca(MAXFFT1),cb(MAXFFT1) !FFTs of raw x,y data - complex cx(0:MAXFFT2-1),cy(0:MAXFFT2-1),cz(0:MAXFFT2-1) + complex cx(0:MAXFFT2-1),cy(0:MAXFFT2-1),cz(0:MAXFFT2) logical xpol,first real*8 fcenter character*12 mycall0,hiscall0 @@ -87,10 +87,11 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & npol=1 if(xpol) npol=4 do ipol=1,npol - if(ipol.eq.1) cz=cx - if(ipol.eq.2) cz=0.707*(cx+cy) - if(ipol.eq.3) cz=cy - if(ipol.eq.4) cz=0.707*(cx-cy) + if(ipol.eq.1) cz(0:MAXFFT2-1)=cx + if(ipol.eq.2) cz(0:MAXFFT2-1)=0.707*(cx+cy) + if(ipol.eq.3) cz(0:MAXFFT2-1)=cy + if(ipol.eq.4) cz(0:MAXFFT2-1)=0.707*(cx-cy) + cz(MAXFFT2)=0. call four2a(cz,2*nfft2,1,1,-1) !Transform to time domain (real), fsample=12000 Hz do i=0,nfft2-1 j=nfft2-1-i