NCEPLIBS-bufr  11.6.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> | Date | Programmer | Comments |
29 C> | -----|------------|----------|
30 C> | 2002-05-14 | J. Woollen | Original author |
31 C> | 2004-08-09 | J. Ator | Maximum message length increased from 20,000 to 50,000 bytes |
32 C> | 2006-04-14 | J. Ator | Added MAXO=0 option and overflow check |
33 C> | 2009-03-23 | D. Keyser | No longer print record length change diagnostic if requested record length is the same as the previous value |
34 C> | 2009-04-21 | J. Ator | Use errwrt() |
35 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
36 C> | 2015-09-24 | D. Stokes | Correct typos in docblock |
37 C>
38  SUBROUTINE maxout(MAXO)
39 
40  USE moda_bitbuf
41 
42  COMMON /maxcmp/ maxcmb,maxrow,maxcol,ncmsgs,ncsubs,ncbyts
43  COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),
44  . ld30(10),dxstr(10)
45  COMMON /quiet / iprt
46 
47  CHARACTER*128 errstr
48  CHARACTER*56 dxstr
49 
50 C-----------------------------------------------------------------------
51 C-----------------------------------------------------------------------
52 
53  IF((maxo.EQ.0).OR.(maxo.GT.mxmsgl)) THEN
54  newsiz = mxmsgl
55  ELSE
56  newsiz = maxo
57  ENDIF
58 
59  IF(iprt.GE.0) THEN
60  IF(maxbyt.NE.newsiz) THEN
61  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
62  WRITE ( unit=errstr, fmt='(A,A,I7,A,I7)' )
63  . 'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',
64  . 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ', maxbyt,
65  . ' TO ', newsiz
66  CALL errwrt(errstr)
67  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
68  CALL errwrt(' ')
69  ENDIF
70  ENDIF
71 
72  maxbyt = newsiz
73  maxcmb = newsiz
74  maxdx = newsiz
75 
76  RETURN
77  END
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:41
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:38