Make flag variables boolean types especially those passed between languages

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6585 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-04-06 17:11:19 +00:00
parent 3cefb34c46
commit 53308a941b
7 changed files with 82 additions and 78 deletions

View File

@ -40,7 +40,7 @@ extern struct dec_data {
int ntxmode; int ntxmode;
int nmode; int nmode;
int minw; int minw;
int nclearave; bool nclearave;
int minSync; int minSync;
float emedelay; float emedelay;
float dttol; float dttol;

View File

@ -17,6 +17,7 @@ subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, &
dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, &
width1,width2,xlst8,techo8) width1,width2,xlst8,techo8)
if (len_trim(AzElFileName) .eq. 0) go to 999
imin=60*uth8 imin=60*uth8
isec=3600*uth8 isec=3600*uth8
ih=uth8 ih=uth8

View File

@ -57,8 +57,9 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
endif endif
call my_jt4%decode(jt4_decoded,dd,jz,params%nutc,params%nfqso,params%ntol, & call my_jt4%decode(jt4_decoded,dd,jz,params%nutc,params%nfqso,params%ntol, &
params%emedelay,params%dttol,logical(params%nagain),params%ndepth, & params%emedelay,params%dttol,logical(params%nagain),params%ndepth, &
params%nclearave,params%minsync,params%minw,params%nsubmode,params%mycall, & logical (params%nclearave),params%minsync,params%minw,params%nsubmode, &
params%hiscall,params%hisgrid,params%nlist,params%listutc,jt4_average) params%mycall,params%hiscall,params%hisgrid,params%nlist,params%listutc, &
jt4_average)
go to 800 go to 800
endif endif
@ -86,8 +87,9 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, & call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, &
nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, & nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, &
logical(params%nagain),params%n2pass,logical(params%nrobust), & logical(params%nagain),params%n2pass,logical(params%nrobust), &
ntrials,params%naggressive,params%ndepth,params%nclearave, & ntrials,params%naggressive,params%ndepth, &
params%mycall,params%hiscall,params%hisgrid,params%nexp_decode) logical(params%nclearave),params%mycall,params%hiscall, &
params%hisgrid,params%nexp_decode)
call timer('jt65a ',1) call timer('jt65a ',1)
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
@ -110,8 +112,9 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, & call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, &
nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, & nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, &
logical(params%nagain),params%n2pass,logical(params%nrobust), & logical(params%nagain),params%n2pass,logical(params%nrobust), &
ntrials,params%naggressive,params%ndepth,params%nclearave, & ntrials,params%naggressive,params%ndepth, &
params%mycall,params%hiscall,params%hisgrid,params%nexp_decode) logical(params%nclearave),params%mycall,params%hiscall, &
params%hisgrid,params%nexp_decode)
call timer('jt65a ',1) call timer('jt65a ',1)
else else
call timer('decjt9 ',0) call timer('decjt9 ',0)

View File

@ -59,10 +59,10 @@ contains
class(jt4_decoder), intent(inout) :: this class(jt4_decoder), intent(inout) :: this
procedure(jt4_decode_callback) :: decode_callback procedure(jt4_decode_callback) :: decode_callback
integer, intent(in) :: jz,nutc,nfqso,ntol0,ndepth,nclearave, & integer, intent(in) :: jz,nutc,nfqso,ntol0,ndepth,minsync,minw,nsubmode, &
minsync,minw,nsubmode,nlist0,listutc0(10) nlist0,listutc0(10)
real, intent(in) :: dd(jz),emedelay,dttol real, intent(in) :: dd(jz),emedelay,dttol
logical, intent(in) :: nagain logical, intent(in) :: nagain, nclearave
character(len=12), intent(in) :: mycall,hiscall character(len=12), intent(in) :: mycall,hiscall
character(len=6), intent(in) :: hisgrid character(len=6), intent(in) :: hisgrid
procedure(jt4_average_callback), optional :: average_callback procedure(jt4_average_callback), optional :: average_callback
@ -119,9 +119,9 @@ contains
use timer_module, only: timer use timer_module, only: timer
class(jt4_decoder), intent(inout) :: this class(jt4_decoder), intent(inout) :: this
integer, intent(in) :: npts,nutc,NClearAve,minsync,ntol,mode4,minw, & integer, intent(in) :: npts,nutc,minsync,ntol,mode4,minw, &
nfqso,ndepth,neme nfqso,ndepth,neme
logical, intent(in) :: NAgain logical, intent(in) :: NAgain,NClearAve
character(len=12), intent(in) :: mycall,hiscall character(len=12), intent(in) :: mycall,hiscall
character(len=6), intent(in) :: hisgrid character(len=6), intent(in) :: hisgrid
@ -150,7 +150,7 @@ contains
nq1=3 nq1=3
nq2=6 nq2=6
if(naggressive.eq.1) nq1=1 if(naggressive.eq.1) nq1=1
if(NClearAve.ne.0) then if(NClearAve) then
nsave=0 nsave=0
iutc=-1 iutc=-1
nfsave=0. nfsave=0.

View File

