2014-04-19 22:44:47 -04:00
|
|
|
subroutine decoder(ss,id2)
|
|
|
|
|
|
|
|
use prog_args
|
2015-02-05 17:07:19 -05:00
|
|
|
!$ use omp_lib
|
2015-02-04 10:34:46 -05:00
|
|
|
|
2014-04-19 22:44:47 -04:00
|
|
|
include 'constants.f90'
|
|
|
|
real ss(184,NSMAX)
|
|
|
|
character*20 datetime
|
2015-02-04 10:34:46 -05:00
|
|
|
logical baddata
|
2014-04-19 22:44:47 -04:00
|
|
|
integer*2 id2(NTMAX*12000)
|
|
|
|
real*4 dd(NTMAX*12000)
|
|
|
|
common/npar/nutc,ndiskdat,ntrperiod,nfqso,newdat,npts8,nfa,nfsplit,nfb, &
|
|
|
|
ntol,kin,nzhsym,nsave,nagain,ndepth,ntxmode,nmode,datetime
|
|
|
|
common/tracer/limtrace,lu
|
2015-02-05 17:07:19 -05:00
|
|
|
integer onlevel(0:10)
|
|
|
|
common/tracer_priv/level,onlevel
|
|
|
|
!$omp threadprivate(/tracer_priv/)
|
2014-04-19 22:44:47 -04:00
|
|
|
save
|
|
|
|
|
|
|
|
nfreqs0=0
|
|
|
|
nfreqs1=0
|
|
|
|
ndecodes0=0
|
|
|
|
ndecodes1=0
|
|
|
|
|
|
|
|
if (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-02-01 11:23:36 -05:00
|
|
|
open(22,file=trim(temp_dir)//'/kvasd.dat',access='direct',recl=1024, &
|
|
|
|
status='unknown')
|
2014-04-19 22:44:47 -04:00
|
|
|
|
|
|
|
npts65=52*12000
|
|
|
|
if(baddata(id2,npts65)) then
|
|
|
|
nsynced=0
|
|
|
|
ndecoded=0
|
|
|
|
go to 800
|
|
|
|
endif
|
|
|
|
|
|
|
|
ntol65=20
|
|
|
|
|
2015-02-04 10:34:46 -05:00
|
|
|
!$ call omp_set_dynamic(.true.)
|
2015-02-06 11:34:26 -05:00
|
|
|
!$omp parallel sections num_threads(2) copyin(/tracer_priv/) shared(ndecoded)
|
2014-04-19 22:44:47 -04:00
|
|
|
|
2015-02-03 20:41:26 -05:00
|
|
|
!$omp section
|
2015-02-04 11:33:45 -05:00
|
|
|
if(nmode.eq.65 .or. (nmode.gt.65 .and. ntxmode.eq.65)) then
|
2015-02-04 10:34:46 -05:00
|
|
|
! We're decoding JT65 or should do this mode first
|
2014-04-19 22:44:47 -04:00
|
|
|
if(newdat.ne.0) dd(1:npts65)=id2(1:npts65)
|
|
|
|
nf1=nfa
|
|
|
|
nf2=nfb
|
2015-02-01 15:11:10 -05:00
|
|
|
call timer('jt65a ',0)
|
2014-04-19 22:44:47 -04:00
|
|
|
call jt65a(dd,npts65,newdat,nutc,nf1,nf2,nfqso,ntol65,nagain,ndecoded)
|
2015-02-01 15:11:10 -05:00
|
|
|
call timer('jt65a ',1)
|
2015-02-04 10:34:46 -05:00
|
|
|
else
|
|
|
|
! We're decoding JT9 or should do this mode first
|
|
|
|
call timer('decjt9 ',0)
|
|
|
|
call decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol,nzhsym, &
|
|
|
|
nagain,ndepth,nmode)
|
|
|
|
call timer('decjt9 ',1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
!$omp section
|
|
|
|
if(nmode.gt.65) then ! do the other mode in dual mode
|
|
|
|
if (ntxmode.eq.9) then
|
|
|
|
if(newdat.ne.0) dd(1:npts65)=id2(1:npts65)
|
|
|
|
nf1=nfa
|
|
|
|
nf2=nfb
|
|
|
|
call timer('jt65a ',0)
|
|
|
|
call jt65a(dd,npts65,newdat,nutc,nf1,nf2,nfqso,ntol65,nagain,ndecoded)
|
|
|
|
call timer('jt65a ',1)
|
|
|
|
else
|
|
|
|
call timer('decjt9 ',0)
|
|
|
|
call decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol,nzhsym, &
|
|
|
|
nagain,ndepth,nmode)
|
|
|
|
call timer('decjt9 ',1)
|
|
|
|
end if
|
2014-04-19 22:44:47 -04:00
|
|
|
endif
|
|
|
|
|
2015-02-03 20:41:26 -05: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)
|
|
|
|
close(13)
|
|
|
|
close(22)
|
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine decoder
|