2012-10-03 14:39:37 -04:00
|
|
|
subroutine sync9(ss,tstep,f0a,df3,fpk)
|
2012-10-01 16:37:05 -04:00
|
|
|
|
|
|
|
parameter (NSMAX=22000) !Max length of saved spectra
|
|
|
|
real ss(184,NSMAX)
|
|
|
|
|
2012-10-02 14:08:44 -04:00
|
|
|
integer ii0(16)
|
|
|
|
integer ii(16) !Locations of sync half-symbols
|
|
|
|
data ii/1,11,21,31,41,51,61,77,89,101,113,125,137,149,161,169/
|
|
|
|
integer isync(85) !Sync vector for half-symbols
|
2012-10-01 16:37:05 -04:00
|
|
|
data isync/ &
|
|
|
|
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0, &
|
|
|
|
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0, &
|
|
|
|
0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, &
|
|
|
|
0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, &
|
|
|
|
1,0,0,0,1/
|
|
|
|
|
|
|
|
nz=1000.0/df3
|
|
|
|
|
|
|
|
smax=0.
|
2012-10-02 11:56:18 -04:00
|
|
|
lagmax=2.5/tstep + 0.9999
|
2012-10-01 16:37:05 -04:00
|
|
|
do n=1,nz
|
|
|
|
do lag=-lagmax,lagmax
|
|
|
|
sum=0.
|
|
|
|
do i=1,16
|
|
|
|
k=ii(i) + lag
|
|
|
|
if(k.ge.1) sum=sum + ss(k,n)
|
|
|
|
enddo
|
|
|
|
if(sum.gt.smax) then
|
|
|
|
smax=sum
|
|
|
|
npk=n
|
2012-10-02 11:56:18 -04:00
|
|
|
lagpk=lag
|
2012-10-01 16:37:05 -04:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2012-10-02 14:08:44 -04:00
|
|
|
fpk=f0a + (npk-1)*df3
|
2012-10-02 11:56:18 -04:00
|
|
|
|
2012-10-03 12:31:47 -04:00
|
|
|
! This loop for tests only:
|
|
|
|
! do lag=-lagmax,lagmax
|
|
|
|
! sum=0.
|
|
|
|
! do i=1,16
|
|
|
|
! k=ii(i) + lag
|
|
|
|
! if(k.ge.1) sum=sum + ss(k,npk)
|
|
|
|
! enddo
|
|
|
|
! write(71,3001) lag,sum
|
|
|
|
!3001 format(i8,f12.3)
|
|
|
|
! enddo
|
|
|
|
! flush(71)
|
2012-10-01 16:37:05 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine sync9
|