NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
igetntbi.f
Go to the documentation of this file.
1 C> @file
2 C> @author ATOR @date 2009-03-23
3 
4 C> THIS FUNCTION RETURNS THE NEXT AVAILABLE INDEX FOR
5 C> STORING AN ENTRY WITHIN INTERNAL BUFR TABLE CTB.
6 C>
7 C> PROGRAM HISTORY LOG:
8 C> 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
9 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
10 C>
11 C> USAGE: CALL IGETNTBI ( LUN, CTB )
12 C> INPUT ARGUMENT LIST:
13 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
14 C> CTB - CHARACTER*1: INTERNAL BUFR TABLE FROM WHICH TO RETURN
15 C> THE NEXT AVAILABLE INDEX ('A','B', OR 'D')
16 C>
17 C> OUTPUT ARGUMENT LIST:
18 C> IGETNTBI - INTEGER: NEXT AVAILABLE INDEX IN TABLE CTB
19 C>
20 C> REMARKS:
21 C> THIS ROUTINE CALLS: BORT
22 C> THIS ROUTINE IS CALLED BY: RDUSDX READS3 STBFDX STSEQ
23 C> Not normally called by application
24 C> programs.
25 C>
26  FUNCTION igetntbi ( LUN, CTB )
27 
28  USE moda_tababd
29 
30  CHARACTER*128 bort_str
31  CHARACTER*1 ctb
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36  IF ( ctb .EQ. 'A' ) THEN
37  igetntbi = ntba(lun) + 1
38  imax = ntba(0)
39  ELSE IF ( ctb .EQ. 'B' ) THEN
40  igetntbi = ntbb(lun) + 1
41  imax = ntbb(0)
42  ELSE IF ( ctb .EQ. 'D' ) THEN
43  igetntbi = ntbd(lun) + 1
44  imax = ntbd(0)
45  ENDIF
46  IF ( igetntbi .GT. imax ) goto 900
47 
48  RETURN
49 900 WRITE(bort_str,'("BUFRLIB: IGETNTBI - NUMBER OF INTERNAL TABLE'
50  . //'",A1," ENTRIES EXCEEDS THE LIMIT (",I4,")")') ctb, imax
51  CALL bort(bort_str)
52  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
function igetntbi(LUN, CTB)
THIS FUNCTION RETURNS THE NEXT AVAILABLE INDEX FOR STORING AN ENTRY WITHIN INTERNAL BUFR TABLE CTB...
Definition: igetntbi.f:26
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23