1 SUBROUTINE UFBCUP
(LUBIN
,LUBOT
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE MAKES ONE COPY OF EACH UNIQUE ELEMENT IN AN
9 C INPUT SUBSET BUFFER INTO THE IDENTICAL MNEMONIC SLOT IN THE OUTPUT
12 C PROGRAM HISTORY LOG:
13 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
14 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
15 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
17 C 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
18 C OPENED AT ONE TIME INCREASED FROM 10 TO 32
19 C (NECESSARY IN ORDER TO PROCESS MULTIPLE
20 C BUFR FILES UNDER THE MPI)
21 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
23 C 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
24 C INCREASED FROM 15000 TO 16000 (WAS IN
25 C VERIFICATION VERSION); UNIFIED/PORTABLE FOR
26 C WRF; ADDED DOCUMENTATION (INCLUDING
27 C HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC
28 C INFO WHEN ROUTINE TERMINATES ABNORMALLY
30 C USAGE: CALL UFBCUP (LUBIN, LUBOT)
31 C INPUT ARGUMENT LIST:
32 C LUBIN - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR INPUT BUFR
34 C LUBOT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR OUTPUT BUFR
38 C THIS ROUTINE CALLS: BORT STATUS
39 C THIS ROUTINE IS CALLED BY: None
40 C Normally called only by application
44 C LANGUAGE: FORTRAN 77
45 C MACHINE: PORTABLE TO ALL PLATFORMS
51 COMMON /BTABLES
/ MAXTAB
,NTAB
,TAG
(MAXJL
),TYP
(MAXJL
),KNT
(MAXJL
),
52 . JUMP
(MAXJL
),LINK
(MAXJL
),JMPB
(MAXJL
),
53 . IBT
(MAXJL
),IRF
(MAXJL
),ISC
(MAXJL
),
54 . ITP
(MAXJL
),VALI
(MAXJL
),KNTI
(MAXJL
),
55 . ISEQ
(MAXJL
,2),JSEQ
(MAXJL
)
57 COMMON /MSGCWD
/ NMSG
(NFILES
),NSUB
(NFILES
),MSUB
(NFILES
),
58 . INODE
(NFILES
),IDATE
(NFILES
)
59 COMMON /USRINT
/ NVAL
(NFILES
),INV
(MAXSS
,NFILES
),VAL
(MAXSS
,NFILES
)
61 CHARACTER*10 TAG
,TAGI
(MAXJL
),TAGO
66 C----------------------------------------------------------------------
67 C----------------------------------------------------------------------
69 C CHECK THE FILE STATUSES AND I-NODE
70 C ----------------------------------
72 CALL STATUS
(LUBIN
,LUI
,IL
,IM
)
76 IF(INODE
(LUI
).NE
.INV
(1,LUI
)) GOTO 903
78 CALL STATUS
(LUBOT
,LUO
,IL
,IM
)
83 C MAKE A LIST OF UNIQUE TAGS IN INPUT BUFFER
84 C ------------------------------------------
90 IF(ITP
(NIN
).GE
.2) THEN
92 IF(TAGI
(NV
).EQ
.TAG
(NIN
)) GOTO 5
100 IF(NTAG
.EQ
.0) GOTO 907
102 C GIVEN A LIST MAKE ONE COPY OF COMMON ELEMENTS TO OUTPUT BUFFER
103 C --------------------------------------------------------------
108 TAGO
= TAG
(INV
(NO
,LUO
))
109 IF(TAGI
(NV
).EQ
.TAGO
) THEN
110 VAL
(NO
,LUO
) = VAL
(NI
,LUI
)
120 900 CALL BORT
('BUFRLIB: UFBCUP - INPUT BUFR FILE IS CLOSED, IT '//
121 . 'MUST BE OPEN FOR INPUT')
122 901 CALL BORT
('BUFRLIB: UFBCUP - INPUT BUFR FILE IS OPEN FOR '//
123 . 'OUTPUT, IT MUST BE OPEN FOR INPUT')
124 902 CALL BORT
('BUFRLIB: UFBCUP - A MESSAGE MUST BE OPEN IN INPUT '//
125 . 'BUFR FILE, NONE ARE')
126 903 CALL BORT
('BUFRLIB: UFBCUP - LOCATION OF INTERNAL TABLE FOR '//
127 . 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN '//
128 . 'INTERNAL SUBSET ARRAY')
129 904 CALL BORT
('BUFRLIB: UFBCUP - OUTPUT BUFR FILE IS CLOSED, IT '//
130 . 'MUST BE OPEN FOR OUTPUT')
131 905 CALL BORT
('BUFRLIB: UFBCUP - OUTPUT BUFR FILE IS OPEN FOR '//
132 . 'INPUT, IT MUST BE OPEN FOR OUTPUT')
133 906 CALL BORT
('BUFRLIB: UFBCUP - A MESSAGE MUST BE OPEN IN OUTPUT '//
134 . 'BUFR FILE, NONE ARE')
135 907 CALL BORT
('BUFRLIB: UFBCUP - THERE ARE NO ELEMENTS (TAGS) IN '//
136 . 'INPUT SUBSET BUFFER')