WSJT-X/lib/sync9.f90
Joe Taylor 7369062c4a Rename library directory
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2635 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2012-10-03 14:31:43 +00:00

48 lines
1.2 KiB
Fortran

subroutine sync9(ss,tstep,f0a,df3,lagpk,fpk)
parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX)
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
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.
lagmax=2.5/tstep + 0.9999
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
lagpk=lag
endif
enddo
enddo
fpk=f0a + (npk-1)*df3
do lag=-lagmax,lagmax
sum=0.
do i=1,16
k=ii(i) + lag
if(k.ge.1) sum=sum + ss(k,npk)
enddo
enddo
return
end subroutine sync9