NCEPLIBS-bufr 11.7.1
upb8.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE UNPACKS AND RETURNS AN 8-BYTE INTEGER
5C> CONTAINED WITHIN NBITS BITS OF IBAY, STARTING WITH BIT (IBIT+1).
6C> IT IS SIMILAR TO BUFR ARCHIVE LIBRARY SUBROUTINE UP8, EXCEPT
7C> HERE IBIT IS NOT UPDATED UPON OUTPUT (AND THE ORDER OF ARGUMENTS
8C> IS DIFFERENT).
9C>
10C> PROGRAM HISTORY LOG:
11C> 2022-05-06 J. WOOLLEN -- ORIGINAL AUTHOR
12C>
13C> USAGE: CALL UPB8 (NVAL, NBITS, IBIT, IBAY)
14C> INPUT ARGUMENT LIST:
15C> NBITS - INTEGER: NUMBER OF BITS OF IBAY WITHIN WHICH TO UNPACK
16C> NVAL
17C> IBIT - INTEGER: BIT POINTER WITHIN IBAY TO START UNPACKING
18C> FROM
19C> IBAY - INTEGER: *-WORD PACKED BINARY ARRAY CONTAINING PACKED
20C> NVAL
21C>
22C> OUTPUT ARGUMENT LIST:
23C> NVAL - INTEGER*8: UNPACKED INTEGER
24C>
25C> REMARKS:
26C> THIS ROUTINE CALLS: UPB UPBB
27C> THIS ROUTINE IS CALLED BY: RCSTPL RDTREE UFBGET UFBTAB
28C> UFBTAM
29C> Normally not called by any application
30C> programs.
31C>
32!----------------------------------------------------------------------
33!----------------------------------------------------------------------
34
35 subroutine upb8(nval,nbits,ibit,ibay)
36
37 common /hrdwrd/ nbytw,nbitw,iord(8)
38
39 integer(8) :: nval
40 integer(4) :: nbits,ibit,ibay(*)
41
42 integer(4) :: nvals(2)
43 integer(8) :: nval8
44 equivalence(nval8,nvals)
45
46 if(nbits<0 ) call bort('BUFRLIB: UPB8 - nbits < zero !!!!!')
47 if(nbits>64) nval=0
48 if(nbits>64) return
49
50 if(nbitw==32) then
51 jbit=ibit; nvals=0
52 call upb(nvals(2),max(nbits-nbitw,0),ibay,jbit)
53 call upb(nvals(1),min(nbitw,nbits ),ibay,jbit)
54 nval=nval8
55 else
56 call upbb(nval,nbits,ibit,ibay)
57 endif
58
59 end subroutine
60
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine upb8(nval, nbits, ibit, ibay)
THIS SUBROUTINE UNPACKS AND RETURNS AN 8-BYTE INTEGER CONTAINED WITHIN NBITS BITS OF IBAY,...
Definition: upb8.f:36
subroutine upb(NVAL, NBITS, IBAY, IBIT)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY,...
Definition: upb.f:50
subroutine upbb(NVAL, NBITS, IBIT, IBAY)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY,...
Definition: upbb.f:43