NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
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 
5 C> This function returns the next available index for storing an
6 C> entry within a specified internal DX BUFR table.
7 C>
8 C> @author J. Ator
9 C> @date 2009-03-23
10 C>
11 C> @param[in] LUN -- integer: Internal I/O stream index associated
12 C> with BUFR file
13 C> @param[in] CTB -- character: Type of internal DX BUFR table for
14 C> which to return the next available index
15 C> - 'A' = Table A
16 C> - 'B' = Table B
17 C> - 'D' = Table D
18 C> @returns igetntbi -- integer: Next available index for storing an
19 C> entry within CTB
20 C>
21 C> <b>Program history log:</b>
22 C> | Date | Programmer | Comments |
23 C> | -----|------------|----------|
24 C> | 2009-03-23 | J. Ator | Original author |
25 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
26 C>
27  FUNCTION igetntbi ( LUN, CTB )
28 
29  USE moda_tababd
30 
31  CHARACTER*128 bort_str
32  CHARACTER*1 ctb
33 
34 C-----------------------------------------------------------------------
35 C-----------------------------------------------------------------------
36 
37  IF ( ctb .EQ. 'A' ) THEN
38  igetntbi = ntba(lun) + 1
39  imax = ntba(0)
40  ELSE IF ( ctb .EQ. 'B' ) THEN
41  igetntbi = ntbb(lun) + 1
42  imax = ntbb(0)
43  ELSE IF ( ctb .EQ. 'D' ) THEN
44  igetntbi = ntbd(lun) + 1
45  imax = ntbd(0)
46  ENDIF
47  IF ( igetntbi .GT. imax ) goto 900
48 
49  RETURN
50 900 WRITE(bort_str,'("BUFRLIB: IGETNTBI - NUMBER OF INTERNAL TABLE'
51  . //'",A1," ENTRIES EXCEEDS THE LIMIT (",I4,")")') ctb, imax
52  CALL bort(bort_str)
53  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 a specified internal DX BU...
Definition: igetntbi.f:27
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22