1 SUBROUTINE TABENT
(LUN
,NEMO
,TAB
,ITAB
,IREP
,IKNT
,JUM0
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE BUILDS AND STORES AN ENTRY FOR A TABLE B OR
9 C TABLE D MNEMONIC (NEMO) WITHIN THE INTERNAL JUMP/LINK TABLE.
11 C PROGRAM HISTORY LOG:
12 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
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"; CORRECTED SOME MINOR ERRORS
16 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
17 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
19 C 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
20 C INCREASED FROM 15000 TO 16000 (WAS IN
21 C VERIFICATION VERSION); UNIFIED/PORTABLE FOR
22 C WRF; ADDED HISTORY DOCUMENTATION; OUTPUTS
23 C MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
24 C TERMINATES ABNORMALLY
25 C 2005-11-29 J. ATOR -- ADDED SUPPORT FOR 207 AND 208 OPERATORS
26 C 2010-03-19 J. ATOR -- ADDED SUPPORT FOR 204 OPERATOR
27 C 2012-03-02 J. ATOR -- ADDED SUPPORT FOR 203 OPERATOR
29 C USAGE: CALL TABENT (LUN, NEMO, TAB, ITAB, IREP, IKNT, JUM0)
30 C INPUT ARGUMENT LIST:
31 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
32 C NEMO - CHARACTER*8: TABLE B OR D MNEMONIC TO STORE IN JUMP/
34 C TAB - CHARACTER*1: INTERNAL BUFR TABLE ARRAY ('B' OR 'D') IN
35 C WHICH NEMO IS DEFINED
36 C ITAB - INTEGER: POSITIONAL INDEX OF NEMO WITHIN TAB
37 C IREP - INTEGER: POSITIONAL INDEX WITHIN COMMON /REPTAB/
38 C ARRAYS, FOR USE WHEN NEMO IS REPLICATED:
39 C 0 = NEMO is not replicated
40 C IKNT - INTEGER: NUMBER OF REPLICATIONS, FOR USE WHEN NEMO IS
41 C REPLICATED USING F=1 REGULAR (I.E., NON-DELAYED)
43 C 0 = NEMO is not replicated using F=1 regular
44 C (i.e., non-delayed) replication
45 C JUM0 - INTEGER: INDEX VALUE TO BE STORED FOR NEMO WITHIN
46 C INTERNAL JUMP/LINK TABLE ARRAY JMPB(*)
49 C THIS ROUTINE CALLS: BORT INCTAB NEMTBB
50 C THIS ROUTINE IS CALLED BY: TABSUB
51 C Normally not called by any application
55 C LANGUAGE: FORTRAN 77
56 C MACHINE: PORTABLE TO ALL PLATFORMS
62 C Note that the values within the COMMON /REPTAB/ arrays were
63 C initialized within subroutine BFRINI.
65 COMMON /REPTAB
/ IDNR
(5,2),TYPS
(5,2),REPS
(5,2),LENS
(5)
67 COMMON /BTABLES
/ MAXTAB
,NTAB
,TAG
(MAXJL
),TYP
(MAXJL
),KNT
(MAXJL
),
68 . JUMP
(MAXJL
),LINK
(MAXJL
),JMPB
(MAXJL
),
69 . IBT
(MAXJL
),IRF
(MAXJL
),ISC
(MAXJL
),
70 . ITP
(MAXJL
),VALI
(MAXJL
),KNTI
(MAXJL
),
71 . ISEQ
(MAXJL
,2),JSEQ
(MAXJL
)
72 COMMON /TABCCC
/ ICDW
,ICSC
,ICRV
,INCW
73 COMMON /NRV203
/ NNRV
,INODNRV
(MXNRV
),NRV
(MXNRV
),TAGNRV
(MXNRV
),
74 . ISNRV
(MXNRV
),IENRV
(MXNRV
),IBTNRV
,IPFNRV
76 CHARACTER*128 BORT_STR
79 CHARACTER*8 NEMO
,TAGNRV
80 CHARACTER*3 TYP
,TYPS
,TYPT
83 C-----------------------------------------------------------------------
84 C-----------------------------------------------------------------------
86 C MAKE A JUMP/LINK TABLE ENTRY FOR A REPLICATOR
87 C ---------------------------------------------
90 RTAG
= REPS
(IREP
,1)//NEMO
92 IF(RTAG
(I
:I
).EQ
.' ') THEN
93 RTAG
(I
:I
) = REPS
(IREP
,2)
94 CALL INCTAB
(RTAG
,TYPS
(IREP
,1),NODE
)
98 IBT
(NODE
) = LENS
(IREP
)
101 IF(IREP
.EQ
.1) IRF
(NODE
) = IKNT
109 C MAKE AN JUMP/LINK ENTRY FOR AN ELEMENT OR A SEQUENCE
110 C ----------------------------------------------------
112 1 IF(TAB
.EQ
.'B') THEN
114 CALL NEMTBB
(LUN
,ITAB
,UNIT
,ISCL
,IREF
,IBIT
)
115 IF(UNIT
(1:5).EQ
.'CCITT') THEN
120 CALL INCTAB
(NEMO
,TYPT
,NODE
)
127 IF(UNIT
(1:4).EQ
.'CODE') THEN
129 ELSEIF
(UNIT
(1:4).EQ
.'FLAG') THEN
133 IF( (TYPT
.EQ
.'NUM') .AND
. (IBTNRV
.NE
.0) ) THEN
135 C This node contains a new (redefined) reference value.
137 IF(NNRV
+1.GT
.MXNRV
) GOTO 902
143 IF(IPFNRV
.EQ
.0) IPFNRV
= NNRV
144 ELSEIF
( (TYPT
.EQ
.'NUM') .AND
. (NEMO
(1:3).NE
.'204') ) THEN
145 IBT
(NODE
) = IBT
(NODE
) + ICDW
146 ISC
(NODE
) = ISC
(NODE
) + ICSC
147 IRF
(NODE
) = IRF
(NODE
) * ICRV
148 ELSEIF
( (TYPT
.EQ
.'CHR') .AND
. (INCW
.GT
.0) ) THEN
152 ELSEIF
(TAB
.EQ
.'D') THEN
159 CALL INCTAB
(NEMO
,TYPT
,NODE
)
177 900 WRITE(BORT_STR
,'("BUFRLIB: TABENT - REPLICATOR ERROR FOR INPUT '//
178 . 'MNEMONIC ",A,", RTAG IS ",A)') NEMO
,RTAG
180 901 WRITE(BORT_STR
,'("BUFRLIB: TABENT - UNDEFINED TAG (",A,") FOR '//
181 . 'INPUT MNEMONIC ",A)') TAB
,NEMO
183 902 CALL BORT
('BUFRLIB: TABENT - MXNRV OVERFLOW')