NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
isetprm.F
Go to the documentation of this file.
1 C> @file
2 C> @brief Define a customized parameter value for dynamic allocation.
3 
4 C> This function sets a specified parameter to a specified value for
5 C> use in dynamically allocating one or more internal arrays within
6 C> the BUFRLIB software.
7 C>
8 C> <p>This function should only be called if a dynamic allocation
9 C> build of the software is being used. A separate call to this
10 C> function must be made for each parameter that is to be set to a
11 C> customized value, and all such calls must be made prior to the
12 C> first call to subroutine openbf() from within an application
13 C> program, because that is when all internal arrays are dynamically
14 C> allocated based on the parameter values in effect at the time.
15 C> Otherwise, if this function is never called for a particular
16 C> parameter, then an internal default value for that parameter is
17 C> used instead.
18 C>
19 C> @author J. Ator
20 C> @date 2014-12-04
21 C>
22 C> @param[in] CPRMNM - character*(*): Parameter to be changed from its
23 C> internal default value
24 C> - 'MXMSGL' = Maximum length (in bytes) of a BUFR
25 C> message
26 C> - 'MAXSS' = Maximum number of data values in an
27 C> uncompressed BUFR subset
28 C> - 'MXCDV' = Maximum number of data values that
29 C> can be written into a compressed BUFR
30 C> subset
31 C> - 'MXLCC' = Maximum length (in bytes) of a
32 C> character string that can be written
33 C> into a compressed BUFR subset
34 C> - 'MXCSB' = Maximum number of subsets that can be
35 C> written into a compressed BUFR
36 C> message
37 C> - 'NFILES' = Maximum number of BUFR files that can
38 C> be accessed for reading or writing at
39 C> any one time
40 C> - 'MAXTBA' = Maximum number of entries in internal
41 C> BUFR Table A per BUFR file
42 C> - 'MAXTBB' = Maximum number of entries in internal
43 C> BUFR Table B per BUFR file
44 C> - 'MAXTBD' = Maximum number of entries in internal
45 C> BUFR Table D per BUFR file
46 C> - 'MAXMEM' = Maximum number of bytes that can be
47 C> used to store BUFR messages in
48 C> internal memory
49 C> - 'MAXMSG' = Maximum number of BUFR messages that
50 C> can be stored in internal memory
51 C> - 'MXDXTS' = Maximum number of dictionary tables
52 C> that can be stored for use with BUFR
53 C> messages in internal memory
54 C> - 'MXMTBB' = Maximum number of master Table B
55 C> entries
56 C> - 'MXMTBD' = Maximum number of master Table D
57 C> entries
58 C> - 'MXMTBF' = Maximum number of master Code/Flag
59 C> entries
60 C> - 'MAXCD' = Maximum number of child descriptors
61 C> in a Table D descriptor sequence
62 C> definition
63 C> - 'MAXJL' = Maximum number of entries in the
64 C> internal jump/link table
65 C> - 'MXS01V' = Maximum number of default Section 0
66 C> or Section 1 values that can be
67 C> overwritten within an output BUFR
68 C> message
69 C> - 'MXBTM' = Maximum number of bitmaps that can be
70 C> stored internally for a BUFR subset
71 C> - 'MXBTMSE' = Maximum number of entries that can
72 C> be set within a bitmap
73 C> - 'MXTAMC' = Maximum number of Table A mnemonics
74 C> in the internal jump/link table which
75 C> contain at least one Table C operator
76 C> with XX >= 21 in their subset definition
77 C> - 'MXTCO' = Maximum number of Table C operators
78 C> with XX >= 21 in the subset definition
79 C> of a Table A mnemonic
80 C> - 'MXNRV' = Maximum number of 2-03 reference
81 C> values in the internal jump/link
82 C> table
83 C> - 'MXRST' = Maximum number of long character
84 C> strings that can be read from a
85 C> compressed subset
86 C> @param[in] IPVAL - integer: Value to be set for CPRMNM
87 C>
88 C> @returns isetprm - integer: return code
89 C> - 0 = normal return
90 C> - -1 = Unknown CPRMNM, or dynamic allocation
91 C> not in effect for this build of the
92 C> library
93 C>
94 C> <b>Program history log:</b>
95 C> - 2014-12-04 J. Ator -- Original author
96 C> - 2016-05-24 J. Ator -- Add MXNRV, MXBTM, MXBTMSE, MXTCO
97 C> - 2017-04-03 J. Ator -- Add MXTAMC
98 C> - 2017-05-22 J. Ator -- Add MXRST
99 C> - 2017-10-17 J. Ator -- Add MXMTBF
100 C>
101  INTEGER FUNCTION isetprm ( CPRMNM, IPVAL )
102 
103  USE modv_maxss
104  USE modv_nfiles
105  USE modv_mxmsgl
106  USE modv_mxdxts
107  USE modv_maxmsg
108  USE modv_maxmem
109  USE modv_maxtba
110  USE modv_maxtbb
111  USE modv_maxtbd
112  USE modv_maxjl
113  USE modv_mxcdv
114  USE modv_mxlcc
115  USE modv_mxcsb
116  USE modv_mxmtbb
117  USE modv_mxmtbd
118  USE modv_mxmtbf
119  USE modv_maxcd
120  USE modv_mxs01v
121  USE modv_mxbtm
122  USE modv_mxbtmse
123  USE modv_mxtamc
124  USE modv_mxtco
125  USE modv_mxnrv
126  USE modv_mxrst
127 
128  character*(*) cprmnm
129  character*128 errstr
130 
131 C-----------------------------------------------------------------------
132 C-----------------------------------------------------------------------
133 
134 #ifdef DYNAMIC_ALLOCATION
135  isetprm = 0
136  IF ( cprmnm .EQ. 'MAXSS' ) THEN
137  maxss = ipval
138  ELSE IF ( cprmnm .EQ. 'NFILES' ) THEN
139  nfiles = ipval
140  ELSE IF ( cprmnm .EQ. 'MXMSGL' ) THEN
141  mxmsgl = ipval
142  ELSE IF ( cprmnm .EQ. 'MXDXTS' ) THEN
143  mxdxts = ipval
144  ELSE IF ( cprmnm .EQ. 'MAXMSG' ) THEN
145  maxmsg = ipval
146  ELSE IF ( cprmnm .EQ. 'MAXMEM' ) THEN
147  maxmem = ipval
148  ELSE IF ( cprmnm .EQ. 'MAXTBA' ) THEN
149  maxtba = ipval
150  ELSE IF ( cprmnm .EQ. 'MAXTBB' ) THEN
151  maxtbb = ipval
152  ELSE IF ( cprmnm .EQ. 'MAXTBD' ) THEN
153  maxtbd = ipval
154  ELSE IF ( cprmnm .EQ. 'MAXJL' ) THEN
155  maxjl = ipval
156  ELSE IF ( cprmnm .EQ. 'MXCDV' ) THEN
157  mxcdv = ipval
158  ELSE IF ( cprmnm .EQ. 'MXLCC' ) THEN
159  mxlcc = ipval
160  ELSE IF ( cprmnm .EQ. 'MXCSB' ) THEN
161  mxcsb = ipval
162  ELSE IF ( cprmnm .EQ. 'MXMTBB' ) THEN
163  mxmtbb = ipval
164  ELSE IF ( cprmnm .EQ. 'MXMTBD' ) THEN
165  mxmtbd = ipval
166  ELSE IF ( cprmnm .EQ. 'MXMTBF' ) THEN
167  mxmtbf = ipval
168  ELSE IF ( cprmnm .EQ. 'MAXCD' ) THEN
169  maxcd = ipval
170  ELSE IF ( cprmnm .EQ. 'MXS01V' ) THEN
171  mxs01v = ipval
172  ELSE IF ( cprmnm .EQ. 'MXBTM' ) THEN
173  mxbtm = ipval
174  ELSE IF ( cprmnm .EQ. 'MXBTMSE' ) THEN
175  mxbtmse = ipval
176  ELSE IF ( cprmnm .EQ. 'MXTAMC' ) THEN
177  mxtamc = ipval
178  ELSE IF ( cprmnm .EQ. 'MXTCO' ) THEN
179  mxtco = ipval
180  ELSE IF ( cprmnm .EQ. 'MXNRV' ) THEN
181  mxnrv = ipval
182  ELSE IF ( cprmnm .EQ. 'MXRST' ) THEN
183  mxrst = ipval
184  ELSE
185  isetprm = -1
186  CALL errwrt('++++++++++++++++++WARNING+++++++++++++++++++')
187  errstr = 'BUFRLIB: ISETPRM - UNKNOWN INPUT PARAMETER '//
188  . cprmnm // ' -- NO ACTION WAS TAKEN'
189  CALL errwrt(errstr)
190  CALL errwrt('++++++++++++++++++WARNING+++++++++++++++++++')
191  ENDIF
192 #else
193  isetprm = -1
194  CALL errwrt('++++++++++++++++++++WARNING+++++++++++++++++++++')
195  errstr = 'BUFRLIB: ISETPRM - DYNAMIC MEMORY ALLOCATION IS '//
196  . 'NOT SUPPORTED FOR THIS BUILD OF BUFRLIB'
197  CALL errwrt(errstr)
198  CALL errwrt('++++++++++++++++++++WARNING+++++++++++++++++++++')
199 #endif
200 
201  RETURN
202  END
This module declares and initializes the MAXMSG variable.
Definition: modv_MAXMSG.F:16
This module declares and initializes the MXMTBB variable.
Definition: modv_MXMTBB.F:16
This module declares and initializes the MXS01V variable.
Definition: modv_MXS01V.F:16
This module declares and initializes the MXTCO variable.
Definition: modv_MXTCO.F:16
This module declares and initializes the MXBTM variable.
Definition: modv_MXBTM.F:16
This module declares and initializes the MXCDV variable.
Definition: modv_MXCDV.F:16
This module declares and initializes the MXMTBD variable.
Definition: modv_MXMTBD.F:16
This module declares and initializes the MAXJL variable.
Definition: modv_MAXJL.F:16
This module declares and initializes the MXLCC variable.
Definition: modv_MXLCC.F:16
This module declares and initializes the MAXSS variable.
Definition: modv_MAXSS.F:16
This module declares and initializes the MXTAMC variable.
Definition: modv_MXTAMC.F:16
This module declares and initializes the MXMTBF variable.
Definition: modv_MXMTBF.F:16
This module declares and initializes the MXRST variable.
Definition: modv_MXRST.F:16
This module declares and initializes the MXDXTS variable.
Definition: modv_MXDXTS.F:16
This module declares and initializes the MAXMEM variable.
Definition: modv_MAXMEM.F:16
This module declares and initializes the MXMSGL variable.
Definition: modv_MXMSGL.F:16
INTEGER function isetprm(CPRMNM, IPVAL)
This function sets a specified parameter to a specified value for use in dynamically allocating one o...
Definition: isetprm.F:101
This module declares and initializes the MXBTMSE variable.
Definition: modv_MXBTMSE.F:16
This module declares and initializes the MXNRV variable.
Definition: modv_MXNRV.F:16
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 declares and initializes the MAXTBB variable.
Definition: modv_MAXTBB.F:16
This module declares and initializes the NFILES variable.
Definition: modv_NFILES.F:16
This module declares and initializes the MAXTBD variable.
Definition: modv_MAXTBD.F:16
This module declares and initializes the MXCSB variable.
Definition: modv_MXCSB.F:16
This module declares and initializes the MAXTBA variable.
Definition: modv_MAXTBA.F:16
This module declares and initializes the MAXCD variable.
Definition: modv_MAXCD.F:16