NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
maxout.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Define a customized maximum length for output BUFR messages.
3 
4 C> This subroutine allows the user to define the maximum length of a
5 C> BUFR message that can be written to an output file by the BUFRLIB
6 C> software.
7 C>
8 C> This subroutine can be called from within an application program at
9 C> any time after the initial call to subroutine openbf(), and the
10 C> specified value MAXO will then be used for all future BUFR messages
11 C> written by the software to all output files for the remainder of
12 C> the program, unless another call is made to this same subroutine
13 C> to reset the value of MAXO again. Otherwise, if this subroutine
14 C> is never called, a default maximum message length is used for all
15 C> output files, as set via an initial internal call to subroutine
16 C> bfrini().
17 C>
18 C> @authors J. Woollen
19 C> @authors J. Ator
20 C> @date 2002-05-14
21 C>
22 C> @param[in] MAXO - integer: New maximum length (in bytes) for
23 C> all BUFR messages written to all output files
24 C> - 0 = Set MAXO to the maximum value allowed
25 C> by the BUFRLIB software
26 C>
27 C> <b>Program history log:</b>
28 C> - 2002-05-14 J. Woollen -- Original author
29 C> - 2004-08-09 J. Ator -- Maximum message length increased from
30 C> 20,000 to 50,000 bytes
31 C> - 2006-04-14 J. Ator -- Added MAXO=0 option and overflow check
32 C> - 2009-03-23 D. Keyser -- No longer prints the record length change
33 C> diagnostic if the requested record length
34 C> passed in as MAXO is actually the same as
35 C> the previous value
36 C> - 2009-04-21 J. Ator -- Use errwrt()
37 C> - 2014-12-10 J. Ator -- Use modules instead of COMMON blocks
38 C> - 2015-09-24 D. Stokes -- Correct typos in docblock
39 C>
40  SUBROUTINE maxout(MAXO)
41 
42  USE moda_bitbuf
43 
44  COMMON /maxcmp/ maxcmb,maxrow,maxcol,ncmsgs,ncsubs,ncbyts
45  COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),
46  . ld30(10),dxstr(10)
47  COMMON /quiet / iprt
48 
49  CHARACTER*128 errstr
50  CHARACTER*56 dxstr
51 
52 C-----------------------------------------------------------------------
53 C-----------------------------------------------------------------------
54 
55  IF((maxo.EQ.0).OR.(maxo.GT.mxmsgl)) THEN
56  newsiz = mxmsgl
57  ELSE
58  newsiz = maxo
59  ENDIF
60 
61  IF(iprt.GE.0) THEN
62  IF(maxbyt.NE.newsiz) THEN
63  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
64  WRITE ( unit=errstr, fmt='(A,A,I7,A,I7)' )
65  . 'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',
66  . 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ', maxbyt,
67  . ' TO ', newsiz
68  CALL errwrt(errstr)
69  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
70  CALL errwrt(' ')
71  ENDIF
72  ENDIF
73 
74  maxbyt = newsiz
75  maxcmb = newsiz
76  maxdx = newsiz
77 
78  RETURN
79  END
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:39
This module contains array and variable declarations used to store BUFR messages internally for multi...
Definition: moda_bitbuf.F:10
subroutine maxout(MAXO)
This subroutine allows the user to define the maximum length of a BUFR message that can be written to...
Definition: maxout.f:40