NCEPLIBS-bufr  12.0.0
igetntbi.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get the next index for storing an entry within an internal
3 C> DX BUFR table
4 C>
5 C> @author J. Ator @date 2009-03-23
6 
7 C> This function returns the next available index for storing an
8 C> entry within a specified internal DX BUFR table.
9 C>
10 C> @param[in] LUN -- integer: Internal I/O stream index associated
11 C> with BUFR file
12 C> @param[in] CTB -- character: Type of internal DX BUFR table for
13 C> which to return the next available index
14 C> - 'A' = Table A
15 C> - 'B' = Table B
16 C> - 'D' = Table D
17 C> @returns igetntbi -- integer: Next available index for storing an
18 C> entry within CTB
19 C>
20 C> @author J. Ator @date 2009-03-23
21  FUNCTION igetntbi ( LUN, CTB )
22 
23  USE moda_tababd
24 
25  CHARACTER*128 bort_str
26  CHARACTER*1 ctb
27 
28 C-----------------------------------------------------------------------
29 C-----------------------------------------------------------------------
30 
31  IF ( ctb .EQ. 'A' ) THEN
32  igetntbi = ntba(lun) + 1
33  imax = ntba(0)
34  ELSE IF ( ctb .EQ. 'B' ) THEN
35  igetntbi = ntbb(lun) + 1
36  imax = ntbb(0)
37  ELSE IF ( ctb .EQ. 'D' ) THEN
38  igetntbi = ntbd(lun) + 1
39  imax = ntbd(0)
40  ENDIF
41  IF ( igetntbi .GT. imax ) GOTO 900
42 
43  RETURN
44 900 WRITE(bort_str,'("BUFRLIB: IGETNTBI - NUMBER OF INTERNAL TABLE'
45  . //'",A1," ENTRIES EXCEEDS THE LIMIT (",I4,")")') ctb, imax
46  CALL bort(bort_str)
47  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
function igetntbi(LUN, CTB)
This function returns the next available index for storing an entry within a specified internal DX BU...
Definition: igetntbi.f:22
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,...
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...