diff options
| author | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
| commit | f647d78463c1250ce9c99af664615fafccf5e959 (patch) | |
| tree | 5b00428cef68aef1c9d407e2d4535687422419b6 /lib/77bit/hash22calc.f90 | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'lib/77bit/hash22calc.f90')
| -rw-r--r--[-rwxr-xr-x] | lib/77bit/hash22calc.f90 | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lib/77bit/hash22calc.f90 b/lib/77bit/hash22calc.f90 index 46581a98..500e1eea 100755..100644 --- a/lib/77bit/hash22calc.f90 +++ b/lib/77bit/hash22calc.f90 @@ -1,42 +1,42 @@ -program hash22calc
-! Given a valid callsign, calculate and print its 22-bit hash.
-
- use packjt77
-
- character*13 callsign
- character*1 c
- character*6 basecall
- logical cok
-
- nargs=iargc()
- if(nargs.ne.1) then
- print*,'Given a valid callsign, print its 22-bit hash.'
- print*,'Usage: hash22calc <callsign>'
- print*,' e.g. hash22calc W9ABC'
- go to 999
- endif
- call getarg(1,callsign)
-
-! convert to upper case
- ilen=len(trim(callsign))
- do i=1, ilen
- c=callsign(i:i)
- if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case
- callsign(i:i)=c
- enddo
-
-! check for a valid callsign
- call chkcall(callsign,basecall,cok)
- if(.not.cok) then
- print*,'Invalid callsign'
- print*,'Usage: hash22calc <callsign>'
- goto 999
- endif
-
-! calculate the hash
- n22 = ihashcall(callsign,22)
- write(*,'(a,i7.7)') callsign,n22
-
-999 end program hash22calc
-
-include '../chkcall.f90'
+program hash22calc +! Given a valid callsign, calculate and print its 22-bit hash. + + use packjt77 + + character*13 callsign + character*1 c + character*6 basecall + logical cok + + nargs=iargc() + if(nargs.ne.1) then + print*,'Given a valid callsign, print its 22-bit hash.' + print*,'Usage: hash22calc <callsign>' + print*,' e.g. hash22calc W9ABC' + go to 999 + endif + call getarg(1,callsign) + +! convert to upper case + ilen=len(trim(callsign)) + do i=1, ilen + c=callsign(i:i) + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case + callsign(i:i)=c + enddo + +! check for a valid callsign + call chkcall(callsign,basecall,cok) + if(.not.cok) then + print*,'Invalid callsign' + print*,'Usage: hash22calc <callsign>' + goto 999 + endif + +! calculate the hash + n22 = ihashcall(callsign,22) + write(*,'(a,i7.7)') callsign,n22 + +999 end program hash22calc + +include '../chkcall.f90' |
