NCEPLIBS-bufr 11.7.1
nemtbb.f
Go to the documentation of this file.
1C> @file
2C> @brief Get information about a Table B descriptor
3
4C> This subroutine returns information about a Table B descriptor
5C> from the internal DX BUFR tables.
6C>
7C> @author J. Woollen
8C> @date 1994-01-06
9C>
10C> @param[in] LUN -- integer: Internal I/O stream index associated
11C> with DX BUFR tables
12C> @param[in] ITAB -- integer: Positional index of descriptor within
13C> internal Table B
14C> @param[out] UNIT -- character*24: Units of descriptor
15C> @param[out] ISCL -- integer: Scale factor of descriptor
16C> @param[out] IREF -- integer: Reference value of descriptor
17C> @param[out] IBIT -- integer: Bit width of descriptor
18C>
19C> <b>Program history log:</b>
20C> | Date | Programmer | Comments |
21C> | -----|------------|----------|
22C> | 1994-01-06 | J. Woollen | Original author |
23C> | 1995-06-28 | J. Woollen | Increased the size of internal BUFR table arrays in order to handle bigger files |
24C> | 1998-07-08 | J. Woollen | Replaced call to Cray library routine "ABORT" with call to new internal routine bort() |
25C> | 1999-11-18 | J. Woollen | Changed call to function "val$" to valx() |
26C> | 2003-11-04 | J. Ator | Added documentation |
27C> | 2003-11-04 | S. Bender | Added remarks/bufrlib routine interdependencies |
28C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added documentation; outputs more complete diagnostic info when routine terminates abnormally |
29C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
30C>
31 SUBROUTINE nemtbb(LUN,ITAB,UNIT,ISCL,IREF,IBIT)
32
33 USE moda_tababd
34
35 CHARACTER*128 BORT_STR
36 CHARACTER*24 UNIT
37 CHARACTER*8 NEMO
38 real*8 mxr
39
40C-----------------------------------------------------------------------
41C-----------------------------------------------------------------------
42
43 mxr = 1e11-1
44
45 IF(itab.LE.0 .OR. itab.GT.ntbb(lun)) GOTO 900
46
47C PULL OUT TABLE B INFORMATION
48C ----------------------------
49
50 idn = idnb(itab,lun)
51 nemo = tabb(itab,lun)( 7:14)
52 unit = tabb(itab,lun)(71:94)
53 iscl = valx(tabb(itab,lun)( 95: 98))
54 iref = valx(tabb(itab,lun)( 99:109))
55 ibit = valx(tabb(itab,lun)(110:112))
56
57C CHECK TABLE B CONTENTS
58C ----------------------
59
60 IF(idn.LT.ifxy('000000')) GOTO 901
61 IF(idn.GT.ifxy('063255')) GOTO 901
62
63 IF(iscl.LT.-999 .OR. iscl.GT.999) GOTO 902
64 IF(iref.LE.-mxr .OR. iref.GE.mxr) GOTO 903
65 IF(ibit.LE.0) GOTO 904
66 IF(unit(1:5).NE.'CCITT' .AND. ibit.GT.32 ) GOTO 904
67 IF(unit(1:5).EQ.'CCITT' .AND. mod(ibit,8).NE.0) GOTO 905
68
69C EXITS
70C -----
71
72 RETURN
73900 WRITE(bort_str,'("BUFRLIB: NEMTBB - ITAB (",I7,") NOT FOUND IN '//
74 . 'TABLE B")') itab
75 CALL bort(bort_str)
76901 WRITE(bort_str,'("BUFRLIB: NEMTBB - INTEGER REPRESENTATION OF '//
77 . 'DESCRIPTOR FOR TABLE B MNEMONIC ",A," (",I7,") IS OUTSIDE '//
78 . 'RANGE 0-16383 (16383 -> 0-63-255)")') nemo,idn
79 CALL bort(bort_str)
80902 WRITE(bort_str,'("BUFRLIB: NEMTBB - SCALE VALUE FOR TABLE B '//
81 .'MNEMONIC ",A," (",I7,") IS OUTSIDE RANGE -999 TO 999")')
82 . nemo,iscl
83 CALL bort(bort_str)
84903 WRITE(bort_str,'("BUFRLIB: NEMTBB - REFERENCE VALUE FOR TABLE B'//
85 .' MNEMONIC ",A," (",I7,") IS OUTSIDE RANGE +/- 1E11-1")')
86 . nemo,iref
87 CALL bort(bort_str)
88904 WRITE(bort_str,'("BUFRLIB: NEMTBB - BIT WIDTH FOR NON-CHARACTER'//
89 . ' TABLE B MNEMONIC ",A," (",I7,") IS > 32")') nemo,ibit
90 CALL bort(bort_str)
91905 WRITE(bort_str,'("BUFRLIB: NEMTBB - BIT WIDTH FOR CHARACTER '//
92 . 'TABLE B MNEMONIC ",A," (",I7,") IS NOT A MULTIPLE OF 8")')
93 . nemo,ibit
94 CALL bort(bort_str)
95 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
Definition: moda_tababd.F:56
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
Definition: moda_tababd.F:59
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
Definition: moda_tababd.F:52
subroutine nemtbb(LUN, ITAB, UNIT, ISCL, IREF, IBIT)
This subroutine returns information about a Table B descriptor from the internal DX BUFR tables.
Definition: nemtbb.f:32
function valx(STR)
This function decodes a real number from a character string.
Definition: valx.f:26