mirror of https://github.com/saitohirga/WSJT-X.git
Some code cleanup.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8225 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
c88c485325
commit
91518ffd19
|
@ -1,9 +1,9 @@
|
||||||
module dxped_fox
|
module dxped_fox
|
||||||
|
|
||||||
parameter (MAXSIG=5,NSEQ=10)
|
parameter (MAXSIG=5,NSEQ=10,NCALLS=268)
|
||||||
|
|
||||||
character*6 cx(MAXSIG)
|
character*6 cx(MAXSIG),xcall(NCALLS)
|
||||||
character*4 gx(MAXSIG)
|
character*4 gx(MAXSIG),xgrid(NCALLS)
|
||||||
character*6 called(MAXSIG)
|
character*6 called(MAXSIG)
|
||||||
character*6 acknowledged(MAXSIG)
|
character*6 acknowledged(MAXSIG)
|
||||||
character*6 MyCall
|
character*6 MyCall
|
||||||
|
@ -11,8 +11,11 @@ module dxped_fox
|
||||||
integer nsig
|
integer nsig
|
||||||
integer isent(MAXSIG)
|
integer isent(MAXSIG)
|
||||||
integer istate(2,MAXSIG)
|
integer istate(2,MAXSIG)
|
||||||
|
integer isnr(NCALLS)
|
||||||
|
integer irpt(MAXSIG)
|
||||||
integer nlogged
|
integer nlogged
|
||||||
integer nrx
|
integer nrx
|
||||||
|
integer nc
|
||||||
|
|
||||||
! istate
|
! istate
|
||||||
! 0 = Start QSO: call X (from FIFO) or CQ if FIFO is empty
|
! 0 = Start QSO: call X (from FIFO) or CQ if FIFO is empty
|
||||||
|
@ -39,11 +42,16 @@ contains
|
||||||
if(iseq.eq.0) then
|
if(iseq.eq.0) then
|
||||||
txmsg(j)='CQ KH1DX AJ10'
|
txmsg(j)='CQ KH1DX AJ10'
|
||||||
else
|
else
|
||||||
read(10,1002,end=1,err=999) cx(j),gx(j) !Grab next call from FIFO
|
! read(10,1002,end=1,err=999) cx(j),gx(j) !Grab next call from FIFO
|
||||||
1002 format(a6,7x,a4)
|
!1002 format(a6,7x,a4)
|
||||||
call random_number(x)
|
nc=nc+1
|
||||||
irpt=-20+int(40*x)
|
if(nc.gt.NCALLS) go to 1
|
||||||
write(txmsg(j),1004) cx(j),mycall,irpt
|
cx(j)=xcall(nc)
|
||||||
|
gx(j)=xgrid(NC)
|
||||||
|
! call random_number(x)
|
||||||
|
! irpt=-20+int(40*x)
|
||||||
|
irpt(j)=isnr(nc)
|
||||||
|
write(txmsg(j),1004) cx(j),mycall,irpt(j)
|
||||||
1004 format(a6,1x,a6,i4.2)
|
1004 format(a6,1x,a6,i4.2)
|
||||||
if(txmsg(j)(15:15).eq.' ') txmsg(j)(15:15)='+'
|
if(txmsg(j)(15:15).eq.' ') txmsg(j)(15:15)='+'
|
||||||
istate(1,j)=1
|
istate(1,j)=1
|
||||||
|
@ -54,11 +62,17 @@ contains
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(js.eq.2) then
|
if(js.eq.2) then
|
||||||
read(10,1002,end=3,err=999) cy,gy !Grab next call from FIFO
|
! read(10,1002,end=3,err=999) cy,gy !Grab next call from FIFO
|
||||||
call random_number(x)
|
nc=nc+1
|
||||||
irpt=-20+int(40*x)
|
if(nc.gt.NCALLS) go to 3
|
||||||
isent(j)=irpt
|
cy=xcall(nc)
|
||||||
write(txmsg(j),1006) cx(j),cy,irpt
|
gy=xgrid(nc)
|
||||||
|
! call random_number(x)
|
||||||
|
! irpt=-20+int(40*x)
|
||||||
|
irpt(j)=isnr(nc)
|
||||||
|
|
||||||
|
isent(j)=irpt(j)
|
||||||
|
write(txmsg(j),1006) cx(j),cy,irpt(j)
|
||||||
1006 format(a6,' RR73; ',a6,1x,'<KH1DX>',i4.2)
|
1006 format(a6,' RR73; ',a6,1x,'<KH1DX>',i4.2)
|
||||||
if(txmsg(j)(29:29).eq.' ') txmsg(j)(29:29)='+'
|
if(txmsg(j)(29:29).eq.' ') txmsg(j)(29:29)='+'
|
||||||
write(log,1008) cx(j),gx(j),isent(j)
|
write(log,1008) cx(j),gx(j),isent(j)
|
||||||
|
@ -67,7 +81,7 @@ contains
|
||||||
cx(j)=cy
|
cx(j)=cy
|
||||||
gx(j)=gy
|
gx(j)=gy
|
||||||
called(j)=cy
|
called(j)=cy
|
||||||
isent(j)=irpt
|
isent(j)=irpt(j)
|
||||||
istate(2,j)=1
|
istate(2,j)=1
|
||||||
go to 4
|
go to 4
|
||||||
3 write(txmsg(j),1006) cx(j),'DE '
|
3 write(txmsg(j),1006) cx(j),'DE '
|
||||||
|
@ -84,14 +98,14 @@ contains
|
||||||
write(*,1010) iseq,j,istate(1:2,j),txmsg(j),log,nlogged,nrate
|
write(*,1010) iseq,j,istate(1:2,j),txmsg(j),log,nlogged,nrate
|
||||||
1010 format(i4.4,i3,2i2,1x,a32,20x,a16,2i4)
|
1010 format(i4.4,i3,2i2,1x,a32,20x,a16,2i4)
|
||||||
else
|
else
|
||||||
irpt=-20+int(40*x)
|
! irpt=-20+int(40*x)
|
||||||
if(iseq.ge.2) write(txmsg(j),1004) cx(j),mycall,irpt
|
if(iseq.ge.2) write(txmsg(j),1004) cx(j),mycall,irpt(j)
|
||||||
write(*,1010) iseq,j,istate(1:2,j),txmsg(j)
|
write(*,1010) iseq,j,istate(1:2,j),txmsg(j)
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
return
|
return
|
||||||
999 stop '*** ERROR ***'
|
!999 stop '*** ERROR ***'
|
||||||
end subroutine fox_tx
|
end subroutine fox_tx
|
||||||
|
|
||||||
subroutine fox_rx(iseq,rxmsg)
|
subroutine fox_rx(iseq,rxmsg)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
program driver
|
program dxped_sim
|
||||||
|
|
||||||
|
! Simulates QSO exchanges using the proposed FT8 "DXpedition" mode.
|
||||||
|
|
||||||
use dxped_fox
|
use dxped_fox
|
||||||
character*22 rxmsg
|
character*22 rxmsg
|
||||||
character cxx*6,gxx*4
|
character cxx*6,gxx*4
|
||||||
character*8 arg
|
character*8 arg
|
||||||
integer ntot(5),irate(5)
|
integer ntot(5),irate(5)
|
||||||
|
|
||||||
open(10,file='xcall.txt',status='old')
|
|
||||||
ntot=0
|
ntot=0
|
||||||
irate=0
|
irate=0
|
||||||
MyCall='KH1DX'
|
MyCall='KH1DX'
|
||||||
|
@ -26,11 +27,21 @@ program driver
|
||||||
jj1=nint(10*fail)
|
jj1=nint(10*fail)
|
||||||
jj2=nint(10*fail)
|
jj2=nint(10*fail)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
! Read a file with calls and grids; insert random S/N values.
|
||||||
|
open(10,file='xcall.txt',status='old')
|
||||||
|
do i=1,NCALLS
|
||||||
|
read(10,1000) xcall(i),xgrid(i)
|
||||||
|
1000 format(a6,7x,a4)
|
||||||
|
call random_number(x)
|
||||||
|
isnr(i)=-20+int(40*x)
|
||||||
|
enddo
|
||||||
|
close(10)
|
||||||
|
|
||||||
do jj=jj1,jj2
|
do jj=jj1,jj2
|
||||||
fail=0.1*jj
|
fail=0.1*jj
|
||||||
do ii=ii1,ii2
|
do ii=ii1,ii2
|
||||||
rewind 10
|
nc=0
|
||||||
nsig=ii
|
nsig=ii
|
||||||
! Start with all istate = 0
|
! Start with all istate = 0
|
||||||
istate=0
|
istate=0
|
||||||
|
@ -43,21 +54,20 @@ program driver
|
||||||
nrx=0
|
nrx=0
|
||||||
do j=1,nsig
|
do j=1,nsig
|
||||||
if(ichar(cx(j)(1:1)).ne.0) then
|
if(ichar(cx(j)(1:1)).ne.0) then
|
||||||
call random_number(x)
|
write(rxmsg,1001) MyCall,cx(j),isnr(j)
|
||||||
irpt=-20+int(40*x)
|
1001 format(a6,1x,a6,' R',i3.2)
|
||||||
write(rxmsg,1000) MyCall,cx(j),irpt
|
|
||||||
1000 format(a6,1x,a6,' R',i3.2)
|
|
||||||
if(rxmsg(16:16).eq.' ') rxmsg(16:16)='+'
|
if(rxmsg(16:16).eq.' ') rxmsg(16:16)='+'
|
||||||
endif
|
endif
|
||||||
if(iseq.eq.1) then
|
if(iseq.eq.1) then
|
||||||
read(10,1002) cxx,gxx
|
nc=nc+1
|
||||||
1002 format(a6,7x,a4)
|
cxx=xcall(nc)
|
||||||
|
gxx=xgrid(nc)
|
||||||
rxmsg='KH1DX '//cxx//' '//gxx
|
rxmsg='KH1DX '//cxx//' '//gxx
|
||||||
endif
|
endif
|
||||||
call random_number(x)
|
call random_number(x)
|
||||||
if(x.ge.fail .and. cx(j)(1:1).ne.' ') call fox_rx(iseq,rxmsg)
|
if(x.ge.fail .and. cx(j)(1:1).ne.' ') call fox_rx(iseq,rxmsg)
|
||||||
enddo
|
enddo
|
||||||
if(iseq.eq.1) rewind 10
|
if(iseq.eq.1) nc=0
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
ntot(ii)=nlogged
|
ntot(ii)=nlogged
|
||||||
|
@ -70,4 +80,4 @@ program driver
|
||||||
1100 format(f5.1,5i6,5x,5i6)
|
1100 format(f5.1,5i6,5x,5i6)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end program driver
|
end program dxped_sim
|
||||||
|
|
Loading…
Reference in New Issue