@ -41,7 +41,7 @@ contains
subroutine decode(this,callback,dd0,npts,newdat,nutc,nf1,nf2,nfqso, & subroutine decode(this,callback,dd0,npts,newdat,nutc,nf1,nf2,nfqso, &
ntol,nsubmode,minsync,nagain,n2pass,nrobust,ntrials,naggressive, & ntol,nsubmode,minsync,nagain,n2pass,nrobust,ntrials,naggressive, &
ndepth,nclearave,mycall,hiscall,hisgrid,nexp_decode) ndepth,clearave,mycall,hiscall,hisgrid,nexp_decode)
! Process dd0() data to find and decode JT65 signals. ! Process dd0() data to find and decode JT65 signals.
@ -56,7 +56,7 @@ contains
integer, intent(in) :: npts, nutc, nf1, nf2, nfqso, ntol & integer, intent(in) :: npts, nutc, nf1, nf2, nfqso, ntol &
, nsubmode, minsync, n2pass, ntrials, naggressive, ndepth & , nsubmode, minsync, n2pass, ntrials, naggressive, ndepth &
, nexp_decode , nexp_decode
logical, intent(in) :: newdat, nagain, nrobust logical, intent(in) :: newdat, nagain, nrobust, clearave
character(len=12), intent(in) :: mycall, hiscall character(len=12), intent(in) :: mycall, hiscall
character(len=6), intent(in) :: hisgrid character(len=6), intent(in) :: hisgrid
@ -172,7 +172,7 @@ contains
freq0=0. freq0=0.
prtavg=.false. prtavg=.false.
if(.not.nagain) nsum=0 if(.not.nagain) nsum=0
if(nclearave.eq.1) then if(clearave) then
nsum=0 nsum=0
nsave=0 nsave=0
endif endif
@ -222,7 +222,7 @@ contains
nsave=nsave+1 nsave=nsave+1
nsave=mod(nsave-1,64)+1 nsave=mod(nsave-1,64)+1
call avg65(nutc,nsave,sync1,dtx,nflip,nfreq,mode65,ntol, & call avg65(nutc,nsave,sync1,dtx,nflip,nfreq,mode65,ntol, &
ndepth,ntrials,naggressive,nclearave,neme,mycall, & ndepth,ntrials,naggressive,clearave,neme,mycall, &
hiscall,hisgrid,nftt,avemsg,qave,deepave,nsum,ndeepave) hiscall,hisgrid,nftt,avemsg,qave,deepave,nsum,ndeepave)
nsmo=param(9) nsmo=param(9)
nqave=qave nqave=qave
@ -297,7 +297,7 @@ contains
end subroutine decode end subroutine decode
subroutine avg65(nutc,nsave,snrsync,dtxx,nflip,nfreq,mode65,ntol,ndepth, & subroutine avg65(nutc,nsave,snrsync,dtxx,nflip,nfreq,mode65,ntol,ndepth, &
ntrials,naggressive,nclearave,neme,mycall,hiscall,hisgrid,nftt, & ntrials,naggressive,clearave,neme,mycall,hiscall,hisgrid,nftt, &
avemsg,qave,deepave,nsum,ndeepave) avemsg,qave,deepave,nsum,ndeepave)
! Decodes averaged JT65 data ! Decodes averaged JT65 data
@ -321,11 +321,11 @@ contains
real s3c(64,63) real s3c(64,63)
real dtsave(MAXAVE) real dtsave(MAXAVE)
real syncsave(MAXAVE) real syncsave(MAXAVE)
logical first logical first,clearave
data first/.true./ data first/.true./
save save
if(first .or. (nclearave.eq.1)) then if(first .or. clearave) then
iutc=-1 iutc=-1
nfsave=0 nfsave=0
dtdiff=0.2 dtdiff=0.2

View File

@ -24,15 +24,15 @@ contains
character(len=12), intent(in) :: mycall, hiscall character(len=12), intent(in) :: mycall, hiscall
character(len=6), intent(in) :: hisgrid character(len=6), intent(in) :: hisgrid
type(jt65_decoder) :: my_decoder type(jt65_decoder) :: my_decoder
integer nclearave !### Should be a dummy arg? logical nclearave !### Should be a dummy arg?
nclearave=0 nclearave=.false.
call timer('jt65a ',0) call timer('jt65a ',0)
call my_decoder%decode(my_callback,dd,npts=52*12000,newdat=.true., & call my_decoder%decode(my_callback,dd,npts=52*12000,newdat=.true., &
nutc=nutc,nf1=nflow,nf2=nfhigh,nfqso=nfqso,ntol=ntol, & nutc=nutc,nf1=nflow,nf2=nfhigh,nfqso=nfqso,ntol=ntol, &
nsubmode=nsubmode, minsync=-1,nagain=.false.,n2pass=n2pass, & nsubmode=nsubmode, minsync=-1,nagain=.false.,n2pass=n2pass, &
nrobust=nrobust,ntrials=ntrials,naggressive=naggressive, & nrobust=nrobust,ntrials=ntrials,naggressive=naggressive, &
ndepth=ndepth,nclearave=nclearave,mycall=mycall,hiscall=hiscall, & ndepth=ndepth,clearave=nclearave,mycall=mycall,hiscall=hiscall, &
hisgrid=hisgrid,nexp_decode=nexp_decode) hisgrid=hisgrid,nexp_decode=nexp_decode)
call timer('jt65a ',1) call timer('jt65a ',1)
end subroutine test end subroutine test

View File

@ -24,7 +24,7 @@
integer(c_int) :: ntxmode integer(c_int) :: ntxmode
integer(c_int) :: nmode integer(c_int) :: nmode
integer(c_int) :: minw integer(c_int) :: minw
integer(c_int) :: nclearave logical(c_bool) :: nclearave
integer(c_int) :: minsync integer(c_int) :: minsync
real(c_float) :: emedelay real(c_float) :: emedelay
real(c_float) :: dttol real(c_float) :: dttol