NCEPLIBS-bufr  12.0.0
nemtbax.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search for a Table A descriptor within the internal DX
3 C> BUFR tables
4 C>
5 C> @author J. Woollen @date 1999-11-18
6 
7 C> This subroutine searches for a descriptor within Table A of the
8 C> internal DX BUFR tables.
9 C>
10 C> It is similar to subroutine nemtba(), except it returns an INOD
11 C> value of 0 if the descriptor is not found in Table A, whereas
12 C> nemtba() will call subroutine bort() in such cases.
13 C>
14 C> @param[in] LUN - integer: Internal I/O stream index associated
15 C> with DX BUFR tables
16 C> @param[in] NEMO - character*(*): Mnemonic for Table A descriptor
17 C> @param[out] MTYP - integer: Message type corresponding to NEMO
18 C> @param[out] MSBT - integer: Message subtype corresponding to NEMO
19 C> @param[out] INOD - integer:
20 C> - Positional index of NEMO within internal
21 C> Table A, if found
22 C> - 0, otherwise
23 C>
24 C> @author J. Woollen @date 1999-11-18
25  SUBROUTINE nemtbax(LUN,NEMO,MTYP,MSBT,INOD)
26 
27  USE moda_tababd
28 
29  CHARACTER*(*) NEMO
30  CHARACTER*128 BORT_STR
31 
32 C-----------------------------------------------------------------------
33 C-----------------------------------------------------------------------
34 
35  inod = 0
36 
37 C LOOK FOR NEMO IN TABLE A
38 C ------------------------
39 
40  DO i=1,ntba(lun)
41  IF(taba(i,lun)(4:11).EQ.nemo) THEN
42  mtyp = idna(i,lun,1)
43  msbt = idna(i,lun,2)
44  inod = mtab(i,lun)
45  IF(mtyp.LT.0 .OR. mtyp.GT.255) GOTO 900
46  IF(msbt.LT.0 .OR. msbt.GT.255) GOTO 901
47  GOTO 100
48  ENDIF
49  ENDDO
50 
51 C EXITS
52 C -----
53 
54 100 RETURN
55 900 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE TYPE (",I4'//
56  . ',") RETURNED FOR MENMONIC ",A)') mtyp,nemo
57  CALL bort(bort_str)
58 901 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE SUBTYPE ("'//
59  . ',I4,") RETURNED FOR MENMONIC ",A)') msbt,nemo
60  CALL bort(bort_str)
61  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
integer, dimension(:,:), allocatable mtab
Entries within jump/link table corresponding to taba.
integer, dimension(:,:,:), allocatable idna
Message types (in array element 1) and subtypes (in array element 2) corresponding to taba.
subroutine nemtbax(LUN, NEMO, MTYP, MSBT, INOD)
This subroutine searches for a descriptor within Table A of the internal DX BUFR tables.
Definition: nemtbax.f:26