2018-06-27 08:57:13 -04:00
|
|
|
subroutine unpack28(n28_0,c13)
|
2018-06-26 08:33:13 -04:00
|
|
|
|
2018-06-28 11:48:42 -04:00
|
|
|
parameter (NTOKENS=2063592,MAX22=4194304)
|
2018-06-26 08:33:13 -04:00
|
|
|
integer nc(6)
|
|
|
|
character*13 c13
|
|
|
|
character*37 c1
|
|
|
|
character*36 c2
|
|
|
|
character*10 c3
|
|
|
|
character*27 c4
|
|
|
|
data c1/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
|
|
|
|
data c2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
|
|
|
|
data c3/'0123456789'/
|
|
|
|
data c4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
|
|
|
|
data nc/37,36,19,27,27,27/
|
|
|
|
|
2018-06-27 08:57:13 -04:00
|
|
|
n28=n28_0
|
2018-06-26 15:20:39 -04:00
|
|
|
if(n28.lt.NTOKENS) then
|
2018-06-27 08:57:13 -04:00
|
|
|
! Special tokens DE, QRZ, CQ, CQ_nnn, CQ_aaaa
|
|
|
|
if(n28.eq.0) c13='DE '
|
|
|
|
if(n28.eq.1) c13='QRZ '
|
|
|
|
if(n28.eq.2) c13='CQ '
|
|
|
|
if(n28.le.2) go to 900
|
|
|
|
if(n28.le.1002) then
|
|
|
|
write(c13,1002) n28-3
|
|
|
|
1002 format('CQ_',i3.3)
|
|
|
|
go to 900
|
|
|
|
endif
|
|
|
|
if(n28.le.532443) then
|
|
|
|
n=n28-1003
|
2018-06-27 16:41:58 -04:00
|
|
|
n0=n
|
2018-06-27 08:57:13 -04:00
|
|
|
i1=n/(27*27*27)
|
|
|
|
n=n-27*27*27*i1
|
|
|
|
i2=n/(27*27)
|
|
|
|
n=n-27*27*i2
|
|
|
|
i3=n/27
|
|
|
|
i4=n-27*i3
|
|
|
|
c13=c4(i1+1:i1+1)//c4(i2+1:i2+1)//c4(i3+1:i3+1)//c4(i4+1:i4+1)
|
|
|
|
c13=adjustl(c13)
|
2018-06-27 15:07:04 -04:00
|
|
|
c13='CQ_'//c13(1:10)
|
2018-06-27 08:57:13 -04:00
|
|
|
go to 900
|
|
|
|
endif
|
2018-06-26 15:20:39 -04:00
|
|
|
endif
|
|
|
|
n28=n28-NTOKENS
|
2018-06-28 11:48:42 -04:00
|
|
|
if(n28.lt.MAX22) then
|
|
|
|
! This is a 22-bit hash of a callsign
|
|
|
|
n22=n28
|
|
|
|
call hash22(n22,c13,-1) !Retrieve callsign from hash table
|
2018-06-28 13:07:01 -04:00
|
|
|
if(c13(1:1).ne.'<') then
|
|
|
|
n=len(trim(c13))
|
|
|
|
c13='<'//c13(1:n)//'>'//' '
|
|
|
|
endif
|
2018-06-27 11:08:39 -04:00
|
|
|
go to 900
|
2018-06-26 15:20:39 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
! Standard callsign
|
2018-06-28 11:48:42 -04:00
|
|
|
n=n28 - MAX22
|
2018-06-26 15:20:39 -04:00
|
|
|
i1=n/(36*10*27*27*27)
|
|
|
|
n=n-36*10*27*27*27*i1
|
|
|
|
i2=n/(10*27*27*27)
|
|
|
|
n=n-10*27*27*27*i2
|
|
|
|
i3=n/(27*27*27)
|
|
|
|
n=n-27*27*27*i3
|
|
|
|
i4=n/(27*27)
|
|
|
|
n=n-27*27*i4
|
|
|
|
i5=n/27
|
|
|
|
i6=n-27*i5
|
|
|
|
c13=c1(i1+1:i1+1)//c2(i2+1:i2+1)//c3(i3+1:i3+1)//c4(i4+1:i4+1)// &
|
|
|
|
c4(i5+1:i5+1)//c4(i6+1:i6+1)//' '
|
|
|
|
c13=adjustl(c13)
|
2018-06-26 08:33:13 -04:00
|
|
|
|
2018-06-27 08:57:13 -04:00
|
|
|
900 return
|
2018-06-26 08:33:13 -04:00
|
|
|
end subroutine unpack28
|