mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 18:02:29 -04:00
Set naptype properly; protect nap() index from out-of-range values.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7341 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
4838d97370
commit
5da4ae6363
@ -236,10 +236,10 @@ contains
|
|||||||
integer, intent(in) :: nsum
|
integer, intent(in) :: nsum
|
||||||
integer, intent(in) :: minsync
|
integer, intent(in) :: minsync
|
||||||
|
|
||||||
integer i,nft,nap(-1:11)
|
integer i,nft,iirc,nap(-1:11)
|
||||||
logical is_deep,is_average
|
logical is_deep,is_average
|
||||||
character decoded*22,csync*2,cflags*3
|
character decoded*22,csync*2,cflags*3
|
||||||
data nap/-1,0,2,4,2,4,5,2,4,6,5,6,6/
|
data nap/-1,0,2,3,2,3,4,2,3,6,4,6,6/
|
||||||
|
|
||||||
if(width.eq.-9999.0) stop !Silence compiler warning
|
if(width.eq.-9999.0) stop !Silence compiler warning
|
||||||
!$omp critical(decode_results)
|
!$omp critical(decode_results)
|
||||||
@ -249,16 +249,17 @@ contains
|
|||||||
|
|
||||||
if(ft.ge.80) then !QRA64 mode
|
if(ft.ge.80) then !QRA64 mode
|
||||||
nft=ft-100
|
nft=ft-100
|
||||||
|
iirc=max(-1,min(nft,11))
|
||||||
csync=': '
|
csync=': '
|
||||||
if(sync.ge.float(minsync) .or. nft.ge.0) csync=':*'
|
if(sync.ge.float(minsync) .or. nft.ge.0) csync=':*'
|
||||||
if(nft.lt.0) then
|
if(nft.lt.0) then
|
||||||
write(*,1009) params%nutc,snr,dt,freq,csync,decoded
|
write(*,1009) params%nutc,snr,dt,freq,csync,decoded
|
||||||
else
|
else
|
||||||
write(*,1009) params%nutc,snr,dt,freq,csync,decoded,nap(nft),nft
|
write(*,1009) params%nutc,snr,dt,freq,csync,decoded,nap(iirc),nft
|
||||||
1009 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,i2,i3)
|
1009 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,i2,i3)
|
||||||
endif
|
endif
|
||||||
write(13,1011) params%nutc,nint(sync),snr,dt,float(freq),drift, &
|
write(13,1011) params%nutc,nint(sync),snr,dt,float(freq),drift, &
|
||||||
decoded,nap(nft),nft
|
decoded,nap(iirc),nft
|
||||||
1011 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' QRA64',i3)
|
1011 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' QRA64',i3)
|
||||||
go to 100
|
go to 100
|
||||||
endif
|
endif
|
||||||
|
@ -45,7 +45,7 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
|
|||||||
10 [CQ/QRZ HisCall _ ] 68 5 Optional
|
10 [CQ/QRZ HisCall _ ] 68 5 Optional
|
||||||
11 [CQ/QRZ HisCall Grid] 68 ? Optional
|
11 [CQ/QRZ HisCall Grid] 68 ? Optional
|
||||||
*/
|
*/
|
||||||
static int nc1z=-1;
|
|
||||||
float EbNodBEstimated;
|
float EbNodBEstimated;
|
||||||
int err=0;
|
int err=0;
|
||||||
int nSubmode=*ns0;
|
int nSubmode=*ns0;
|
||||||
|
@ -19,8 +19,8 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
|||||||
integer dat4(12) !Decoded message (as 12 integers)
|
integer dat4(12) !Decoded message (as 12 integers)
|
||||||
integer dat4x(12)
|
integer dat4x(12)
|
||||||
integer nap(0:11)
|
integer nap(0:11)
|
||||||
data nap/0,2,4,2,4,5,2,4,6,5,6,6/
|
data nap/0,2,3,2,3,4,2,3,6,4,6,6/
|
||||||
data nc1z/-1/,nc2z/-1/,ng2z/-1/
|
data nc1z/-1/,nc2z/-1/,ng2z/-1/,maxaptypez/-1/
|
||||||
save
|
save
|
||||||
|
|
||||||
call timer('qra64a ',0)
|
call timer('qra64a ',0)
|
||||||
@ -43,7 +43,8 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
|||||||
nFadingModel=1
|
nFadingModel=1
|
||||||
maxaptype=4
|
maxaptype=4
|
||||||
if(iand(ndepth,64).ne.0) maxaptype=5
|
if(iand(ndepth,64).ne.0) maxaptype=5
|
||||||
if(nc1.ne.nc1z .or. nc2.ne.nc2z .or. ng2.ne.ng2z) then
|
if(nc1.ne.nc1z .or. nc2.ne.nc2z .or. ng2.ne.ng2z .or. &
|
||||||
|
maxaptype.ne.maxaptypez) then
|
||||||
do naptype=0,maxaptype
|
do naptype=0,maxaptype
|
||||||
if(naptype.eq.2 .and. maxaptype.eq.4) cycle
|
if(naptype.eq.2 .and. maxaptype.eq.4) cycle
|
||||||
call qra64_dec(s3,nc1,nc2,ng2,naptype,1,nSubmode,b90, &
|
call qra64_dec(s3,nc1,nc2,ng2,naptype,1,nSubmode,b90, &
|
||||||
@ -52,7 +53,9 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
|||||||
nc1z=nc1
|
nc1z=nc1
|
||||||
nc2z=nc2
|
nc2z=nc2
|
||||||
ng2z=ng2
|
ng2z=ng2
|
||||||
|
maxaptypez=maxaptype
|
||||||
endif
|
endif
|
||||||
|
naptype=maxaptype
|
||||||
|
|
||||||
maxf1=0
|
maxf1=0
|
||||||
call timer('sync64 ',0)
|
call timer('sync64 ',0)
|
||||||
@ -94,11 +97,12 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
|||||||
if(abs(snr2).gt.30.) snr2=-30.0
|
if(abs(snr2).gt.30.) snr2=-30.0
|
||||||
if(irc.eq.0) go to 10
|
if(irc.eq.0) go to 10
|
||||||
if(irc.lt.0) cycle
|
if(irc.lt.0) cycle
|
||||||
if(irc.gt.0 .and. nap(irc).le.napmin) then
|
iirc=max(0,min(irc,11))
|
||||||
|
if(irc.gt.0 .and. nap(iirc).le.napmin) then
|
||||||
dat4x=dat4
|
dat4x=dat4
|
||||||
b90x=b90
|
b90x=b90
|
||||||
snr2x=snr2
|
snr2x=snr2
|
||||||
napmin=nap(irc)
|
napmin=nap(iirc)
|
||||||
irckeep=irc
|
irckeep=irc
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user