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

@ -1,54 +1,55 @@
subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, &
AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, &
RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx, & RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx, &
AzElFileName,jpleph) AzElFileName,jpleph)
implicit real*8 (a-h,o-z) implicit real*8 (a-h,o-z)
character*6 mygrid,hisgrid,c1*1 character*6 mygrid,hisgrid,c1*1
character*6 AzElFileName*(*),jpleph*(*) character*6 AzElFileName*(*),jpleph*(*)
character*256 jpleph_file_name character*256 jpleph_file_name
logical*1 bTx logical*1 bTx
common/jplcom/jpleph_file_name common/jplcom/jpleph_file_name
jpleph_file_name=jpleph jpleph_file_name=jpleph
call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, &
AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, &
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)
imin=60*uth8 if (len_trim(AzElFileName) .eq. 0) go to 999
isec=3600*uth8 imin=60*uth8
ih=uth8 isec=3600*uth8
im=mod(imin,60) ih=uth8
is=mod(isec,60) im=mod(imin,60)
open(15,file=AzElFileName,status='unknown',err=900) is=mod(isec,60)
c1='R' open(15,file=AzElFileName,status='unknown',err=900)
nRx=1 c1='R'
if(bTx) then nRx=1
c1='T' if(bTx) then
nRx=0 c1='T'
endif nRx=0
AzAux=0. endif
ElAux=0. AzAux=0.
nfreq=freq8/1000000 ElAux=0.
doppler=ndop nfreq=freq8/1000000
doppler00=ndop00 doppler=ndop
write(15,1010,err=10) ih,im,is,AzMoon8,ElMoon8, & doppler00=ndop00
ih,im,is,AzSun8,ElSun8, & write(15,1010,err=10) ih,im,is,AzMoon8,ElMoon8, &
ih,im,is,AzAux,ElAux, & ih,im,is,AzSun8,ElSun8, &
nfreq,doppler,dfdt,doppler00,dfdt0,c1 ih,im,is,AzAux,ElAux, &
! TXFirst,TRPeriod,poloffset,Dgrd,xnr,ave,rms,nRx nfreq,doppler,dfdt,doppler00,dfdt0,c1
1010 format( & ! TXFirst,TRPeriod,poloffset,Dgrd,xnr,ave,rms,nRx
i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ & 1010 format( &
i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ &
i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ &
i5,',',f8.1,',',f8.2,',',f8.1,',',f8.2,',Doppler, ',a1) i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ &
! i1,',',i3,',',f8.1,','f8.1,',',f8.1,',',f12.3,',',f12.3,',',i1,',RPol') i5,',',f8.1,',',f8.2,',',f8.1,',',f8.2,',Doppler, ',a1)
10 close(15) ! i1,',',i3,',',f8.1,','f8.1,',',f8.1,',',f12.3,',',f12.3,',',i1,',RPol')
go to 999 10 close(15)
go to 999
900 print*,'Error opening azel.dat'
900 print*,'Error opening azel.dat'
999 return
end subroutine astrosub 999 return
end subroutine astrosub

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