NCEPLIBS-g2c 2.0.0
|
Pack a Grid Definition Section (Section 3) and adds it to a GRIB2 message. More...
Go to the source code of this file.
Functions | |
g2int | g2_addgrid (unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum) |
Packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message. | |
Pack a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
Definition in file g2_addgrid.c.
g2int g2_addgrid | ( | unsigned char * | cgrib, |
g2int * | igds, | ||
g2int * | igdstmpl, | ||
g2int * | ideflist, | ||
g2int | idefnum | ||
) |
Packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
This function is used with routines g2_create(), g2_addlocal(), g2_addfield(), and g2_gribend() to create a complete GRIB2 message. g2_create() must be called first to initialize a new GRIB2 message.
cgrib | Char array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message. |
igds | Contains information needed for GRIB Grid Definition Section 3. Must be dimensioned >= 5.
|
igdstmpl | Contains the data values for the specified Grid Definition Template (igds[4]). Each element of this integer array contains an entry (in the order specified) of Grid Defintion Template. |
ideflist | (Used if igds[2] != 0) This array contains the number of grid points contained in each row (or column). |
idefnum | (Used if igds[2] != 0) The number of entries in array ideflist. i.e. number of rows (or columns) for which optional grid points are defined. |
Definition at line 66 of file g2_addgrid.c.
References gtemplate::ext, extgridtemplate(), gtemplate::extlen, G2_ADD_MSG_COMPLETE, G2_ADD_MSG_INIT, G2_ADDGRID_BAD_GDT, G2_BAD_SEC, G2_BAD_SEC_COUNTS, g2c_check_msg(), G2C_EMSGCOMPLETE, G2C_ENOTGRIB, gbit(), getgridtemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, sbit(), and sbits().