NCEPLIBS-bufr 11.7.1
ufbqcd.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE READS IN A MNEMONIC KNOWN TO BE IN THE BUFR
5C> TABLE ASSOCIATED WITH THE BUFR FILE IN LOGICAL UNIT LUNIT, AND
6C> RETURNS THE DESCRIPTOR ENTRY (Y) ASSOCIATED WITH IT WHEN THE FXY
7C> DESCRIPTOR IS A SEQUENCE DESCRIPTOR (F=3) WITH TABLE D CATEGORY 63
8C> (X=63). THIS ROUTINE WILL NOT WORK FOR ANY OTHER TYPE OF
9C> DESCRIPTOR OR ANY OTHER SEQUENCE DESCRIPTOR TABLE D CATEGORY.
10C> LUNIT MUST ALREADY BE OPENED FOR INPUT OR OUTPUT VIA A CALL TO
11C> OPENBF. THIS ROUTINE IS ESPECIALLY USEFUL WHEN THE CALLING PROGRAM
12C> IS WRITING "EVENTS" TO AN OUTPUT BUFR FILE (USUALLY THE "PREPBUFR"
13C> FILE) USING THE SAME BUFR TABLE SINCE THE DESCRIPTOR ENTRY (Y) HERE
14C> DEFINES THE EVENT PROGRAM CODE. THUS, THE CALLING PROGRAM CAN PASS
15C> THE PROGRAM CODE INTO VARIOUS EVENTS WITHOUT ACTUALLY KNOWING ITS
16C> VALUE AS LONG AS IT KNOWS THE MNEMONIC NAME ASSOCIATED WITH IT.
17C>
18C> PROGRAM HISTORY LOG:
19C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
20C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
21C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
22C> ROUTINE "BORT"
23C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
24C> INTERDEPENDENCIES
25C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
26C> DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
27C> MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
28C> TERMINATES ABNORMALLY
29C>
30C> USAGE: CALL UFBQCD (LUNIT, NEMO, QCD)
31C> INPUT ARGUMENT LIST:
32C> LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
33C> (ASSOCIATED BUFR TABLE MAY BE INTERNAL OR EXTERNAL)
34C> NEMO - CHARACTER*(*): MNEMONIC
35C>
36C> OUTPUT ARGUMENT LIST:
37C> QCD - REAL: SEQUENCE DESCRIPTOR ENTRY (I.E., EVENT PROGRAM
38C> CODE) IN BUFR TABLE ASSOCIATED WITH NEMO (Y IN FXY
39C> DESCRIPTOR, WHERE F=3 AND X=63)
40C>
41C> REMARKS:
42C> THIS SUBROUTINE IS THE INVERSE OF BUFR ARCHIVE LIBRARY ROUTINE
43C> UFBQCP.
44C>
45C> THIS ROUTINE CALLS: ADN30 BORT NEMTAB STATUS
46C> THIS ROUTINE IS CALLED BY: None
47C> Normally called only by application
48C> programs.
49C>
50 SUBROUTINE ufbqcd(LUNIT,NEMO,QCD)
51
52
53
54 CHARACTER*(*) NEMO
55 CHARACTER*128 BORT_STR
56 CHARACTER*6 FXY,ADN30
57 CHARACTER*1 TAB
58
59C-----------------------------------------------------------------------
60C-----------------------------------------------------------------------
61
62 CALL status(lunit,lun,il,im)
63 IF(il.EQ.0) GOTO 900
64
65 CALL nemtab(lun,nemo,idn,tab,iret)
66 IF(tab.NE.'D') GOTO 901
67
68 fxy = adn30(idn,6)
69 IF(fxy(2:3).NE.'63') GOTO 902
70 READ(fxy(4:6),'(F3.0)',err=903) qcd
71
72C EXITS
73C -----
74
75 RETURN
76900 CALL bort('BUFRLIB: UFBQCD - BUFR FILE IS CLOSED, IT MUST BE'//
77 . ' OPEN')
78901 WRITE(bort_str,'("BUFRLIB: UFBQCD - INPUT MNEMONIC ",A," NOT '//
79 . 'DEFINED AS A SEQUENCE DESCRIPTOR IN BUFR TABLE")') nemo
80 CALL bort(bort_str)
81902 WRITE(bort_str,'("BUFRLIB: UFBQCD - BUFR TABLE SEQ. DESCRIPTOR '//
82 . 'ASSOC. WITH INPUT MNEMONIC ",A," HAS INVALID CATEGORY ",A," -'//
83 . ' CATEGORY MUST BE 63")') nemo,fxy(2:3)
84 CALL bort(bort_str)
85903 WRITE(bort_str,'("BUFRLIB: UFBQCD - ERROR READING ENTRY '//
86 . '(PROGRAM CODE) FROM BUFR TBL SEQ. DESCRIPTOR ",A," ASSOC. '//
87 . 'WITH INPUT MNEM. ",A)') fxy,nemo
88 CALL bort(bort_str)
89 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables,...
Definition: nemtab.f:45
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 ufbqcd(LUNIT, NEMO, QCD)
THIS SUBROUTINE READS IN A MNEMONIC KNOWN TO BE IN THE BUFR TABLE ASSOCIATED WITH THE BUFR FILE IN LO...
Definition: ufbqcd.f:51