From 595ef8e9db0d07b4c80ee5ce27ae490011299fed Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 20 Oct 2021 18:00:32 +0100 Subject: [PATCH] Repair a long-standing defect that could cause access violations This was revealed when building with gcc-fortran v11 and using reference spectrum correction. --- lib/four2a.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/four2a.f90 b/lib/four2a.f90 index e7e0e8018..a63f31a4d 100644 --- a/lib/four2a.f90 +++ b/lib/four2a.f90 @@ -67,7 +67,7 @@ subroutine four2a(a,nfft,ndim,isign,iform) if(nfft.le.NSMALL) then jz=nfft - if(iform.eq.0) jz=nfft/2 + if(iform.le.0) jz=nfft/2 aa(1:jz)=a(1:jz) endif @@ -87,7 +87,7 @@ subroutine four2a(a,nfft,ndim,isign,iform) if(nfft.le.NSMALL) then jz=nfft - if(iform.eq.0) jz=nfft/2 + if(iform.le.0) jz=nfft/2 a(1:jz)=aa(1:jz) endif end if