g2_create.c(3)
π NAME π
okay bestie, welcome to g2_create.c β this is page 3 of the Library Functions Manual, and it's literally all about one job: Initialize a new GRIB2 message and pack GRIB2 sections 0 (Indicator Section) and 1 (Identification Section). that's the whole vibe. π
β¨ SYNOPSIS β¨
#include 'grib2_int.h'
#include <stdio.h>
π Macros π
#define LENSEC0 16β Length of GRIB Section 0.#define MAPSEC1LEN 13β Length of Map Section 1.
π«Ά Functions π«Ά
g2int g2_create (unsigned char *cgrib, g2int *listsec0, g2int *listsec1)β Initialize a new GRIB2 message and pack GRIB2 Section 0 (Indicator Section) and Section 1 (Identification Section).
π Detailed Description π
Initialize a new GRIB2 message and pack GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
Author
Stephen Gilbert
Date
2002-10-31
Definition in file g2_create.c.
π₯ Macro Definition Documentation π₯
#define LENSEC0 16
Length of GRIB Section 0.
Definition at line 11 of file g2_create.c.
Referenced by g2_create().
#define MAPSEC1LEN 13
Length of Map Section 1.
Definition at line 10 of file g2_create.c.
Referenced by g2_create().
π Function Documentation π
g2int g2_create (unsigned char * cgrib, g2int * listsec0, g2int * listsec1)
Initialize a new GRIB2 message and pack GRIB2 Section 0 (Indicator Section) and Section 1 (Identification Section). This routine is used with routines g2_addlocal(), g2_addgrid(), g2_addfield(), and g2_gribend() to create a complete GRIB2 message. g2_create() must be called first to initialize a new GRIB2 message. A call to g2_gribend() is required to complete GRIB2 message after all fields have been added.
Parameters
cgrib Character array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message. πΈ
listsec0 Contains information needed for GRIB Indicator Section 0. Must be dimensioned >= 2.
listsec0[0]Discipline-GRIB Master Table Number (Code Table 0.0 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table0-0.shtml). π¦listsec0[1]GRIB Edition Number (currently2).
listsec1 Contains information needed for GRIB Identification Section 1. Must be dimensioned >= 13.
listsec1[0]Id of orginating centre (Table 0 βhttps://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html).listsec1[1]Id of orginating sub-centre (Table C βhttps://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html).listsec1[2]GRIB Master Tables Version Number (Table 1.0 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-0.shtml).listsec1[3]GRIB Local Tables Version Number (Table 1.1 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml).listsec1[4]Significance of Reference Time (Table 1.2 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-2.shtml)listsec1[5]Reference Time - Year (4 digits)listsec1[6]Reference Time - Monthlistsec1[7]Reference Time - Daylistsec1[8]Reference Time - Hourlistsec1[9]Reference Time - Minutelistsec1[10]Reference Time - Secondlistsec1[11]Production status of data (Table 1.3 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-3.shtml).listsec1[12]Type of processed data (Table 1.4 βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-4.shtml).
Returns
> 0Current size of new GRIB2 message β¨G2_CREATE_GRIB_VERSIONTried to use for version other than GRIB Edition 2
This routine is intended for use with routines g2_addlocal(), g2_addgrid(), g2_addfield(), and g2_gribend() to create a complete GRIB2 message.
bestie listen π β you gotta callg2_create()first, and you absolutely cannot skipg2_gribend()at the end. nog2_gribend()= no complete message. that's just the rules. π
Author
Stephen Gilbeert
not me noticing the extra e in there π that's literally how it's written on the page, so i'm keeping it, no cap.
Date
2002-10-31
Definition at line 68 of file g2_create.c.
References G2_CREATE_GRIB_VERSION, LENSEC0, MAPSEC1LEN, and sbit().
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
aaaand that's a wrap, bestie π this whole page came to you courtesy of NCEPLIBS-g2c, Version 2.3.0, landing in the g2_create.c(3) slot of your manual. go forth and pack those sections, you icon ππ
π¦ where this page comes from
- ubuntu resolute: libg2c-dev 2.3.0-4 Β· LGPL-3.0-only
- ubuntu stonking: libg2c-dev 2.3.0-7 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms