Decrease execution time of the most time-consuming loop in opdetmsk144.f90.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7095 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2016-09-17 22:59:21 +00:00
parent 1acefe669a
commit dda9f24b9d

View File

@ -15,6 +15,7 @@ subroutine opdetmsk144(cbig,n,lines,nmessages,nutc,ntol,t00)
complex cb(42) !Complex waveform for sync word complex cb(42) !Complex waveform for sync word
complex cfac,cca,ccb complex cfac,cca,ccb
complex cc(0:NSPM-1) complex cc(0:NSPM-1)
complex csum
integer s8(8),hardbits(144) integer s8(8),hardbits(144)
integer, dimension(1) :: iloc integer, dimension(1) :: iloc
integer*1 decoded(80) integer*1 decoded(80)
@ -87,17 +88,27 @@ subroutine opdetmsk144(cbig,n,lines,nmessages,nutc,ntol,t00)
bestf=0.0 bestf=0.0
do ifr=-ntol,ntol ! search for frequency that maximizes sync correlation do ifr=-ntol,ntol ! search for frequency that maximizes sync correlation
ferr=ifr ferr=ifr
! call timer('opdetavg ',0)
call tweak1(cdat,NPTS,-(1500+ferr),cdat2) call tweak1(cdat,NPTS,-(1500+ferr),cdat2)
cr=reshape(cdat2,(/NSPM,NAVG/)) cr=reshape(cdat2,(/NSPM,NAVG/))
c=sum(cr,2) c=sum(cr,2)
! call timer('opdetavg ',1)
! call timer('opdetsync',0)
cc=0 cc=0
do ish=0,NSPM-1 do ish=0,NSPM-1
ct=cshift(c,ish) ct=cshift(c,ish)
cc(ish)=sum(ct(1:42)*conjg(cb))+sum(ct(56*6:56*6+41)*conjg(cb)) ! cc(ish)=sum(ct(1:42)*conjg(cb))+sum(ct(56*6:56*6+41)*conjg(cb))
! cc(ish)=sum(ct(1:42)*conjg(cb)+ ct(56*6:56*6+41)*conjg(cb))
csum=0
do j=1,42
csum=csum+(ct(j)+ct(56*6+j-1))*conjg(cb(j))
enddo
cc(ish)=csum
enddo enddo
ccm=abs(cc) ccm=abs(cc)
xb=maxval(ccm) xb=maxval(ccm)
! call timer('opdetsync',1)
if( xb .gt. xmax ) then if( xb .gt. xmax ) then
xmax=xb xmax=xb
bestf=ferr bestf=ferr