.TH "reduce.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME reduce.c \- Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Typedefs" .in +1c .ti -1c .RI "typedef \fBg2int\fP \fBinteger\fP" .br .RI "Integer type\&. " .ti -1c .RI "typedef \fBg2float\fP \fBreal\fP" .br .RI "Float type\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBreduce\fP (\fBinteger\fP *kfildo, \fBinteger\fP *jmin, \fBinteger\fP *jmax, \fBinteger\fP *lbit, \fBinteger\fP *nov, \fBinteger\fP *lx, \fBinteger\fP *ndg, \fBinteger\fP *ibit, \fBinteger\fP *jbit, \fBinteger\fP *kbit, \fBinteger\fP *novref, \fBinteger\fP *ibxx2, \fBinteger\fP *ier)" .br .RI "Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment\&. " .in -1c .SH "Detailed Description" .PP Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment\&. .PP \fBAuthor\fP .RS 4 Glahn .RE .PP \fBDate\fP .RS 4 November 2001 .RE .PP .PP Definition in file \fBreduce\&.c\fP\&. .SH "Typedef Documentation" .PP .SS "typedef \fBg2int\fP \fBinteger\fP" .PP Integer type\&. .PP Definition at line 11 of file reduce\&.c\&. .SS "typedef \fBg2float\fP \fBreal\fP" .PP Float type\&. .PP Definition at line 12 of file reduce\&.c\&. .SH "Function Documentation" .PP .SS "int reduce (\fBinteger\fP * kfildo, \fBinteger\fP * jmin, \fBinteger\fP * jmax, \fBinteger\fP * lbit, \fBinteger\fP * nov, \fBinteger\fP * lx, \fBinteger\fP * ndg, \fBinteger\fP * ibit, \fBinteger\fP * jbit, \fBinteger\fP * kbit, \fBinteger\fP * novref, \fBinteger\fP * ibxx2, \fBinteger\fP * ier)" .PP Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment\&. By reducing the size of the large groups, less bits may be necessary for packing the group sizes and all the information about the groups\&. .PP The reference for nov was removed in the calling routine so that kbit could be determined\&. This furnishes a starting point for the iterations in reduce\&. However, the reference must be considered\&. .PP PROGRAM HISTORY LOG .IP "\(bu" 2 November 2001 Glahn tdl grib2 .IP "\(bu" 2 March 2002 Glahn comment ier = 715 .IP "\(bu" 2 March 2002 Glahn modified to accommodate lx=1 on entry .PP .PP DATA SET USE .IP "\(bu" 2 kfildo - unit number for output (print) file\&. (output) .PP .PP \fBParameters\fP .RS 4 \fIkfildo\fP unit number for output (print) file\&. (input) .br \fIjmin\fP the minimum of each group (j=1,lx)\&. it is possible after splitting the groups, jmin( ) will not be the minimum of the new group\&. this doesn't matter; jmin( ) is really the group reference and doesn't have to be the smallest value\&. (input/output) .br \fIjmax\fP the maximum of each group (j=1,lx)\&. (input/output) .br \fIlbit\fP the number of bits necessary to pack each group (j=1,lx)\&. (input/output) .br \fInov\fP the number of values in each group (j=1,lx)\&. (input/output) .br \fIlx\fP the number of groups\&. this will be increased if groups are split\&. (input/output) .br \fIndg\fP the dimension of jmin( ), jmax( ), lbit( ), and nov( )\&. (input) .br \fIibit\fP the number of bits necessary to pack the jmin(j) values, j=1,lx\&. (input) .br \fIjbit\fP the number of bits necessary to pack the lbit(j) values, j=1,lx\&. (input) .br \fIkbit\fP the number of bits necessary to pack the nov(j) values, j=1,lx\&. if the groups are split, kbit is reduced\&. (input/output) .br \fInovref\fP reference value for nov( )\&. (input) .br \fIibxx2\fP 2**j (j=0,30)\&. (input) .br \fIier\fP error return\&. (output) .IP "\(bu" 2 0 = good return\&. .IP "\(bu" 2 714 = problem in algorithm\&. reduce aborted\&. .IP "\(bu" 2 715 = ngp not large enough\&. reduce aborted\&. .PP .RE .PP \fBReturns\fP .RS 4 always returns 0, see parameter ier for error code\&. .RE .PP .PP .nf ntotbt(j) = the total bits used for the packing bits j (j=1,30)\&. (internal) nboxj(j) = new boxes needed for the packing bits j (j=1,30)\&. (internal) newbox(l) = number of new boxes (groups) for each original group (l=1,lx) for the current j\&. (automatic) (internal) newboxp(l) = same as newbox( ) but for the previous j\&. this eliminates recomputation\&. (automatic) (internal) cfeed = contains the character representation of a printer form feed\&. (character) (internal) ifeed = contains the integer value of a printer form feed\&. (internal) iorigb = the original number of bits necessary for the group values\&. (internal) .fi .PP .PP \fBAuthor\fP .RS 4 Glahn .RE .PP \fBDate\fP .RS 4 November 2001 .RE .PP .PP Definition at line 84 of file reduce\&.c\&. .PP Referenced by pack_gp()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.