General code clean-up to eliminate compiler warnings.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3198 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-04-22 15:08:20 +00:00
parent e6adce61e2
commit 1b810b4f9a
13 changed files with 16 additions and 173 deletions

View File

@ -20,7 +20,7 @@ CFLAGS = -I. -fbounds-check -mno-stack-arg-probe
%.o: %.F90
${FC} ${FFLAGS} -c $<
all: libjt9.a jt9sim.exe jt9.exe jt9code.exe wsjt24d.exe
all: libjt9.a jt9sim.exe jt9.exe jt9code.exe
OBJS1 = pctile.o graycode.o sort.o ssort.o \
unpackmsg.o igray.o unpackcall.o unpackgrid.o \
@ -29,10 +29,11 @@ OBJS1 = pctile.o graycode.o sort.o ssort.o \
nchar.o four2a.o grid2deg.o pfxdump.o f77_wisdom.o \
symspec.o timf2.o analytic.o db.o genjt9.o \
packbits.o unpackbits.o encode232.o interleave9.o \
entail.o fano232.o gran.o spec9.o sync9.o decode9.o \
entail.o fano232.o gran.o sync9.o decode9.o \
fil3.o redsync.o decoder.o grid2n.o n2grid.o timer.o \
decode9a.o getlags.o afc9.o fchisq.o twkfreq.o downsam9.o \
peakdt9.o symspec2.o stdmsg.o morse.o azdist.o geodist.o
peakdt9.o symspec2.o stdmsg.o morse.o azdist.o geodist.o \
rig_control.o fillcom.o
libjt9.a: $(OBJS1)
ar cr libjt9.a $(OBJS1)
@ -98,6 +99,12 @@ ipcomm.o: ipcomm.cpp
sec_midn.o: sec_midn.f90
$(FC) -c -fno-second-underscore sec_midn.f90
rig_control.o: rig_control.c
$(CC) -c -Wall -I..\..\..\hamlib-1.2.15.3\include rig_control.c
tstrig.o: tstrig.c
$(CC) -c -Wall -I..\..\..\hamlib-1.2.15.3\include tstrig.c
.PHONY : clean
clean:

View File

@ -25,7 +25,7 @@ OBJS1 = pctile.o graycode.o sort.o ssort.o \
nchar.o four2a.o grid2deg.o pfxdump.o f77_wisdom.o \
symspec.o timf2.o analytic.o db.o genjt9.o ptt_unix.o \
packbits.o unpackbits.o encode232.o interleave9.o \
entail.o fano232.o gran.o spec9.o sync9.o decode9.o \
entail.o fano232.o gran.o sync9.o decode9.o \
fil3.o redsync.o decoder.o grid2n.o n2grid.o timer.o \
decode9a.o peakdt9.o getlags.o afc9.o fchisq.o \
twkfreq.o downsam9.o symspec2.o ipcomm.o sleep_msec.o \

View File

