NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
chekstab.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE CHECKS THAT AN INTERNAL BUFR TABLE
5 C> REPRESENTATION IS SELF-CONSISTENT AND FULLY DEFINED. IF ANY ERRORS
6 C> ARE FOUND, THEN AN APPROPRIATE CALL IS MADE TO BUFR ARCHIVE LIBRARY
7 C> SUBROUTINE BORT.
8 C>
9 C> PROGRAM HISTORY LOG:
10 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
11 C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
12 C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
13 C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
14 C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
15 C> ROUTINE "BORT"
16 C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
17 C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
18 C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
19 C> BUFR FILES UNDER THE MPI)
20 C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
21 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22 C> INTERDEPENDENCIES
23 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
24 C> DOCUMENTATION; OUTPUTS MORE COMPLETE
25 C> DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
26 C> ABNORMALLY
27 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
28 C>
29 C> USAGE: CALL CHEKSTAB (LUN)
30 C> INPUT ARGUMENT LIST:
31 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
32 C>
33 C> REMARKS:
34 C> THIS ROUTINE CALLS: BORT NEMTAB NEMTBB NEMTBD
35 C> THIS ROUTINE IS CALLED BY: MAKESTAB
36 C> Normally not called by any application
37 C> programs.
38 C>
39  SUBROUTINE chekstab(LUN)
40 
41  USE moda_tababd
42  USE moda_nmikrp
43 
44  CHARACTER*128 bort_str
45  CHARACTER*24 unit
46  CHARACTER*8 nemo
47  CHARACTER*1 tab
48 
49 C-----------------------------------------------------------------------
50 C-----------------------------------------------------------------------
51 
52 C THERE MUST BE ENTRIES IN TABLES A, B, AND D
53 C -------------------------------------------
54 
55  IF(ntba(lun).EQ.0) goto 900
56  IF(ntbb(lun).EQ.0) goto 901
57  IF(ntbd(lun).EQ.0) goto 902
58 
59 C MAKE SURE EACH TABLE A ENTRY DEFINED AS A SEQUENCE
60 C --------------------------------------------------
61 
62  DO i=1,ntba(lun)
63  nemo = taba(i,lun)(4:11)
64  CALL nemtab(lun,nemo,idn,tab,iret)
65  IF(tab.NE.'D') goto 903
66  ENDDO
67 
68 C CHECK TABLE B CONTENTS
69 C ----------------------
70 
71  DO itab=1,ntbb(lun)
72  CALL nemtbb(lun,itab,unit,iscl,iref,ibit)
73  ENDDO
74 
75 C CHECK TABLE D CONTNETS
76 C ----------------------
77 
78  DO itab=1,ntbd(lun)
79  CALL nemtbd(lun,itab,nseq,nem(1,1),irp(1,1),krp(1,1))
80  ENDDO
81 
82 C EXITS
83 C -----
84 
85  RETURN
86 900 CALL bort
87  . ('BUFRLIB: CHEKSTAB - EMPTY TABLE A IN INTERNAL BUFR TABLES')
88 901 CALL bort
89  . ('BUFRLIB: CHEKSTAB - EMPTY TABLE B IN INTERNAL BUFR TABLES')
90 902 CALL bort
91  . ('BUFRLIB: CHEKSTAB - EMPTY TABLE D IN INTERNAL BUFR TABLES')
92 903 WRITE(bort_str,'("BUFRLIB: CHEKSTAB - TABLE A ENTRY: ",A," NOT '//
93  . 'DEFINED AS A SEQUENCE")') nemo
94  CALL bort(bort_str)
95  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine nemtbb(LUN, ITAB, UNIT, ISCL, IREF, IBIT)
This subroutine returns information about a Table B descriptor from the internal DX BUFR tables...
Definition: nemtbb.f:31
subroutine chekstab(LUN)
THIS SUBROUTINE CHECKS THAT AN INTERNAL BUFR TABLE REPRESENTATION IS SELF-CONSISTENT AND FULLY DEFINE...
Definition: chekstab.f:39
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables, based on the mnemonic associated with that descriptor.
Definition: nemtab.f:44
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22
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