summaryrefslogtreecommitdiff
path: root/lib/77bit/test28.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
committerChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
commite0737c56c1e384e05064a0c6e1ac46979371041b (patch)
treea0123d694a2d36c43dabdf0a3907392fce11d457 /lib/77bit/test28.f90
parentb4aebf2d137b892f53503b13785ecae900062ff7 (diff)
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'lib/77bit/test28.f90')
-rw-r--r--lib/77bit/test28.f9043
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/77bit/test28.f90 b/lib/77bit/test28.f90
new file mode 100644
index 00000000..67bde4af
--- /dev/null
+++ b/lib/77bit/test28.f90
@@ -0,0 +1,43 @@
+program test28
+
+ parameter (NTOKENS=2063592,MAX22=4194304)
+ character*13 call_0,call_1,bare_call_1
+ character*1 cerr
+
+ nargs=iargc()
+ open(10,file='test28.txt',status='old')
+
+ write(*,1000)
+1000 format('Encoded text Recovered text n28 Err? Type'/60('-'))
+
+ do iline=1,999999
+ if(nargs.eq.0) then
+ read(10,'(a13)',end=999) call_0
+ else
+ call getarg(1,call_0)
+ endif
+ if(call_0.eq.' ') exit
+ if(call_0(1:3).eq.'CQ ' .and. call_0(4:4).ne.' ') call_0(3:3)='_'
+ call_1=' '
+ call pack28(call_0,n28)
+ call unpack28(n28,call_1)
+ cerr=' '
+ if(call_0.ne.call_1) cerr='*'
+ if(call_1(1:1).eq.'<') then
+ i=index(call_1,'>')
+ bare_call_1=call_1(2:i-1)//' '
+ endif
+ if(call_0.eq.bare_call_1) cerr=' '
+ if(call_0(1:3).eq.'CQ_') call_0(3:3)=' '
+ if(call_1(1:3).eq.'CQ_') call_1(3:3)=' '
+ if(n28.lt.NTOKENS) write(*,1010) call_0,call_1,n28,cerr
+1010 format(a13,2x,a13,i10,2x,a1,2x,'Special token')
+ if(n28.ge.NTOKENS .and. n28.lt.NTOKENS+MAX22) write(*,1012) call_0, &
+ call_1,n28,cerr
+1012 format(a13,2x,a13,i10,2x,a1,2x,'22-bit hash')
+ if(n28.ge.NTOKENS+MAX22) write(*,1014) call_0,call_1,n28,cerr
+1014 format(a13,2x,a13,i10,2x,a1,2x,'Standard callsign')
+ if(nargs.gt.0) exit
+ enddo
+
+999 end program test28