summaryrefslogtreecommitdiff
path: root/lib/xcor.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xcor.f90')
-rw-r--r--lib/xcor.f9017
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/xcor.f90 b/lib/xcor.f90
index 3f95f768..83937736 100644
--- a/lib/xcor.f90
+++ b/lib/xcor.f90
@@ -1,4 +1,5 @@
-subroutine xcor(ss,ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust)
+!subroutine xcor(ss,ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust)
+subroutine xcor(ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust)
! Computes ccf of a row of ss and the pseudo-random array pr. Returns
! peak of the CCF and the lag at which peak occurs. For JT65, the
@@ -7,17 +8,19 @@ subroutine xcor(ss,ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust)
use jt65_mod
parameter (NHMAX=3413) !Max length of power spectra
- parameter (NSMAX=322) !Max number of half-symbol steps
+ parameter (NSMAX=552) !Max number of quarter-symbol steps
real ss(NSMAX,NHMAX) !2d spectrum, stepped by half-symbols
real a(NSMAX)
- real ccf(-11:540)
+! real ccf(-44:118)
+ real ccf(lag1:lag2)
data lagmin/0/ !Silence g77 warning
- save
+! save
+ common/sync/ss
df=12000.0/8192.
- dtstep=0.5/df
+! dtstep=0.5/df
+ dtstep=0.25/df
fac=dtstep/(60.0*df)
-
do j=1,nsteps
ii=nint((j-nsteps/2)*fdot*fac)+ipk
if( (ii.ge.1) .and. (ii.le.NHMAX) ) then
@@ -43,7 +46,7 @@ subroutine xcor(ss,ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust)
do lag=lag1,lag2
x=0.
do i=1,nsym
- j=2*i-1+lag
+ j=4*i-3+lag
if(j.ge.1 .and. j.le.nsteps) x=x+a(j)*pr(i)
enddo
ccf(lag)=2*x !The 2 is for plotting scale