NCEPLIBS-bufr  12.0.0
getabdb.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get Table B and Table D information from the internal DX BUFR
3 C> tables
4 C> @author J. Ator @date 2005-11-29
5 
6 C> This subroutine reads Table B and Table D information from the
7 C> internal DX BUFR tables for a specified Fortran logical unit, then
8 C> returns this information in a pre-defined ASCII format.
9 C>
10 C> @param[in] LUNIT -- integer: Fortran logical unit number for BUFR file
11 C> @param[in] ITAB -- integer: Dimensioned size of TABDB array; used
12 C> by the subroutine to ensure that it doesn't
13 C> overflow the TABDB array
14 C> @param[out] TABDB -- character*128(*): Internal Table B and Table D
15 C> information
16 C> @param[out] JTAB -- integer: Number of entries stored within TABDB
17 C>
18 C> @author J. Ator @date 2005-11-29
19  RECURSIVE SUBROUTINE getabdb(LUNIT,TABDB,ITAB,JTAB)
20 
21  USE moda_tababd
22  USE moda_nmikrp
23  USE modv_im8b
24 
25  CHARACTER*128 tabdb(*)
26  CHARACTER*8 nemo
27 
28 C-----------------------------------------------------------------------
29 C-----------------------------------------------------------------------
30 
31 C CHECK FOR I8 INTEGERS
32 C ---------------------
33 
34  IF(im8b) THEN
35  im8b=.false.
36 
37  CALL x84(lunit,my_lunit,1)
38  CALL x84(itab,my_itab,1)
39  CALL getabdb(my_lunit,tabdb,my_itab,jtab)
40  CALL x48(jtab,jtab,1)
41 
42  im8b=.true.
43  RETURN
44  ENDIF
45 
46  jtab = 0
47 
48 C MAKE SURE THE FILE IS OPEN
49 C --------------------------
50 
51  CALL status(lunit,lun,il,im)
52  IF(il.EQ.0) RETURN
53 
54 C WRITE OUT THE TABLE D ENTRIES FOR THIS FILE
55 C -------------------------------------------
56 
57  DO i=1,ntbd(lun)
58  nemo = tabd(i,lun)(7:14)
59  CALL nemtbd(lun,i,nseq,nem(1,1),irp(1,1),krp(1,1))
60  DO j=1,nseq,10
61  jtab = jtab+1
62  IF(jtab.LE.itab) THEN
63  WRITE(tabdb(jtab),1) nemo,(nem(k,1),k=j,min(j+9,nseq))
64 1 FORMAT('D ',a8,10(1x,a10))
65  ENDIF
66  ENDDO
67  ENDDO
68 
69 C ADD THE TABLE B ENTRIES
70 C -----------------------
71 
72  DO i=1,ntbb(lun)
73  jtab = jtab+1
74  IF(jtab.LE.itab) THEN
75  WRITE(tabdb(jtab),2) tabb(i,lun)(7:14),tabb(i,lun)(71:112)
76 2 FORMAT('B ',a8,1x,a42)
77  ENDIF
78  ENDDO
79 
80  RETURN
81  END
recursive subroutine getabdb(LUNIT, TABDB, ITAB, JTAB)
This subroutine reads Table B and Table D information from the internal DX BUFR tables for a specifie...
Definition: getabdb.f:20
This module contains declarations for arrays used by various subroutines to hold information about Ta...
integer, dimension(:,:), allocatable krp
Replication counts corresponding to nem:
integer, dimension(:,:), allocatable irp
Replication indicators corresponding to nem:
character *8, dimension(:,:), allocatable nem
Child mnemonics within Table D sequences.
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
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,...
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
subroutine nemtbd(LUN, ITAB, NSEQ, NEMS, IRPS, KNTS)
This subroutine returns information about a Table D descriptor from the internal DX BUFR tables.
Definition: nemtbd.f:44
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
Definition: status.f:36
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
Definition: x48.F:19
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19