NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
getabdb.f
Go to the documentation of this file.
1 C> @file
2 C> @author ATOR @date 2005-11-29
3 
4 C> THIS SUBROUTINE RETURNS INTERNAL TABLE B AND TABLE D
5 C> INFORMATION FOR LOGICAL UNIT LUNIT IN A PRE-DEFINED ASCII FORMAT.
6 C>
7 C> PROGRAM HISTORY LOG:
8 C> 2005-11-29 J. ATOR -- ADDED TO BUFR ARCHIVE LIBRARY (WAS IN-LINED
9 C> IN PROGRAM NAMSND)
10 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
11 C>
12 C> USAGE: CALL GETABDB( LUNIT, TABDB, ITAB, JTAB )
13 C> INPUT ARGUMENT LIST:
14 C> LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
15 C> ITAB - INTEGER: DIMENSIONED SIZE OF TABDB ARRAY
16 C>
17 C> OUTPUT ARGUMENT LIST:
18 C> TABDB - CHARACTER*128: (JTAB)-WORD ARRAY OF INTERNAL TABLE B
19 C> AND TABLE D INFORMATION
20 C> JTAB - INTEGER: NUMBER OF ENTRIES STORED WITHIN TABDB
21 C>
22 C> REMARKS:
23 C> THIS ROUTINE CALLS: NEMTBD STATUS
24 C> THIS ROUTINE IS CALLED BY: None
25 C> Normally called only by application
26 C> programs.
27 C>
28  SUBROUTINE getabdb(LUNIT,TABDB,ITAB,JTAB)
29 
30  USE moda_tababd
31  USE moda_nmikrp
32 
33  CHARACTER*128 tabdb(*)
34  CHARACTER*8 nemo
35 
36 C-----------------------------------------------------------------------
37 C-----------------------------------------------------------------------
38 
39  jtab = 0
40 
41 C MAKE SURE THE FILE IS OPEN
42 C --------------------------
43 
44  CALL status(lunit,lun,il,im)
45  IF(il.EQ.0) RETURN
46 
47 C WRITE OUT THE TABLE D ENTRIES FOR THIS FILE
48 C -------------------------------------------
49 
50  DO i=1,ntbd(lun)
51  nemo = tabd(i,lun)(7:14)
52  CALL nemtbd(lun,i,nseq,nem(1,1),irp(1,1),krp(1,1))
53  DO j=1,nseq,10
54  jtab = jtab+1
55  IF(jtab.LE.itab) THEN
56  WRITE(tabdb(jtab),1) nemo,(nem(k,1),k=j,min(j+9,nseq))
57 1 FORMAT('D ',a8,10(1x,a10))
58  ENDIF
59  ENDDO
60  ENDDO
61 
62 C ADD THE TABLE B ENTRIES
63 C -----------------------
64 
65  DO i=1,ntbb(lun)
66  jtab = jtab+1
67  IF(jtab.LE.itab) THEN
68  WRITE(tabdb(jtab),2) tabb(i,lun)(7:14),tabb(i,lun)(71:112)
69 2 FORMAT('B ',a8,1x,a42)
70  ENDIF
71  ENDDO
72 
73  RETURN
74  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:55
subroutine getabdb(LUNIT, TABDB, ITAB, JTAB)
THIS SUBROUTINE RETURNS INTERNAL TABLE B AND TABLE D INFORMATION FOR LOGICAL UNIT LUNIT IN A PRE-DEFI...
Definition: getabdb.f:28
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:54