NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
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 
5 C> This subroutine searches for a descriptor within Table A of the
6 C> internal DX BUFR tables.
7 C>
8 C> <p>It is similar to subroutine nemtba(), except it returns an INOD
9 C> value of 0 if the descriptor is not found in Table A, whereas
10 C> nemtba() will call subroutine bort() in such cases.
11 C>
12 C> @author J. Woollen
13 C> @date 1999-11-18
14 C>
15 C> @param[in] LUN -- integer: Internal I/O stream index associated
16 C> with DX BUFR tables
17 C> @param[in] NEMO -- character*(*): Mnemonic for Table A descriptor
18 C> @param[out] MTYP -- integer: Message type corresponding to NEMO
19 C> @param[out] MSBT -- integer: Message subtype corresponding to NEMO
20 C> @param[out] INOD -- integer:
21 C> - Positional index of NEMO within internal
22 C> Table A, if found
23 C> - 0, otherwise
24 C>
25 C> <b>Program history log:</b>
26 C> | Date | Programmer | Comments |
27 C> | -----|------------|----------|
28 C> | 1999-11-18 | J. Woollen | Original author |
29 C> | 2003-11-04 | S. Bender | Added remarks/bufrlib routine interdependencies |
30 C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added documentation; outputs more complete diagnostic info when routine terminates abnormally |
31 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
32 C>
33  SUBROUTINE nemtbax(LUN,NEMO,MTYP,MSBT,INOD)
34 
35  USE moda_tababd
36 
37  CHARACTER*(*) nemo
38  CHARACTER*128 bort_str
39 
40 C-----------------------------------------------------------------------
41 C-----------------------------------------------------------------------
42 
43  inod = 0
44 
45 C LOOK FOR NEMO IN TABLE A
46 C ------------------------
47 
48  DO i=1,ntba(lun)
49  IF(taba(i,lun)(4:11).EQ.nemo) THEN
50  mtyp = idna(i,lun,1)
51  msbt = idna(i,lun,2)
52  inod = mtab(i,lun)
53  IF(mtyp.LT.0 .OR. mtyp.GT.255) goto 900
54  IF(msbt.LT.0 .OR. msbt.GT.255) goto 901
55  goto 100
56  ENDIF
57  ENDDO
58 
59 C EXITS
60 C -----
61 
62 100 RETURN
63 900 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE TYPE (",I4'//
64  . ',") RETURNED FOR MENMONIC ",A)') mtyp,nemo
65  CALL bort(bort_str)
66 901 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE SUBTYPE ("'//
67  . ',I4,") RETURNED FOR MENMONIC ",A)') msbt,nemo
68  CALL bort(bort_str)
69  END
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:33
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22