NCEPLIBS-bufr 11.7.1
nemtbax.f
Go to the documentation of this file.
1C> @file
2C> @brief Search for a Table A descriptor within the internal DX
3C> BUFR tables
4
5C> This subroutine searches for a descriptor within Table A of the
6C> internal DX BUFR tables.
7C>
8C> <p>It is similar to subroutine nemtba(), except it returns an INOD
9C> value of 0 if the descriptor is not found in Table A, whereas
10C> nemtba() will call subroutine bort() in such cases.
11C>
12C> @author J. Woollen
13C> @date 1999-11-18
14C>
15C> @param[in] LUN -- integer: Internal I/O stream index associated
16C> with DX BUFR tables
17C> @param[in] NEMO -- character*(*): Mnemonic for Table A descriptor
18C> @param[out] MTYP -- integer: Message type corresponding to NEMO
19C> @param[out] MSBT -- integer: Message subtype corresponding to NEMO
20C> @param[out] INOD -- integer:
21C> - Positional index of NEMO within internal
22C> Table A, if found
23C> - 0, otherwise
24C>
25C> <b>Program history log:</b>
26C> | Date | Programmer | Comments |
27C> | -----|------------|----------|
28C> | 1999-11-18 | J. Woollen | Original author |
29C> | 2003-11-04 | S. Bender | Added remarks/bufrlib routine interdependencies |
30C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added documentation; outputs more complete diagnostic info when routine terminates abnormally |
31C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
32C>
33 SUBROUTINE nemtbax(LUN,NEMO,MTYP,MSBT,INOD)
34
35 USE moda_tababd
36
37 CHARACTER*(*) NEMO
38 CHARACTER*128 BORT_STR
39
40C-----------------------------------------------------------------------
41C-----------------------------------------------------------------------
42
43 inod = 0
44
45C LOOK FOR NEMO IN TABLE A
46C ------------------------
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
59C EXITS
60C -----
61
62100 RETURN
63900 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE TYPE (",I4'//
64 . ',") RETURNED FOR MENMONIC ",A)') mtyp,nemo
65 CALL bort(bort_str)
66901 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE SUBTYPE ("'//
67 . ',I4,") RETURNED FOR MENMONIC ",A)') msbt,nemo
68 CALL bort(bort_str)
69 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
Definition: moda_tababd.F:58
integer, dimension(:,:), allocatable mtab
Entries within jump/link table corresponding to taba.
Definition: moda_tababd.F:54
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
Definition: moda_tababd.F:51
integer, dimension(:,:,:), allocatable idna
Message types (in array element 1) and subtypes (in array element 2) corresponding to taba.
Definition: moda_tababd.F:55
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:34