NCEPLIBS-bufr  12.0.0
nemtab.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get information about a descriptor, based on the mnemonic.
3 C>
4 C> @author J. Woollen @date 1994-01-06
5 
6 C> Get information about a descriptor, based on the mnemonic.
7 C>
8 C> This subroutine returns information about a descriptor from the
9 C> internal DX BUFR tables, based on the mnemonic associated with
10 C> that descriptor.
11 C>
12 C> @param[in] LUN - integer: File ID.
13 C> @param[in] NEMO - character*(*): Mnemonic.
14 C> @param[out] IDN - integer: WMO bit-wise representation of FXY value
15 C> for descriptor associated with NEMO.
16 C> @param[out] TAB - character: Type associated with IDN:
17 C> - 'B' Table B descriptor.
18 C> - 'D' Table D descriptor.
19 C> - 'C' Table C operator.
20 C> @param[out] IRET - integer:
21 C> - Positional index of IDN within internal Table B, if TAB = 'B'.
22 C> - Positional index of IDN within internal Table D, if TAB = 'D'.
23 C> - The X portion of the FXY value in IDN, if TAB = 'C'.
24 C> - 0, otherwise
25 C>
26 C> @author J. Woollen @date 1994-01-06
27 
28  SUBROUTINE nemtab(LUN,NEMO,IDN,TAB,IRET)
29 
30  USE moda_tababd
31 
32  CHARACTER*(*) NEMO
33  CHARACTER*8 NEMT
34  CHARACTER*1 TAB
35  LOGICAL FOLVAL
36 
37 C-----------------------------------------------------------------------
38 C-----------------------------------------------------------------------
39 
40  folval = nemo(1:1).EQ.'.'
41  iret = 0
42  tab = ' '
43 
44 C LOOK FOR NEMO IN TABLE B
45 C ------------------------
46 
47  DO 1 i=1,ntbb(lun)
48  nemt = tabb(i,lun)(7:14)
49  IF(nemt.EQ.nemo) THEN
50  idn = idnb(i,lun)
51  tab = 'B'
52  iret = i
53  GOTO 100
54  ELSEIF(folval.AND.nemt(1:1).EQ.'.') THEN
55  DO j=2,len(nemt)
56  IF(nemt(j:j).NE.'.' .AND. nemt(j:j).NE.nemo(j:j)) GOTO 1
57  ENDDO
58  idn = idnb(i,lun)
59  tab = 'B'
60  iret = i
61  GOTO 100
62  ENDIF
63 1 ENDDO
64 
65 C DON'T LOOK IN TABLE D FOR FOLLOWING VALUE-MNEMONICS
66 C ---------------------------------------------------
67 
68  IF(folval) GOTO 100
69 
70 C LOOK IN TABLE D IF WE GOT THIS FAR
71 C ----------------------------------
72 
73  DO i=1,ntbd(lun)
74  nemt = tabd(i,lun)(7:14)
75  IF(nemt.EQ.nemo) THEN
76  idn = idnd(i,lun)
77  tab = 'D'
78  iret = i
79  GOTO 100
80  ENDIF
81  ENDDO
82 
83 C IF STILL NOTHING, CHECK HERE FOR TABLE C OPERATOR DESCRIPTORS
84 C -------------------------------------------------------------
85 
86  IF (iokoper(nemo).EQ.1) THEN
87  READ(nemo,'(1X,I2)') iret
88  idn = ifxy(nemo)
89  tab = 'C'
90  GOTO 100
91  ENDIF
92 
93 C EXIT
94 C ----
95 
96 100 RETURN
97  END
function ifxy(ADSC)
Convert an FXY value from its 6 character representation to its WMO bit-wise representation.
Definition: ifxy.f:34
integer function iokoper(NEMO)
This function determines whether a specified mnemonic is a Table C operator supported by the BUFRLIB ...
Definition: iokoper.f:18
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
Get information about a descriptor, based on the mnemonic.
Definition: nemtab.f:29