36 return "GRIB2 header not found";
38 return "GRIB message is already complete.";
40 return "Name too long";
42 return "Invalid input";
44 return "Error reading file";
48 return "Too many files open";
50 return "Out of memory";
52 return "Error decoding message";
54 return "No GRIB message found";
56 return "Error parsing XML";
58 return "Table or entry not found";
62 return "Cannot find section";
64 return "Cannot find end of GRIB message";
66 return "End of message in wrong place";
68 return "Invalid section number";
70 return "Error encoding/decoding JPEG data";
72 return "Error encoding/decoding PNG data";
74 return "Template not found";
76 return "Template problem";
78 return "Parameter not found";
80 return "Product not found";
85 return "Unknown Error";
114 LOG((4,
"Discipline: %s", desc));
117 LOG((4,
"Identification of originating/generating center: %d", msg->
center));
118 LOG((4,
"Identification of originating/generating subcenter: %d", msg->
subcenter));
121 LOG((4,
"GRIB master tables version number: %s", desc));
124 LOG((4,
"Version number of GRIB local tables used to augment Master Tables: %s", desc));
127 LOG((4,
"Significance of reference time: %s", desc));
128 LOG((4,
"Reference time: %d/%d/%d %d:%d:%d", msg->
year, msg->
month, msg->
day,
132 LOG((4,
"Production Status of Processed data in the GRIB message: %s", desc));
135 LOG((4,
"Type of processed data in this GRIB message: %s", desc));
157 LOG((3,
"sec_id %d sec_len %d byte_to_sec %ld sec_num %d", sec->
sec_id,
168 LOG((4,
"%s", abbrev));
204 LOG((1,
"num_messages %ld",
g2c_file[g2cid].num_messages));
209 LOG((1,
"message %ld bytes_to_msg %ld bytes_in_msg %ld num_fields %d num_local %d",
211 LOG((1,
"sec1_len %d center %d subcenter %d master_version %d local_version %d",
213 LOG((1,
"sig_ref_time %d %d %d %d %d:%d:%d status %d type %d", msg->
sig_ref_time, msg->
year,
222 for (sec = msg->
sec; sec; sec = sec->
next)
int g2c_find_desc(char *title, int code, char *desc)
Given a table title and an integer code, find a description.
int g2c_csv_init()
Initialize tables from "CodeFlag.txt".
void g2c_free_tables()
Free table memory.
int g2c_param_abbrev(int g2disc, int g2cat, int g2num, char *abbrev)
Get NOAA abbreviation for a GRIB2 parameter.
const char * g2c_strerror(int g2cerr)
Given an error code, return an error message.
int g2c_log_section1(G2C_MESSAGE_INFO_T *msg)
Log section 0 information.
int g2c_log_section(G2C_SECTION_INFO_T *sec)
Log info about a section.
G2C_FILE_INFO_T g2c_file[G2C_MAX_FILES+1]
Global file information.
int g2c_log_file(int g2cid)
Print a summary of the contents of an open GRIB2 file.
G2C_CODE_TABLE_T * g2c_table
Pointer to the list of code tables.
#define G2C_EMSG
Error decoding GRIB message.
#define G2C_MAX_FILES
Maximum number of open files.
#define G2C_MAX_GRIB_DESC_LEN
Maximum length of code description.
#define G2C_ENOEND
Cannot find end of GRIB message.
#define G2C_ENOMSG
No GRIB message found.
#define G2C_EBADEND
End of message in wrong place.
#define G2C_ENAMETOOLONG
Name too long.
#define G2C_ENOTGRIB2
Not GRIB 2.
#define G2C_ENOSECTION
Cannot find section.
#define G2C_EFILE
File I/O error.
#define G2C_ENOPARAM
Parameter not found.
#define G2C_ENOTEMPLATE
Template not found.
#define G2C_ENOMEM
Out of memory.
#define G2C_EPNG
Error encoding/decoding PNG data.
#define G2C_ENOTFOUND
Table or entry not found.
#define G2C_ENOPRODUCT
Product not found.
#define G2C_EINVAL
Invalid input.
#define G2C_ENOTGRIB
GRIB header not found.
#define G2C_ETOOMANYFILES
Trying to open too many files.
#define G2C_EBADSECTION
Invalid section number.
#define G2C_EMSGCOMPLETE
GRIB message already complete.
#define G2C_EBADTEMPLATE
Template problem.
#define G2C_EXML
XML error.
#define G2C_EJPEG
Error encoding/decoding JPEG data.
#define G2C_EBADID
Bad ID.
#define G2C_MAX_NOAA_ABBREV_LEN
Maximum length of a NOAA abbreviation of a parameter.
#define G2C_NOERROR
No error.
#define G2C_EBADTYPE
Type not found.
Header file with internal function prototypes NCEPLIBS-g2c library.
struct g2c_section_info * next
Pointer to next in list.
struct g2c_section_info * sec
List of section metadata.
short subcenter
Originating subcenter.
int sec_id
ID of the section (0-based).
unsigned char master_version
GRIB master tables version number.
unsigned char type
Type of processed data in this GRIB message.
unsigned char minute
Minute.
int num_local
Number of local sections in the message.
unsigned char sig_ref_time
Significance of reference time.
unsigned char discipline
Discipline from section 0.
size_t bytes_in_msg
Number of bytes in this message.
int num_fields
Number of fields in the message.
unsigned char sec_num
Section number.
unsigned int sec_len
Length of the section (in bytes).
size_t bytes_to_sec
Number of bytes from start of message to this section.
unsigned char status
Production Status of Processed data in the GRIB message.
#define LOG(e)
Ignore logging to stdout.
unsigned char second
Second.
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).
size_t bytes_to_msg
Number of bytes to skip in the file, to get to this message.
long long int * template
Grid, product, or data template.
int sec1_len
Length of section 1.
struct g2c_message_info * next
Pointer to next in list.
G2C_MESSAGE_INFO_T * msg
Pointer to contianing message.
short center
Originating center.
This is the information about each open file.
This is the information about each message.
Information about a section 3 through 7 in a GRIB2 message.