@ -5,11 +5,9 @@ subroutine decode9a(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
complex c2(0:4096-1)
complex c3(0:4096-1)
complex c5(0:4096-1)
complex z
real a(3),aa(3)
real a(3)
integer*1 i1SoftSymbolsScrambled(207)
integer*1 i1SoftSymbols(207)
character*22 msg
include 'jt9sync.f90'
nspsd=16
@ -29,19 +27,9 @@ subroutine decode9a(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
call symspec2(c5,nz3,nsps8,nspsd,fsample,snrdb,i1SoftSymbolsScrambled)
call interleave9(i1SoftSymbolsScrambled,-1,i1SoftSymbols)
! limit=10000
! call decode9(i1SoftSymbols,limit,nlim,msg)
!###
! do j=1,85
! write(71,2101) j,nint(1.e-3*ss2(0:8,j))
!2101 format(i2,2x,9i6)
! enddo
freq=fpk - a(1)
drift=-2.0*a(2)
! write(*,1100) nutc,nsync,nsnr,xdt,freq,a(2),msg
!1100 format(i4.4,i5,i5,f6.1,f9.2,f8.2,2x,a22)
return
end subroutine decode9a

View File

@ -7,14 +7,12 @@ subroutine decoder(ss,c0,nstandalone)
parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX)
character*22 msg
character*33 line
character*80 fmt
character*20 datetime
real*4 ccfred(NSMAX)
logical ccfok(NSMAX)
logical done(NSMAX)
integer*1 i1SoftSymbols(207)
integer*2 id2
integer ii(1)
complex c0(NDMAX)
complex c1(NDMAX)
@ -83,7 +81,7 @@ subroutine decoder(ss,c0,nstandalone)
endif
call timer('sync9 ',0)
! Compute ccfred()
call sync9(ss,nzhsym,tstep,df3,nfa1,nfb1,ntol,nfqso,ccfred,ia,ib,ipk)
call sync9(ss,nzhsym,tstep,df3,nfa1,nfb1,ccfred,ia,ib,ipk)
call timer('sync9 ',1)
ccfok=.false.
@ -104,12 +102,10 @@ subroutine decoder(ss,c0,nstandalone)
fgood=0.
nsps8=nsps/8
df8=1500.0/nsps8
sbest=-1.0
dblim=db(864.0/nsps8) - 26.2
i1=max(nint((nfqso-1000)/df3 - 10),ia)
i2=min(nint((nfqso-1000)/df3 + 10),ib)
ii=maxloc(ccfred(i1:i2))
i00=ii(1) + i1 - 1
do i=ia,ib
f=(i-1)*df3

View File

@ -19,7 +19,6 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
df1=1500.0/nfft1
call four2a(c1,nfft1,1,-1,1) !Forward FFT
ia=nint(250.0/df1)
nadd=1.0/df1
j=250/df1
s=0.

View File

@ -5,7 +5,6 @@ real function fchisq(c3,npts,fsample,a)
complex c4(NMAX)
real a(3)
complex z
complex w,wstep
data a1,a2,a3/99.,99.,99./
include 'jt9sync.f90'
save

View File

@ -13,12 +13,8 @@ program jt9
real*4 s(NSMAX)
real*4 ccfred(NSMAX)
logical*1 lstrong(0:1023)
integer*1 i1SoftSymbols(207)
character*22 msg
character*33 line
integer*2 id2
complex c0
complex c1(NDMAX)
common/jt9com/ss(184,NSMAX),savg(NSMAX),c0(NDMAX),id2(NMAX),nutc,ndiskdat, &
ntr,mousefqso,newdat,nfa,nfb,ntol,kin,nzhsym,nsynced,ndecoded
common/tracer/limtrace,lu
@ -49,11 +45,10 @@ program jt9
nfa=1000
nfb=2000
ntol=500
nfqso=1500
mousefqso=1500
newdat=1
nb=0
nbslider=30
limit=20000
ndiskdat=1
do ifile=ifile1,nargs
@ -84,7 +79,6 @@ program jt9
if(nsps.eq.0) stop 'Error: bad TRperiod'
kstep=nsps/2
tstep=kstep/12000.0
k=0
nhsym0=-999
npts=(60*ntrperiod-6)*12000

View File

@ -82,7 +82,6 @@ subroutine jt9c(ss,savg,c0,id2,nparams0)
equivalence (nparams,nutc)
nparams=nparams0 !Copy parameters into common/npar/
npatience=1
call flush(6)
if(sum(nparams).ne.0) call decoder(ss,c0,0)

View File

@ -6,11 +6,6 @@ program jt9code
character msg*22,msg0*22,decoded*22
integer*4 i4tone(85) !Channel symbols (values 0-8)
integer*4 i4data(69)
integer*4 i4DataSymNoGray(69) !Data Symbols, values 0-7
integer*1 i1ScrambledBits(207) !Unpacked bits, scrambled order
integer*1 i1Bits(207) !Encoded information-carrying bits
integer*1 i1SoftSymbols(207)
integer*1 i1
equivalence (i1,i4)
include 'jt9sync.f90'

View File

@ -120,7 +120,7 @@ program jt9test
nutc=nutc0
call timer('sync9 ',0)
call sync9(ss,nzhsym,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipk) !Get sync, freq
call sync9(ss,nzhsym,tstep,df3,ccfred,ia,ib,ipk) !Get sync, freq
call timer('sync9 ',1)
fgood=0.

View File

@ -1,133 +0,0 @@
subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,snrdb,i1SoftSymbols)
parameter (MAXFFT=31500)
complex c0(0:npts8-1)
complex c1(0:2700000)
real*4 ssym(0:7,69)
real*4 sx(0:31500-1)
complex c(0:MAXFFT-1)
integer*1 i1SoftSymbolsScrambled(207)
integer*1 i1SoftSymbols(207)
integer*1 i1
equivalence (i1,i4)
include 'jt9sync.f90'
! Fix up the data in c0()
sum=0.
do i=0,npts8-1
sum=sum + real(c0(i))**2 + aimag(c0(i))**2
enddo
rms=sqrt(sum/npts8)
fac=1.0/rms
twopi=8.0*atan(1.0)
phi=0.
dphi=twopi*500.0/1500.0
do i=0,npts8-1
phi=phi+dphi
if(phi.gt.twopi) phi=phi-twopi
if(phi.lt.-twopi) phi=phi+twopi
c1(i)=fac*cmplx(aimag(c0(i)),real(c0(i)))*cmplx(cos(phi),sin(phi))
enddo
nsps8=nsps/8
foffset=fpk0
istart=1520
call timer('peakdt9 ',0)
call peakdt9(c1,npts8,nsps8,istart,foffset,idt)
call timer('peakdt9 ',1)
istart=istart + nint(0.0625*nsps8*idt)
xdt=istart/1500.0 - 1.0
call timer('peakdf9 ',0)
call peakdf9(c1,npts8,nsps8,istart,foffset,idf)
call timer('peakdf9 ',1)
fpk=fpk0 + idf*0.1*1500.0/nsps8
foffset=foffset + idf*0.1*1500.0/nsps8
twopi=8.0*atan(1.0)
dphi=twopi*foffset/1500.0
nfft=nsps8
nsym=min((npts8-istart)/nsps8,85)
k=0
do j=1,nsym
if(isync(j).eq.1) cycle
k=k+1
ia=(j-1)*nsps8 + istart
! c(0:nfft-1)=c1(ia:ib)
do i=0,nfft-1
c(i)=0.
if(ia+i.ge.0 .and. ia+i.lt.2700000-1) c(i)=c1(ia+i)
enddo
phi=0.
do i=0,nfft-1
phi=phi + dphi
c(i)=c(i) * cmplx(cos(phi),-sin(phi))
enddo
call four2a(c,nfft,1,-1,1)
do i=0,nfft-1
sx(i)=real(c(i))**2 + aimag(c(i))**2
if(i.ge.1 .and. i.le.8) ssym(i-1,k)=sx(i)
enddo
enddo
sum=0.
sig=0.
do j=1,69
smax=0.
do i=0,7
smax=max(smax,ssym(i,j))
sum=sum+ssym(i,j)
enddo
sig=sig+smax
sum=sum-smax
enddo
ave=sum/(69*7)
call pctile(sx,nsps8,50,xmed)
ssym=ssym/ave
sig=sig/69.
df8=1500.0/nsps8
t=max(1.0,sig/xmed - 1.0)
snrdb=db(t) - db(2500.0/df8) - 5.0
m0=3
k=0
do j=1,69
smax=0.
do i=0,7
if(ssym(i,j).gt.smax) then
smax=ssym(i,j)
ipk=i
endif
enddo
do m=m0-1,0,-1 !Get bit-wise soft symbols
if(m.eq.2) then
r1=max(ssym(4,j),ssym(5,j),ssym(6,j),ssym(7,j))
r0=max(ssym(0,j),ssym(1,j),ssym(2,j),ssym(3,j))
else if(m.eq.1) then
r1=max(ssym(2,j),ssym(3,j),ssym(4,j),ssym(5,j))
r0=max(ssym(0,j),ssym(1,j),ssym(6,j),ssym(7,j))
else
r1=max(ssym(1,j),ssym(2,j),ssym(4,j),ssym(7,j))
r0=max(ssym(0,j),ssym(3,j),ssym(5,j),ssym(6,j))
endif
k=k+1
i4=nint(10.0*(r1-r0))
if(i4.lt.-127) i4=-127
if(i4.gt.127) i4=127
i4=i4+128
i1SoftSymbolsScrambled(k)=i1
enddo
enddo
call interleave9(i1SoftSymbolsScrambled,-1,i1SoftSymbols)
return
end subroutine spec9

View File

@ -48,7 +48,6 @@ subroutine symspec2(c5,nz3,nsps8,nspsd,fsample,snrdb,i1SoftSymbolsScrambled)
ss3=ss3/ave
sig=sig/69.
df8=1500.0/nsps8
t=max(1.0,sig - 1.0)
snrdb=db(t) - 61.3

View File

@ -1,4 +1,4 @@
subroutine sync9(ss,nzhsym,tstep,df3,nfa,nfb,ntol,nfqso,ccfred,ia,ib,ipkbest)
subroutine sync9(ss,nzhsym,tstep,df3,nfa,nfb,ccfred,ia,ib,ipkbest)
parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX)