1 SUBROUTINE CHEKSTAB
(LUN
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE CHECKS THAT AN INTERNAL BUFR TABLE
9 C REPRESENTATION IS SELF-CONSISTENT AND FULLY DEFINED. IF ANY ERRORS
10 C ARE FOUND, THEN AN APPROPRIATE CALL IS MADE TO BUFR ARCHIVE LIBRARY
13 C PROGRAM HISTORY LOG:
14 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
15 C 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
16 C ARRAYS IN ORDER TO HANDLE BIGGER FILES
17 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
18 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
20 C 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
21 C OPENED AT ONE TIME INCREASED FROM 10 TO 32
22 C (NECESSARY IN ORDER TO PROCESS MULTIPLE
23 C BUFR FILES UNDER THE MPI)
24 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
25 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
27 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
28 C DOCUMENTATION; OUTPUTS MORE COMPLETE
29 C DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
32 C USAGE: CALL CHEKSTAB (LUN)
33 C INPUT ARGUMENT LIST:
34 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
37 C THIS ROUTINE CALLS: BORT NEMTAB NEMTBB NEMTBD
38 C THIS ROUTINE IS CALLED BY: MAKESTAB
39 C Normally not called by any application
43 C LANGUAGE: FORTRAN 77
44 C MACHINE: PORTABLE TO ALL PLATFORMS
50 COMMON /TABABD
/ NTBA
(0:NFILES
),NTBB
(0:NFILES
),NTBD
(0:NFILES
),
51 . MTAB
(MAXTBA
,NFILES
),IDNA
(MAXTBA
,NFILES
,2),
52 . IDNB
(MAXTBB
,NFILES
),IDND
(MAXTBD
,NFILES
),
53 . TABA
(MAXTBA
,NFILES
),TABB
(MAXTBB
,NFILES
),
59 CHARACTER*128 BORT_STR
61 CHARACTER*8 NEMO
,NEMS
(MAXCD
)
63 DIMENSION IRPS
(MAXCD
),KNTS
(MAXCD
)
65 C-----------------------------------------------------------------------
66 C-----------------------------------------------------------------------
68 C THERE MUST BE ENTRIES IN TABLES A, B, AND D
69 C -------------------------------------------
71 IF(NTBA
(LUN
).EQ
.0) GOTO 900
72 IF(NTBB
(LUN
).EQ
.0) GOTO 901
73 IF(NTBD
(LUN
).EQ
.0) GOTO 902
75 C MAKE SURE EACH TABLE A ENTRY DEFINED AS A SEQUENCE
76 C --------------------------------------------------
79 NEMO
= TABA
(I
,LUN
)(4:11)
80 CALL NEMTAB
(LUN
,NEMO
,IDN
,TAB
,IRET
)
81 IF(TAB
.NE
.'D') GOTO 903
84 C CHECK TABLE B CONTENTS
85 C ----------------------
88 CALL NEMTBB
(LUN
,ITAB
,UNIT
,ISCL
,IREF
,IBIT
)
91 C CHECK TABLE D CONTNETS
92 C ----------------------
95 CALL NEMTBD
(LUN
,ITAB
,NSEQ
,NEMS
,IRPS
,KNTS
)
103 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE A IN INTERNAL BUFR TABLES')
105 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE B IN INTERNAL BUFR TABLES')
107 . ('BUFRLIB: CHEKSTAB - EMPTY TABLE D IN INTERNAL BUFR TABLES')
108 903 WRITE(BORT_STR
,'("BUFRLIB: CHEKSTAB - TABLE A ENTRY: ",A," NOT '//
109 . 'DEFINED AS A SEQUENCE")') NEMO