Strip out callback arguments that are constant and known to the callback implememtation

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6671 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-05-05 01:32:30 +00:00
parent 7c2ededab6
commit e59af9a781
6 changed files with 47 additions and 65 deletions

View File

@ -1,4 +1,4 @@
subroutine decode9w(nutc,nfqso,ntol,nsubmode,ss,id2,sync,nsnr,xdt1,f0,decoded) subroutine decode9w(nfqso,ntol,nsubmode,ss,id2,sync,nsnr,xdt1,f0,decoded)
! Decode a weak signal in a wide/slow JT9 submode. ! Decode a weak signal in a wide/slow JT9 submode.

View File

@ -95,7 +95,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
else if(params%nmode.eq.9 .or. (params%nmode.eq.(65+9) .and. params%ntxmode.eq.9)) then else if(params%nmode.eq.9 .or. (params%nmode.eq.(65+9) .and. params%ntxmode.eq.9)) then
! We're in JT9 mode, or should do JT9 first ! We're in JT9 mode, or should do JT9 first
call timer('decjt9 ',0) call timer('decjt9 ',0)
call my_jt9%decode(jt9_decoded,ss,id2,params%nutc,params%nfqso, & call my_jt9%decode(jt9_decoded,ss,id2,params%nfqso, &
newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, & newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, &
params%ntol,params%nzhsym,logical(params%nagain),params%ndepth, & params%ntol,params%nzhsym,logical(params%nagain),params%ndepth, &
params%nmode,params%nsubmode,params%nexp_decode) params%nmode,params%nsubmode,params%nexp_decode)
@ -118,7 +118,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
call timer('jt65a ',1) call timer('jt65a ',1)
else else
call timer('decjt9 ',0) call timer('decjt9 ',0)
call my_jt9%decode(jt9_decoded,ss,id2,params%nutc,params%nfqso, & call my_jt9%decode(jt9_decoded,ss,id2,params%nfqso, &
newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, & newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, &
params%ntol,params%nzhsym,logical(params%nagain), & params%ntol,params%nzhsym,logical(params%nagain), &
params%ndepth,params%nmode,params%nsubmode,params%nexp_decode) params%ndepth,params%nmode,params%nsubmode,params%nexp_decode)
@ -140,11 +140,10 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
contains contains
subroutine jt4_decoded(this,utc,snr,dt,freq,have_sync,sync,is_deep, & subroutine jt4_decoded(this,snr,dt,freq,have_sync,sync,is_deep, &
decoded,qual,ich,is_average,ave) decoded,qual,ich,is_average,ave)
implicit none implicit none
class(jt4_decoder), intent(inout) :: this class(jt4_decoder), intent(inout) :: this
integer, intent(in) :: utc
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
integer, intent(in) :: freq integer, intent(in) :: freq
@ -163,18 +162,18 @@ contains
if (int(qual).gt.0) then if (int(qual).gt.0) then
write(cqual, '(i2)') int(qual) write(cqual, '(i2)') int(qual)
if (ave.gt.0) then if (ave.gt.0) then
write(*,1000) utc,snr,dt,freq,sync,decoded,cqual, & write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1), ave char(ichar('A')+ich-1), ave
else else
write(*,1000) utc,snr,dt,freq,sync,decoded,cqual, & write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1) char(ichar('A')+ich-1)
end if end if
else else
write(*,1000) utc,snr,dt,freq,sync,decoded,' *', & write(*,1000) params%nutc,snr,dt,freq,sync,decoded,' *', &
char(ichar('A')+ich-1) char(ichar('A')+ich-1)
end if end if
else else
write(*,1000) utc,snr,dt,freq write(*,1000) params%nutc,snr,dt,freq
end if end if
1000 format(i4.4,i4,f5.2,i5,1x,'$',a1,1x,a22,a2,1x,a1,i3) 1000 format(i4.4,i4,f5.2,i5,1x,'$',a1,1x,a22,a2,1x,a1,i3)
select type(this) select type(this)
@ -202,14 +201,13 @@ contains
1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1) 1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1)
end subroutine jt4_average end subroutine jt4_average
subroutine jt65_decoded(this,utc,sync,snr,dt,freq,drift,nflip,width, & subroutine jt65_decoded(this,sync,snr,dt,freq,drift,nflip,width, &
decoded0,ft,qual,nsmo,nsum,minsync,nsubmode,naggressive,single_decode) decoded0,ft,qual,nsmo,nsum,minsync)
use jt65_decode use jt65_decode
implicit none implicit none
class(jt65_decoder), intent(inout) :: this class(jt65_decoder), intent(inout) :: this
integer, intent(in) :: utc
real, intent(in) :: sync real, intent(in) :: sync
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
@ -223,9 +221,6 @@ contains
integer, intent(in) :: nsmo integer, intent(in) :: nsmo
integer, intent(in) :: nsum integer, intent(in) :: nsum
integer, intent(in) :: minsync integer, intent(in) :: minsync
integer, intent(in) :: nsubmode
integer, intent(in) :: naggressive
logical, intent(in) :: single_decode
integer i,n integer i,n
character*5 ctail,decoded*22,csync*2,fmt*33 character*5 ctail,decoded*22,csync*2,fmt*33
@ -236,21 +231,22 @@ contains
! write(*,3301) ft,qual,nsmo,nsum,minsync,naggressive,sync !### ! write(*,3301) ft,qual,nsmo,nsum,minsync,naggressive,sync !###
!3301 format('decoded.f90:',6i3,f5.1) !### !3301 format('decoded.f90:',6i3,f5.1) !###
if (iand(params%nexp_decode,32).ne.0) print *, 'OK'
decoded=decoded0 decoded=decoded0
fmt='(i4.4,i4,f5.1,i5,1x,a1,1x,a22,a5)' fmt='(i4.4,i4,f5.1,i5,1x,a1,1x,a22,a5)'
if(single_decode) fmt='(i4.4,i4,f5.1,i5,1x,a2,1x,a22,a5)' if(iand(params%nexp_decode,32).ne.0) fmt='(i4.4,i4,f5.1,i5,1x,a2,1x,a22,a5)'
if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then
write(*,fmt) utc,snr,dt,freq write(*,fmt) params%nutc,snr,dt,freq
else else
ctail=' ' ctail=' '
if(naggressive.gt.0 .and. ft.gt.0) then if(params%naggressive.gt.0 .and. ft.gt.0) then
ctail(1:1)='d' ctail(1:1)='d'
if(ft.eq.1) ctail(1:1)='f' if(ft.eq.1) ctail(1:1)='f'
n=max(2,nsum+1) n=max(2,nsum+1)
n=min(n,36) n=min(n,36)
ctail(2:2)=c(n:n) ctail(2:2)=c(n:n)
n=min(nsmo+1,36) n=min(nsmo+1,36)
if(nsubmode.gt.0) ctail(3:3)=c(n:n) if(params%nsubmode.gt.0) ctail(3:3)=c(n:n)
if(ft.eq.2) then if(ft.eq.2) then
ctail(5:5)='*' ctail(5:5)='*'
if(qual.le.9) ctail(5:5)=char(48+qual) if(qual.le.9) ctail(5:5)=char(48+qual)
@ -270,10 +266,10 @@ contains
endif endif
endif endif
endif endif
write(*,fmt) utc,snr,dt,freq,csync,decoded,ctail write(*,fmt) params%nutc,snr,dt,freq,csync,decoded,ctail
endif endif
write(13,1012) utc,nint(sync),snr,dt,float(freq),drift,decoded,ft,nsum,nsmo write(13,1012) params%nutc,nint(sync),snr,dt,float(freq),drift,decoded,ft,nsum,nsmo
1012 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' JT65',3i3) 1012 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' JT65',3i3)
call flush(6) call flush(6)
@ -284,12 +280,11 @@ contains
end select end select
end subroutine jt65_decoded end subroutine jt65_decoded
subroutine jt9_decoded (this, utc, sync, snr, dt, freq, drift, decoded) subroutine jt9_decoded (this, sync, snr, dt, freq, drift, decoded)
use jt9_decode use jt9_decode
implicit none implicit none
class(jt9_decoder), intent(inout) :: this class(jt9_decoder), intent(inout) :: this
integer, intent(in) :: utc
real, intent(in) :: sync real, intent(in) :: sync
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
@ -298,9 +293,9 @@ contains
character(len=22), intent(in) :: decoded character(len=22), intent(in) :: decoded
!$omp critical(decode_results) !$omp critical(decode_results)
write(*,1000) utc,snr,dt,nint(freq),decoded write(*,1000) params%nutc,snr,dt,nint(freq),decoded
1000 format(i4.4,i4,f5.1,i5,1x,'@',1x,a22) 1000 format(i4.4,i4,f5.1,i5,1x,'@ ',1x,a22)
write(13,1002) utc,nint(sync),snr,dt,freq,drift,decoded write(13,1002) params%nutc,nint(sync),snr,dt,freq,drift,decoded
1002 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT9') 1002 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT9')
call flush(6) call flush(6)
!$omp end critical(decode_results) !$omp end critical(decode_results)

