WSJT-X/libm65/packbits.f90
Joe Taylor 9507a4e8a3 Moving from JT8 to JT9, and working toward program jt9sim.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2602 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2012-09-27 19:10:15 +00:00

22 lines
372 B
Fortran

subroutine packbits(dbits,nsymd,m0,sym)
! Pack 0s and 1s from dbits() into sym() with m0 bits per word.
! NB: nsymd is the number of packed output words.
integer sym(nsymd)
integer*1 dbits(*)
k=0
do i=1,nsymd
n=0
do j=1,m0
k=k+1
m=dbits(k)
n=ior(ishft(n,1),m)
enddo
sym(i)=n
enddo
return
end subroutine packbits