1 SUBROUTINE WRITDX
(LUNIT
,LUN
,LUNDX
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE WRITES BUFR TABLE (DICTIONARY) MESSAGES TO
9 C THE BEGINNING OF AN OUTPUT BUFR FILE IN LUNIT. THE TABLE MESSAGES
10 C ARE READ FROM ARRAYS IN INTERNAL MEMORY (COMMON BLOCK /TABABD/).
11 C AN INITIAL CALL TO BUFR ARCHIVE LIBRARY SUBROUTINE READDX GENERATES
12 C THESE INTERNAL ARRAYS.
14 C PROGRAM HISTORY LOG:
15 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
16 C 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
17 C ARRAYS IN ORDER TO HANDLE BIGGER FILES
18 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
19 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
21 C 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
22 C OPENED AT ONE TIME INCREASED FROM 10 TO 32
23 C (NECESSARY IN ORDER TO PROCESS MULTIPLE
24 C BUFR FILES UNDER THE MPI)
25 C 2000-09-19 J. WOOLLEN -- MAXIMUM MESSAGE LENGTH INCREASED FROM
26 C 10,000 TO 20,000 BYTES
27 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
29 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
30 C DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
31 C MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
32 C TERMINATES ABNORMALLY
33 C 2004-08-09 J. ATOR -- MAXIMUM MESSAGE LENGTH INCREASED FROM
34 C 20,000 TO 50,000 BYTES
35 C 2009-03-23 J. ATOR -- USE WRDXTB
37 C USAGE: CALL WRITDX (LUNIT, LUN, LUNDX)
38 C INPUT ARGUMENT LIST:
39 C LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
41 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
42 C (ASSOCIATED WITH FILE CONNECTED TO LOGICAL UNIT LUNIT)
43 C LUNDX - INTEGER: FORTRAN LOGICAL UNIT NUMBER CONTAINING
44 C DICTIONARY TABLE INFORMATION TO BE USED (BY READDX) TO
45 C CREATE INTERNAL TABLES WRITTEN TO LUNIT (SEE READDX);
46 C IF SET EQUAL TO LUNIT, THIS SUBROUTINE CALLS BORT
49 C THIS ROUTINE CALLS: BORT READDX WRDXTB
50 C THIS ROUTINE IS CALLED BY: OPENBF
51 C Normally not called by any application
55 C LANGUAGE: FORTRAN 77
56 C MACHINE: PORTABLE TO ALL PLATFORMS
60 CHARACTER*128 BORT_STR
62 C-----------------------------------------------------------------------
63 C-----------------------------------------------------------------------
65 C CHECK UNITS, TABLE MUST BE COMING FROM AN INPUT FILE
66 C ----------------------------------------------------
68 IF(LUNIT
.EQ
.LUNDX
) GOTO 900
70 C MUST FIRST CALL READDX TO GENERATE INTERNAL DICTIONARY TABLE ARRAYS
71 C -------------------------------------------------------------------
73 CALL READDX
(LUNIT
,LUN
,LUNDX
)
75 C NOW CALL WRDXTB TO WRITE OUT DICTIONARY MESSAGES FROM THESE ARRAYS
76 C ------------------------------------------------------------------
78 CALL WRDXTB
(LUNIT
,LUNIT
)
84 900 WRITE(BORT_STR
,'("BUFRLIB: WRITDX - FILES CONTAINING BUFR DATA '//
85 . 'AND DICTIONARY TABLE CANNOT BE THE SAME (HERE BOTH SHARE '//
86 . 'FORTRAN UNIT NUMBER ",I3,")")') LUNIT