View File

@ -11,12 +11,11 @@ module jt4_decode
! Callback function to be called with each decode ! Callback function to be called with each decode
! !
abstract interface abstract interface
subroutine jt4_decode_callback (this, utc, snr, dt, freq, have_sync, & subroutine jt4_decode_callback (this, snr, dt, freq, have_sync, &
sync, is_deep, decoded, qual, ich, is_average, ave) sync, is_deep, decoded, qual, ich, is_average, ave)
import jt4_decoder import jt4_decoder
implicit none implicit none
class(jt4_decoder), intent(inout) :: this class(jt4_decoder), intent(inout) :: this
integer, intent(in) :: utc
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
integer, intent(in) :: freq integer, intent(in) :: freq
@ -187,7 +186,7 @@ contains
nsnr=nint(snrx) nsnr=nint(snrx)
if(sync.lt.syncmin) then if(sync.lt.syncmin) then
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
call this%decode_callback(nutc,nsnr,dtxz,nfreqz,.false.,csync, & call this%decode_callback(nsnr,dtxz,nfreqz,.false.,csync, &
.false.,decoded,0.,ich,.false.,0) .false.,decoded,0.,ich,.false.,0)
end if end if
go to 990 go to 990
@ -219,7 +218,7 @@ contains
if(nfano.gt.0) then if(nfano.gt.0) then
! Fano succeeded: report the message and return FANO OK ! Fano succeeded: report the message and return FANO OK
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
call this%decode_callback(nutc,nsnr,dtx,nfreq,.true.,csync, & call this%decode_callback(nsnr,dtx,nfreq,.true.,csync, &
.false.,decoded,0.,ich,.false.,0) .false.,decoded,0.,ich,.false.,0)
end if end if
nsave=0 nsave=0
@ -255,7 +254,7 @@ contains
if(nfanoave.gt.0) then if(nfanoave.gt.0) then
! Fano succeeded: report the message AVG FANO OK ! Fano succeeded: report the message AVG FANO OK
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
call this%decode_callback(nutc,nsnr,dtx,nfreq,.true.,csync, & call this%decode_callback(nsnr,dtx,nfreq,.true.,csync, &
.false.,avemsg,0.,ich,.true.,nfanoave) .false.,avemsg,0.,ich,.true.,nfanoave)
end if end if
prtavg=.true. prtavg=.true.
@ -279,10 +278,10 @@ contains
qual=qbest qual=qbest
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
if(int(qual).ge.nq1) then if(int(qual).ge.nq1) then
call this%decode_callback(nutc,nsnr,dtx,nfreqz,.true.,csync,.true., & call this%decode_callback(nsnr,dtx,nfreqz,.true.,csync,.true., &
deepmsg,qual,ich,.false.,0) deepmsg,qual,ich,.false.,0)
else else
call this%decode_callback(nutc,nsnr,dtxz,nfreqz,.true.,csync, & call this%decode_callback(nsnr,dtxz,nfreqz,.true.,csync, &
.false.,blank,0.,ich,.false.,0) .false.,blank,0.,ich,.false.,0)
endif endif
end if end if
@ -294,7 +293,7 @@ contains
qave=qabest qave=qabest
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
if(int(qave).ge.nq1) then if(int(qave).ge.nq1) then
call this%decode_callback(nutc,nsnr,dtx,nfreq,.true.,csync,.true., & call this%decode_callback(nsnr,dtx,nfreq,.true.,csync,.true., &
deepave,qave,ich,.true.,ndeepave) deepave,qave,ich,.true.,ndeepave)
endif endif
end if end if

