From 37f727ac0746fd85504aa46c1f023c09b3eff33a Mon Sep 17 00:00:00 2001 From: hibby Date: Fri, 16 Feb 2018 15:17:14 +0000 Subject: New upstream version 1.8.0+repack --- lib/ccf2.f90 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/ccf2.f90') diff --git a/lib/ccf2.f90 b/lib/ccf2.f90 index 4e74a52e..194608d1 100644 --- a/lib/ccf2.f90 +++ b/lib/ccf2.f90 @@ -1,7 +1,6 @@ -subroutine ccf2(ss,nz,nflip,ccfbest,lagpk) +subroutine ccf2(ss,nz,nflip,ccfbest,xlagpk) - parameter (LAGMAX=60) -! parameter (LAGMAX=200) + parameter (LAGMIN=-86,LAGMAX=258) real ss(nz) real ccf(-LAGMAX:LAGMAX) integer npr(126) @@ -18,15 +17,15 @@ subroutine ccf2(ss,nz,nflip,ccfbest,lagpk) save ccfbest=0. - lag1=-LAGMAX + lag1=LAGMIN lag2=LAGMAX do lag=lag1,lag2 s0=0. s1=0. do i=1,126 - j=2*(8*i + 43) + lag + j=16*(i-1)+1 + lag if(j.ge.1 .and. j.le.nz-8) then - x=ss(j)+ss(j+8) !Add two half-symbol contributions + x=ss(j) if(npr(i).eq.0) then s0=s0 + x else @@ -38,8 +37,12 @@ subroutine ccf2(ss,nz,nflip,ccfbest,lagpk) if(ccf(lag).gt.ccfbest) then ccfbest=ccf(lag) lagpk=lag + xlagpk=lagpk endif enddo - + if( lagpk.gt.-LAGMAX .and. lagpk.lt.LAGMAX) then + call peakup(ccf(lagpk-1),ccf(lagpk),ccf(lagpk+1),dx) + xlagpk=lagpk+dx + endif return end subroutine ccf2 -- cgit v1.2.3