updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / external / bufr / drstpl.f
blobf6a75f8b46bcc516b0eb324703da39a9a426a766
1 SUBROUTINE DRSTPL(INOD,LUN,INV1,INV2,INVN)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: DRSTPL
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE IS CALLED BY BUFR ARCHIVE LIBRARY SUBROUTINE
9 C UFBRW WHENEVER IT CAN'T FIND A MNEMONIC IT WANTS TO WRITE WITHIN THE
10 C CURRENT SUBSET BUFFER. IT LOOKS FOR THE MNEMONIC WITHIN ANY
11 C UNEXPANDED "DRS" (STACK) OR "DRB" (1-BIT DELAYED REPLICATION)
12 C SEQUENCES INSIDE OF THE PORTION OF THE SUBSET BUFFER BOUNDED BY THE
13 C INDICES INV1 AND INV2. IF FOUND, IT EXPANDS THE APPLICABLE "DRS" OR
14 C "DRB" SEQUENCE TO THE POINT WHERE THE MNEMONIC IN QUESTION NOW
15 C APPEARS IN THE SUBSET BUFFER, AND IN DOING SO IT WILL ALSO RETURN
16 C A NEW VALUE FOR INV2.
18 C PROGRAM HISTORY LOG:
19 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
20 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
21 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
22 C ROUTINE "BORT" (LATER REMOVED, UNKNOWN
23 C WHEN)
24 C 2002-05-14 J. WOOLLEN -- REMOVED OLD CRAY COMPILER DIRECTIVES
25 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
26 C INTERDEPENDENCIES
27 C 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
28 C INCREASED FROM 15000 TO 16000 (WAS IN
29 C VERIFICATION VERSION); UNIFIED/PORTABLE FOR
30 C WRF; ADDED DOCUMENTATION (INCLUDING
31 C HISTORY)
32 C 2009-03-31 J. WOOLLEN -- ADDED ADDITIONAL DOCUMENTATION
34 C USAGE: CALL DRSTPL (INOD, LUN, INV1, INV2, INVN)
36 C INPUT ARGUMENT LIST:
37 C INOD - INTEGER: JUMP/LINK TABLE INDEX OF MNEMONIC TO LOOK FOR
38 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
39 C INV1 - INTEGER: STARTING INDEX OF THE PORTION OF THE SUBSET
40 C BUFFER CURRENTLY BEING PROCESSED BY UFBRW
41 C INV2 - INTEGER: ENDING INDEX OF THE PORTION OF THE SUBSET
42 C BUFFER CURRENTLY BEING PROCESSED BY UFBRW
44 C OUTPUT ARGUMENT LIST:
45 C INVN - INTEGER: LOCATION INDEX OF INOD WITHIN SUBSET BUFFER:
46 C 0 = NOT FOUND
47 C INV2 - INTEGER: IF INVN = 0, THEN INV2 IS UNCHANGED FROM ITS
48 C INPUT VALUE. OTHERWISE, IT CONTAINS THE REDEFINED
49 C ENDING INDEX OF THE PORTION OF THE SUBSET BUFFER
50 C CURRENTLY BEING PROCESSED BY UFBRW, SINCE EXPANDING A
51 C DELAYED REPLICATION SEQUENCE WILL HAVE NECESSARILY
52 C INCREASED THE SIZE OF THIS BUFFER.
54 C REMARKS:
55 C THIS ROUTINE CALLS: INVWIN NEWWIN USRTPL
56 C THIS ROUTINE IS CALLED BY: UFBRW
57 C Normally not called by any application
58 C programs.
60 C ATTRIBUTES:
61 C LANGUAGE: FORTRAN 77
62 C MACHINE: PORTABLE TO ALL PLATFORMS
64 C$$$
66 INCLUDE 'bufrlib.prm'
68 COMMON /BTABLES/ MAXTAB,NTAB,TAG(MAXJL),TYP(MAXJL),KNT(MAXJL),
69 . JUMP(MAXJL),LINK(MAXJL),JMPB(MAXJL),
70 . IBT(MAXJL),IRF(MAXJL),ISC(MAXJL),
71 . ITP(MAXJL),VALI(MAXJL),KNTI(MAXJL),
72 . ISEQ(MAXJL,2),JSEQ(MAXJL)
74 CHARACTER*10 TAG
75 CHARACTER*3 TYP
77 C-----------------------------------------------------------------------
78 C-----------------------------------------------------------------------
80 1 NODE = INOD
81 2 NODE = JMPB(NODE)
82 IF(NODE.EQ.0) GOTO 100
83 IF(TYP(NODE).EQ.'DRS' .OR. TYP(NODE).EQ.'DRB') THEN
84 INVN = INVWIN(NODE,LUN,INV1,INV2)
85 IF(INVN.GT.0) THEN
86 CALL USRTPL(LUN,INVN,1)
87 CALL NEWWIN(LUN,INV1,INV2)
88 INVN = INVWIN(INOD,LUN,INVN,INV2)
89 IF(INVN.GT.0) GOTO 100
90 GOTO 1
91 ENDIF
92 ENDIF
93 GOTO 2
95 C EXIT
96 C ----
98 100 RETURN
99 END