View File

@ -12,14 +12,12 @@ module jt65_decode
! Callback function to be called with each decode ! Callback function to be called with each decode
! !
abstract interface abstract interface
subroutine jt65_decode_callback(this,utc,sync,snr,dt,freq,drift, & subroutine jt65_decode_callback(this,sync,snr,dt,freq,drift, &
nflip,width,decoded,ft,qual,nsmo,nsum,minsync,nsubmode, & nflip,width,decoded,ft,qual,nsmo,nsum,minsync)
naggressive,single_decode)
import jt65_decoder import jt65_decoder
implicit none implicit none
class(jt65_decoder), intent(inout) :: this class(jt65_decoder), intent(inout) :: this
integer, intent(in) :: utc
real, intent(in) :: sync real, intent(in) :: sync
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
@ -33,9 +31,6 @@ module jt65_decode
integer, intent(in) :: nsmo integer, intent(in) :: nsmo
integer, intent(in) :: nsum integer, intent(in) :: nsum
integer, intent(in) :: minsync integer, intent(in) :: minsync
integer, intent(in) :: nsubmode
integer, intent(in) :: naggressive
logical, intent(in) :: single_decode
end subroutine jt65_decode_callback end subroutine jt65_decode_callback
end interface end interface
@ -249,9 +244,8 @@ contains
nqave=qave nqave=qave
if (associated(this%callback) .and. nsum.ge.2) then if (associated(this%callback) .and. nsum.ge.2) then
call this%callback(nutc,sync1,nsnr,dtx-1.0,nfreq,ndrift, & call this%callback(sync1,nsnr,dtx-1.0,nfreq,ndrift, &
nflip,width,avemsg,nftt,nqave,nsmo,nsum,minsync, & nflip,width,avemsg,nftt,nqave,nsmo,nsum,minsync)
nsubmode,naggressive,single_decode)
prtavg=.true. prtavg=.true.
cycle cycle
end if end if
@ -301,9 +295,8 @@ contains
dec(ndecoded)%decoded=decoded dec(ndecoded)%decoded=decoded
nqual=min(qual,9999.0) nqual=min(qual,9999.0)
if (associated(this%callback)) then if (associated(this%callback)) then
call this%callback(nutc,sync1,nsnr,dtx-1.0,nfreq,ndrift, & call this%callback(sync1,nsnr,dtx-1.0,nfreq,ndrift, &
nflip,width,decoded,nft,nqual,nsmo,nsum,minsync, & nflip,width,decoded,nft,nqual,nsmo,nsum,minsync)
nsubmode,naggressive,single_decode)
end if end if
endif endif
decoded0=decoded decoded0=decoded

