2006-07-29 12:00:59 -04:00
|
|
|
subroutine avemsg65(mseg,mode65,ndepth,decoded,nused,
|
|
|
|
+ nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual,
|
|
|
|
+ ns,ncount)
|
2005-12-22 11:40:53 -05:00
|
|
|
|
|
|
|
C Decodes averaged JT65 data for the specified segment (mseg=1 or 2).
|
|
|
|
|
|
|
|
parameter (MAXAVE=120) !Max avg count is 120
|
2006-07-29 12:00:59 -04:00
|
|
|
character decoded*22,deepmsg*22
|
|
|
|
character mycall*12,hiscall*12,hisgrid*6
|
2005-12-22 11:40:53 -05:00
|
|
|
real s3(64,63)
|
|
|
|
common/ave/ppsave(64,63,MAXAVE),nflag(MAXAVE),nsave,iseg(MAXAVE)
|
|
|
|
|
|
|
|
C Count the available spectra for this Monitor segment (mseg=1 or 2),
|
|
|
|
C and the number of spectra flagged as good.
|
|
|
|
|
|
|
|
nused=0
|
|
|
|
ns=0
|
2006-07-29 12:00:59 -04:00
|
|
|
nqual=0
|
|
|
|
deepmsg=' '
|
2005-12-22 11:40:53 -05:00
|
|
|
do i=1,nsave
|
|
|
|
if(iseg(i).eq.mseg) then
|
|
|
|
ns=ns+1
|
|
|
|
if(nflag(i).eq.1) nused=nused+1
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
if(nused.lt.1) go to 100
|
|
|
|
|
|
|
|
C Compute the average of all flagged spectra for this segment.
|
|
|
|
do j=1,63
|
|
|
|
call zero(s3(1,j),64)
|
|
|
|
do n=1,nsave
|
|
|
|
if(nflag(n).eq.1 .and. iseg(n).eq.mseg) then
|
|
|
|
call add(s3(1,j),ppsave(1,j,n),s3(1,j),64)
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
nadd=nused*mode65
|
|
|
|
call extract(s3,nadd,ndepth,ncount,decoded) !Extract the message
|
2006-07-29 12:00:59 -04:00
|
|
|
if(ncount.lt.0) decoded=' '
|
|
|
|
|
|
|
|
nqual=0
|
|
|
|
C Possibly should pass nadd=nused, also:
|
|
|
|
if(ndepth.ge.3) then
|
2006-08-01 13:19:31 -04:00
|
|
|
flipx=1.0 !Normal flip not relevant for ave msg
|
|
|
|
call deep65(s3,mode65,neme,nsked,flipx,
|
2006-07-29 12:00:59 -04:00
|
|
|
+ mycall,hiscall,hisgrid,deepmsg,qual)
|
|
|
|
nqual=qual
|
|
|
|
if(nqual.lt.nq1) deepmsg=' '
|
|
|
|
if(nqual.ge.nq1 .and. nqual.lt.nq2) deepmsg(19:19)='?'
|
|
|
|
endif
|
|
|
|
if(ncount.lt.0) decoded=deepmsg
|
2005-12-22 11:40:53 -05:00
|
|
|
|
|
|
|
C Suppress "birdie messages":
|
|
|
|
if(decoded(1:7).eq.'000AAA ') decoded=' '
|
|
|
|
if(decoded(1:7).eq.'0L6MWK ') decoded=' '
|
|
|
|
|
2006-07-29 12:00:59 -04:00
|
|
|
100 if(nused.lt.1) decoded=' '
|
2005-12-22 11:40:53 -05:00
|
|
|
return
|
|
|
|
end
|