NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
nemtbax.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1999-11-18
3 
4 C> THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE
5 C> INTERNAL TABLE A ARRAYS HOLDING THE DICTIONARY TABLE (ARRAYS IN
6 C> MODULE TABABD) AND, IF FOUND, RETURNS INFORMATION ABOUT
7 C> THAT MNEMONIC FROM WITHIN THESE ARRAYS. IT IS IDENTICAL TO BUFR
8 C> ARCHIVE LIBRARY SUBROUTINE NEMTBA EXCEPT THAT, IF NEMO IS NOT
9 C> FOUND, THIS SUBROUTINE RETURNS WITH INOD EQUAL TO ZERO, WHEREAS
10 C> NEMTBA CALLS BUFR ARCHIVE LIBRARY SUBROUTINE BORT IN SUCH CASES.
11 C>
12 C> PROGRAM HISTORY LOG:
13 C> 1999-11-18 J. WOOLLEN -- ORIGINAL AUTHOR
14 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
15 C> INTERDEPENDENCIES
16 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
17 C> DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
18 C> MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
19 C> TERMINATES ABNORMALLY
20 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
21 C>
22 C> USAGE: CALL NEMTBAX (LUN, NEMO, MTYP, MSBT, INOD)
23 C> INPUT ARGUMENT LIST:
24 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
25 C> NEMO - CHARACTER*(*): TABLE A MNEMONIC TO SEARCH FOR
26 C>
27 C> OUTPUT ARGUMENT LIST:
28 C> MTYP - INTEGER: MESSAGE TYPE CORRESPONDING TO NEMO
29 C> MSBT - INTEGER: MESSAGE SUBTYPE CORRESPONDING TO NEMO
30 C> INOD - INTEGER: POSITIONAL INDEX OF NEMO WITHIN INTERNAL
31 C> JUMP/LINK TABLE IF NEMO FOUND
32 C> 0 = NEMO not found
33 C>
34 C> REMARKS:
35 C> THIS ROUTINE CALLS: BORT
36 C> THIS ROUTINE IS CALLED BY: CKTABA IOK2CPY NEMTBA STNDRD
37 C> Normally not called by any application
38 C> programs.
39 C>
40  SUBROUTINE nemtbax(LUN,NEMO,MTYP,MSBT,INOD)
41 
42  USE moda_tababd
43 
44  CHARACTER*(*) nemo
45  CHARACTER*128 bort_str
46 
47 C-----------------------------------------------------------------------
48 C-----------------------------------------------------------------------
49 
50  inod = 0
51 
52 C LOOK FOR NEMO IN TABLE A
53 C ------------------------
54 
55  DO i=1,ntba(lun)
56  IF(taba(i,lun)(4:11).EQ.nemo) THEN
57  mtyp = idna(i,lun,1)
58  msbt = idna(i,lun,2)
59  inod = mtab(i,lun)
60  IF(mtyp.LT.0 .OR. mtyp.GT.255) goto 900
61  IF(msbt.LT.0 .OR. msbt.GT.255) goto 901
62  goto 100
63  ENDIF
64  ENDDO
65 
66 C EXITS
67 C -----
68 
69 100 RETURN
70 900 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE TYPE (",I4'//
71  . ',") RETURNED FOR MENMONIC ",A)') mtyp,nemo
72  CALL bort(bort_str)
73 901 WRITE(bort_str,'("BUFRLIB: NEMTBAX - INVALID MESSAGE SUBTYPE ("'//
74  . ',I4,") RETURNED FOR MENMONIC ",A)') msbt,nemo
75  CALL bort(bort_str)
76  END
subroutine nemtbax(LUN, NEMO, MTYP, MSBT, INOD)
THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE INTERNAL TABLE A ARRAYS HOLDING THE DICTIONARY ...
Definition: nemtbax.f:40
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:23