1 FUNCTION IUPM
(CBAY
,NBITS
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD
9 C CONTAINED WITHIN NBITS BITS OF A CHARACTER STRING CBAY, STARTING
10 C WITH THE FIRST BIT OF THE FIRST BYTE OF CBAY.
12 C PROGRAM HISTORY LOG:
13 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
14 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
15 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
17 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
18 C 2003-11-04 J. WOOLLEN -- BIG-ENDIAN/LITTLE-ENDIAN INDEPENDENT (WAS
20 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
23 C DOCUMENTATION; OUTPUTS MORE COMPLETE
24 C DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
27 C USAGE: IUPM (CBAY, NBITS)
28 C INPUT ARGUMENT LIST:
29 C CBAY - CHARACTER*8: CHARACTER STRING CONTAINING PACKED
31 C NBITS - INTEGER: NUMBER OF BITS WITHIN CBAY TO BE UNPACKED
33 C OUTPUT ARGUMENT LIST:
34 C IUPM - INTEGER: UNPACKED INTEGER WORD
37 C THIS ROUTINE CALLS: BORT IREV
38 C THIS ROUTINE IS CALLED BY: CHRTRNA CRBMG DXMINI ICBFMS
39 C PKC PKTDD STBFDX UPC
41 C Normally not called by any application
45 C LANGUAGE: FORTRAN 77
46 C MACHINE: PORTABLE TO ALL PLATFORMS
50 COMMON /HRDWRD
/ NBYTW
,NBITW
,IORD
(8)
52 CHARACTER*128 BORT_STR
56 EQUIVALENCE
(CINT
,INT
)
58 C----------------------------------------------------------------------
59 C----------------------------------------------------------------------
61 IF(NBITS
.GT
.NBITW
) GOTO 900
64 IUPM
= ISHFT
(INT
(1),NBITS
-NBITW
)
70 900 WRITE(BORT_STR
,'("BUFRLIB: IUPM - NUMBER OF BITS BEING UNPACKED'//
71 . ', NBITS (",I4,"), IS > THE INTEGER WORD LENGTH ON THIS '//
72 . 'MACHINE, NBITW (",I3,")")') NBITS
,NBITW