NCEPLIBS-bufr  12.0.0
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 C>
4 C> @authors J. Woollen, J. Ator @date 2002-05-14
5 
6 C> This subroutine allows the user to define the maximum length of a
7 C> BUFR message that can be written to an output file by the BUFRLIB
8 C> software.
9 C>
10 C> This subroutine can be called from within an application program at
11 C> any time after the initial call to subroutine openbf(), and the
12 C> specified value MAXO will then be used for all future BUFR messages
13 C> written by the software to all output files for the remainder of
14 C> the program, unless another call is made to this same subroutine
15 C> to reset the value of MAXO again. Otherwise, if this subroutine
16 C> is never called, a default maximum message length is used for all
17 C> output files, as set via an initial internal call to subroutine
18 C> bfrini().
19 C>
20 C> @param[in] MAXO -- integer: New maximum length (in bytes) for
21 C> all BUFR messages written to all output files
22 C> - 0 = Set MAXO to the maximum value allowed
23 C> by the BUFRLIB software
24 C>
25 C> @authors J. Woollen, J. Ator @date 2002-05-14
26  RECURSIVE SUBROUTINE maxout(MAXO)
27 
28  USE modv_mxmsgl
29  USE modv_im8b
30 
31  USE moda_bitbuf
32 
33  COMMON /maxcmp/ maxcmb,maxrow,maxcol,ncmsgs,ncsubs,ncbyts
34  COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),
35  . ld30(10),dxstr(10)
36  COMMON /quiet / iprt
37 
38  CHARACTER*128 errstr
39  CHARACTER*56 dxstr
40 
41 C-----------------------------------------------------------------------
42 C-----------------------------------------------------------------------
43 
44 C CHECK FOR I8 INTEGERS
45 
46  IF(im8b) THEN
47  im8b=.false.
48 
49  CALL x84(maxo,my_maxo,1)
50  CALL maxout(my_maxo)
51 
52  im8b=.true.
53  RETURN
54  ENDIF
55 
56  IF((maxo.EQ.0).OR.(maxo.GT.mxmsgl)) THEN
57  newsiz = mxmsgl
58  ELSE
59  newsiz = maxo
60  ENDIF
61 
62  IF(iprt.GE.0) THEN
63  IF(maxbyt.NE.newsiz) THEN
64  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
65  WRITE ( unit=errstr, fmt='(A,A,I7,A,I7)' )
66  . 'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',
67  . 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ', maxbyt,
68  . ' TO ', newsiz
69  CALL errwrt(errstr)
70  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
71  CALL errwrt(' ')
72  ENDIF
73  ENDIF
74 
75  maxbyt = newsiz
76  maxcmb = newsiz
77  maxdx = newsiz
78 
79  RETURN
80  END
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:36
recursive 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:27
This module contains array and variable declarations used to store BUFR messages internally for multi...
integer maxbyt
Maximum length of an output BUFR message.
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
This module declares and initializes the MXMSGL variable.
integer mxmsgl
Maximum length (in bytes) of a BUFR message that can be read or written by the BUFRLIB software.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19