NCEPLIBS-bufr 11.7.1
ufbcup.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE MAKES ONE COPY OF EACH UNIQUE ELEMENT IN AN
5C> INPUT SUBSET BUFFER INTO THE IDENTICAL MNEMONIC SLOT IN THE OUTPUT
6C> SUBSET BUFFER.
7C>
8C> PROGRAM HISTORY LOG:
9C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
11C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
12C> ROUTINE "BORT"
13C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
14C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
15C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
16C> BUFR FILES UNDER THE MPI)
17C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
18C> INTERDEPENDENCIES
19C> 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
20C> INCREASED FROM 15000 TO 16000 (WAS IN
21C> VERIFICATION VERSION); UNIFIED/PORTABLE FOR
22C> WRF; ADDED DOCUMENTATION (INCLUDING
23C> HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC
24C> INFO WHEN ROUTINE TERMINATES ABNORMALLY
25C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
26C>
27C> USAGE: CALL UFBCUP (LUBIN, LUBOT)
28C> INPUT ARGUMENT LIST:
29C> LUBIN - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR INPUT BUFR
30C> FILE
31C> LUBOT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR OUTPUT BUFR
32C> FILE
33C>
34C> REMARKS:
35C> THIS ROUTINE CALLS: BORT STATUS
36C> THIS ROUTINE IS CALLED BY: None
37C> Normally called only by application
38C> programs.
39C>
40 SUBROUTINE ufbcup(LUBIN,LUBOT)
41
42 USE moda_usrint
43 USE moda_msgcwd
44 USE moda_tables
45 USE moda_ivttmp
46
47 CHARACTER*10 TAGO
48
49C----------------------------------------------------------------------
50C----------------------------------------------------------------------
51
52C CHECK THE FILE STATUSES AND I-NODE
53C ----------------------------------
54
55 CALL status(lubin,lui,il,im)
56 IF(il.EQ.0) GOTO 900
57 IF(il.GT.0) GOTO 901
58 IF(im.EQ.0) GOTO 902
59 IF(inode(lui).NE.inv(1,lui)) GOTO 903
60
61 CALL status(lubot,luo,il,im)
62 IF(il.EQ.0) GOTO 904
63 IF(il.LT.0) GOTO 905
64 IF(im.EQ.0) GOTO 906
65
66C MAKE A LIST OF UNIQUE TAGS IN INPUT BUFFER
67C ------------------------------------------
68
69 ntag = 0
70
71 DO 5 ni=1,nval(lui)
72 nin = inv(ni,lui)
73 IF(itp(nin).GE.2) THEN
74 DO nv=1,ntag
75 IF(ttmp(nv).EQ.tag(nin)) GOTO 5
76 ENDDO
77 ntag = ntag+1
78 itmp(ntag) = ni
79 ttmp(ntag) = tag(nin)
80 ENDIF
815 ENDDO
82
83 IF(ntag.EQ.0) GOTO 907
84
85C GIVEN A LIST MAKE ONE COPY OF COMMON ELEMENTS TO OUTPUT BUFFER
86C --------------------------------------------------------------
87
88 DO 10 nv=1,ntag
89 ni = itmp(nv)
90 DO no=1,nval(luo)
91 tago = tag(inv(no,luo))
92 IF(ttmp(nv).EQ.tago) THEN
93 val(no,luo) = val(ni,lui)
94 GOTO 10
95 ENDIF
96 ENDDO
9710 ENDDO
98
99C EXITS
100C -----
101
102 RETURN
103900 CALL bort('BUFRLIB: UFBCUP - INPUT BUFR FILE IS CLOSED, IT '//
104 . 'MUST BE OPEN FOR INPUT')
105901 CALL bort('BUFRLIB: UFBCUP - INPUT BUFR FILE IS OPEN FOR '//
106 . 'OUTPUT, IT MUST BE OPEN FOR INPUT')
107902 CALL bort('BUFRLIB: UFBCUP - A MESSAGE MUST BE OPEN IN INPUT '//
108 . 'BUFR FILE, NONE ARE')
109903 CALL bort('BUFRLIB: UFBCUP - LOCATION OF INTERNAL TABLE FOR '//
110 . 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN '//
111 . 'INTERNAL SUBSET ARRAY')
112904 CALL bort('BUFRLIB: UFBCUP - OUTPUT BUFR FILE IS CLOSED, IT '//
113 . 'MUST BE OPEN FOR OUTPUT')
114905 CALL bort('BUFRLIB: UFBCUP - OUTPUT BUFR FILE IS OPEN FOR '//
115 . 'INPUT, IT MUST BE OPEN FOR OUTPUT')
116906 CALL bort('BUFRLIB: UFBCUP - A MESSAGE MUST BE OPEN IN OUTPUT '//
117 . 'BUFR FILE, NONE ARE')
118907 CALL bort('BUFRLIB: UFBCUP - THERE ARE NO ELEMENTS (TAGS) IN '//
119 . 'INPUT SUBSET BUFFER')
120 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
This module contains array and variable declarations used to store the internal jump/link table.
Definition: moda_tables.F:13
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
Definition: moda_tables.F:141
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
Definition: moda_tables.F:132
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56
subroutine ufbcup(LUBIN, LUBOT)
THIS SUBROUTINE MAKES ONE COPY OF EACH UNIQUE ELEMENT IN AN INPUT SUBSET BUFFER INTO THE IDENTICAL MN...
Definition: ufbcup.f:41