NCEPLIBS-bufr  12.0.1
writdx.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Write DX BUFR tables messages to the beginning of a
3 C> BUFR file.
4 C>
5 C> @author Woollen @date 1994-01-06
6 
7 C> Write DX BUFR tables messages to the beginning of a BUFR file.
8 C>
9 C> This subroutine writes BUFR table (dictionary) messages to
10 C> the beginning of an output BUFR file in lunit. The table messages
11 C> are read from arrays in internal memory (module @ref moda_tababd).
12 C> An initial call to BUFR archive library subroutine readdx() generates
13 C> these internal arrays.
14 C>
15 C> @param[in] lunit - integer: fortran logical unit number for BUFR
16 C> file being written.
17 C> @param[in] lun - integer: file ID of open BUFR file.
18 C> @param[in] lundx - integer: fortran logical unit number containing
19 C> dictionary table information to be used (by readdx()) to create
20 C> internal tables written to lunit; if set equal to lunit, this
21 C> subroutine calls bort().
22 C>
23 C> @author Woollen @date 1994-01-06
24 
25  SUBROUTINE writdx(LUNIT,LUN,LUNDX)
26 
27  CHARACTER*128 BORT_STR
28 
29 C-----------------------------------------------------------------------
30 C-----------------------------------------------------------------------
31 
32 C CHECK UNITS, TABLE MUST BE COMING FROM AN INPUT FILE
33 C ----------------------------------------------------
34 
35  IF(lunit.EQ.lundx) GOTO 900
36 
37 C MUST FIRST CALL READDX TO GENERATE INTERNAL DICTIONARY TABLE ARRAYS
38 C -------------------------------------------------------------------
39 
40  CALL readdx(lunit,lun,lundx)
41 
42 C NOW CALL WRDXTB TO WRITE OUT DICTIONARY MESSAGES FROM THESE ARRAYS
43 C ------------------------------------------------------------------
44 
45  CALL wrdxtb(lunit,lunit)
46 
47 C EXITS
48 C -----
49 
50  RETURN
51 900 WRITE(bort_str,'("BUFRLIB: WRITDX - FILES CONTAINING BUFR DATA '//
52  . 'AND DICTIONARY TABLE CANNOT BE THE SAME (HERE BOTH SHARE '//
53  . 'FORTRAN UNIT NUMBER ",I3,")")') lunit
54  CALL bort(bort_str)
55  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
subroutine readdx(LUNIT, LUN, LUNDX)
This subroutine initializes modules moda_tababd and moda_msgcwd with DX BUFR (dictionary) tables.
Definition: readdx.f:35
recursive subroutine wrdxtb(LUNDX, LUNOT)
This subroutine generates one or more BUFR messages from the DX BUFR tables information associated wi...
Definition: wrdxtb.f:26
subroutine writdx(LUNIT, LUN, LUNDX)
Write DX BUFR tables messages to the beginning of a BUFR file.
Definition: writdx.f:26