updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / external / bufr / upb.f
blobbf3a3467e384d623b139cdc97901d9d077b35a9b
1 SUBROUTINE UPB(NVAL,NBITS,IBAY,IBIT)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: UPB
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER
9 C CONTAINED WITHIN NBITS BITS OF IBAY, STARTING WITH BIT (IBIT+1).
10 C ON OUTPUT, IBIT IS UPDATED TO POINT TO THE LAST BIT THAT WAS
11 C UNPACKED. THIS IS SIMILAR TO BUFR ARCHIVE LIBRARY SUBROUTINE UPBB,
12 C EXCEPT IN UPBB IBIT IS NOT UPDATED UPON OUTPUT (AND THE ORDER OF
13 C ARGUMENTS IS DIFFERENT).
15 C PROGRAM HISTORY LOG:
16 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
17 C 2003-05-19 J. ATOR -- ADDED CHECK FOR NBITS EQUAL TO ZERO
18 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
19 C 2003-11-04 J. WOOLLEN -- BIG-ENDIAN/LITTLE-ENDIAN INDEPENDENT (WAS
20 C IN DECODER VERSION)
21 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22 C INTERDEPENDENCIES
23 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
24 C DOCUMENTATION
25 C 2009-03-23 J. ATOR -- REWROTE TO CALL UPBB
27 C USAGE: CALL UPB (NVAL, NBITS, IBAY, IBIT)
28 C INPUT ARGUMENT LIST:
29 C NBITS - INTEGER: NUMBER OF BITS OF IBAY WITHIN WHICH TO UNPACK
30 C NVAL
31 C IBAY - INTEGER: *-WORD PACKED BINARY ARRAY CONTAINING PACKED
32 C NVAL
33 C IBIT - INTEGER: BIT POINTER WITHIN IBAY INDICATING BIT AFTER
34 C WHICH TO START UNPACKING
36 C OUTPUT ARGUMENT LIST:
37 C NVAL - INTEGER: UNPACKED INTEGER
38 C IBIT - INTEGER: BIT POINTER WITHIN IBAY INDICATING LAST BIT
39 C THAT WAS UNPACKED
41 C REMARKS:
42 C THIS SUBROUTINE IS THE INVERSE OF BUFR ARCHIVE LIBRARY ROUTINE
43 C PKB.
45 C THIS ROUTINE CALLS: UPBB
46 C THIS ROUTINE IS CALLED BY: COPYSB IUPB MVB RDCMPS
47 C RDMGSB READSB STNDRD UFBINX
48 C UFBPOS UFBTAB UFBTAM UPC
49 C WRCMPS WRITLC
50 C Normally not called by any application
51 C programs.
53 C ATTRIBUTES:
54 C LANGUAGE: FORTRAN 77
55 C MACHINE: PORTABLE TO ALL PLATFORMS
57 C$$$
59 DIMENSION IBAY(*)
61 C----------------------------------------------------------------------
62 C----------------------------------------------------------------------
64 CALL UPBB(NVAL,NBITS,IBIT,IBAY)
66 IBIT = IBIT+NBITS
68 RETURN
69 END