NCEPLIBS-bufr 11.7.1
iupm.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD
5C> CONTAINED WITHIN NBITS BITS OF A CHARACTER STRING CBAY, STARTING
6C> WITH THE FIRST BIT OF THE FIRST BYTE OF CBAY.
7C>
8C> PROGRAM HISTORY LOG:
9C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
11C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
12C> ROUTINE "BORT"
13C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
14C> 2003-11-04 J. WOOLLEN -- BIG-ENDIAN/LITTLE-ENDIAN INDEPENDENT (WAS
15C> IN DECODER VERSION)
16C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
17C> INTERDEPENDENCIES
18C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
19C> DOCUMENTATION; OUTPUTS MORE COMPLETE
20C> DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
21C> ABNORMALLY
22C>
23C> USAGE: IUPM (CBAY, NBITS)
24C> INPUT ARGUMENT LIST:
25C> CBAY - CHARACTER*8: CHARACTER STRING CONTAINING PACKED
26C> INTEGER
27C> NBITS - INTEGER: NUMBER OF BITS WITHIN CBAY TO BE UNPACKED
28C>
29C> OUTPUT ARGUMENT LIST:
30C> IUPM - INTEGER: UNPACKED INTEGER WORD
31C>
32C> REMARKS:
33C> THIS ROUTINE CALLS: BORT IREV
34C> THIS ROUTINE IS CALLED BY: CHRTRNA CRBMG DXMINI ICBFMS
35C> PKC PKTDD UPC UPTDD
36C> WRDLEN WRDXTB
37C> Normally not called by any application
38C> programs.
39C>
40 FUNCTION iupm(CBAY,NBITS)
41
42
43
44 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
45
46 CHARACTER*128 bort_str
47 CHARACTER*8 cbay
48 CHARACTER*8 cint
49 dimension int(2)
50 equivalence(cint,int)
51
52C----------------------------------------------------------------------
53C----------------------------------------------------------------------
54
55 IF(nbits.GT.nbitw) GOTO 900
56 cint = cbay
57 int(1) = irev(int(1))
58 iupm = ishft(int(1),nbits-nbitw)
59
60C EXITS
61C -----
62
63 RETURN
64900 WRITE(bort_str,'("BUFRLIB: IUPM - NUMBER OF BITS BEING UNPACKED'//
65 . ', NBITS (",I4,"), IS > THE INTEGER WORD LENGTH ON THIS '//
66 . 'MACHINE, NBITW (",I3,")")') nbits,nbitw
67 CALL bort(bort_str)
68 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function irev(N)
THIS FUNCTION WILL, WHEN THE LOCAL MACHINE IS "LITTLE- ENDIAN" (I.E., USES A RIGHT TO LEFT SCHEME ...
Definition: irev.F:51
function iupm(CBAY, NBITS)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBITS BITS OF A CHARACTER ST...
Definition: iupm.f:41