2012-10-02 11:56:18 -04:00
|
|
|
subroutine sync9(ss,tstep,f0a,df3)
|
2012-10-01 16:37:05 -04:00
|
|
|
|
|
|
|
parameter (NSMAX=22000) !Max length of saved spectra
|
|
|
|
real ss(184,NSMAX)
|
|
|
|
|
|
|
|
integer ii(16)
|
|
|
|
integer isync(85) !Sync vector
|
|
|
|
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/
|
|
|
|
|
|
|
|
ii=0
|
|
|
|
k=0
|
|
|
|
do i=1,85
|
|
|
|
if(isync(i).eq.1) then
|
|
|
|
k=k+1
|
|
|
|
ii(k)=2*i-1
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
|
|
|
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 11:56:18 -04:00
|
|
|
freq=f0a + (npk-1)*df3
|
|
|
|
write(*,1010) lagpk,npk,freq
|
|
|
|
1010 format('lagpk:',i4,' npk:',i6,' freq:',f8.2)
|
|
|
|
|
2012-10-01 16:37:05 -04:00
|
|
|
do lag=-lagmax,lagmax
|
|
|
|
sum=0.
|
|
|
|
do i=1,16
|
|
|
|
k=ii(i) + lag
|
2012-10-02 11:56:18 -04:00
|
|
|
if(k.ge.1) sum=sum + ss(k,npk)
|
2012-10-01 16:37:05 -04:00
|
|
|
enddo
|
2012-10-02 11:56:18 -04:00
|
|
|
! write(73,3000) lag,sum
|
|
|
|
!3000 format(i3,f12.3)
|
2012-10-01 16:37:05 -04:00
|
|
|
enddo
|
2012-10-02 11:56:18 -04:00
|
|
|
flush(73)
|
2012-10-01 16:37:05 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine sync9
|