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:
Joe Taylor
2016-11-27 16:38:39 +00:00
parent 4838d97370
commit 5da4ae6363
3 changed files with 15 additions and 10 deletions
+5 -4
View File
@@ -236,10 +236,10 @@ contains
integer, intent(in) :: nsum
integer, intent(in) :: minsync
integer i,nft,nap(-1:11)
integer i,nft,iirc,nap(-1:11)
logical is_deep,is_average
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
!$omp critical(decode_results)
@@ -249,16 +249,17 @@ contains
if(ft.ge.80) then !QRA64 mode
nft=ft-100
iirc=max(-1,min(nft,11))
csync=': '
if(sync.ge.float(minsync) .or. nft.ge.0) csync=':*'
if(nft.lt.0) then
write(*,1009) params%nutc,snr,dt,freq,csync,decoded
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)
endif
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)
go to 100
endif