2015-12-17 15:29:55 -05:00
|
|
|
subroutine decoder(ss,id2,params,nfsample)
|
2014-04-19 22:44:47 -04:00
|
|
|
|
|
|
|
use prog_args
|
2015-02-05 17:07:19 -05:00
|
|
|
!$ use omp_lib
|
2015-02-04 10:34:46 -05:00
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
include 'jt9com.f90'
|
2014-04-19 22:44:47 -04:00
|
|
|
real ss(184,NSMAX)
|
2015-02-04 10:34:46 -05:00
|
|
|
logical baddata
|
2014-04-19 22:44:47 -04:00
|
|
|
integer*2 id2(NTMAX*12000)
|
2015-12-17 15:29:55 -05:00
|
|
|
type(params_block) :: params
|
2014-04-19 22:44:47 -04:00
|
|
|
real*4 dd(NTMAX*12000)
|
|
|
|
common/tracer/limtrace,lu
|
2015-02-05 17:07:19 -05:00
|
|
|
integer onlevel(0:10)
|
|
|
|
common/tracer_priv/level,onlevel
|
2015-11-17 20:28:12 -05:00
|
|
|
!$omp threadprivate(/tracer_priv/)
|
2014-04-19 22:44:47 -04:00
|
|
|
save
|
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
if(mod(params%nranera,2).eq.0) ntrials=10**(params%nranera/2)
|
|
|
|
if(mod(params%nranera,2).eq.1) ntrials=3*10**(params%nranera/2)
|
|
|
|
if(params%nranera.eq.0) ntrials=0
|
2015-11-17 20:28:12 -05:00
|
|
|
|
2015-02-24 15:19:04 -05:00
|
|
|
rms=sqrt(dot_product(float(id2(300000:310000)), &
|
|
|
|
float(id2(300000:310000)))/10000.0)
|
|
|
|
if(rms.lt.2.0) go to 800
|
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
if (params%nagain .eq. 0) then
|
2014-12-02 19:06:54 -05:00
|
|
|
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown')
|
2014-04-19 22:44:47 -04:00
|
|
|
else
|
2015-02-01 11:23:36 -05:00
|
|
|
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', &
|
|
|
|
position='append')
|
2014-04-19 22:44:47 -04:00
|
|
|
end if
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%nmode.eq.4 .or. params%nmode.eq.65) open(14,file=trim(temp_dir)//'/avemsg.txt', &
|
2015-02-01 11:23:36 -05:00
|
|
|
status='unknown')
|
2014-04-19 22:44:47 -04:00
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%nmode.eq.4) then
|
2015-04-22 13:48:03 -04:00
|
|
|
jz=52*nfsample
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%newdat.ne.0) then
|
2015-04-22 13:48:03 -04:00
|
|
|
if(nfsample.eq.12000) call wav11(id2,jz,dd)
|
|
|
|
if(nfsample.eq.11025) dd(1:jz)=id2(1:jz)
|
|
|
|
endif
|
2015-12-17 15:29:55 -05:00
|
|
|
call jt4a(dd,jz,params%nutc,params%nfqso,params%ntol,params%emedelay,params%dttol, &
|
|
|
|
params%nagain,params%ndepth,params%nclearave,params%minsync,params%minw, &
|
|
|
|
params%nsubmode,params%mycall,params%hiscall,params%hisgrid, &
|
|
|
|
params%nlist,params%listutc)
|
2015-04-22 13:48:03 -04:00
|
|
|
go to 800
|
|
|
|
endif
|
|
|
|
|
2014-04-19 22:44:47 -04:00
|
|
|
npts65=52*12000
|
|
|
|
if(baddata(id2,npts65)) then
|
|
|
|
nsynced=0
|
|
|
|
ndecoded=0
|
|
|
|
go to 800
|
|
|
|
endif
|
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
ntol65=params%ntol !### is this OK? ###
|
|
|
|
newdat65=params%newdat
|
|
|
|
newdat9=params%newdat
|
2014-04-19 22:44:47 -04:00
|
|
|
|
2015-04-22 13:48:03 -04:00
|
|
|
!$ call omp_set_dynamic(.true.)
|
|
|
|
!$omp parallel sections num_threads(2) copyin(/tracer_priv/) shared(ndecoded) if(.true.) !iif() needed on Mac
|
2014-04-19 22:44:47 -04:00
|
|
|
|
2015-04-22 13:48:03 -04:00
|
|
|
!$omp section
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%nmode.eq.65 .or. (params%nmode.eq.(65+9) .and. params%ntxmode.eq.65)) then
|
2015-04-22 13:48:03 -04:00
|
|
|
! We're in JT65 mode, or should do JT65 first
|
2015-02-08 10:07:31 -05:00
|
|
|
if(newdat65.ne.0) dd(1:npts65)=id2(1:npts65)
|
2015-12-17 15:29:55 -05:00
|
|
|
nf1=params%nfa
|
|
|
|
nf2=params%nfb
|
2015-02-01 15:11:10 -05:00
|
|
|
call timer('jt65a ',0)
|
2015-12-17 15:29:55 -05:00
|
|
|
call jt65a(dd,npts65,newdat65,params%nutc,nf1,nf2,params%nfqso,ntol65,params%nsubmode, &
|
|
|
|
params%minsync,params%nagain,params%n2pass,params%nrobust,ntrials,params%naggressive, &
|
|
|
|
params%ndepth,params%mycall,params%hiscall,params%hisgrid,params%nexp_decode,ndecoded)
|
2015-02-01 15:11:10 -05:00
|
|
|
call timer('jt65a ',1)
|
2015-04-22 13:48:03 -04:00
|
|
|
|
2015-12-17 15:29:55 -05:00
|
|
|
else if(params%nmode.eq.9 .or. (params%nmode.eq.(65+9) .and. params%ntxmode.eq.9)) then
|
2015-04-22 13:48:03 -04:00
|
|
|
! We're in JT9 mode, or should do JT9 first
|
2015-02-04 10:34:46 -05:00
|
|
|
call timer('decjt9 ',0)
|
2015-12-17 15:29:55 -05:00
|
|
|
call decjt9(ss,id2,params%nutc,params%nfqso,newdat9,params%npts8,params%nfa,params%nfsplit, &
|
|
|
|
params%nfb,params%ntol,params%nzhsym,params%nagain,params%ndepth,params%nmode)
|
2015-02-04 10:34:46 -05:00
|
|
|
call timer('decjt9 ',1)
|
|
|
|
endif
|
|
|
|
|
2015-04-22 13:48:03 -04:00
|
|
|
!$omp section
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%nmode.eq.(65+9)) then !Do the other mode (we're in dual mode)
|
|
|
|
if (params%ntxmode.eq.9) then
|
2015-02-08 10:07:31 -05:00
|
|
|
if(newdat65.ne.0) dd(1:npts65)=id2(1:npts65)
|
2015-12-17 15:29:55 -05:00
|
|
|
nf1=params%nfa
|
|
|
|
nf2=params%nfb
|
2015-02-04 10:34:46 -05:00
|
|
|
call timer('jt65a ',0)
|
2015-12-17 15:29:55 -05:00
|
|
|
call jt65a(dd,npts65,newdat65,params%nutc,nf1,nf2,params%nfqso,ntol65,params%nsubmode, &
|
|
|
|
params%minsync,params%nagain,params%n2pass,params%nrobust,ntrials, &
|
|
|
|
params%naggressive,params%ndepth,params%mycall,params%hiscall,params%hisgrid, &
|
|
|
|
params%nexp_decode,ndecoded)
|
2015-02-04 10:34:46 -05:00
|
|
|
call timer('jt65a ',1)
|
|
|
|
else
|
|
|
|
call timer('decjt9 ',0)
|
2015-12-17 15:29:55 -05:00
|
|
|
call decjt9(ss,id2,params%nutc,params%nfqso,newdat9,params%npts8,params%nfa,params%nfsplit, &
|
|
|
|
params%nfb,params%ntol,params%nzhsym,params%nagain,params%ndepth,params%nmode)
|
2015-02-04 10:34:46 -05:00
|
|
|
call timer('decjt9 ',1)
|
|
|
|
end if
|
2014-04-19 22:44:47 -04:00
|
|
|
endif
|
|
|
|
|
2015-04-22 13:48:03 -04:00
|
|
|
!$omp end parallel sections
|
2015-02-01 11:23:36 -05:00
|
|
|
|
2014-10-30 15:29:16 -04:00
|
|
|
! JT65 is not yet producing info for nsynced, ndecoded.
|
2014-04-19 22:44:47 -04:00
|
|
|
800 write(*,1010) nsynced,ndecoded
|
|
|
|
1010 format('<DecodeFinished>',2i4)
|
|
|
|
call flush(6)
|
2015-04-22 13:48:03 -04:00
|
|
|
close(13)
|
2015-12-17 15:29:55 -05:00
|
|
|
if(params%nmode.eq.4 .or. params%nmode.eq.65) close(14)
|
2014-04-19 22:44:47 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine decoder
|