50 *num_msg =
g2c_file[g2cid].num_messages;
87g2c_inq_msg(
int g2cid,
int msg_num,
unsigned char *discipline,
int *num_fields,
88 int *num_local,
short *center,
short *subcenter,
unsigned char *master_version,
89 unsigned char *local_version)
171 unsigned char *month,
unsigned char *day,
unsigned char *hour,
172 unsigned char *minute,
unsigned char *second)
247g2c_inq_prod(
int g2cid,
int msg_num,
int prod_num,
int *pds_template_len,
248 long long int *pds_template,
int *gds_template_len,
long long int *gds_template,
249 int *drs_template_len,
long long int *drs_template)
259 if (msg_num < 0 || prod_num < 0)
282 for (sec4 = msg->
sec; sec4; sec4 = sec4->
next)
293 if (pds_template_len)
297 pds_template[t] = sec4->
template[t];
303 for (sec3 = sec4->
prev; sec3; sec3 = sec3->
prev)
313 if (gds_template_len)
317 gds_template[t] = sec3->
template[t];
323 for (sec5 = sec4->
next; sec5; sec5 = sec5->
next)
333 if (drs_template_len)
337 drs_template[t] = sec5->
template[t];
372g2c_inq_dim(
int g2cid,
int msg_num,
int prod_num,
int dim_num,
size_t *len,
373 char *name,
float *val)
384 if (msg_num < 0 || prod_num < 0 || dim_num < 0)
408 for (sec4 = msg->
sec; sec4; sec4 = sec4->
next)
419 for (sec3 = sec4->
prev; sec3; sec3 = sec3->
prev)
435 for (d = 0; d < dim->
len; d++)
436 val[d] = dim->
value[d];
471 return g2c_inq_dim(g2cid, msg_num, prod_num, dim_num, len, name, NULL);
G2C_FILE_INFO_T g2c_file[G2C_MAX_FILES+1]
Global file information.
int g2c_inq(int g2cid, int *num_msg)
Learn about a GRIB2 file.
int g2c_inq_dim(int g2cid, int msg_num, int prod_num, int dim_num, size_t *len, char *name, float *val)
Learn about the one of the dimensions of a GRIB2 product.
int g2c_inq_msg_time(int g2cid, int msg_num, unsigned char *sig_ref_time, short *year, unsigned char *month, unsigned char *day, unsigned char *hour, unsigned char *minute, unsigned char *second)
Learn about the date/time information in a GRIB2 message.
int g2c_inq_prod(int g2cid, int msg_num, int prod_num, int *pds_template_len, long long int *pds_template, int *gds_template_len, long long int *gds_template, int *drs_template_len, long long int *drs_template)
Inquire about a product.
int g2c_inq_msg(int g2cid, int msg_num, unsigned char *discipline, int *num_fields, int *num_local, short *center, short *subcenter, unsigned char *master_version, unsigned char *local_version)
Learn about a GRIB2 message.
int g2c_inq_dim_info(int g2cid, int msg_num, int prod_num, int dim_num, size_t *len, char *name)
Learn about the one of the dimensions of a GRIB2 product.
#define G2C_MAX_FILES
Maximum number of open files.
#define G2C_ENOMSG
No GRIB message found.
#define G2C_ENOSECTION
Cannot find section.
#define G2C_MAX_NAME
Maximum length of a name.
#define G2C_ENOPRODUCT
Product not found.
#define G2C_EINVAL
Invalid input.
#define G2C_EBADID
Bad ID.
#define G2C_NOERROR
No error.
Header file with internal function prototypes NCEPLIBS-g2c library.
struct g2c_section3_info G2C_SECTION3_INFO_T
Information about Section 3 GRID DEFINITION SECTION.
struct g2c_section_info * next
Pointer to next in list.
struct g2c_section_info * sec
List of section metadata.
size_t len
Length of dimension.
short subcenter
Originating subcenter.
unsigned char master_version
GRIB master tables version number.
struct g2c_file_info G2C_FILE_INFO_T
This is the information about each open file.
#define MUTEX_UNLOCK(m)
Pthreads not enabled, so do nothing.
unsigned char minute
Minute.
struct g2c_dim_info G2C_DIM_INFO_T
Keep information about dimensions defined in section 3.
int num_local
Number of local sections in the message.
unsigned char sig_ref_time
Significance of reference time.
struct g2c_section_info G2C_SECTION_INFO_T
Information about a section 3 through 7 in a GRIB2 message.
unsigned char discipline
Discipline from section 0.
char name[G2C_MAX_NAME+1]
Name of dimension.
struct g2c_section_info * prev
Pointer to previous in list.
int num_fields
Number of fields in the message.
struct g2c_section4_info G2C_SECTION4_INFO_T
Information about Section 4 PRODUCT DEFINITION SECTION.
unsigned char sec_num
Section number.
void * sec_info
Pointer to struct specific for section 3, 4, 5, 6, or 7.
float * value
Array of dimension values.
struct g2c_message_info G2C_MESSAGE_INFO_T
This is the information about each message.
unsigned char second
Second.
int template_len
Number of entries in template.
unsigned char local_version
Version number of GRIB local tables used to augment Master Tables.
unsigned char month
Month.
size_t msg_num
Number of message in file (0-based).
#define MUTEX_LOCK(m)
Pthreads not enabled, so do nothing.
#define EXTERN_MUTEX(m)
Pthreads not enabled, so do nothing.
long long int * template
Grid, product, or data template.
struct g2c_message_info * next
Pointer to next in list.
short center
Originating center.