summaryrefslogtreecommitdiff
path: root/lib/ccf2.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
committerChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
commitf647d78463c1250ce9c99af664615fafccf5e959 (patch)
tree5b00428cef68aef1c9d407e2d4535687422419b6 /lib/ccf2.f90
parent0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'lib/ccf2.f90')
-rw-r--r--[-rwxr-xr-x]lib/ccf2.f9098
1 files changed, 49 insertions, 49 deletions
diff --git a/lib/ccf2.f90 b/lib/ccf2.f90
index 42392d67..8e1f6cf4 100755..100644
--- a/lib/ccf2.f90
+++ b/lib/ccf2.f90
@@ -1,49 +1,49 @@
-subroutine ccf2(ss,nz,nflip,ccfbest,xlagpk)
-
-! parameter (LAGMIN=-86,LAGMAX=258)
- parameter (LAGMIN=-112,LAGMAX=258) ! Look for DT from -3.6s to +5.0s
- real ss(nz)
- real ccf(-LAGMAX:LAGMAX)
- integer npr(126)
-
-! The JT65 pseudo-random sync pattern:
- data npr/ &
- 1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, &
- 0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, &
- 0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, &
- 0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, &
- 1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, &
- 0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, &
- 1,1,1,1,1,1/
- save
-
- ccfbest=0.
- lag1=LAGMIN
- lag2=LAGMAX
- do lag=lag1,lag2
- s0=0.
- s1=0.
- do i=1,126
- j=16*(i-1)+1 + lag
- if(j.ge.1 .and. j.le.nz-8) then
- x=ss(j)
- if(npr(i).eq.0) then
- s0=s0 + x
- else
- s1=s1 + x
- endif
- endif
- enddo
- ccf(lag)=nflip*(s1-s0)
- 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
+subroutine ccf2(ss,nz,nflip,ccfbest,xlagpk)
+
+! parameter (LAGMIN=-86,LAGMAX=258)
+ parameter (LAGMIN=-112,LAGMAX=258) ! Look for DT from -3.6s to +5.0s
+ real ss(nz)
+ real ccf(-LAGMAX:LAGMAX)
+ integer npr(126)
+
+! The JT65 pseudo-random sync pattern:
+ data npr/ &
+ 1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, &
+ 0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, &
+ 0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, &
+ 0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, &
+ 1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, &
+ 0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, &
+ 1,1,1,1,1,1/
+ save
+
+ ccfbest=0.
+ lag1=LAGMIN
+ lag2=LAGMAX
+ do lag=lag1,lag2
+ s0=0.
+ s1=0.
+ do i=1,126
+ j=16*(i-1)+1 + lag
+ if(j.ge.1 .and. j.le.nz-8) then
+ x=ss(j)
+ if(npr(i).eq.0) then
+ s0=s0 + x
+ else
+ s1=s1 + x
+ endif
+ endif
+ enddo
+ ccf(lag)=nflip*(s1-s0)
+ 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