From e16e78790a04da40e43e5da4f847acbf0f4d7dc5 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Sat, 16 Jun 2018 09:04:51 -0500 Subject: [PATCH] Create chkcrc13a.f90. Should chkcrc12a, chkcrc13a, and chkcrc14a be combined into one routine? --- CMakeLists.txt | 1 + lib/ft8/chkcrc13a.f90 | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 lib/ft8/chkcrc13a.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index ce311b4ee..cf89605f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -387,6 +387,7 @@ set (wsjt_FSRCS lib/fsk4hf/chkcrc10.f90 lib/fsk4hf/chkcrc12.f90 lib/ft8/chkcrc12a.f90 + lib/ft8/chkcrc13a.f90 lib/ft8/chkcrc14a.f90 lib/chkcall.f90 lib/chkhist.f90 diff --git a/lib/ft8/chkcrc13a.f90 b/lib/ft8/chkcrc13a.f90 new file mode 100644 index 000000000..74259cfcf --- /dev/null +++ b/lib/ft8/chkcrc13a.f90 @@ -0,0 +1,24 @@ +subroutine chkcrc13a(decoded,nbadcrc) + + use crc + integer*1 decoded(90) + integer*1, target:: i1Dec8BitBytes(12) + character*90 cbits + +! Write decoded bits into cbits: 77-bit message plus 13-bit CRC + write(cbits,1000) decoded +1000 format(90i1) + read(cbits,1001) i1Dec8BitBytes +1001 format(12b8) + read(cbits,1002) ncrc13 !Received CRC13 +1002 format(77x,b13) + + i1Dec8BitBytes(10)=iand(i1Dec8BitBytes(10),128+64+32+16+8) + i1Dec8BitBytes(11:12)=0 + icrc13=crc13(c_loc(i1Dec8BitBytes),12) !CRC13 computed from 77 msg bits + + nbadcrc=1 + if(ncrc13.eq.icrc13) nbadcrc=0 + + return +end subroutine chkcrc13a