Protect against bounds error when ntol range goes below 0.

This commit is contained in:
Joe Taylor 2021-06-03 13:34:22 -04:00
parent 068a96a489
commit f7464c8df6
1 changed files with 2 additions and 2 deletions

View File

@ -439,8 +439,8 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ntol,ndepth,ntrperiod,iavg,ipk,jpk, &
ib=min(nfb,4900)/df
if(nqd.ne.1 .or. iavg.ne.0) max_drift=0
if(max_drift.ne.0) then
ia=nint((nfqso-ntol)/df)
ib=nint((nfqso+ntol)/df)
ia=max(100,nint((nfqso-ntol)/df))
ib=min(4900,nint((nfqso+ntol)/df))
endif
do i=ia,ib