NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
iupm.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD
5 C> CONTAINED WITHIN NBITS BITS OF A CHARACTER STRING CBAY, STARTING
6 C> WITH THE FIRST BIT OF THE FIRST BYTE OF CBAY.
7 C>
8 C> PROGRAM HISTORY LOG:
9 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10 C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
11 C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
12 C> ROUTINE "BORT"
13 C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
14 C> 2003-11-04 J. WOOLLEN -- BIG-ENDIAN/LITTLE-ENDIAN INDEPENDENT (WAS
15 C> IN DECODER VERSION)
16 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
17 C> INTERDEPENDENCIES
18 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
19 C> DOCUMENTATION; OUTPUTS MORE COMPLETE
20 C> DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
21 C> ABNORMALLY
22 C>
23 C> USAGE: IUPM (CBAY, NBITS)
24 C> INPUT ARGUMENT LIST:
25 C> CBAY - CHARACTER*8: CHARACTER STRING CONTAINING PACKED
26 C> INTEGER
27 C> NBITS - INTEGER: NUMBER OF BITS WITHIN CBAY TO BE UNPACKED
28 C>
29 C> OUTPUT ARGUMENT LIST:
30 C> IUPM - INTEGER: UNPACKED INTEGER WORD
31 C>
32 C> REMARKS:
33 C> THIS ROUTINE CALLS: BORT IREV
34 C> THIS ROUTINE IS CALLED BY: CHRTRNA CRBMG DXMINI ICBFMS
35 C> PKC PKTDD UPC UPTDD
36 C> WRDLEN WRDXTB
37 C> Normally not called by any application
38 C> programs.
39 C>
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 
52 C----------------------------------------------------------------------
53 C----------------------------------------------------------------------
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 
60 C EXITS
61 C -----
62 
63  RETURN
64 900 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
function irev(N)
THIS FUNCTION WILL, WHEN THE LOCAL MACHINE IS "LITTLE- ENDIAN" (I.E., USES A RIGHT TO LEFT SCHEME ...
Definition: irev.F:50
function iupm(CBAY, NBITS)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBITS BITS OF A CHARACTER ST...
Definition: iupm.f:40
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23