From 9590ff5f435c76e11b0e9c3a236710d4b08cdc53 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 6 Sep 2006 19:51:52 +0000 Subject: [PATCH] More code cleanup: silenced many g95 warning messages about variables "set but not used". git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@275 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- GeoDist.f | 11 +++++------ MoonDop.f | 1 - astro.F | 13 ------------- astro0.F90 | 1 - audio_init.F90 | 5 ----- bzap.f | 3 +-- decode1.F90 | 2 -- decode2.f90 | 3 +-- decode3.F90 | 1 - decode6m.f | 2 -- fivehz.F90 | 13 +++---------- gen65.f | 1 - gencwid.f | 3 --- horizspec.f90 | 7 ------- mtdecode.f | 3 --- pix2d65.f90 | 1 - savedata.F90 | 2 -- short65.f | 2 -- spec.f90 | 4 +--- spec2d65.f | 1 - stdecode.f | 1 - sync65.f | 10 ---------- wsjt1.F | 5 ----- wsjt65.f | 4 +--- wsjtgen.F90 | 1 - 25 files changed, 12 insertions(+), 88 deletions(-) diff --git a/GeoDist.f b/GeoDist.f index d9df3d8ac..3de97c22a 100644 --- a/GeoDist.f +++ b/GeoDist.f @@ -1,7 +1,7 @@ subroutine geodist(Eplat, Eplon, Stlat, Stlon, + Az, Baz, Dist) implicit none - real eplat, eplon, stlat, stlon, az, baz, dist, deg + real eplat, eplon, stlat, stlon, az, baz, dist C JHT: In actual fact, I use the first two arguments for "My Location", C the second two for "His location"; West longitude is positive. @@ -68,7 +68,6 @@ c convert st/end pts to radians FF64 = F * F / 64.0 Dist = AL*SD*(T -(F/4.0)*(T*X-Y)+FF64*(X*(A+(T-(A+E) + /2.0)*X)+Y*(-2.0*D+E*Y)+D*X*Y))/1000.0 - Deg = Dist/111.195 TDLPM = Tan((DLR+(-((E*(4.0-X)+2.0*Y)*((F/2.0)*T+FF64* + (32.0*T+(A-20.0*T)*X-2.0*(D+2.0)*Y))/4.0)*Tan(DLR)))/2.0) HAPBR = ATan2(SDTM,(CTM*TDLPM)) @@ -77,8 +76,8 @@ c convert st/end pts to radians A2M1 = Pi2 - HAMBR - HAPBR 1 If ((A1M2 .ge. 0.0) .AND. (A1M2 .lt. Pi2)) GOTO 5 -2 If (A1M2 .lt. Pi2) GOTO 4 -3 A1M2 = A1M2 - Pi2 + If (A1M2 .lt. Pi2) GOTO 4 + A1M2 = A1M2 - Pi2 GOTO 1 4 A1M2 = A1M2 + Pi2 GOTO 1 @@ -87,8 +86,8 @@ c all of this gens the proper az, baz (forward and back azimuth) c 5 If ((A2M1 .ge. 0.0) .AND. (A2M1 .lt. Pi2)) GOTO 9 -6 If (A2M1 .lt. Pi2) GOTO 8 -7 A2M1 = A2M1 - Pi2 + If (A2M1 .lt. Pi2) GOTO 8 + A2M1 = A2M1 - Pi2 GOTO 5 8 A2M1 = A2M1 + Pi2 GOTO 5 diff --git a/MoonDop.f b/MoonDop.f index 49ae97bad..a71f141c7 100644 --- a/MoonDop.f +++ b/MoonDop.f @@ -29,7 +29,6 @@ data rad/57.2957795130823d0/,twopi/6.28310530717959d0/ pi=0.5d0*twopi - pio2=0.5d0*pi km=.true. dlat=lat4/rad dlong1=lon4/rad diff --git a/astro.F b/astro.F index b548530b0..d95fa0634 100644 --- a/astro.F +++ b/astro.F @@ -48,13 +48,6 @@ C NB: may want to smooth the Tsky map to 10 degrees or so. call sun(nyear,month,nday,uth,lon,lat,RASun,DecSun,LST, + AzSun,ElSun,mjd) -! If(NStation.eq.1 .and. ElSun.gt.-2.0) then -! arg=ElSun + 8.6/(ElSun+4.4) -! refraction=0.0167/tan(arg/rad) !Refraction in degrees -! ElSun=ElSun+refraction -! endif - - mjd2=mjd freq=nfreq*1.e6 call MoonDop(nyear,month,nday,uth,lon,lat,RAMoon,DecMoon, @@ -67,12 +60,6 @@ C Compute spatial polarization offset if(NStation.eq.1) poloffset1=rad*atan2(yy,xx) if(NStation.eq.2) poloffset2=rad*atan2(yy,xx) -! If(NStation.eq.1 .and. ElMoon.gt.-2.0) then -! arg=ElMoon + 8.6/(ElMoon+4.4) -! refraction=0.0167/tan(arg/rad) !Refraction in degrees -! ElMoon=ElMoon+refraction -! endif - techo=2.0 * dist/2.99792458e5 !Echo delay time doppler=-freq*vr/2.99792458e5 !One-way Doppler t408=ftsky(ldeg,bdeg) !Read sky map diff --git a/astro0.F90 b/astro0.F90 index c240344e1..dbfae3df1 100644 --- a/astro0.F90 +++ b/astro0.F90 @@ -1,4 +1,3 @@ - !--------------------------------------------------- astro0 subroutine astro0(nyear,month,nday,uth8,nfreq,grid,cauxra,cauxdec, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & diff --git a/audio_init.F90 b/audio_init.F90 index eef9a50f7..d93a4b244 100644 --- a/audio_init.F90 +++ b/audio_init.F90 @@ -7,7 +7,6 @@ subroutine audio_init(ndin,ndout) external a2d,decode1 #endif - integer brightness,contrast include 'gcom1.f90' include 'gcom2.f90' @@ -30,10 +29,6 @@ subroutine audio_init(ndin,ndout) nmax=nbufs*nspb nwave=60*nfsample ngo=1 - brightness=0 - contrast=0 - nsec=1 - df=11025.0/4096 f0=800.0 do i=1,nwave iwave(i)=nint(32767.0*sin(6.283185307*i*f0/nfsample)) diff --git a/bzap.f b/bzap.f index 294570f80..4ac36d9f0 100644 --- a/bzap.f +++ b/bzap.f @@ -45,8 +45,7 @@ C This is a kludge: enddo enddo - 10 nzaps=izap - ia=70/df + 10 ia=70/df do i=1,ia c(i)=0. enddo diff --git a/decode1.F90 b/decode1.F90 index 4a95e7cce..fac24fdb2 100644 --- a/decode1.F90 +++ b/decode1.F90 @@ -69,8 +69,6 @@ subroutine decode1(iarg) mode0=mode endif -20 continue - #ifdef Win32 call sleepqq(100) #else diff --git a/decode2.f90 b/decode2.f90 index 720afa111..e8c62fcc5 100644 --- a/decode2.f90 +++ b/decode2.f90 @@ -1,4 +1,3 @@ - !---------------------------------------------------- decode2 subroutine decode2 @@ -98,6 +97,6 @@ subroutine decode2 endif fnameb=fnamea -999 return + return end subroutine decode2 diff --git a/decode3.F90 b/decode3.F90 index 647393390..bceaf930f 100644 --- a/decode3.F90 +++ b/decode3.F90 @@ -26,7 +26,6 @@ subroutine decode3(d2,jz,istart,filename) endif if(mode.eq.'Echo') nmode=3 if(mode.eq.'JT6M') nmode=4 - mode441=1 sum=0. do i=1,jz diff --git a/decode6m.f b/decode6m.f index b41e4ed9d..73a358b90 100644 --- a/decode6m.f +++ b/decode6m.f @@ -43,13 +43,11 @@ C threshold. However, for the average message we want all FFTs computed. call zero(ref,44) - nh=256 nz=jz/512 - 1 fac=1.0/512.0 do j=1,nz i0=512*(j-1) + 1 do i=0,511 -c fac=1.0/512.0 * abs(i-nh)/float(nh) !Window OK? ct(i)=fac*c(i0+i) enddo call four2a(ct,512,1,-1,1) diff --git a/fivehz.F90 b/fivehz.F90 index 1c3c595df..7ed19234b 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -17,10 +17,10 @@ subroutine fivehz parameter (NTRING=64) real*8 tt1(0:NTRING-1) real*8 tstart,tstop,t60 - logical first,txtime,debug,filled + logical first,txtime,filled integer ptt integer TxOKz - real*8 fs,fsample,tt,tt0,u + real*8 fs,fsample,tt,u include 'gcom1.f90' include 'gcom2.f90' data first/.true./,nc0/1/,nc1/1/ @@ -37,14 +37,11 @@ subroutine fivehz first=.false. iptt=0 ntr0=-99 - debug=.false. rxdone=.false. ibuf00=-99 ncall=-1 - tt0=tt u=0.05d0 fsample=11025.d0 - maxms=0 mfsample=110250 filled=.false. endif @@ -54,7 +51,6 @@ subroutine fivehz ! Measure average sampling frequency over a recent interval ncall=ncall+1 if(ncall.eq.9) then - tt0=tt ntt0=0 ntt1=0 tt1(ntt1)=tt @@ -199,7 +195,7 @@ subroutine fivehztx parameter (NTRING=64) real*8 tt1(0:NTRING-1) logical first,filled - real*8 fs,fsample,tt,tt0,u + real*8 fs,fsample,tt,u include 'gcom1.f90' data first/.true./ save @@ -212,17 +208,14 @@ subroutine fivehztx first=.false. ncall=-1 fsample=11025.d0 - nsec0=-999 u=0.05d0 mfsample2=110250 - tt0=tt filled=.false. endif ! Measure average sampling frequency over a recent interval ncall=ncall+1 if(ncall.eq.9) then - tt0=tt ntt0=0 ntt1=0 tt1(ntt1)=tt diff --git a/gen65.f b/gen65.f index 0d605bdf0..5d9c768b7 100644 --- a/gen65.f +++ b/gen65.f @@ -41,7 +41,6 @@ C Set up necessary constants dt=1.0/(samfac*11025.0) f0=118*11025.d0/1024 dfgen=mode65*11025.0/4096.0 - xn=0. t=0.d0 phi=0.d0 k=0 diff --git a/gencwid.f b/gencwid.f index 9d1a1fe39..b415ded45 100644 --- a/gencwid.f +++ b/gencwid.f @@ -18,7 +18,6 @@ tdit=1.2d0/wpm !Key-down dit time, seconds dt=1.d0/(11025.d0*samfac) nwave=ndits*tdit/dt - k=0 pha=0. dpha=twopi*freqcw*dt t=0.d0 @@ -28,8 +27,6 @@ t=t+dt pha=pha+dpha j=t/tdit + 1 -! iwave(k)=0 -! if(idat(j).ne.0) iwave(i)=nint(32767.d0*sin(pha)) s=s + u*(idat(j)-s) iwave(i)=nint(s*32767.d0*sin(pha)) enddo diff --git a/horizspec.f90 b/horizspec.f90 index 809192ee8..217263fa6 100644 --- a/horizspec.f90 +++ b/horizspec.f90 @@ -15,9 +15,7 @@ subroutine horizspec(x,brightness,contrast,a) nfft=512 nq=nfft/4 gain=50.0 * 3.0**(0.36+0.01*contrast) - gamma=1.3 + 0.01*contrast offset=0.5*(brightness+30.0) -! offset=0.5*(brightness+60.0) df=11025.0/512.0 if(ntr.ne.ntr0) then if(lauto.eq.0 .or. ntr.eq.TxFirst) then @@ -30,9 +28,6 @@ subroutine horizspec(x,brightness,contrast,a) i0=0 do iter=1,5 if(nx.lt.750) nx=nx+1 - if(nx.eq.1) then - t0curr=Tsec - endif do i=1,nfft y(i)=1.4*x(i+i0) enddo @@ -46,9 +41,7 @@ subroutine horizspec(x,brightness,contrast,a) do i=21,120 p=p+ss(i) n=0 -! Use the gamma formula here! if(ss(i).gt.0.) n=gain*log10(0.05*ss(i)) + offset -! if(ss(i).gt.0.) n=(0.2*ss(i))**gamma + offset n=min(252,max(0,n)) j=121-i a(nx,j)=n diff --git a/mtdecode.f b/mtdecode.f index 08b047398..36622e701 100644 --- a/mtdecode.f +++ b/mtdecode.f @@ -24,9 +24,7 @@ C Decode Multi-Tone FSK441 mesages. nf1=-DFTolerance nf2=DFTolerance msg3=' ' - nq=64 dt=1.0/11025.0 - df=11025.0/256.0 C Find signal power at suitable intervals to search for pings. istep=221 @@ -137,7 +135,6 @@ C If it's the best ping yet, save the spectrum: cf=' ' if(nline.le.99) nline=nline+1 tping(nline)=tstart - snr=10.0*log10(10.0**(0.1*peak)-1.0) write(line(nline),1050) cfile6,tstart,mswidth,int(peak), + nwidth,nstrength,noffset,msg3,msg,cf 1050 format(a6,f5.1,i5,i3,1x,2i1,i5,1x,a3,1x,a40,1x,a1) diff --git a/pix2d65.f90 b/pix2d65.f90 index dfa24853c..0daf73d18 100644 --- a/pix2d65.f90 +++ b/pix2d65.f90 @@ -13,7 +13,6 @@ subroutine pix2d65(d2,jz) nadd=nint(53.0*11025.0/500.0) ngreen=min(jz/nadd,500) k=0 - j=0 do i=1,ngreen sq=0. do n=1,nadd diff --git a/savedata.F90 b/savedata.F90 index 851310981..06ae8d028 100644 --- a/savedata.F90 +++ b/savedata.F90 @@ -29,7 +29,6 @@ subroutine savedata ibuf2=ibuf0-1 1 jza=2048*(ibuf2-ibuf1) if(jza.lt.0) jza=jza+NRxMax - lenok=1 if(jza.lt.110250) go to 999 !Don't save files less than 10 s if(jza.gt.60*11025) go to 999 !Don't save if something's fishy k=2048*(ibuf1-1) @@ -127,7 +126,6 @@ subroutine savedata 999 if(mode(1:4).ne.'JT65') then ibuf0z=ibuf0 - ntime0=ntime call get_fname(hiscall,ntime,trperiod,lauto,fname0) endif diff --git a/short65.f b/short65.f index 6488a0f1d..f79c8e752 100644 --- a/short65.f +++ b/short65.f @@ -114,9 +114,7 @@ C Find strongest line in each of the 4 phases, repeating for each drift rate. if(nstest.lt.0) nstest=0 if(nstest.gt.10) nstest=10 dfsh=nint(xdf) - fdotbest=fdotsh iderrbest=iderr - idiffbest=idiff idriftbest=idrift snrdb=db(snr) - db(2500.0/df) - db(sqrt(nsteps/4.0))+1.8 n1=nbest diff --git a/spec.f90 b/spec.f90 index 9ae824e00..c5d7757e9 100644 --- a/spec.f90 +++ b/spec.f90 @@ -170,9 +170,7 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) smax=max(ss(2*i+i0),ss(2*i+i0-1)) a0(i)=5*smax/nsum endif - xdb=-40. - if(a0(i).gt.0.) xdb=10*log10(a0(i)) -20 enddo + enddo nsum=0 newdat=1 !Flag for new spectrum available do i=1,nh !Zero the accumulating array diff --git a/spec2d65.f b/spec2d65.f index c37f55d8f..c1ec6b1aa 100644 --- a/spec2d65.f +++ b/spec2d65.f @@ -26,7 +26,6 @@ C Peak up in frequency and time, and compute ftrack. call ftpeak65(dat,jz,istart,f0,flip,pr,nafc,ftrack) nfft=2048/mode65 !Size of FFTs - nh=nfft/2 dt=2.0/11025.0 df=0.5*11025.0/nfft call zero(ps,77) diff --git a/stdecode.f b/stdecode.f index 9a4565bb6..bdc0735c4 100644 --- a/stdecode.f +++ b/stdecode.f @@ -43,7 +43,6 @@ C second best peak (excluding points around the first peak). do i=ia,ib if((abs(i-ipk).gt.iwidth) .and. s2(i,j).gt.smax2) then smax2=s2(i,j) - ipk2=i endif enddo diff --git a/sync65.f b/sync65.f index 594e1d594..d86505331 100644 --- a/sync65.f +++ b/sync65.f @@ -52,9 +52,6 @@ C Find the best frequency channel for CCF ib=fb/df i0=nint(1270.46/df) - ired0=ia-i0 - ired1=ib-i0 - lag1=-5 lag2=59 syncbest=-1.e30 @@ -77,7 +74,6 @@ C Find the best sync value ipk2=i lagpk2=lagpk0 syncbest2=sync - flippk2=flip endif C We are most interested if snrx will be more than -30 dB. @@ -86,7 +82,6 @@ C We are most interested if snrx will be more than -30 dB. ipk=i lagpk=lagpk0 syncbest=sync - flippk=flip endif endif enddo @@ -96,7 +91,6 @@ C If we found nothing with snrx > -30 dB, take the best sync that *was* found. ipk=ipk2 lagpk=lagpk2 syncbest=syncbest2 - flippk=flippk2 endif C Peak up in frequency to fraction of channel @@ -166,10 +160,6 @@ C Compute width of sync tone to outermost -3 dB points width=df*width width=max(0.0,min(99.0,width)) - ic=600/df - nn=1800/df - nred=448 - return end diff --git a/wsjt1.F b/wsjt1.F index f8929872c..310891cf5 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -37,23 +37,18 @@ real yellow(216) real yellow0(216) real fzap(200) - integer resample real*8 samfacin,samratio real dat2(NP2) - - integer*1 dtmp character msg3*3 character cfile6*6 logical lcum integer indx(100) character*90 line - common/avecom/dat(NP2),labdat,jza,modea common/ccom/nline,tping(100),line(100) common/limcom/ nslim2a common/clipcom/ nclip - equivalence (dtmp,ntmp) save lcum=.true. diff --git a/wsjt65.f b/wsjt65.f index 439c6b36b..faef1c80a 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -55,13 +55,11 @@ C already been done. C Attempt to synchronize: look for sync tone, get DF and DT. call sync65(dat,npts,DFTolerance,NFreeze,MouseDF, + mode65,dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) - f0=1270.46 + dfx csync=' ' decoded=' ' deepmsg=' ' special=' ' cooo=' ' - itry=0 ncount=-1 !Flag for RS decode of current record ncount1=-1 !Flag for RS Decode of ave1 ncount2=-1 !Flag for RS Decode of ave2 @@ -204,7 +202,7 @@ C If Monitor segment #2 is available, write that line also write(12,1011) ave2 call flushqqq(12) - 800 if(lumsg.ne.6) end file 11 + if(lumsg.ne.6) end file 11 900 continue diff --git a/wsjtgen.F90 b/wsjtgen.F90 index f34bc4eb9..09b266789 100644 --- a/wsjtgen.F90 +++ b/wsjtgen.F90 @@ -200,7 +200,6 @@ subroutine wsjtgen k=0 df=11025.0/NSPD do m=1,ndits - j=itone(m) freq=(LTone-1+itone(m))*df dpha=twopi*freq*dt do i=1,NSPD