NCEPLIBS-bufr 11.7.1
igetntbi.f
Go to the documentation of this file.
1C> @file
2C> @brief Get the next index for storing an entry within an internal
3C> DX BUFR table
4
5C> This function returns the next available index for storing an
6C> entry within a specified internal DX BUFR table.
7C>
8C> @author J. Ator
9C> @date 2009-03-23
10C>
11C> @param[in] LUN -- integer: Internal I/O stream index associated
12C> with BUFR file
13C> @param[in] CTB -- character: Type of internal DX BUFR table for
14C> which to return the next available index
15C> - 'A' = Table A
16C> - 'B' = Table B
17C> - 'D' = Table D
18C> @returns igetntbi -- integer: Next available index for storing an
19C> entry within CTB
20C>
21C> <b>Program history log:</b>
22C> | Date | Programmer | Comments |
23C> | -----|------------|----------|
24C> | 2009-03-23 | J. Ator | Original author |
25C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
26C>
27 FUNCTION igetntbi ( LUN, CTB )
28
29 USE moda_tababd
30
31 CHARACTER*128 bort_str
32 CHARACTER*1 ctb
33
34C-----------------------------------------------------------------------
35C-----------------------------------------------------------------------
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
50900 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
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function igetntbi(LUN, CTB)
This function returns the next available index for storing an entry within a specified internal DX BU...
Definition: igetntbi.f:28
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
Definition: moda_tababd.F:53
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
Definition: moda_tababd.F:52
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