diff --git a/commons.h b/commons.h index 35f2200c9..4ad3ac5ee 100644 --- a/commons.h +++ b/commons.h @@ -40,7 +40,7 @@ extern struct dec_data { int ntxmode; int nmode; int minw; - int nclearave; + bool nclearave; int minSync; float emedelay; float dttol; diff --git a/lib/astrosub.f90 b/lib/astrosub.f90 index 963d2cb8b..49551ce3e 100644 --- a/lib/astrosub.f90 +++ b/lib/astrosub.f90 @@ -1,54 +1,55 @@ -subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & - AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & - RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx, & - AzElFileName,jpleph) - - implicit real*8 (a-h,o-z) - character*6 mygrid,hisgrid,c1*1 - character*6 AzElFileName*(*),jpleph*(*) - character*256 jpleph_file_name - logical*1 bTx - common/jplcom/jpleph_file_name - - jpleph_file_name=jpleph - - call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & - AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & - dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & - width1,width2,xlst8,techo8) - - imin=60*uth8 - isec=3600*uth8 - ih=uth8 - im=mod(imin,60) - is=mod(isec,60) - open(15,file=AzElFileName,status='unknown',err=900) - c1='R' - nRx=1 - if(bTx) then - c1='T' - nRx=0 - endif - AzAux=0. - ElAux=0. - nfreq=freq8/1000000 - doppler=ndop - doppler00=ndop00 - write(15,1010,err=10) ih,im,is,AzMoon8,ElMoon8, & - ih,im,is,AzSun8,ElSun8, & - ih,im,is,AzAux,ElAux, & - nfreq,doppler,dfdt,doppler00,dfdt0,c1 -! TXFirst,TRPeriod,poloffset,Dgrd,xnr,ave,rms,nRx -1010 format( & - i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ & - i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ & - i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ & - i5,',',f8.1,',',f8.2,',',f8.1,',',f8.2,',Doppler, ',a1) -! i1,',',i3,',',f8.1,','f8.1,',',f8.1,',',f12.3,',',f12.3,',',i1,',RPol') -10 close(15) - go to 999 - -900 print*,'Error opening azel.dat' - -999 return -end subroutine astrosub +subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & + AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & + RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx, & + AzElFileName,jpleph) + + implicit real*8 (a-h,o-z) + character*6 mygrid,hisgrid,c1*1 + character*6 AzElFileName*(*),jpleph*(*) + character*256 jpleph_file_name + logical*1 bTx + common/jplcom/jpleph_file_name + + jpleph_file_name=jpleph + + call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & + AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & + dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & + width1,width2,xlst8,techo8) + + if (len_trim(AzElFileName) .eq. 0) go to 999 + imin=60*uth8 + isec=3600*uth8 + ih=uth8 + im=mod(imin,60) + is=mod(isec,60) + open(15,file=AzElFileName,status='unknown',err=900) + c1='R' + nRx=1 + if(bTx) then + c1='T' + nRx=0 + endif + AzAux=0. + ElAux=0. + nfreq=freq8/1000000 + doppler=ndop + doppler00=ndop00 + write(15,1010,err=10) ih,im,is,AzMoon8,ElMoon8, & + ih,im,is,AzSun8,ElSun8, & + ih,im,is,AzAux,ElAux, & + nfreq,doppler,dfdt,doppler00,dfdt0,c1 +! TXFirst,TRPeriod,poloffset,Dgrd,xnr,ave,rms,nRx +1010 format( & + i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ & + i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ & + i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ & + i5,',',f8.1,',',f8.2,',',f8.1,',',f8.2,',Doppler, ',a1) +! i1,',',i3,',',f8.1,','f8.1,',',f8.1,',',f12.3,',',f12.3,',',i1,',RPol') +10 close(15) + go to 999 + +900 print*,'Error opening azel.dat' + +999 return +end subroutine astrosub diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 1d39e08e0..3e2ed5f5a 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -57,8 +57,9 @@ subroutine multimode_decoder(ss,id2,params,nfsample) endif call my_jt4%decode(jt4_decoded,dd,jz,params%nutc,params%nfqso,params%ntol, & params%emedelay,params%dttol,logical(params%nagain),params%ndepth, & - params%nclearave,params%minsync,params%minw,params%nsubmode,params%mycall, & - params%hiscall,params%hisgrid,params%nlist,params%listutc,jt4_average) + logical (params%nclearave),params%minsync,params%minw,params%nsubmode, & + params%mycall,params%hiscall,params%hisgrid,params%nlist,params%listutc, & + jt4_average) go to 800 endif @@ -86,8 +87,9 @@ subroutine multimode_decoder(ss,id2,params,nfsample) call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, & nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, & logical(params%nagain),params%n2pass,logical(params%nrobust), & - ntrials,params%naggressive,params%ndepth,params%nclearave, & - params%mycall,params%hiscall,params%hisgrid,params%nexp_decode) + ntrials,params%naggressive,params%ndepth, & + logical(params%nclearave),params%mycall,params%hiscall, & + params%hisgrid,params%nexp_decode) call timer('jt65a ',1) 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, & nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, & logical(params%nagain),params%n2pass,logical(params%nrobust), & - ntrials,params%naggressive,params%ndepth,params%nclearave, & - params%mycall,params%hiscall,params%hisgrid,params%nexp_decode) + ntrials,params%naggressive,params%ndepth, & + logical(params%nclearave),params%mycall,params%hiscall, & + params%hisgrid,params%nexp_decode) call timer('jt65a ',1) else call timer('decjt9 ',0) diff --git a/lib/jt4_decode.f90 b/lib/jt4_decode.f90 index b2ee5032d..85511ea76 100644 --- a/lib/jt4_decode.f90 +++ b/lib/jt4_decode.f90 @@ -59,10 +59,10 @@ contains class(jt4_decoder), intent(inout) :: this procedure(jt4_decode_callback) :: decode_callback - integer, intent(in) :: jz,nutc,nfqso,ntol0,ndepth,nclearave, & - minsync,minw,nsubmode,nlist0,listutc0(10) + integer, intent(in) :: jz,nutc,nfqso,ntol0,ndepth,minsync,minw,nsubmode, & + nlist0,listutc0(10) 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=6), intent(in) :: hisgrid procedure(jt4_average_callback), optional :: average_callback @@ -119,9 +119,9 @@ contains use timer_module, only: timer 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 - logical, intent(in) :: NAgain + logical, intent(in) :: NAgain,NClearAve character(len=12), intent(in) :: mycall,hiscall character(len=6), intent(in) :: hisgrid @@ -150,7 +150,7 @@ contains nq1=3 nq2=6 if(naggressive.eq.1) nq1=1 - if(NClearAve.ne.0) then + if(NClearAve) then nsave=0 iutc=-1 nfsave=0. diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index 2f4c00628..8008b8cc0 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -41,7 +41,7 @@ contains subroutine decode(this,callback,dd0,npts,newdat,nutc,nf1,nf2,nfqso, & 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. @@ -56,7 +56,7 @@ contains integer, intent(in) :: npts, nutc, nf1, nf2, nfqso, ntol & , nsubmode, minsync, n2pass, ntrials, naggressive, ndepth & , nexp_decode - logical, intent(in) :: newdat, nagain, nrobust + logical, intent(in) :: newdat, nagain, nrobust, clearave character(len=12), intent(in) :: mycall, hiscall character(len=6), intent(in) :: hisgrid @@ -172,7 +172,7 @@ contains freq0=0. prtavg=.false. if(.not.nagain) nsum=0 - if(nclearave.eq.1) then + if(clearave) then nsum=0 nsave=0 endif @@ -222,7 +222,7 @@ contains nsave=nsave+1 nsave=mod(nsave-1,64)+1 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) nsmo=param(9) nqave=qave @@ -297,7 +297,7 @@ contains end subroutine decode 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) ! Decodes averaged JT65 data @@ -321,11 +321,11 @@ contains real s3c(64,63) real dtsave(MAXAVE) real syncsave(MAXAVE) - logical first + logical first,clearave data first/.true./ save - if(first .or. (nclearave.eq.1)) then + if(first .or. clearave) then iutc=-1 nfsave=0 dtdiff=0.2 diff --git a/lib/jt65_test.f90 b/lib/jt65_test.f90 index ef8ab2dac..a570e75f6 100644 --- a/lib/jt65_test.f90 +++ b/lib/jt65_test.f90 @@ -24,15 +24,15 @@ contains character(len=12), intent(in) :: mycall, hiscall character(len=6), intent(in) :: hisgrid type(jt65_decoder) :: my_decoder - integer nclearave !### Should be a dummy arg? - nclearave=0 + logical nclearave !### Should be a dummy arg? + nclearave=.false. call timer('jt65a ',0) call my_decoder%decode(my_callback,dd,npts=52*12000,newdat=.true., & nutc=nutc,nf1=nflow,nf2=nfhigh,nfqso=nfqso,ntol=ntol, & nsubmode=nsubmode, minsync=-1,nagain=.false.,n2pass=n2pass, & 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) call timer('jt65a ',1) end subroutine test diff --git a/lib/jt9com.f90 b/lib/jt9com.f90 index 87cca58ac..01be6d25a 100644 --- a/lib/jt9com.f90 +++ b/lib/jt9com.f90 @@ -24,7 +24,7 @@ integer(c_int) :: ntxmode integer(c_int) :: nmode integer(c_int) :: minw - integer(c_int) :: nclearave + logical(c_bool) :: nclearave integer(c_int) :: minsync real(c_float) :: emedelay real(c_float) :: dttol