NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
writdx.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES TO
5 C> THE BEGINNING OF AN OUTPUT BUFR FILE IN LUNIT. THE TABLE MESSAGES
6 C> ARE READ FROM ARRAYS IN INTERNAL MEMORY (MODULE TABABD).
7 C> AN INITIAL CALL TO BUFR ARCHIVE LIBRARY SUBROUTINE READDX GENERATES
8 C> THESE INTERNAL ARRAYS.
9 C>
10 C> PROGRAM HISTORY LOG:
11 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
12 C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
13 C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
14 C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
15 C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
16 C> ROUTINE "BORT"
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> 2000-09-19 J. WOOLLEN -- MAXIMUM MESSAGE LENGTH INCREASED FROM
22 C> 10,000 TO 20,000 BYTES
23 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
24 C> INTERDEPENDENCIES
25 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
26 C> DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
27 C> MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
28 C> TERMINATES ABNORMALLY
29 C> 2004-08-09 J. ATOR -- MAXIMUM MESSAGE LENGTH INCREASED FROM
30 C> 20,000 TO 50,000 BYTES
31 C> 2009-03-23 J. ATOR -- USE WRDXTB
32 C>
33 C> USAGE: CALL WRITDX (LUNIT, LUN, LUNDX)
34 C> INPUT ARGUMENT LIST:
35 C> LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
36 C> BEING WRITTEN
37 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
38 C> (ASSOCIATED WITH FILE CONNECTED TO LOGICAL UNIT LUNIT)
39 C> LUNDX - INTEGER: FORTRAN LOGICAL UNIT NUMBER CONTAINING
40 C> DICTIONARY TABLE INFORMATION TO BE USED (BY READDX) TO
41 C> CREATE INTERNAL TABLES WRITTEN TO LUNIT (SEE READDX);
42 C> IF SET EQUAL TO LUNIT, THIS SUBROUTINE CALLS BORT
43 C>
44 C> REMARKS:
45 C> THIS ROUTINE CALLS: BORT READDX WRDXTB
46 C> THIS ROUTINE IS CALLED BY: OPENBF
47 C> Normally not called by any application
48 C> programs.
49 C>
50  SUBROUTINE writdx(LUNIT,LUN,LUNDX)
51 
52 
53 
54  CHARACTER*128 bort_str
55 
56 C-----------------------------------------------------------------------
57 C-----------------------------------------------------------------------
58 
59 C CHECK UNITS, TABLE MUST BE COMING FROM AN INPUT FILE
60 C ----------------------------------------------------
61 
62  IF(lunit.EQ.lundx) goto 900
63 
64 C MUST FIRST CALL READDX TO GENERATE INTERNAL DICTIONARY TABLE ARRAYS
65 C -------------------------------------------------------------------
66 
67  CALL readdx(lunit,lun,lundx)
68 
69 C NOW CALL WRDXTB TO WRITE OUT DICTIONARY MESSAGES FROM THESE ARRAYS
70 C ------------------------------------------------------------------
71 
72  CALL wrdxtb(lunit,lunit)
73 
74 C EXITS
75 C -----
76 
77  RETURN
78 900 WRITE(bort_str,'("BUFRLIB: WRITDX - FILES CONTAINING BUFR DATA '//
79  . 'AND DICTIONARY TABLE CANNOT BE THE SAME (HERE BOTH SHARE '//
80  . 'FORTRAN UNIT NUMBER ",I3,")")') lunit
81  CALL bort(bort_str)
82  END
subroutine writdx(LUNIT, LUN, LUNDX)
THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES TO THE BEGINNING OF AN OUTPUT BUFR FILE IN LU...
Definition: writdx.f:50
subroutine readdx(LUNIT, LUN, LUNDX)
THIS SUBROUTINE GENERATES INTERNAL ARRAYS CONTAINING BUFR DICTIONARY TABLES WHICH ARE NEEDED TO READ...
Definition: readdx.f:54
subroutine wrdxtb(LUNDX, LUNOT)
THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES ASSOCIATED WITH THE BUFR FILE IN LUNDX TO THE...
Definition: wrdxtb.f:36
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22