View File

@ -37,13 +37,12 @@ contains
call timer('jt65a ',1) call timer('jt65a ',1)
end subroutine test end subroutine test
subroutine my_callback (this,utc,sync,snr,dt,freq,drift,nflip,width, & subroutine my_callback (this,sync,snr,dt,freq,drift,nflip,width, &
decoded,ft,qual,smo,sum,minsync,submode,aggression,single_decode) decoded,ft,qual,smo,sum,minsync)
use jt65_decode use jt65_decode
implicit none implicit none
class(jt65_decoder), intent(inout) :: this class(jt65_decoder), intent(inout) :: this
integer, intent(in) :: utc
real, intent(in) :: sync real, intent(in) :: sync
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
@ -57,9 +56,6 @@ contains
integer, intent(in) :: smo integer, intent(in) :: smo
integer, intent(in) :: sum integer, intent(in) :: sum
integer, intent(in) :: minsync integer, intent(in) :: minsync
integer, intent(in) :: submode
integer, intent(in) :: aggression
logical, intent(in) :: single_decode
integer nwidth integer nwidth
real t real t
@ -68,16 +64,16 @@ contains
nwidth=max(nint(sqrt(t)),2) nwidth=max(nint(sqrt(t)),2)
!### deal with nflip here! ### !### deal with nflip here! ###
!### also single_decode, csync, etc... ### !### also single_decode, csync, etc... ###
write(*,1010) utc,snr,dt,freq,decoded write(*,1010) snr,dt,freq,decoded
1010 format(i4.4,i4,f5.1,i5,1x,'#',1x,a22) 1010 format(i4,f5.1,i5,1x,'#',1x,a22)
write(13,1012) utc,nint(sync),snr,dt,freq,drift,nwidth, & write(13,1012) nint(sync),snr,dt,freq,drift,nwidth, &
decoded,ft,sum,smo decoded,ft,sum,smo
1012 format(i4.4,i4,i5,f6.2,i5,i4,i3,1x,a22,' JT65',3i3) 1012 format(i4,i5,f6.2,i5,i4,i3,1x,a22,' JT65',3i3)
nft=ft nft=ft
call flush(6) call flush(6)
! write(79,3001) utc,sync,snr,dt,freq,candidates, & ! write(79,3001) sync,snr,dt,freq,candidates, &
! hard_min,total_min,rtt,tries,ft,qual,decoded ! hard_min,total_min,rtt,tries,ft,qual,decoded
!3001 format(i4.4,f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22) !3001 format(f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22)
end subroutine my_callback end subroutine my_callback

