From 72d3e6f6b03227fd3e6212bc73b4c5acd9aab67d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 12 Nov 2018 12:28:17 -0500 Subject: [PATCH] Protect against negative ccfred() value in sync4. --- lib/sync4.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sync4.f90 b/lib/sync4.f90 index a15177665..e3a6a24de 100644 --- a/lib/sync4.f90 +++ b/lib/sync4.f90 @@ -140,8 +140,9 @@ subroutine sync4(dat,jz,ntol,nfqso,mode,mode4,minwidth,dtx,dfx,snrx, & endif enddo rms=0.1 + snrx=-26.0 if(ns.gt.0) rms=sqrt(sq/ns) - snrx=10.0*log10(ccfred(ipk1a)/rms) - 41.2 + if(ccfred(ipk1a).gt.0.0) snrx=10.0*log10(ccfred(ipk1a)/rms) - 41.2 if(snrx.gt.50.0) snrx=50.0 900 return