From 3d04c767cab550fe15dc16ae04b27f65a054b572 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 18 Jul 2021 08:39:34 -0400 Subject: [PATCH] Protect against a bounds error when no input data. --- lib/qra/q65/q65.f90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index c9c4331b8..86cd15d56 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -425,9 +425,13 @@ subroutine q65_ccf_85(s1,iz,jz,nfqso,ia,ia2,ipk,jpk,f0,xdt,imsg_best, & endif best(imsg)=ccfmax enddo ! imsg + deallocate(ccf) - best(imsg_best)=0. - better=ccf_best/maxval(best) + better=0. + if(imsg_best.gt.0) then + best(imsg_best)=0. + better=ccf_best/maxval(best) + endif return end subroutine q65_ccf_85