View File

@ -7,12 +7,11 @@ module jt9_decode
end type jt9_decoder end type jt9_decoder
abstract interface abstract interface
subroutine jt9_decode_callback (this, utc, sync, snr, dt, freq, drift, & subroutine jt9_decode_callback (this, sync, snr, dt, freq, drift, &
decoded) decoded)
import jt9_decoder import jt9_decoder
implicit none implicit none
class(jt9_decoder), intent(inout) :: this class(jt9_decoder), intent(inout) :: this
integer, intent(in) :: utc
real, intent(in) :: sync real, intent(in) :: sync
integer, intent(in) :: snr integer, intent(in) :: snr
real, intent(in) :: dt real, intent(in) :: dt
@ -24,7 +23,7 @@ module jt9_decode
contains contains
subroutine decode(this,callback,ss,id2,nutc,nfqso,newdat,npts8,nfa, & subroutine decode(this,callback,ss,id2,nfqso,newdat,npts8,nfa, &
nfsplit,nfb,ntol,nzhsym,nagain,ndepth,nmode,nsubmode,nexp_decode) nfsplit,nfb,ntol,nzhsym,nagain,ndepth,nmode,nsubmode,nexp_decode)
use timer_module, only: timer use timer_module, only: timer
@ -45,10 +44,10 @@ contains
this%callback => callback this%callback => callback
if(nmode.eq.9 .and. nsubmode.ge.1) then if(nmode.eq.9 .and. nsubmode.ge.1) then
call decode9w(nutc,nfqso,ntol,nsubmode,ss,id2,sync,nsnr,xdt,freq,msg) call decode9w(nfqso,ntol,nsubmode,ss,id2,sync,nsnr,xdt,freq,msg)
if (associated(this%callback)) then if (associated(this%callback)) then
ndrift=0 ndrift=0
call this%callback(nutc,sync,nsnr,xdt,freq,ndrift,msg) call this%callback(sync,nsnr,xdt,freq,ndrift,msg)
end if end if
go to 999 go to 999
endif endif
@ -152,7 +151,7 @@ contains
if(msg.ne.' ') then if(msg.ne.' ') then
numfano=numfano+1 numfano=numfano+1
if (associated(this%callback)) then if (associated(this%callback)) then
call this%callback(nutc,sync,nsnr,xdt,freq,ndrift,msg) call this%callback(sync,nsnr,xdt,freq,ndrift,msg)
end if end if
iaa=max(1,i-1) iaa=max(1,i-1)
ibb=min(NSMAX,i+22) ibb=min(NSMAX,i+22)