From 304ca4a55d96349fb9dcee3b937c692f851e2fba Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 13 Jan 2021 09:46:14 -0500 Subject: [PATCH] Move some routines into the module q65.f90. --- lib/qra/q65/q65.f90 | 49 +++++++++++++++++++++++++++++++++++++ lib/qra/q65/q65_sync.f90 | 52 +--------------------------------------- lib/timer_impl.f90 | 4 ++-- 3 files changed, 52 insertions(+), 53 deletions(-) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index 79d5b062b..8c121ff70 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -194,4 +194,53 @@ subroutine q65_clravg return end subroutine q65_clravg +subroutine q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) + + use packjt77 + real s3(1,1) !Silence compiler warning that wants to see a 2D array + real s3prob(0:63,63) !Symbol-value probabilities + integer dat4(13) + character c77*77,decoded*37 + logical unpk77_success + + nFadingModel=1 + decoded=' ' + call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob) + call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) + if(sum(dat4).le.0) irc=-2 + if(irc.ge.0) then + write(c77,1000) dat4(1:12),dat4(13)/2 +1000 format(12b6.6,b5.5) + call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent + endif + + return +end subroutine q65_dec2 + +subroutine q65_s1_to_s3(s1,iz,jz,i0,j0,ipk,jpk,LL,mode_q65,sync,s3) + +! Copy from s1a into s3, then call the dec_q* routines + + real s1(iz,jz) + real s3(-64:LL-65,63) + real sync(85) !sync vector + + i1=i0+ipk-64 + mode_q65 + i2=i1+LL-1 + if(i1.ge.1 .and. i2.le.iz) then + j=j0+jpk-7 + n=0 + do k=1,85 + j=j+8 + if(sync(k).gt.0.0) then + cycle + endif + n=n+1 + if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j) + enddo + endif + + return +end subroutine q65_s1_to_s3 + end module q65 diff --git a/lib/qra/q65/q65_sync.f90 b/lib/qra/q65/q65_sync.f90 index 08c43b28f..cea6862e4 100644 --- a/lib/qra/q65/q65_sync.f90 +++ b/lib/qra/q65/q65_sync.f90 @@ -329,36 +329,10 @@ subroutine q65_dec_q3(codewords,ncw,isync,sync,df,s1,iz,jz,ia,ibwa,ibwb, & return end subroutine q65_dec_q3 -subroutine q65_s1_to_s3(s1,iz,jz,i0,j0,ipk,jpk,LL,mode_q65,sync,s3) - -! Copy from s1a into s3, then call the dec_q* routines - - real s1(iz,jz) - real s3(-64:LL-65,63) - real sync(85) !sync vector - - i1=i0+ipk-64 + mode_q65 - i2=i1+LL-1 - if(i1.ge.1 .and. i2.le.iz) then - j=j0+jpk-7 - n=0 - do k=1,85 - j=j+8 - if(sync(k).gt.0.0) then - cycle - endif - n=n+1 - if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j) - enddo - endif - - return -end subroutine q65_s1_to_s3 - subroutine q65_dec1(s3,nsubmode,b90ts,codewords,ncw,esnodb,irc,dat4,decoded) - use q65 use packjt77 + parameter (PLOG_MIN=-240.0) !List decoding threshold real s3(1,1) !Silence compiler warning that wants to see a 2D array real s3prob(0:63,63) !Symbol-value probabilities integer codewords(63,206) @@ -381,27 +355,3 @@ subroutine q65_dec1(s3,nsubmode,b90ts,codewords,ncw,esnodb,irc,dat4,decoded) return end subroutine q65_dec1 - -subroutine q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) - - use q65 - use packjt77 - real s3(1,1) !Silence compiler warning that wants to see a 2D array - real s3prob(0:63,63) !Symbol-value probabilities - integer dat4(13) - character c77*77,decoded*37 - logical unpk77_success - - nFadingModel=1 - decoded=' ' - call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob) - call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) - if(sum(dat4).le.0) irc=-2 - if(irc.ge.0) then - write(c77,1000) dat4(1:12),dat4(13)/2 -1000 format(12b6.6,b5.5) - call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent - endif - - return -end subroutine q65_dec2 diff --git a/lib/timer_impl.f90 b/lib/timer_impl.f90 index 221db9e0a..0c6eadfc6 100644 --- a/lib/timer_impl.f90 +++ b/lib/timer_impl.f90 @@ -5,8 +5,8 @@ module timer_impl implicit none public :: init_timer, fini_timer - integer, public :: limtrace=0 -! integer, public :: limtrace=10000000 +! integer, public :: limtrace=0 + integer, public :: limtrace=10000000 private