NCEPLIBS-bufr 11.7.1
chekstab.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE CHECKS THAT AN INTERNAL BUFR TABLE
5C> REPRESENTATION IS SELF-CONSISTENT AND FULLY DEFINED. IF ANY ERRORS
6C> ARE FOUND, THEN AN APPROPRIATE CALL IS MADE TO BUFR ARCHIVE LIBRARY
7C> SUBROUTINE BORT.
8C>
9C> PROGRAM HISTORY LOG:
10C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
11C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
12C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
13C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
14C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
15C> ROUTINE "BORT"
16C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
17C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
18C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
19C> BUFR FILES UNDER THE MPI)
20C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
21C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22C> INTERDEPENDENCIES
23C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
24C> DOCUMENTATION; OUTPUTS MORE COMPLETE
25C> DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
26C> ABNORMALLY
27C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
28C>
29C> USAGE: CALL CHEKSTAB (LUN)
30C> INPUT ARGUMENT LIST:
31C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
32C>
33C> REMARKS:
34C> THIS ROUTINE CALLS: BORT NEMTAB NEMTBB NEMTBD
35C> THIS ROUTINE IS CALLED BY: MAKESTAB
36C> Normally not called by any application
37C> programs.
38C>
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
49C-----------------------------------------------------------------------
50C-----------------------------------------------------------------------
51
52C THERE MUST BE ENTRIES IN TABLES A, B, AND D
53C -------------------------------------------
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
59C MAKE SURE EACH TABLE A ENTRY DEFINED AS A SEQUENCE
60C --------------------------------------------------
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
68C CHECK TABLE B CONTENTS
69C ----------------------
70
71 DO itab=1,ntbb(lun)
72 CALL nemtbb(lun,itab,unit,iscl,iref,ibit)
73 ENDDO
74
75C CHECK TABLE D CONTNETS
76C ----------------------
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
82C EXITS
83C -----
84
85 RETURN
86900 CALL bort
87 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE A IN INTERNAL BUFR TABLES')
88901 CALL bort
89 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE B IN INTERNAL BUFR TABLES')
90902 CALL bort
91 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE D IN INTERNAL BUFR TABLES')
92903 WRITE(bort_str,'("BUFRLIB: CHEKSTAB - TABLE A ENTRY: ",A," NOT '//
93 . 'DEFINED AS A SEQUENCE")') nemo
94 CALL bort(bort_str)
95 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine chekstab(LUN)
THIS SUBROUTINE CHECKS THAT AN INTERNAL BUFR TABLE REPRESENTATION IS SELF-CONSISTENT AND FULLY DEFINE...
Definition: chekstab.f:40
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
Definition: moda_tababd.F:58
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
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables,...
Definition: nemtab.f:45
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:32
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:55