.TH "g2_create.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME g2_create.c \- Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Macros" .in +1c .ti -1c .RI "#define \fBMAPSEC1LEN\fP 13" .br .RI "Length of Map Section 1\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBg2int\fP \fBg2_create\fP (unsigned char *cgrib, \fBg2int\fP *listsec0, \fBg2int\fP *listsec1)" .br .RI "This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)\&. " .in -1c .SH "Detailed Description" .PP Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition in file \fBg2_create\&.c\fP\&. .SH "Macro Definition Documentation" .PP .SS "#define MAPSEC1LEN 13" .PP Length of Map Section 1\&. .PP Definition at line 9 of file g2_create\&.c\&. .SH "Function Documentation" .PP .SS "\fBg2int\fP g2_create (unsigned char * cgrib, \fBg2int\fP * listsec0, \fBg2int\fP * listsec1)" .PP This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)\&. This routine is used with routines \fBg2_addlocal()\fP, \fBg2_addgrid()\fP, \fBg2_addfield()\fP, and \fBg2_gribend()\fP to create a complete GRIB2 message\&. \fBg2_create()\fP must be called first to initialize a new GRIB2 message\&. Also, a call to \fBg2_gribend()\fP is required to complete GRIB2 message after all fields have been added\&. .PP \fBParameters\fP .RS 4 \fIcgrib\fP Character array to contain the GRIB2 message\&. Must be allocated large enough to store the entire GRIB2 message\&. .br \fIlistsec0\fP Contains information needed for GRIB Indicator Section 0\&. Must be dimensioned >= 2\&. .IP "\(bu" 2 listsec0[0]=Discipline-GRIB Master Table Number (see Code Table 0\&.0) .IP "\(bu" 2 listsec0[1]=GRIB Edition Number (currently 2) .PP .br \fIlistsec1\fP Contains information needed for GRIB Identification Section 1\&. Must be dimensioned >= 13\&. .IP "\(bu" 2 listsec1[0] Id of orginating centre (Common Code Table C-1) .IP "\(bu" 2 listsec1[1] Id of orginating sub-centre (local table) .IP "\(bu" 2 listsec1[2] GRIB Master Tables Version Number (Code Table 1\&.0) .IP "\(bu" 2 listsec1[3] GRIB Local Tables Version Number (Code Table 1\&.1) .IP "\(bu" 2 listsec1[4] Significance of Reference Time (Code Table 1\&.2) .IP "\(bu" 2 listsec1[5] Reference Time - Year (4 digits) .IP "\(bu" 2 listsec1[6] Reference Time - Month .IP "\(bu" 2 listsec1[7] Reference Time - Day .IP "\(bu" 2 listsec1[8] Reference Time - Hour .IP "\(bu" 2 listsec1[9] Reference Time - Minute .IP "\(bu" 2 listsec1[10] Reference Time - Second .IP "\(bu" 2 listsec1[11] Production status of data (Code Table 1\&.3) .IP "\(bu" 2 listsec1[12] Type of processed data (Code Table 1\&.4) .PP .RE .PP \fBReturns\fP .RS 4 - > 0 Current size of new GRIB2 message .IP "\(bu" 2 -1 Tried to use for version other than GRIB Edition 2 .PP .RE .PP This routine is intended for use with routines \fBg2_addlocal()\fP, \fBg2_addgrid()\fP, \fBg2_addfield()\fP, and \fBg2_gribend()\fP to create a complete GRIB2 message\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 52 of file g2_create\&.c\&. .PP References MAPSEC1LEN, and sbit()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.