From e0c06168cf284022d7a51604fd1cbd5a9a6bbce8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 30 Jun 2021 14:49:00 -0400 Subject: [PATCH] One more attempt at fixing the bounds errors in spec64. --- lib/spec64.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spec64.f90 b/lib/spec64.f90 index 048bf6700..793220500 100644 --- a/lib/spec64.f90 +++ b/lib/spec64.f90 @@ -22,7 +22,9 @@ subroutine spec64(c0,npts,nsps,mode_q65,jpk,s3,LL,NN) jb=ja+nsps-1 if(ja.lt.0) ja=0 if(jb.gt.npts-1) jb=npts-1 - cs(0:nfft-1)=c0(ja:jb) + nz=jb-ja + cs(0:nz)=c0(ja:jb) + if(nz.lt.nfft-1) cs(nz+1:)=0. call four2a(cs,nsps,1,-1,1) !c2c FFT to frequency do ii=1,LL i=ii-65+mode_q65 !mode_q65 = 1 2 4 8 16 for Q65 A B C D E