File: packbits.f90

package info (click to toggle)
wsjtx 1.1.r3496-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,988 kB
  • ctags: 1,377
  • sloc: cpp: 6,647; f90: 5,319; ansic: 1,266; fortran: 108; makefile: 17; sh: 10
file content (21 lines) | stat: -rw-r--r-- 372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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