NCEPLIBS-bufr 11.7.1
writdx.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES TO
5C> THE BEGINNING OF AN OUTPUT BUFR FILE IN LUNIT. THE TABLE MESSAGES
6C> ARE READ FROM ARRAYS IN INTERNAL MEMORY (MODULE TABABD).
7C> AN INITIAL CALL TO BUFR ARCHIVE LIBRARY SUBROUTINE READDX GENERATES
8C> THESE INTERNAL ARRAYS.
9C>
10C> PROGRAM HISTORY LOG:
11C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
12C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
13C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
14C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
15C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
16C> ROUTINE "BORT"
17C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
18C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
19C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
20C> BUFR FILES UNDER THE MPI)
21C> 2000-09-19 J. WOOLLEN -- MAXIMUM MESSAGE LENGTH INCREASED FROM
22C> 10,000 TO 20,000 BYTES
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> 2004-08-09 J. ATOR -- MAXIMUM MESSAGE LENGTH INCREASED FROM
30C> 20,000 TO 50,000 BYTES
31C> 2009-03-23 J. ATOR -- USE WRDXTB
32C>
33C> USAGE: CALL WRITDX (LUNIT, LUN, LUNDX)
34C> INPUT ARGUMENT LIST:
35C> LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
36C> BEING WRITTEN
37C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
38C> (ASSOCIATED WITH FILE CONNECTED TO LOGICAL UNIT LUNIT)
39C> LUNDX - INTEGER: FORTRAN LOGICAL UNIT NUMBER CONTAINING
40C> DICTIONARY TABLE INFORMATION TO BE USED (BY READDX) TO
41C> CREATE INTERNAL TABLES WRITTEN TO LUNIT (SEE READDX);
42C> IF SET EQUAL TO LUNIT, THIS SUBROUTINE CALLS BORT
43C>
44C> REMARKS:
45C> THIS ROUTINE CALLS: BORT READDX WRDXTB
46C> THIS ROUTINE IS CALLED BY: OPENBF
47C> Normally not called by any application
48C> programs.
49C>
50 SUBROUTINE writdx(LUNIT,LUN,LUNDX)
51
52
53
54 CHARACTER*128 BORT_STR
55
56C-----------------------------------------------------------------------
57C-----------------------------------------------------------------------
58
59C CHECK UNITS, TABLE MUST BE COMING FROM AN INPUT FILE
60C ----------------------------------------------------
61
62 IF(lunit.EQ.lundx) GOTO 900
63
64C MUST FIRST CALL READDX TO GENERATE INTERNAL DICTIONARY TABLE ARRAYS
65C -------------------------------------------------------------------
66
67 CALL readdx(lunit,lun,lundx)
68
69C NOW CALL WRDXTB TO WRITE OUT DICTIONARY MESSAGES FROM THESE ARRAYS
70C ------------------------------------------------------------------
71
72 CALL wrdxtb(lunit,lunit)
73
74C EXITS
75C -----
76
77 RETURN
78900 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 bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine readdx(LUNIT, LUN, LUNDX)
THIS SUBROUTINE GENERATES INTERNAL ARRAYS CONTAINING BUFR DICTIONARY TABLES WHICH ARE NEEDED TO READ,...
Definition: readdx.f:55
subroutine wrdxtb(LUNDX, LUNOT)
THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES ASSOCIATED WITH THE BUFR FILE IN LUNDX TO THE...
Definition: wrdxtb.f:37
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:51