diff --git a/ver-1.7.0/annotated.html b/ver-1.7.0/annotated.html
new file mode 100644
index 00000000..380a826e
--- /dev/null
+++ b/ver-1.7.0/annotated.html
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+NCEPLIBS-g2c: enc_jpeg2000.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Encodes JPEG2000 code stream.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
#include "jasper/jasper.h"
+
+
Go to the source code of this file.
+
+
+
Encodes JPEG2000 code stream.
+
Author Stephen Gilbert
+
Date 2002-12-02
+
+
Definition in file enc_jpeg2000.c .
+
+
+
◆ MAXOPTSSIZE
+
+
+
+
+
+ #define MAXOPTSSIZE 1024
+
+
+
+
+
Maximum size of options.
+
+
Definition at line 11 of file enc_jpeg2000.c .
+
+
+
+
+
+
◆ enc_jpeg2000()
+
+
+
+
+
+ int enc_jpeg2000
+ (
+ unsigned char *
+ cin ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ ltype ,
+
+
+
+
+ g2int
+ ratio ,
+
+
+
+
+ g2int
+ retry ,
+
+
+
+
+ char *
+ outjpc ,
+
+
+
+
+ g2int
+ jpclen
+
+
+
+ )
+
+
+
+
+
+
This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software .
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-12-02 Gilbert Initial
+
+2004-12-16 Gilbert Added retry argument allowing increased guard bits.
+
+2022-04-15 Hartnett Converted to use jas_ instead of jpc_ functions.
+
+
Parameters
+
+ cin Packed matrix of Grayscale image values to encode.
+ width width of image.
+ height height of image.
+ nbits depth (in bits) of image. i.e number of bits used to hold each data value.
+ ltype indicator of lossless or lossy compression.
+1, for lossy compression
+!= 1, for lossless compression
+
+
+ ratio target compression ratio. (ratio:1) Used only when ltype == 1.
+ retry If 1 try increasing number of guard bits.
+ outjpc Output encoded JPEG2000 code stream.
+ jpclen Number of bytes allocated for the output JPEG2000 code stream in outjpc.
+
+
+
+
Returns
+> 0 = Length in bytes of encoded JPEG2000 code stream
+G2_JASPER_INIT Error initializing jasper library.
+G2_JASPER_ENCODE Error encode jpeg2000 code stream.
+
+
+
Note Requires JasPer Software version 1.500.4 or 1.700.2 or later.
+
Author Stephen Gilbert
+
Date 2002-12-02
+
Author Ed Hartnett
+
+
Definition at line 51 of file enc_jpeg2000.c .
+
+
References G2_JASPER_ENCODE , G2_JASPER_INIT , G2C_JASPER_JPEG_FORMAT_NAME , and MAXOPTSSIZE .
+
+
Referenced by jpcpack_int() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/enc__jpeg2000_8c.js b/ver-1.7.0/enc__jpeg2000_8c.js
new file mode 100644
index 00000000..91f7ccc9
--- /dev/null
+++ b/ver-1.7.0/enc__jpeg2000_8c.js
@@ -0,0 +1,5 @@
+var enc__jpeg2000_8c =
+[
+ [ "MAXOPTSSIZE", "enc__jpeg2000_8c.html#a9855b4e8c40619aab0092ba284943a67", null ],
+ [ "enc_jpeg2000", "enc__jpeg2000_8c.html#af4af6d586d2f9ca5da713d025dccf781", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/enc__jpeg2000_8c_source.html b/ver-1.7.0/enc__jpeg2000_8c_source.html
new file mode 100644
index 00000000..a71557e4
--- /dev/null
+++ b/ver-1.7.0/enc__jpeg2000_8c_source.html
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: enc_jpeg2000.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
9 #include "jasper/jasper.h"
+
+
11 #define MAXOPTSSIZE 1024
+
+
+
+
+
+
+
+
57 jas_stream_t *jpcstream, *istream;
+
58 jas_image_cmpt_t cmpt, *pcmpt;
+
+
+
+
+
+
+
+
66 snprintf(opts,
MAXOPTSSIZE ,
"mode=real\nrate=%f" ,1.0/(
float )ratio);
+
+
+
69 strcat(opts,
"\nnumgbits=4" );
+
+
+
+
+
+
75 image.brx_ = (jas_image_coord_t)width;
+
76 image.bry_ = (jas_image_coord_t)height;
+
+
+
79 image.clrspc_ = JAS_CLRSPC_SGRAY;
+
+
+
+
+
+
+
86 cmpt.width_ = (jas_image_coord_t)width;
+
87 cmpt.height_ = (jas_image_coord_t)height;
+
88 cmpt.type_ = JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y);
+
+
+
91 cmpt.cps_ = (nbits + 7) / 8;
+
+
+
94 image.cmpts_ = &pcmpt;
+
+
+
+
+
+
+
+
102 jas_conf_set_max_mem_usage(10000000);
+
103 jas_conf_set_multithread(
true );
+
104 if (jas_init_library())
+
+
106 if (jas_init_thread())
+
+
+
+
+
+
+
+
114 istream = jas_stream_memopen((
char *)cin, height * width * cmpt.cps_);
+
115 cmpt.stream_ = istream;
+
+
+
+
119 jpcstream = jas_stream_memopen(outjpc, (
int )jpclen);
+
+
+
+
+
+
125 if ((ier = jas_image_encode(&image, jpcstream, fmt, opts)))
+
+
+
+
+
130 rwcnt = jpcstream->rwcnt_;
+
+
+
133 ier = jas_stream_close(istream);
+
134 ier = jas_stream_close(jpcstream);
+
+
+
+
138 jas_cleanup_thread();
+
139 jas_cleanup_library();
+
+
+
+
+
+
+
+
+
+#define MAXOPTSSIZE
Maximum size of options.
+#define G2_JASPER_INIT
In enc_jpeg2000()/dec_jpeg2000() error initializing jasper library.
+#define G2C_JASPER_JPEG_FORMAT_NAME
Name of JPEG codec in Jasper.
+#define G2_JASPER_ENCODE
In enc_jpeg2000() error encoding image with jasper.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+int64_t g2int
Long integer type.
+int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen)
This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 ...
+
+
+
+
diff --git a/ver-1.7.0/enc__png_8c.html b/ver-1.7.0/enc__png_8c.html
new file mode 100644
index 00000000..0a99996d
--- /dev/null
+++ b/ver-1.7.0/enc__png_8c.html
@@ -0,0 +1,304 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: enc_png.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Functions for dealing with PNG.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include <string.h>
+
#include <png.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+int enc_png (unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
+ Encode PNG. More...
+
+void user_flush_data (png_structp png_ptr)
+ Dummy Custom flush function. More...
+
+void user_write_data (png_structp png_ptr, png_bytep data, png_uint_32 length)
+ Custom write function used to that libpng will write to memory location instead of a file on disk. More...
+
+
+
+
Functions for dealing with PNG.
+
Author Stephen Gilbert
+
+
Definition in file enc_png.c .
+
+
+
◆ png_stream
+
+
+
+
+
+ typedef struct png_stream png_stream
+
+
+
+
+
Typedef for PNG stream.
+
+
Definition at line 21 of file enc_png.c .
+
+
+
+
+
+
◆ enc_png()
+
+
+
+
+
+ int enc_png
+ (
+ unsigned char *
+ data ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ unsigned char *
+ pngbuf
+
+
+
+ )
+
+
+
+
+
+
Encode PNG.
+
Parameters
+
+ data data.
+ width width.
+ height height.
+ nbits number of bits.
+ pngbuf PNG buffer.
+
+
+
+
Returns PNG length, or negative number for error.
+
Author Stephen Gilbert
+
+
Definition at line 75 of file enc_png.c .
+
+
References user_flush_data() , and user_write_data() .
+
+
Referenced by pngpack_int() .
+
+
+
+
+
◆ user_flush_data()
+
+
+
+
+
+ void user_flush_data
+ (
+ png_structp
+ png_ptr )
+
+
+
+
+
+
Dummy Custom flush function.
+
Parameters
+
+ png_ptr Pointer to PNG struct.
+
+
+
+
Author Stephen Gilbert
+
+
Definition at line 57 of file enc_png.c .
+
+
Referenced by enc_png() .
+
+
+
+
+
◆ user_write_data()
+
+
+
+
+
+ void user_write_data
+ (
+ png_structp
+ png_ptr ,
+
+
+
+
+ png_bytep
+ data ,
+
+
+
+
+ png_uint_32
+ length
+
+
+
+ )
+
+
+
+
+
+
Custom write function used to that libpng will write to memory location instead of a file on disk.
+
Parameters
+
+ png_ptr pointer
+ data data
+ length length
+
+
+
+
Author Stephen Gilbert
+
+
Definition at line 37 of file enc_png.c .
+
+
Referenced by enc_png() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/enc__png_8c.js b/ver-1.7.0/enc__png_8c.js
new file mode 100644
index 00000000..30bd650c
--- /dev/null
+++ b/ver-1.7.0/enc__png_8c.js
@@ -0,0 +1,7 @@
+var enc__png_8c =
+[
+ [ "png_stream", "enc__png_8c.html#a51736c0c137626d13b71ea12021c10f3", null ],
+ [ "enc_png", "enc__png_8c.html#a0b304f2dca88e94a76c1182fbc1f5938", null ],
+ [ "user_flush_data", "enc__png_8c.html#a97f27ca60f363a8a91319d3adee16b0e", null ],
+ [ "user_write_data", "enc__png_8c.html#ac84301dcabbe4c2893799955c50c38a5", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/enc__png_8c_source.html b/ver-1.7.0/enc__png_8c_source.html
new file mode 100644
index 00000000..be868ac3
--- /dev/null
+++ b/ver-1.7.0/enc__png_8c_source.html
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: enc_png.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
17 unsigned char *stream_ptr;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
44 ptr = mem->stream_ptr;
+
45 offset = mem->stream_len;
+
46 memcpy(ptr + offset, data, length);
+
47 mem->stream_len += length;
+
+
+
+
+
+
+
+
+
76 unsigned char *pngbuf)
+
+
+
79 g2int j, bytes, pnglen, bit_depth;
+
+
+
82 png_bytep **row_pointers;
+
+
+
+
86 if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)))
+
+
+
89 if (!(info_ptr = png_create_info_struct(png_ptr)))
+
+
91 png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
+
+
+
+
+
96 if (setjmp(png_jmpbuf(png_ptr)))
+
+
98 png_destroy_write_struct(&png_ptr, &info_ptr);
+
+
+
+
+
103 write_io_ptr.stream_ptr = (png_voidp)pngbuf;
+
104 write_io_ptr.stream_len = 0;
+
+
+
107 png_set_write_fn(png_ptr, (png_voidp)&write_io_ptr, (png_rw_ptr)
user_write_data ,
+
+
+
+
+
112 color_type = PNG_COLOR_TYPE_GRAY;
+
+
+
+
116 color_type = PNG_COLOR_TYPE_RGB;
+
+
118 else if (nbits == 32)
+
+
+
121 color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+
+
123 png_set_IHDR(png_ptr, info_ptr, width, height,
+
124 bit_depth, color_type, PNG_INTERLACE_NONE,
+
125 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+
+
+
+
129 row_pointers = malloc(height *
sizeof (png_bytep));
+
130 for (j = 0; j < height; j++)
+
131 row_pointers[j] = (png_bytep *)(data + (j * width * bytes));
+
132 png_set_rows(png_ptr, info_ptr, (png_bytepp)row_pointers);
+
+
+
135 png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
+
+
138 png_destroy_write_struct(&png_ptr, &info_ptr);
+
+
140 pnglen = write_io_ptr.stream_len;
+
+
+
+
+int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
Encode PNG.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+struct png_stream png_stream
Typedef for PNG stream.
+void user_write_data(png_structp, png_bytep, png_uint_32)
Custom write function used to that libpng will write to memory location instead of a file on disk.
+int64_t g2int
Long integer type.
+void user_flush_data(png_structp)
Dummy Custom flush function.
+
+
+
+
diff --git a/ver-1.7.0/files.html b/ver-1.7.0/files.html
new file mode 100644
index 00000000..a207f8ee
--- /dev/null
+++ b/ver-1.7.0/files.html
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: File List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Here is a list of all documented files with brief descriptions:
+
+ cmplxpack.c Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention
+ compack.c Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention
+ comunpack.c Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention
+ dec_jpeg2000.c Decodes JPEG2000 code stream
+ dec_png.c PNG functions
+ decenc_openjpeg.c JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c
+ drstemplates.c Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion
+ enc_jpeg2000.c Encodes JPEG2000 code stream
+ enc_png.c Functions for dealing with PNG
+ g2_addfield.c Pack up Sections 4 through 7 for a given field and adds them to a GRIB2 message
+ g2_addgrid.c Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message
+ g2_addlocal.c Add a Local Use Section (Section 2) to a GRIB2 message
+ g2_create.c Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)
+ g2_free.c Free up memory that was allocated for struct gribfield
+ g2_getfld.c Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field
+ g2_gribend.c Finalize a GRIB2 message after all grids and fields have been added
+ g2_info.c Search through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections
+ g2_miss.c Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field
+ g2_unpack1.c Unpack Section 1 (Identification Section) as defined in GRIB Edition 2
+ g2_unpack2.c Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2
+ g2_unpack3.c Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2
+ g2_unpack4.c Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2
+ g2_unpack5.c Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2
+ g2_unpack6.c Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2
+ g2_unpack7.c Unpack Section 7 (Data Section) as defined in GRIB Edition 2
+ gbits.c Functions to pack and unpack bits to/from a packed bit string
+ getdim.c Return the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format
+ getpoly.c Return the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section used spherical harmonic coefficients using GDT 5.50 through 5.53
+ grib2.h Header file for NCEPLIBS-g2c library
+ grib2_int.h Header file with internal function prototypes NCEPLIBS-g2c library
+ gridtemplates.c Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS)
+ int_power.c Provide function similar to C pow() power function
+ jpcpack.c Pack up a data field into a JPEG2000 code stream
+ jpcunpack.c Unpack a data field that was packed into a JPEG2000 code stream
+ misspack.c Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention
+ mkieee.c
+ pack_gp.c
+ pdstemplates.c Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS)
+ pngpack.c Function to pack data with PNG compression
+ pngunpack.c Contains a function to unpack data packed with PNG compression
+ rdieee.c Read a list of real values in 32-bit IEEE floating point format
+ reduce.c Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment
+ seekgb.c Searches a file for the next GRIB message
+ simpack.c Pack up a data field using the simple packing algorithm
+ simunpack.c
+ specpack.c Pack a spectral data field using the complex packing algorithm for spherical harmonic data
+ specunpack.c Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data
+ util.c Internal utility functions for the g2c library
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/files_dup.js b/ver-1.7.0/files_dup.js
new file mode 100644
index 00000000..e81540b4
--- /dev/null
+++ b/ver-1.7.0/files_dup.js
@@ -0,0 +1,51 @@
+var files_dup =
+[
+ [ "cmplxpack.c", "cmplxpack_8c.html", "cmplxpack_8c" ],
+ [ "compack.c", "compack_8c.html", "compack_8c" ],
+ [ "comunpack.c", "comunpack_8c.html", "comunpack_8c" ],
+ [ "dec_jpeg2000.c", "dec__jpeg2000_8c.html", "dec__jpeg2000_8c" ],
+ [ "dec_png.c", "dec__png_8c.html", "dec__png_8c" ],
+ [ "decenc_openjpeg.c", "decenc__openjpeg_8c.html", null ],
+ [ "drstemplates.c", "drstemplates_8c.html", "drstemplates_8c" ],
+ [ "enc_jpeg2000.c", "enc__jpeg2000_8c.html", "enc__jpeg2000_8c" ],
+ [ "enc_png.c", "enc__png_8c.html", "enc__png_8c" ],
+ [ "g2_addfield.c", "g2__addfield_8c.html", "g2__addfield_8c" ],
+ [ "g2_addgrid.c", "g2__addgrid_8c.html", "g2__addgrid_8c" ],
+ [ "g2_addlocal.c", "g2__addlocal_8c.html", "g2__addlocal_8c" ],
+ [ "g2_create.c", "g2__create_8c.html", "g2__create_8c" ],
+ [ "g2_free.c", "g2__free_8c.html", "g2__free_8c" ],
+ [ "g2_getfld.c", "g2__getfld_8c.html", "g2__getfld_8c" ],
+ [ "g2_gribend.c", "g2__gribend_8c.html", "g2__gribend_8c" ],
+ [ "g2_info.c", "g2__info_8c.html", "g2__info_8c" ],
+ [ "g2_miss.c", "g2__miss_8c.html", "g2__miss_8c" ],
+ [ "g2_unpack1.c", "g2__unpack1_8c.html", "g2__unpack1_8c" ],
+ [ "g2_unpack2.c", "g2__unpack2_8c.html", "g2__unpack2_8c" ],
+ [ "g2_unpack3.c", "g2__unpack3_8c.html", "g2__unpack3_8c" ],
+ [ "g2_unpack4.c", "g2__unpack4_8c.html", "g2__unpack4_8c" ],
+ [ "g2_unpack5.c", "g2__unpack5_8c.html", "g2__unpack5_8c" ],
+ [ "g2_unpack6.c", "g2__unpack6_8c.html", "g2__unpack6_8c" ],
+ [ "g2_unpack7.c", "g2__unpack7_8c.html", "g2__unpack7_8c" ],
+ [ "gbits.c", "gbits_8c.html", "gbits_8c" ],
+ [ "getdim.c", "getdim_8c.html", "getdim_8c" ],
+ [ "getpoly.c", "getpoly_8c.html", "getpoly_8c" ],
+ [ "grib2.h", "grib2_8h.html", "grib2_8h" ],
+ [ "grib2_int.h", "grib2__int_8h.html", "grib2__int_8h" ],
+ [ "gridtemplates.c", "gridtemplates_8c.html", "gridtemplates_8c" ],
+ [ "int_power.c", "int__power_8c.html", "int__power_8c" ],
+ [ "jpcpack.c", "jpcpack_8c.html", "jpcpack_8c" ],
+ [ "jpcunpack.c", "jpcunpack_8c.html", "jpcunpack_8c" ],
+ [ "misspack.c", "misspack_8c.html", "misspack_8c" ],
+ [ "mkieee.c", "mkieee_8c.html", "mkieee_8c" ],
+ [ "pack_gp.c", "pack__gp_8c.html", "pack__gp_8c" ],
+ [ "pdstemplates.c", "pdstemplates_8c.html", "pdstemplates_8c" ],
+ [ "pngpack.c", "pngpack_8c.html", "pngpack_8c" ],
+ [ "pngunpack.c", "pngunpack_8c.html", "pngunpack_8c" ],
+ [ "rdieee.c", "rdieee_8c.html", "rdieee_8c" ],
+ [ "reduce.c", "reduce_8c.html", "reduce_8c" ],
+ [ "seekgb.c", "seekgb_8c.html", "seekgb_8c" ],
+ [ "simpack.c", "simpack_8c.html", "simpack_8c" ],
+ [ "simunpack.c", "simunpack_8c.html", "simunpack_8c" ],
+ [ "specpack.c", "specpack_8c.html", "specpack_8c" ],
+ [ "specunpack.c", "specunpack_8c.html", "specunpack_8c" ],
+ [ "util.c", "util_8c.html", "util_8c" ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/folderclosed.png b/ver-1.7.0/folderclosed.png
new file mode 100644
index 00000000..bb8ab35e
Binary files /dev/null and b/ver-1.7.0/folderclosed.png differ
diff --git a/ver-1.7.0/folderopen.png b/ver-1.7.0/folderopen.png
new file mode 100644
index 00000000..d6c7f676
Binary files /dev/null and b/ver-1.7.0/folderopen.png differ
diff --git a/ver-1.7.0/functions.html b/ver-1.7.0/functions.html
new file mode 100644
index 00000000..ae2e788d
--- /dev/null
+++ b/ver-1.7.0/functions.html
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Data Fields
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Here is a list of all documented data types members with links to the data structure documentation for each member
+
+
- b -
+
+
+
- c -
+
+
+
- d -
+
+
+
- e -
+
+
+
- f -
+
+
+
- g -
+
+
+
- i -
+
+
+
- l -
+
+
+
- m -
+
+
+
- n -
+
+
+
- t -
+
+
+
- u -
+
+
+
- v -
+
+
+
+
+
+
diff --git a/ver-1.7.0/functions_vars.html b/ver-1.7.0/functions_vars.html
new file mode 100644
index 00000000..807b49cf
--- /dev/null
+++ b/ver-1.7.0/functions_vars.html
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Data Fields - Variables
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- b -
+
+
+
- c -
+
+
+
- d -
+
+
+
- e -
+
+
+
- f -
+
+
+
- g -
+
+
+
- i -
+
+
+
- l -
+
+
+
- m -
+
+
+
- n -
+
+
+
- t -
+
+
+
- u -
+
+
+
- v -
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__addfield_8c.html b/ver-1.7.0/g2__addfield_8c.html
new file mode 100644
index 00000000..2e64d1ba
--- /dev/null
+++ b/ver-1.7.0/g2__addfield_8c.html
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addfield.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Pack up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int g2_addfield (unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
+ This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message. More...
+
+
+
+
Pack up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+
Author Stephen Gilbert
+
Date 2002-11-05
+
+
Definition in file g2_addfield.c .
+
+
+
◆ g2_addfield()
+
+
+
+
+
+ g2int g2_addfield
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int
+ ipdsnum ,
+
+
+
+
+ g2int *
+ ipdstmpl ,
+
+
+
+
+ float *
+ coordlist ,
+
+
+
+
+ g2int
+ numcoord ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ngrdpts ,
+
+
+
+
+ g2int
+ ibmap ,
+
+
+
+
+ g2int *
+ bmap
+
+
+
+ )
+
+
+
+
+
+
This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+
They are Product Definition Section , Data Representation Section , Bit-Map Section and Data Section , respectively.
+
This routine is used with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_gribend() to create a complete GRIB2 message. Function g2_create() must be called first to initialize a new GRIB2 message. Function g2_addgrid() must be called after g2_create() and before this routine to add the appropriate grid description to the GRIB2 message. A call to g2_gribend() is required to complete GRIB2 message after all fields have been added.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-11-05 Gilbert Initial
+
+2002-12-23 Gilbert Added complex spherical harmonic packing
+
+2003-08-27 Gilbert Added support for new templates using PNG and JPEG2000 algorithms/templates.
+
+2004-11-29 Gilbert JPEG2000 now can use WMO Template 5.40 PNG can use WMO Template 5.41. Added packing algorithm check.
+
+2005-05-10 Gilbert Imposed minimum size on cpack.
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Char array that contains the GRIB2 message to which sections 4 through 7 should be added. Must be allocated large enough to store the entire GRIB2 message.
+ ipdsnum Product Definition Template Number (see Code Table 4.0 ).
+ ipdstmpl Contains the data values for the Product Definition Template specified by ipdsnum.
+ coordlist Array containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
+ numcoord number of values in array coordlist.
+ idrsnum Data Representation Template Number (see Code Table 5.0 ).
+ idrstmpl The data values for the Data Representation Template specified by idrsnum. Note that some values in this template (eg. reference values, number of bits, etc...) may be changed by the data packing algorithms. Use this to specify scaling factors and order of spatial differencing, if desired.
+ fld Array of data points to pack.
+ ngrdpts Number of data points in grid. i.e. size of fld and bmap.
+ ibmap Bitmap indicator (see Code Table 6.0 )
+0 = bitmap applies and is included in Section 6.
+1-253 = Predefined bitmap applies.
+254 = Previously defined bitmap applies to this field.
+255 = Bit map does not apply to this product.
+
+
+ bmap Integer array containing bitmap to be added (if ibmap = 0).
+
+
+
+
Returns
+
+
Note Note that the Sections 4 through 7 can only follow Section 3 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbert
+
Date 2002-11-05
+
+
Definition at line 98 of file g2_addfield.c .
+
+
References cmplxpack() , gtemplate::ext , gtemplate::extlen , extpdstemplate() , G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_ADDFIELD_BAD_BITMAP , G2_ADDFIELD_BAD_DRT , G2_ADDFIELD_BAD_GDS , G2_ADDFIELD_BAD_GDT , G2_ADDFIELD_BAD_PDT , G2_ADDFIELD_ERR , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , getdim() , getdrstemplate() , getpdstemplate() , getpoly() , jpcpack() , gtemplate::map , gtemplate::maplen , mkieee() , gtemplate::needext , pngpack() , sbit() , sbits() , simpack() , and specpack() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__addfield_8c.js b/ver-1.7.0/g2__addfield_8c.js
new file mode 100644
index 00000000..333ad8dc
--- /dev/null
+++ b/ver-1.7.0/g2__addfield_8c.js
@@ -0,0 +1,4 @@
+var g2__addfield_8c =
+[
+ [ "g2_addfield", "g2__addfield_8c.html#ad403b8c1a156f062c3ded89224e6b46b", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__addfield_8c_source.html b/ver-1.7.0/g2__addfield_8c_source.html
new file mode 100644
index 00000000..67ac6432
--- /dev/null
+++ b/ver-1.7.0/g2__addfield_8c_source.html
@@ -0,0 +1,546 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addfield.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
102 unsigned char *cpack;
+
103 static g2int zero = 0, one = 1, four = 4, five = 5, six = 6, seven = 7;
+
104 const g2int minsize = 50000;
+
105 g2int iofst, ibeg, lencurr, len, nsize;
+
106 g2int ilen, isecnum, i, nbits, temp, left;
+
107 g2int ibmprev, j, lcpack, ioctet, newlen, ndpts;
+
108 g2int lensec4, lensec5, lensec6, lensec7;
+
109 g2int issec3 = 0, isprevbmap = 0, lpos3 = 0, JJ, KK, MM;
+
+
+
+
113 #if defined USE_PNG || defined USE_JPEG2000 || defined USE_OPENJPEG
+
114 unsigned int allones = 4294967295u;
+
115 g2int width, height, iscan, itemp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
136 gbit (cgrib, &ilen, iofst, 32);
+
+
138 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
+
+
+
+
+
+
+
+
150 gbit (cgrib, &ibmprev, iofst, 8);
+
+
152 if (ibmprev >= 0 && ibmprev <= 253)
+
+
+
+
+
+
+
+
+
+
+
+
+
165 printf(
"g2_addfield: Section byte counts don''t add to total.\n" );
+
166 printf(
"g2_addfield: Sum of section byte counts = %ld\n" , len);
+
167 printf(
"g2_addfield: Total byte count in Section 0 = %ld\n" , lencurr);
+
+
+
+
+
+
173 if (isecnum != 3 && isecnum != 7)
+
+
175 printf(
"g2_addfield: Sections 4-7 can only be added after Section 3 or 7.\n" );
+
176 printf(
"g2_addfield: Section %ld was the last found in given GRIB message.\n" ,
+
+
+
+
+
+
+
183 printf(
"g2_addfield: Sections 4-7 can only be added if Section 3 was previously included.\n" );
+
184 printf(
"g2_addfield: Section 3 was not found in given GRIB message.\n" );
+
185 printf(
"g2_addfield: Call to routine addgrid required to specify Grid definition.\n" );
+
+
+
+
+
+
+
192 sbit (cgrib, &four, iofst, 8);
+
+
194 sbit (cgrib, &numcoord, iofst, 16);
+
+
196 sbit (cgrib, &ipdsnum, iofst, 16);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
215 for (i = 0; i < mappds->
maplen ; i++)
+
+
217 nbits = abs(mappds->
map [i]) * 8;
+
218 if ((mappds->
map [i] >= 0) || (ipdstmpl[i] >= 0))
+
219 sbit (cgrib, ipdstmpl + i, iofst, nbits);
+
+
+
222 sbit (cgrib, &one, iofst, 1);
+
223 temp = abs(ipdstmpl[i]);
+
224 sbit (cgrib, &temp, iofst + 1, nbits-1);
+
+
226 iofst = iofst + nbits;
+
+
+
+
+
+
+
233 for (i = 0; i < mappds->
extlen ; i++)
+
+
235 nbits = abs(mappds->
ext [i]) * 8;
+
236 if (mappds->
ext [i] >= 0 || ipdstmpl[j] >= 0)
+
237 sbit (cgrib, ipdstmpl + j, iofst, nbits);
+
+
+
240 sbit (cgrib, &one, iofst, 1);
+
241 temp = abs(ipdstmpl[j]);
+
242 sbit (cgrib, &temp, iofst + 1, nbits - 1);
+
+
244 iofst = iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
256 coordieee = calloc(numcoord,
sizeof (
g2int ));
+
257 mkieee (coordlist, coordieee, numcoord);
+
258 sbits (cgrib, coordieee, iofst, 32, 0, numcoord);
+
259 iofst = iofst + (32 * numcoord);
+
+
+
+
+
+
265 lensec4 = (iofst - ibeg) / 8;
+
266 sbit (cgrib, &lensec4, ibeg, 32);
+
+
+
+
+
+
+
+
+
275 if (ibmap == 0 || ibmap == 254)
+
+
277 pfld = malloc(ngrdpts *
sizeof (
float ));
+
+
279 for (j = 0; j < ngrdpts; j++)
+
+
+
282 pfld[ndpts++] = fld[j];
+
+
+
+
+
+
+
+
+
+
+
+
+
295 cpack = malloc(nsize);
+
+
+
+
299 simpack (pfld, ndpts, idrstmpl, cpack, &lcpack);
+
300 else if (idrsnum == 2 || idrsnum == 3)
+
301 cmplxpack (pfld, ndpts, idrsnum, idrstmpl, cpack, &lcpack);
+
302 else if (idrsnum == 50)
+
+
304 simpack (pfld + 1, ndpts - 1, idrstmpl, cpack, &lcpack);
+
305 mkieee (pfld, idrstmpl + 4, 1);
+
+
307 else if (idrsnum == 51)
+
+
309 getpoly (cgrib + lpos3, &JJ, &KK, &MM);
+
310 if (JJ != 0 && KK != 0 && MM != 0)
+
311 specpack (pfld, ndpts, JJ, KK, MM, idrstmpl, cpack, &lcpack);
+
+
+
314 printf(
"g2_addfield: Cannot pack DRT 5.51.\n" );
+
+
+
+
318 #if defined USE_JPEG2000 || defined USE_OPENJPEG
+
319 else if (idrsnum == 40 || idrsnum == 40000)
+
+
+
+
323 getdim (cgrib + lpos3, &width, &height, &iscan);
+
324 if (width == 0 || height == 0)
+
+
+
+
+
329 else if (width == allones || height == allones)
+
+
+
+
+
334 else if ((iscan & 32) == 32)
+
+
+
+
+
+
+
+
+
+
+
+
+
347 jpcpack (pfld, width, height, idrstmpl, cpack, &lcpack);
+
+
+
+
351 else if (idrsnum == 41 || idrsnum == 40010)
+
+
+
+
355 getdim (cgrib + lpos3, &width, &height, &iscan);
+
356 if (width == 0 || height == 0)
+
+
+
+
+
361 else if (width == allones || height == allones)
+
+
+
+
+
366 else if ((iscan & 32) == 32)
+
+
+
+
+
+
+
+
+
+
+
+
378 pngpack (pfld, width, height, idrstmpl, cpack, &lcpack);
+
+
+
+
+
383 printf(
"g2_addfield: Data Representation Template 5.%ld not yet implemented.\n" , idrsnum);
+
+
+
+
+
388 if (ibmap == 0 || ibmap == 254)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
406 sbit (cgrib, &five, iofst, 8);
+
+
408 sbit (cgrib, &ndpts, iofst, 32);
+
+
410 sbit (cgrib, &idrsnum, iofst, 16);
+
+
+
+
+
+
416 for (i = 0; i < mapdrs->
maplen ; i++)
+
+
418 nbits = abs(mapdrs->
map [i]) * 8;
+
419 if (mapdrs->
map [i] >= 0 || idrstmpl[i] >= 0)
+
420 sbit (cgrib, idrstmpl + i, iofst, nbits);
+
+
+
423 sbit (cgrib, &one, iofst, 1);
+
424 temp = abs(idrstmpl[i]);
+
425 sbit (cgrib, &temp, iofst + 1, nbits - 1);
+
+
427 iofst = iofst + nbits;
+
+
+
+
+
+
433 lensec5 = (iofst - ibeg) / 8;
+
434 sbit (cgrib, &lensec5, ibeg, 32);
+
+
+
+
+
439 sbit (cgrib, &six, iofst, 8);
+
+
441 sbit (cgrib, &ibmap, iofst, 8);
+
+
+
+
+
+
447 sbits (cgrib, bmap, iofst, 1, 0, ngrdpts);
+
448 iofst = iofst + ngrdpts;
+
+
+
+
+
453 if (ibmap == 254 && !isprevbmap)
+
+
455 printf(
"g2_addfield: Requested previously defined bitmap," );
+
456 printf(
" but one does not exist in the current GRIB message.\n" );
+
+
+
+
+
+
462 left = 8 - (iofst % 8);
+
+
+
465 sbit (cgrib, &zero, iofst, left);
+
466 iofst = iofst + left;
+
+
468 lensec6 = (iofst - ibeg) / 8;
+
469 sbit (cgrib, &lensec6, ibeg, 32);
+
+
+
+
+
474 sbit (cgrib, &seven, iofst, 8);
+
+
+
+
+
+
+
+
482 for (j = 0; j < lcpack; j++)
+
483 cgrib[ioctet + j] = cpack[j];
+
484 iofst = iofst + (8 * lcpack);
+
+
+
+
+
489 lensec7 = (iofst - ibeg) / 8;
+
490 sbit (cgrib, &lensec7, ibeg, 32);
+
+
+
+
+
+
496 newlen = lencurr + lensec4 + lensec5 + lensec6 + lensec7;
+
497 sbit (cgrib, &newlen, 96, 32);
+
+
+
+
+
+gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
+g2int * ext
Number of octets of each entry in the extension part of the template.
+#define G2_ADDFIELD_ERR
In g2_addfield() error packing data field.
+g2int getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid De...
+#define G2_ADDFIELD_BAD_DRT
In g2_addfield() unsupported Data Representationi Template.
+gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
+void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+void cmplxpack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
+#define G2_ADDFIELD_BAD_BITMAP
In g2_addfield() no bitmap in the GRIB message.
+g2int needext
Indicates whether or not the template needs to be extended.
+#define G2_BAD_SEC
Previous Section was unexpected.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int maplen
Number of entries in the static part of the template.
+void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+g2int * map
Number of octets of each entry in the static part of the template.
+void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
+int64_t g2int
Long integer type.
+void specpack(float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs a spectral data field using the complex packing algorithm for spherical harmoni...
+#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
+#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
+g2int getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Def...
+#define G2C_MSG_COMPLETE
GRIB message already complete.
+g2int extlen
Number of entries in the template extension.
+void simpack(float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 docu...
+#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+#define G2C_NOT_GRIB
GRIB header not found.
+#define G2_ADDFIELD_BAD_GDS
In g2_addfield() section 3 (GDS) not previously defined in message.
+#define G2_ADDFIELD_BAD_GDT
In g2_addfield() GDT of one of 5.50 through 5.53 required when using DRT 5.51.
+void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a float data field into PNG image format.
+#define G2_ADDFIELD_BAD_PDT
In g2_addfield() could not find requested Product Definition Template.
+g2int g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+Struct for GRIB template.
+int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already termi...
+
+
+
+
diff --git a/ver-1.7.0/g2__addgrid_8c.html b/ver-1.7.0/g2__addgrid_8c.html
new file mode 100644
index 00000000..17044a02
--- /dev/null
+++ b/ver-1.7.0/g2__addgrid_8c.html
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addgrid.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition in file g2_addgrid.c .
+
+
+
◆ g2_addgrid()
+
+
+
+
+
+ g2int g2_addgrid
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ igds ,
+
+
+
+
+ g2int *
+ igdstmpl ,
+
+
+
+
+ g2int *
+ ideflist ,
+
+
+
+
+ g2int
+ idefnum
+
+
+
+ )
+
+
+
+
+
+
This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+
It 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.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-11-01 Gilbert Initial.
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ 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.
+igds[0] Source of grid definition (see Code Table 3.0 ).
+igds[1] Number of grid points in the defined grid.
+igds[2] Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
+igds[3] Interpretation of list for optional points definition. (See Code Table 3.11 ).
+igds[4] Grid Definition Template Number (See Code Table 3.1 ).
+
+
+ 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.
+
+
+
+
Returns
+> 0 Current size of updated GRIB2 message
+G2_ADD_MSG_INIT GRIB message was not initialized. Need to call routine gribcreate first.
+G2_ADD_MSG_COMPLETE GRIB message already complete. Cannot add new section.
+G2_BAD_SEC_COUNTS Sum of Section byte counts doesn't add to total byte count
+G2_BAD_SEC Previous Section was not 1, 2 or 7.
+G2_ADDGRID_BAD_GDT Could not find requested Grid Definition Template.
+
+
+
Note The Grid Def Section (Section 3) can only follow Section 1, 2 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition at line 70 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_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , getgridtemplate() , gtemplate::map , gtemplate::maplen , gtemplate::needext , sbit() , and sbits() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__addgrid_8c.js b/ver-1.7.0/g2__addgrid_8c.js
new file mode 100644
index 00000000..05a5294e
--- /dev/null
+++ b/ver-1.7.0/g2__addgrid_8c.js
@@ -0,0 +1,4 @@
+var g2__addgrid_8c =
+[
+ [ "g2_addgrid", "g2__addgrid_8c.html#a14908ea75d83021b0ec10ae8c084567c", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__addgrid_8c_source.html b/ver-1.7.0/g2__addgrid_8c_source.html
new file mode 100644
index 00000000..7d465fa2
--- /dev/null
+++ b/ver-1.7.0/g2__addgrid_8c_source.html
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addgrid.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
73 static g2int one = 1, three = 3, miss = 65535;
+
74 g2int lensec3, iofst, ibeg, lencurr, len;
+
75 g2int i, j, temp, ilen, isecnum, nbits;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
96 gbit (cgrib, &ilen, iofst, 32);
+
+
98 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
+
+
+
+
+
+
+
109 printf(
"g2_addgrid: Section byte counts don''t add to total.\n" );
+
110 printf(
"g2_addgrid: Sum of section byte counts = %ld\n" , len);
+
111 printf(
"g2_addgrid: Total byte count in Section 0 = %ld\n" , lencurr);
+
+
+
+
+
+
117 if (isecnum != 1 && isecnum != 2 && isecnum != 7)
+
+
119 printf(
"g2_addgrid: Section 3 can only be added after Section 1, 2 or 7.\n" );
+
120 printf(
"g2_addgrid: Section ',isecnum,' was the last found in given GRIB message.\n" );
+
+
+
+
+
+
+
127 sbit (cgrib, &three, iofst, 8);
+
+
129 sbit (cgrib, igds+0, iofst, 8);
+
+
131 sbit (cgrib, igds+1, iofst, 32);
+
+
133 sbit (cgrib, igds+2, iofst, 8);
+
+
135 sbit (cgrib, igds+3, iofst, 8);
+
+
+
+
+
+
141 sbit (cgrib, igds+4, iofst, 16);
+
+
143 sbit (cgrib, &miss, iofst, 16);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
165 for (i = 0; i < mapgrid->
maplen ; i++)
+
+
167 nbits = abs(mapgrid->
map [i]) * 8;
+
168 if ((mapgrid->
map [i] >= 0) || (igdstmpl[i] >= 0))
+
169 sbit (cgrib, igdstmpl+i, iofst, nbits);
+
+
+
172 sbit (cgrib, &one, iofst, 1);
+
173 temp = abs(igdstmpl[i]);
+
174 sbit (cgrib, &temp, iofst+1, nbits-1);
+
+
176 iofst = iofst + nbits;
+
+
+
+
+
+
+
183 for (i = 0; i < mapgrid->
extlen ; i++)
+
+
185 nbits = abs(mapgrid->
ext [i]) * 8;
+
186 if (mapgrid->
ext [i] >= 0 || igdstmpl[j] >= 0)
+
187 sbit (cgrib, igdstmpl + j, iofst, nbits);
+
+
+
190 sbit (cgrib, &one, iofst, 1);
+
191 temp = abs(igdstmpl[j]);
+
192 sbit (cgrib, &temp, iofst + 1, nbits - 1);
+
+
194 iofst = iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
208 sbits (cgrib, ideflist, iofst, nbits, 0, idefnum);
+
209 iofst = iofst + (nbits * idefnum);
+
+
+
+
213 lensec3 = (iofst - ibeg) / 8;
+
214 sbit (cgrib, &lensec3, ibeg, 32);
+
+
+
+
218 sbit (cgrib, &lencurr, 96, 32);
+
+
+
+
+
+g2int * ext
Number of octets of each entry in the extension part of the template.
+g2int needext
Indicates whether or not the template needs to be extended.
+gtemplate * extgridtemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Grid Definition Template,...
+#define G2_BAD_SEC
Previous Section was unexpected.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int maplen
Number of entries in the static part of the template.
+void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+gtemplate * getgridtemplate(g2int number)
This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
+g2int * map
Number of octets of each entry in the static part of the template.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+#define G2_ADDGRID_BAD_GDT
In g2_addgrid() Could not find requested Grid Definition Template.
+int64_t g2int
Long integer type.
+#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
+#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
+#define G2C_MSG_COMPLETE
GRIB message already complete.
+g2int extlen
Number of entries in the template extension.
+#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+#define G2C_NOT_GRIB
GRIB header not found.
+Struct for GRIB template.
+int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already termi...
+g2int g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum)
This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+
+
+
+
diff --git a/ver-1.7.0/g2__addlocal_8c.html b/ver-1.7.0/g2__addlocal_8c.html
new file mode 100644
index 00000000..dff1f978
--- /dev/null
+++ b/ver-1.7.0/g2__addlocal_8c.html
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addlocal.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add a Local Use Section (Section 2) to a GRIB2 message.
+More...
+
#include <stdio.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Add a Local Use Section (Section 2) to a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition in file g2_addlocal.c .
+
+
+
◆ g2_addlocal()
+
+
+
+
+
+ g2int g2_addlocal
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ unsigned char *
+ csec2 ,
+
+
+
+
+ g2int
+ lcsec2
+
+
+
+ )
+
+
+
+
+
+
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
+
It is used with routines g2_create() , g2_addgrid() , g2_addfield() , and g2_gribend() to create a complete GRIB2 message.
+
Parameters
+
+ cgrib Char array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
+ csec2 Character array containing information to be added in Section 2.
+ lcsec2 Number of bytes of character array csec2 to be added to Section 2.
+
+
+
+
Returns > 0 = Current size of updated GRIB2 message.
+
+
Note The Local Use Section (Section 2) can only follow Section 1 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition at line 40 of file g2_addlocal.c .
+
+
References G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , and sbit() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__addlocal_8c.js b/ver-1.7.0/g2__addlocal_8c.js
new file mode 100644
index 00000000..1a181d6b
--- /dev/null
+++ b/ver-1.7.0/g2__addlocal_8c.js
@@ -0,0 +1,4 @@
+var g2__addlocal_8c =
+[
+ [ "g2_addlocal", "g2__addlocal_8c.html#aa9490d67c089f6a15fd9941f273752c3", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__addlocal_8c_source.html b/ver-1.7.0/g2__addlocal_8c_source.html
new file mode 100644
index 00000000..04725119
--- /dev/null
+++ b/ver-1.7.0/g2__addlocal_8c_source.html
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_addlocal.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
43 g2int j, k, lensec2, iofst, ibeg, lencurr, ilen, len, istart;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
64 gbit (cgrib, &ilen, iofst, 32);
+
+
66 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
+
+
+
+
+
+
+
77 printf(
"g2_addlocal: Section byte counts don't add to total.\n" );
+
78 printf(
"g2_addlocal: Sum of section byte counts = %ld\n" , len);
+
79 printf(
"g2_addlocal: Total byte count in Section 0 = %ld\n" , lencurr);
+
+
+
+
+
+
85 if (isecnum != 1 && isecnum != 7)
+
+
87 printf(
"g2_addlocal: Section 2 can only be added after Section 1 or Section 7.\n" );
+
88 printf(
"g2_addlocal: Section %ld was the last found in given GRIB message.\n" , isecnum);
+
+
+
+
+
+
+
95 sbit (cgrib, &two, iofst, 8);
+
+
+
98 for (j = istart; j < istart + lcsec2; j++)
+
99 cgrib[j] = csec2[k++];
+
+
+
+
103 lensec2 = lcsec2 + 5;
+
104 sbit (cgrib, &lensec2, ibeg, 32);
+
+
+
+
108 sbit (cgrib, &lencurr, 96, 32);
+
+
+
+
+
+#define G2_BAD_SEC
Previous Section was unexpected.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
+#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
+#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
+#define G2C_MSG_COMPLETE
GRIB message already complete.
+#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+#define G2C_NOT_GRIB
GRIB header not found.
+int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already termi...
+
+
+
+
diff --git a/ver-1.7.0/g2__create_8c.html b/ver-1.7.0/g2__create_8c.html
new file mode 100644
index 00000000..2967ee57
--- /dev/null
+++ b/ver-1.7.0/g2__create_8c.html
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_create.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
+More...
+
#include <stdio.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_create.c .
+
+
+
◆ LENSEC0
+
+
+
+
+
+ #define LENSEC0 16
+
+
+
+
+
Length of GRIB Section 0.
+
+
Definition at line 11 of file g2_create.c .
+
+
+
+
+
◆ MAPSEC1LEN
+
+
+
+
+
+ #define MAPSEC1LEN 13
+
+
+
+
+
Length of Map Section 1.
+
+
Definition at line 10 of file g2_create.c .
+
+
+
+
+
+
◆ g2_create()
+
+
+
+
+
+ g2int g2_create
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ listsec0 ,
+
+
+
+
+ g2int *
+ listsec1
+
+
+
+ )
+
+
+
+
+
+
This routine initializes a new GRIB2 message and packs 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
+
+ [in] cgrib Character array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
+ [in] listsec0 Contains information needed for GRIB Indicator Section 0. Must be dimensioned >= 2.
+listsec0[0] Discipline-GRIB Master Table Number (Code Table 0.0 ).
+listsec0[1] GRIB Edition Number (currently 2).
+
+
+ [in] listsec1 Contains information needed for GRIB Identification Section 1. Must be dimensioned >= 13.
+listsec1[0] Id of orginating centre (Table 0 ).
+listsec1[1] Id of orginating sub-centre (Table C ).
+listsec1[2] GRIB Master Tables Version Number (Table 1.0 ).
+listsec1[3] GRIB Local Tables Version Number (Table 1.1 ).
+listsec1[4] Significance of Reference Time (Table 1.2 )
+listsec1[5] Reference Time - Year (4 digits)
+listsec1[6] Reference Time - Month
+listsec1[7] Reference Time - Day
+listsec1[8] Reference Time - Hour
+listsec1[9] Reference Time - Minute
+listsec1[10] Reference Time - Second
+listsec1[11] Production status of data (Table 1.3 ).
+listsec1[12] Type of processed data (Table 1.4 ).
+
+
+
+
+
+
Returns
+> 0 Current size of new GRIB2 message
+G2_CREATE_GRIB_VERSION Tried 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.
+
Author Stephen Gilbeert
+
Date 2002-10-31
+
+
Definition at line 68 of file g2_create.c .
+
+
References G2_CREATE_GRIB_VERSION , LENSEC0 , MAPSEC1LEN , and sbit() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__create_8c.js b/ver-1.7.0/g2__create_8c.js
new file mode 100644
index 00000000..1eef7573
--- /dev/null
+++ b/ver-1.7.0/g2__create_8c.js
@@ -0,0 +1,6 @@
+var g2__create_8c =
+[
+ [ "LENSEC0", "g2__create_8c.html#a509c8614b4771ae9b3d2a96a6f3bdc15", null ],
+ [ "MAPSEC1LEN", "g2__create_8c.html#a7ea6e1ded57657a0b75c46636e6dbb89", null ],
+ [ "g2_create", "g2__create_8c.html#a0e8970973e1cefc142240f961a796108", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__create_8c_source.html b/ver-1.7.0/g2__create_8c_source.html
new file mode 100644
index 00000000..ad8d0e05
--- /dev/null
+++ b/ver-1.7.0/g2__create_8c_source.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_create.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
70 g2int zero = 0, one = 1;
+
+
+
+
+
+
+
+
78 g2int mapsec1[
MAPSEC1LEN ] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
+
79 g2int i, lensec1, iofst, ibeg, nbits, len;
+
+
+
+
+
84 printf(
"g2_create: can only code GRIB edition 2." );
+
+
+
+
+
+
+
+
+
+
94 sbit (cgrib, &zero, 32, 16);
+
95 sbit (cgrib, listsec0 + 0, 48, 8);
+
96 sbit (cgrib, listsec0 + 1, 56, 8);
+
+
+
+
+
101 sbit (cgrib, &one, iofst, 8);
+
+
+
+
+
+
+
+
109 nbits = mapsec1[i] * 8;
+
110 sbit (cgrib, listsec1 + i, iofst, nbits);
+
111 iofst = iofst + nbits;
+
+
+
+
+
116 lensec1 = (iofst - ibeg) / 8;
+
117 sbit (cgrib, &lensec1, ibeg, 32);
+
+
+
120 sbit (cgrib, &zero, 64, 32);
+
+
122 sbit (cgrib, &len, 96, 32);
+
+
+
+
+g2int g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
This routine initializes a new GRIB2 message and packs GRIB2 Section 0 (Indicator Section) and Sectio...
+Header file with internal function prototypes NCEPLIBS-g2c library.
+#define LENSEC0
Length of GRIB Section 0.
+int64_t g2int
Long integer type.
+#define G2_CREATE_GRIB_VERSION
Wrong GRIB version for g2_create(), must be 2.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+#define MAPSEC1LEN
Length of Map Section 1.
+
+
+
+
diff --git a/ver-1.7.0/g2__free_8c.html b/ver-1.7.0/g2__free_8c.html
new file mode 100644
index 00000000..f2263d55
--- /dev/null
+++ b/ver-1.7.0/g2__free_8c.html
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_free.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Free up memory that was allocated for struct gribfield.
+More...
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+void g2_free (gribfield *gfld)
+ This routine frees up memory that was allocated for struct gribfield. More...
+
+
+
+
Free up memory that was allocated for struct gribfield.
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition in file g2_free.c .
+
+
+
◆ g2_free()
+
+
+
+
+
+ void g2_free
+ (
+ gribfield *
+ gfld )
+
+
+
+
+
+
This routine frees up memory that was allocated for struct gribfield.
+
Parameters
+
+ gfld pointer to gribfield structure (defined in include file grib2.h ) returned from routine g2_getfld() .
+
+
+
+
Note This routine must be called to free up memory used by the decode routine, g2_getfld() , when user no longer needs to reference this data.
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition at line 24 of file g2_free.c .
+
+
References gribfield::bmap , gribfield::coord_list , gribfield::fld , gribfield::idrtmpl , gribfield::idsect , gribfield::igdtmpl , gribfield::ipdtmpl , gribfield::list_opt , and gribfield::local .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__free_8c.js b/ver-1.7.0/g2__free_8c.js
new file mode 100644
index 00000000..fcd0c051
--- /dev/null
+++ b/ver-1.7.0/g2__free_8c.js
@@ -0,0 +1,4 @@
+var g2__free_8c =
+[
+ [ "g2_free", "g2__free_8c.html#a084c47c8f83bb5a5c7799753ac7b6f02", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__free_8c_source.html b/ver-1.7.0/g2__free_8c_source.html
new file mode 100644
index 00000000..801cad2e
--- /dev/null
+++ b/ver-1.7.0/g2__free_8c_source.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_free.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
+g2int * idsect
Contains the entries in the Identification Section (Section 1).
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
+void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
+float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
+float * fld
Array of ndpts unpacked data points.
+unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
+
+g2int * list_opt
(Used if numoct_opt .ne.
+g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
+g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
+
+
+
+
diff --git a/ver-1.7.0/g2__getfld_8c.html b/ver-1.7.0/g2__getfld_8c.html
new file mode 100644
index 00000000..1beb6f6e
--- /dev/null
+++ b/ver-1.7.0/g2__getfld_8c.html
@@ -0,0 +1,242 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_getfld.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int g2_getfld (unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
+ This subroutine returns all the metadata, template values, bit-map (if applicable), and the unpacked data for a given data field. More...
+
+
+
+
Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field.
+
Author Stephen Gilbert
+
Date 2002-10-28
+
+
Definition in file g2_getfld.c .
+
+
+
◆ g2_getfld()
+
+
+
+
+
+ g2int g2_getfld
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int
+ ifldnum ,
+
+
+
+
+ g2int
+ unpack ,
+
+
+
+
+ g2int
+ expand ,
+
+
+
+
+ gribfield **
+ gfld
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns all the metadata, template values, bit-map (if applicable), and the unpacked data for a given data field.
+
All of the information returned is stored in a gribfield structure, which is defined in file grib2.h . Users of this routine will need to include grib2.h in their source code that calls this routine.
+
Since there can be multiple data fields packed into a GRIB2 message, the calling routine indicates which field is being requested with the ifldnum argument.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-28 Gilbert Initial
+
+2013-08-08 Vuong Free up memory in array igds - free(igds)
+
+
Parameters
+
+ cgrib Character pointer to the GRIB2 message.
+ ifldnum Specifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
+ unpack Boolean value indicating whether to unpack bitmap/data field.
+1 unpack bitmap (if present) and data values.
+0 do not unpack bitmap and data values.
+
+
+ expand Boolean value indicating whether the data points should be expanded to the correspond grid, if a bit-map is present. This argument is ignored if unpack == 0 OR if the returned field does not contain a bit-map.
+1 if possible, expand data field to grid, inserting zero values at gridpoints that are bitmapped out. (SEE REMARKS2)
+0 do not expand data field, leaving it an array of consecutive data points for each "1" in the bitmap.
+
+
+ gfld pointer to structure gribfield containing all decoded data for the data field.
+
+
+
+
Returns
+
+
Note Struct gribfield is allocated by this routine and it also contains pointers to many arrays of data that were allocated during decoding. Users are encouraged to free up this memory, when it is no longer needed, by an explicit call to routine g2_free() .
+
+Example:
+
+
+
+
...
+
g2_free(gfld);
+
Routine g2_info() can be used to first determine how many data fields exist in a given GRIB message.
+
Note It may not always be possible to expand a bit-mapped data field. If a pre-defined bit-map is used and not included in the GRIB2 message itself, this routine would not have the necessary information to expand the data. In this case, gfld->expanded would would be set to 0 (false), regardless of the value of input argument expand.
+
Author Stephen Gilbert
+
Date 2002-10-28
+
+
Definition at line 91 of file g2_getfld.c .
+
+
References gribfield::bmap , gribfield::coord_list , gribfield::discipline , gribfield::expanded , gribfield::fld , g2_free() , G2_GETFLD_BAD_END , G2_GETFLD_BAD_SEC1 , G2_GETFLD_BAD_SEC2 , G2_GETFLD_BAD_SEC3 , G2_GETFLD_BAD_SEC4 , G2_GETFLD_BAD_SEC5 , G2_GETFLD_BAD_SEC6 , G2_GETFLD_BAD_SEC7 , G2_GETFLD_GRIB_VERSION , G2_GETFLD_INVAL , G2_GETFLD_INVAL_SEC , G2_GETFLD_NO_BITMAP , G2_GETFLD_NO_GRIB , G2_GETFLD_WRONG_END , G2_GETFLD_WRONG_NFLDS , G2_NO_ERROR , g2_unpack1() , g2_unpack2() , g2_unpack3() , g2_unpack4() , g2_unpack5() , g2_unpack6() , g2_unpack7() , gbit() , gribfield::griddef , gribfield::ibmap , gribfield::idrtlen , gribfield::idrtmpl , gribfield::idrtnum , gribfield::idsect , gribfield::idsectlen , gribfield::ifldnum , gribfield::igdtlen , gribfield::igdtmpl , gribfield::igdtnum , gribfield::interp_opt , gribfield::ipdtlen , gribfield::ipdtmpl , gribfield::ipdtnum , gribfield::list_opt , gribfield::local , gribfield::locallen , gribfield::ndpts , gribfield::ngrdpts , gribfield::num_coord , gribfield::num_opt , gribfield::numoct_opt , gribfield::unpacked , and gribfield::version .
+
+
+
+
+
+Header file for NCEPLIBS-g2c library.
+
+g2int g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
This subroutine returns all the metadata, template values, bit-map (if applicable),...
+
+
+
+
diff --git a/ver-1.7.0/g2__getfld_8c.js b/ver-1.7.0/g2__getfld_8c.js
new file mode 100644
index 00000000..8cd101be
--- /dev/null
+++ b/ver-1.7.0/g2__getfld_8c.js
@@ -0,0 +1,4 @@
+var g2__getfld_8c =
+[
+ [ "g2_getfld", "g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__getfld_8c_source.html b/ver-1.7.0/g2__getfld_8c_source.html
new file mode 100644
index 00000000..c07810be
--- /dev/null
+++ b/ver-1.7.0/g2__getfld_8c_source.html
@@ -0,0 +1,466 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_getfld.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
95 g2int have3 = 0, have4 = 0, have5 = 0, have6 = 0, have7 = 0;
+
96 g2int numfld = 0, j, n, istart, iofst, ipos;
+
97 g2int disc, ver, lensec0, lengrib, lensec, isecnum;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
112 printf(
"g2_getfld: Request for field number must be positive.\n" );
+
+
+
+
+
+
+
119 for (j = 0; j < 100; j++)
+
+
121 if (cgrib[j] ==
'G' && cgrib[j + 1] ==
'R' &&cgrib[j + 2] ==
'I' &&
+
+
+
+
+
+
+
+
+
130 printf(
"g2_getfld: Beginning characters GRIB not found.\n" );
+
+
+
+
+
+
136 iofst = 8 * (istart + 6);
+
137 gbit (cgrib, &disc, iofst, 8);
+
+
139 gbit (cgrib, &ver, iofst, 8);
+
+
+
142 gbit (cgrib, &lengrib, iofst, 32);
+
+
+
145 ipos = istart + lensec0;
+
+
+
+
+
150 printf(
"g2_getfld: can only decode GRIB edition 2.\n" );
+
+
+
+
+
+
+
+
+
+
+
161 if (cgrib[ipos] ==
'7' && cgrib[ipos + 1] ==
'7' && cgrib[ipos + 2] ==
'7' &&
+
162 cgrib[ipos + 3] ==
'7' )
+
+
+
+
+
+
168 if (ipos != istart + lengrib)
+
+
170 printf(
"g2_getfld: '7777' found, but not where expected.\n" );
+
+
+
+
+
+
+
+
+
179 gbit (cgrib, &lensec, iofst, 32);
+
+
181 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
185 if (isecnum < 1 || isecnum > 7)
+
+
187 printf(
"g2_getfld: Unrecognized Section Encountered=%ld\n" , isecnum);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
248 if (numfld == ifldnum)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
269 if (isecnum == 5 && numfld == ifldnum)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
289 bmpsave = lgfld->
bmap ;
+
+
+
+
+
+
+
+
+
298 if (lgfld->
ibmap == 254)
+
+
+
301 lgfld->
bmap = bmpsave;
+
+
+
304 printf(
"g2_getfld: Prev bit-map specified, but none exist.\n" );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
321 if (isecnum == 7 && numfld == ifldnum && unpack)
+
+
+
+
+
+
+
328 printf(
"g2_getfld: return from g2_unpack7 = %d \n" , (
int )jerr);
+
+
+
+
+
+
+
+
+
337 if (lgfld->
ibmap != 255 && lgfld->
bmap != 0)
+
+
+
+
+
342 newfld = calloc(lgfld->
ngrdpts ,
sizeof (
float ));
+
343 for (j = 0; j < lgfld->
ngrdpts ; j++)
+
+
345 if (lgfld->
bmap [j] == 1)
+
346 newfld[j] = lgfld->
fld [n++];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
365 ipos = ipos + lensec;
+
366 if (ipos > istart + lengrib)
+
+
368 printf(
"g2_getfld: '7777' not found at end of GRIB message.\n" );
+
+
+
+
+
+
+
375 if (unpack && have3 && have4 && have5 && have6 && have7)
+
+
+
+
+
380 if (!unpack && have3 && have4 && have5 && have6)
+
+
+
+
+
+
386 printf(
"g2_getfld: GRIB message contained %ld different fields.\n" , numfld);
+
387 printf(
"g2_getfld: The request was for field %ld.\n" , ifldnum);
+
+
+
+
+
+g2int g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen)
This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
+#define G2_GETFLD_NO_BITMAP
In g2_getfld() previous bitmap specified, yet none exists.
+#define G2_GETFLD_BAD_SEC7
Error in g2_getfld() unpacking section 7.
+g2int ngrdpts
Number of grid points in the defined grid.
+#define G2_GETFLD_BAD_SEC6
Error in g2_getfld() unpacking section 6.
+g2int unpacked
Logical value indicating whether the bitmap and data values were unpacked.
+g2int ifldnum
Field number within GRIB message.
+#define G2_GETFLD_BAD_SEC3
Error in g2_getfld() unpacking section 3.
+g2int idrtlen
Number of elements in idrtmpl.
+#define G2_NO_ERROR
Function succeeded.
+g2int ibmap
Bitmap indicator (see Table 6.0).
+g2int griddef
Source of grid definition (see Table 3.0).
+g2int numoct_opt
Number of octets needed for each additional grid points definition.
+g2int * idsect
Contains the entries in the Identification Section (Section 1).
+g2int g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, float **coordlist, g2int *numcoord)
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+#define G2_GETFLD_WRONG_NFLDS
In g2_getfld() message did not contain the requested number of data fields.
+#define G2_GETFLD_WRONG_END
g2_info() found "7777" not where expected.
+g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
+g2int g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2)
This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
+#define G2_GETFLD_BAD_SEC4
Error in g2_getfld() unpacking section 4.
+g2int interp_opt
Interpretation of list for optional points definition.
+g2int ipdtlen
Number of elements in ipdtmpl - i.e.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
+#define G2_GETFLD_BAD_SEC5
Error in g2_getfld() unpacking section 5.
+g2int g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
+g2int discipline
Message Discipline (see Table 0.0).
+g2int num_opt
(Used if numoct_opt .ne.
+#define G2_GETFLD_BAD_END
g2_getfld() didn't find "7777" at end of message.
+float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
+g2int ipdtnum
Product Definition Template Number (see Table 4.0).
+int64_t g2int
Long integer type.
+#define G2_GETFLD_GRIB_VERSION
Wrong GRIB version for g2_getfld(), must be 2.
+g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+float * fld
Array of ndpts unpacked data points.
+unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
+g2int g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap)
This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+g2int idrtnum
Data Representation Template Number (see Table 5.0).
+#define G2_GETFLD_INVAL
g2_getfld() data field request number was not positive.
+g2int num_coord
Number of values in array coord_list.
+g2int expanded
Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
+g2int g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+
+g2int version
GRIB edition number (2).
+g2int locallen
Length of array local.
+#define G2_GETFLD_INVAL_SEC
g2_getfld() encountered unrecognized section.
+g2int ndpts
Number of data points unpacked and returned.
+g2int igdtlen
Number of elements in igdtmpl - i.e.
+g2int * list_opt
(Used if numoct_opt .ne.
+g2int igdtnum
Grid Definition Template Number (See Table 3.1).
+#define G2_GETFLD_BAD_SEC1
Error in g2_getfld() unpacking section 1.
+#define G2_GETFLD_BAD_SEC2
Error in g2_getfld() unpacking section 2.
+g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
+g2int g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
This subroutine returns all the metadata, template values, bit-map (if applicable),...
+#define G2_GETFLD_NO_GRIB
g2_getfld() can't find beginning characters "GRIB".
+g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
+g2int idsectlen
Number of elements in idsect.
+
+
+
+
diff --git a/ver-1.7.0/g2__gribend_8c.html b/ver-1.7.0/g2__gribend_8c.html
new file mode 100644
index 00000000..4167fc74
--- /dev/null
+++ b/ver-1.7.0/g2__gribend_8c.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_gribend.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Finalize a GRIB2 message after all grids and fields have been added.
+More...
+
#include <stdio.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int g2_gribend (unsigned char *cgrib)
+ This routine finalizes a GRIB2 message after all grids and fields have been added. More...
+
+
+
+
Finalize a GRIB2 message after all grids and fields have been added.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_gribend.c .
+
+
+
◆ g2_gribend()
+
+
+
+
+
+ g2int g2_gribend
+ (
+ unsigned char *
+ cgrib )
+
+
+
+
+
+
This routine finalizes a GRIB2 message after all grids and fields have been added.
+
It adds the End Section ("7777") to the end of the GRIB message and calculates the length and stores it in the appropriate place in Section 0. This routine is used with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_addfield() to create a complete GRIB2 message.
+
Parameters
+
+
+
+
Returns
+
+
Note This routine is intended for use with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_addfield() to create a complete GRIB2 message.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 37 of file g2_gribend.c .
+
+
References G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , and sbit() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__gribend_8c.js b/ver-1.7.0/g2__gribend_8c.js
new file mode 100644
index 00000000..fe05f974
--- /dev/null
+++ b/ver-1.7.0/g2__gribend_8c.js
@@ -0,0 +1,4 @@
+var g2__gribend_8c =
+[
+ [ "g2_gribend", "g2__gribend_8c.html#a84081fb5d32251234409b9ec2d72a0e8", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__gribend_8c_source.html b/ver-1.7.0/g2__gribend_8c_source.html
new file mode 100644
index 00000000..cb103140
--- /dev/null
+++ b/ver-1.7.0/g2__gribend_8c_source.html
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_gribend.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
39 g2int iofst, lencurr, len, ilen, isecnum;
+
+
41 unsigned char seven = 0x37;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
61 gbit (cgrib, &ilen, iofst, 32);
+
+
63 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
+
+
+
+
+
+
+
74 printf(
"g2_gribend: Section byte counts don''t add to total.\n" );
+
75 printf(
"g2_gribend: Sum of section byte counts = %d\n" , (
int )len);
+
76 printf(
"g2_gribend: Total byte count in Section 0 = %d\n" , (
int )lencurr);
+
+
+
+
+
+
+
+
84 printf(
"g2_gribend: Section 8 can only be added after Section 7.\n" );
+
85 printf(
"g2_gribend: Section %ld was the last found in given GRIB message.\n" , isecnum);
+
+
+
+
+
90 cgrib[lencurr] = seven;
+
91 cgrib[lencurr + 1] = seven;
+
92 cgrib[lencurr + 2] = seven;
+
93 cgrib[lencurr + 3] = seven;
+
+
+
96 lengrib = lencurr + 4;
+
97 sbit (cgrib, &lengrib, 96, 32);
+
+
+
+
+
+
+g2int g2_gribend(unsigned char *cgrib)
This routine finalizes a GRIB2 message after all grids and fields have been added.
+#define G2_BAD_SEC
Previous Section was unexpected.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
+#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
+#define G2C_MSG_COMPLETE
GRIB message already complete.
+#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+#define G2C_NOT_GRIB
GRIB header not found.
+int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already termi...
+
+
+
+
diff --git a/ver-1.7.0/g2__info_8c.html b/ver-1.7.0/g2__info_8c.html
new file mode 100644
index 00000000..09df6aa4
--- /dev/null
+++ b/ver-1.7.0/g2__info_8c.html
@@ -0,0 +1,219 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_info.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Search through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int g2_info (unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal)
+ This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections. More...
+
+
+
+
Search through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition in file g2_info.c .
+
+
+
◆ g2_info()
+
+
+
+
+
+ g2int g2_info
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ listsec0 ,
+
+
+
+
+ g2int *
+ listsec1 ,
+
+
+
+
+ g2int *
+ numfields ,
+
+
+
+
+ g2int *
+ numlocal
+
+
+
+ )
+
+
+
+
+
+
This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.
+
Also various checks are performed to see if the message is a valid GRIB2 message.
+
Parameters
+
+ cgrib Character pointer to the GRIB2 message.
+ listsec0 pointer to an array containing information decoded from GRIB Indicator Section 0. Must be allocated with >= 3 elements.
+listsec0(0) Discipline-GRIB Master Table Number (Code Table 0.0 ).
+listsec0[1] GRIB Edition Number (currently 2).
+listsec0[2] Length of GRIB message.
+
+
+ listsec1 Pointer to an array containing information read from GRIB Identification Section 1. Must be allocated with >= 13 elements.
+listsec1[0] Id of orginating centre (Table 0 ).
+listsec1[1] Id of orginating sub-centre (Table C ).
+listsec1[2] GRIB Master Tables Version Number (Table 1.0 ).
+listsec1[3] GRIB Local Tables Version Number (Table 1.1 ).
+listsec1[4] Significance of Reference Time (Table 1.2 )
+listsec1[5] Reference Time - Year (4 digits)
+listsec1[6] Reference Time - Month
+listsec1[7] Reference Time - Day
+listsec1[8] Reference Time - Hour
+listsec1[9] Reference Time - Minute
+listsec1[10] Reference Time - Second
+listsec1[11] Production status of data (Table 1.3 ).
+listsec1[12] Type of processed data (Table 1.4 ).
+
+
+ numfields The number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
+ numlocal The number of Local Use Sections ( Section 2 ) found in the GRIB message.
+
+
+
+
Returns 0 foe success, otherwise:
+
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition at line 67 of file g2_info.c .
+
+
References G2_INFO_BAD_END , G2_INFO_GRIB_VERSION , G2_INFO_INVAL_SEC , G2_INFO_NO_GRIB , G2_INFO_NO_SEC1 , G2_INFO_WRONG_END , and gbit() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__info_8c.js b/ver-1.7.0/g2__info_8c.js
new file mode 100644
index 00000000..883eea00
--- /dev/null
+++ b/ver-1.7.0/g2__info_8c.js
@@ -0,0 +1,4 @@
+var g2__info_8c =
+[
+ [ "g2_info", "g2__info_8c.html#abf8ecb0fe00805abfce20115357b4fa3", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__info_8c_source.html b/ver-1.7.0/g2__info_8c_source.html
new file mode 100644
index 00000000..c28e5d9a
--- /dev/null
+++ b/ver-1.7.0/g2__info_8c_source.html
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_info.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
70 g2int mapsec1len = 13;
+
71 g2int mapsec1[13] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
+
72 g2int i, j, istart, iofst, lengrib, lensec0, lensec1;
+
73 g2int ipos, isecnum, nbits, lensec;
+
+
+
+
+
+
+
80 for (j = 0; j < 100; j++)
+
+
82 if (cgrib[j] ==
'G' && cgrib[j + 1] ==
'R' && cgrib[j + 2] ==
'I' &&
+
+
+
+
+
+
+
+
+
91 printf(
"g2_info: Beginning characters GRIB not found." );
+
+
+
+
+
96 iofst = 8 * (istart + 6);
+
97 gbit (cgrib, listsec0, iofst, 8);
+
+
99 gbit (cgrib, listsec0 + 1, iofst, 8);
+
+
+
102 gbit (cgrib, &lengrib, iofst, 32);
+
+
104 listsec0[2] = lengrib;
+
+
106 ipos = istart + lensec0;
+
+
+
109 if (listsec0[1] != 2)
+
+
111 printf(
"g2_info: can only decode GRIB edition 2." );
+
+
+
+
+
116 gbit (cgrib, &lensec1, iofst, 32);
+
+
118 gbit (cgrib, &isecnum, iofst, 8);
+
+
+
+
122 printf(
"g2_info: Could not find section 1." );
+
+
+
+
+
+
+
129 for (i = 0; i < mapsec1len; i++)
+
+
131 nbits = mapsec1[i] * 8;
+
132 gbit (cgrib, listsec1 + i, iofst, nbits);
+
133 iofst = iofst + nbits;
+
+
135 ipos = ipos + lensec1;
+
+
+
+
+
+
+
142 if (cgrib[ipos] ==
'7' && cgrib[ipos + 1] ==
'7' && cgrib[ipos + 2] ==
'7' &&
+
143 cgrib[ipos + 3] ==
'7' )
+
+
+
146 if (ipos != (istart + lengrib))
+
+
148 printf(
"g2_info: '7777' found, but not where expected.\n" );
+
+
+
+
+
+
+
155 gbit (cgrib, &lensec, iofst, 32);
+
+
157 gbit (cgrib, &isecnum, iofst, 8);
+
+
159 ipos = ipos + lensec;
+
160 if (ipos > (istart + lengrib))
+
+
162 printf(
"g2_info: '7777' not found at end of GRIB message.\n" );
+
+
+
165 if (isecnum >= 2 && isecnum <= 7)
+
+
+
+
+
+
171 else if (isecnum == 4)
+
+
+
+
+
176 printf(
"g2_info: Invalid section number found in GRIB message: %ld\n" , isecnum);
+
+
+
+
+
+
+
+
+#define G2_INFO_NO_GRIB
g2_info() can't find beginning characters "GRIB".
+g2int g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal)
This subroutine searches through a GRIB2 message and returns the number of gridded fields found in th...
+#define G2_INFO_WRONG_END
g2_info() found "7777" not where expected.
+#define G2_INFO_NO_SEC1
g2_info() can't find section 1.
+#define G2_INFO_GRIB_VERSION
Wrong GRIB version for g2_info(), must be 2.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+#define G2_INFO_BAD_END
g2_info() didn't find "7777" at end of message.
+int64_t g2int
Long integer type.
+#define G2_INFO_INVAL_SEC
g2_info() found invalid section number.
+
+
+
+
diff --git a/ver-1.7.0/g2__miss_8c.html b/ver-1.7.0/g2__miss_8c.html
new file mode 100644
index 00000000..ff63b3c9
--- /dev/null
+++ b/ver-1.7.0/g2__miss_8c.html
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_miss.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field.
+More...
+
+
Go to the source code of this file.
+
+
+void g2_miss (gribfield *gfld, float *rmiss, int *nmiss)
+ This routine checks the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field. More...
+
+
+
+
Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field.
+
Author Stephen Gilbeert
+
Date 2004-12-16
+
+
Definition in file g2_miss.c .
+
+
+
◆ g2_miss()
+
+
+
+
+
+ void g2_miss
+ (
+ gribfield *
+ gfld ,
+
+
+
+
+ float *
+ rmiss ,
+
+
+
+
+ int *
+ nmiss
+
+
+
+ )
+
+
+
+
+
+
This routine checks the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field.
+
Parameters
+
+ gfld pointer to gribfield structure.
+ rmiss List of the missing values used.
+ nmiss NUmber of the missing values included in the field. rmiss must be allocated in the calling program with enough space hold all the missing values.
+
+
+
+
Author Stephen Gilbeert
+
Date 2004-12-16
+
+
Definition at line 24 of file g2_miss.c .
+
+
References gribfield::idrtmpl , gribfield::idrtnum , and rdieee() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__miss_8c.js b/ver-1.7.0/g2__miss_8c.js
new file mode 100644
index 00000000..2a21cb71
--- /dev/null
+++ b/ver-1.7.0/g2__miss_8c.js
@@ -0,0 +1,4 @@
+var g2__miss_8c =
+[
+ [ "g2_miss", "g2__miss_8c.html#a5ededd2735de5cd446ee17c2415592e6", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__miss_8c_source.html b/ver-1.7.0/g2__miss_8c_source.html
new file mode 100644
index 00000000..4cb8ddc6
--- /dev/null
+++ b/ver-1.7.0/g2__miss_8c_source.html
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_miss.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
43 rmiss[0] = (float)gfld->
idrtmpl [7];
+
+
+
+
+
+
+
+
+
+
+
+
55 rmiss[0] = (float)gfld->
idrtmpl [7];
+
56 rmiss[1] = (
float )gfld->
idrtmpl [8];
+
+
+
+
+
+
+
+
+
+void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
+void g2_miss(gribfield *gfld, float *rmiss, int *nmiss)
This routine checks the Data Representation Template to see if missing value management is used,...
+int64_t g2int
Long integer type.
+g2int idrtnum
Data Representation Template Number (see Table 5.0).
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack1_8c.html b/ver-1.7.0/g2__unpack1_8c.html
new file mode 100644
index 00000000..961bec12
--- /dev/null
+++ b/ver-1.7.0/g2__unpack1_8c.html
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack1.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition in file g2_unpack1.c .
+
+
+
◆ g2_unpack1()
+
+
+
+
+
+ g2int g2_unpack1
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int **
+ ids ,
+
+
+
+
+ g2int *
+ idslen
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
+
Parameters
+
+ cgrib char array containing Section 1 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 1 in cgrib.
+ ids Pointer that gets an array which contians the information read from Section 1, the Identification section. This array is allocated by this function, and must be freed by caller (using g2_free() ).
+ids[0] Identification of originating Centre (see Table 0 ).
+ids[1] Identification of originating Sub-centre (see Table C ).
+ids[2] GRIB Master Tables Version Number (see Table 1.0 ).
+ids[3] GRIB Local Tables Version Number (see Table 1.1 ).
+ids[4] Significance of Reference Time (see Table 1.2 ).
+ids[5] Year (4 digits)
+ids[6] Month
+ids[7] Day
+ids[8] Hour
+ids[9] Minute
+ids[10] Second
+ids[11] Production status of processed data (see Table 1.3 ).
+ids[12] Type of processed data (see Table 1.4 ).
+
+
+ idslen Number of elements in ids.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition at line 55 of file g2_unpack1.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , and gbit() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack1_8c.js b/ver-1.7.0/g2__unpack1_8c.js
new file mode 100644
index 00000000..64d45a4d
--- /dev/null
+++ b/ver-1.7.0/g2__unpack1_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack1_8c =
+[
+ [ "g2_unpack1", "g2__unpack1_8c.html#a5a9f3222320afe0f957406b53ad36223", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack1_8c_source.html b/ver-1.7.0/g2__unpack1_8c_source.html
new file mode 100644
index 00000000..5022d793
--- /dev/null
+++ b/ver-1.7.0/g2__unpack1_8c_source.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack1.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
58 g2int i, lensec, nbits, isecnum;
+
+
+
61 g2int mapid[13] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
+
+
+
+
65 gbit (cgrib, &lensec, *iofst, 32);
+
+
67 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
73 fprintf(stderr,
"g2_unpack1: Not Section 1 data.\n" );
+
+
+
+
+
+
+
80 if (!(*ids = calloc(*idslen,
sizeof (
g2int ))))
+
+
+
83 for (i = 0; i < *idslen; i++)
+
+
+
86 gbit (cgrib, *ids + i, *iofst, nbits);
+
87 *iofst = *iofst + nbits;
+
+
+
+
+
+
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+g2int g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
+int64_t g2int
Long integer type.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack2_8c.html b/ver-1.7.0/g2__unpack2_8c.html
new file mode 100644
index 00000000..846308bc
--- /dev/null
+++ b/ver-1.7.0/g2__unpack2_8c.html
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack2.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack2.c .
+
+
+
◆ g2_unpack2()
+
+
+
+
+
+ g2int g2_unpack2
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ lencsec2 ,
+
+
+
+
+ unsigned char **
+ csec2
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2008-12-23 Wesley Initialize lencsec2 Length of Local Use data
+
+2010-08-05 Vuong If section 2 has zero length, ierr=0
+
+
Parameters
+
+ cgrib char array containing Section 2 of the GRIB2 message.
+ iofst Pointer that contains the bit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
+ lencsec2 Length (in octets) of Local Use data.
+ csec2 Pointer to a pointer that will get an allocated array containing local use data. This memory must be freed by the caller.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 38 of file g2_unpack2.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , and gbit() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack2_8c.js b/ver-1.7.0/g2__unpack2_8c.js
new file mode 100644
index 00000000..64334e55
--- /dev/null
+++ b/ver-1.7.0/g2__unpack2_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack2_8c =
+[
+ [ "g2_unpack2", "g2__unpack2_8c.html#a4b190a45b5223fa43746cf16c80bef47", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack2_8c_source.html b/ver-1.7.0/g2__unpack2_8c_source.html
new file mode 100644
index 00000000..b113721a
--- /dev/null
+++ b/ver-1.7.0/g2__unpack2_8c_source.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack2.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
39 unsigned char **csec2)
+
+
+
42 g2int lensec, ipos, j;
+
+
+
+
+
+
48 gbit (cgrib, &lensec, *iofst, 32);
+
+
50 *lencsec2 = lensec - 5;
+
+
+
53 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
+
60 fprintf(stderr,
"g2_unpack2: Not Section 2 data.\n" );
+
+
+
+
+
+
+
+
68 if (!(*csec2 = malloc(*lencsec2)))
+
+
+
+
+
+
74 for (j = 0; j < *lencsec2; j++)
+
75 (*csec2)[j] = cgrib[ipos + j];
+
+
77 *iofst = *iofst + (*lencsec2 * 8);
+
+
+
+
+
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2)
This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack3_8c.html b/ver-1.7.0/g2__unpack3_8c.html
new file mode 100644
index 00000000..0bef0ea7
--- /dev/null
+++ b/ver-1.7.0/g2__unpack3_8c.html
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack3.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack3.c .
+
+
+
◆ g2_unpack3()
+
+
+
+
+
+ g2int g2_unpack3
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int **
+ igds ,
+
+
+
+
+ g2int **
+ igdstmpl ,
+
+
+
+
+ g2int *
+ mapgridlen ,
+
+
+
+
+ g2int **
+ ideflist ,
+
+
+
+
+ g2int *
+ idefnum
+
+
+
+ )
+
+
+
+
+
+
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Char array ontaining Section 3 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 3 in cgrib.
+ igds Contains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned.
+igds[0] Source of grid definition (see Table 3.0 ).
+igds[1] Number of grid points in the defined grid.
+igds[2] Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
+igds[3] Interpretation of list for optional points definition. (See Table 3.11 )
+igds[4] Grid Definition Template Number (see Table 3.1 ).
+
+
+ igdstmpl Pointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
+ mapgridlen Number of elements in igdstmpl. i.e. number of entries in Grid Defintion Template specified by igds[4].
+ ideflist (Used if igds[2] .ne. 0) Pointer to integer array containing the number of grid points contained in each row (or column).
+ idefnum (Used if igds[2] .ne. 0) The number of entries in array ideflist - i.e. number of rows (or columns) for which optional grid points are defined.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 57 of file g2_unpack3.c .
+
+
References gtemplate::ext , extgridtemplate() , gtemplate::extlen , G2_NO_ERROR , G2_UNPACK3_BAD_GDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , gbits() , getgridtemplate() , gtemplate::map , gtemplate::maplen , and gtemplate::needext .
+
+
Referenced by g2_getfld() , getdim() , and getpoly() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack3_8c.js b/ver-1.7.0/g2__unpack3_8c.js
new file mode 100644
index 00000000..16867bc3
--- /dev/null
+++ b/ver-1.7.0/g2__unpack3_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack3_8c =
+[
+ [ "g2_unpack3", "g2__unpack3_8c.html#ae0f9483c798b7819852b21fa0ae51590", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack3_8c_source.html b/ver-1.7.0/g2__unpack3_8c_source.html
new file mode 100644
index 00000000..bbe1804f
--- /dev/null
+++ b/ver-1.7.0/g2__unpack3_8c_source.html
@@ -0,0 +1,277 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack3.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
60 g2int i, j, nbits, isecnum;
+
61 g2int lensec, ibyttem = 0, isign, newlen;
+
62 g2int *ligds, *ligdstmpl = NULL, *lideflist = NULL;
+
+
+
+
+
+
+
69 gbit (cgrib, &lensec, *iofst, 32);
+
+
71 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
+
+
+
+
81 ligds = calloc(5,
sizeof (
g2int ));
+
+
+
84 gbit (cgrib, &ligds[0], *iofst, 8);
+
+
86 gbit (cgrib, &ligds[1], *iofst, 32);
+
+
88 gbit (cgrib, &ligds[2], *iofst, 8);
+
+
90 gbit (cgrib, &ligds[3], *iofst, 8);
+
+
92 gbit (cgrib, &ligds[4], *iofst, 16);
+
+
+
95 if (ligds[4] != 65535)
+
+
+
+
+
+
+
+
103 *mapgridlen = mapgrid->
maplen ;
+
+
+
+
+
+
+
110 if (!(ligdstmpl = calloc(*mapgridlen,
sizeof (
g2int ))))
+
+
+
+
+
+
+
+
118 *igdstmpl = ligdstmpl;
+
+
+
121 for (i = 0; i < *mapgridlen; i++)
+
+
123 nbits = abs(mapgrid->
map [i]) * 8;
+
124 if (mapgrid->
map [i] >= 0)
+
+
126 gbit (cgrib, ligdstmpl + i, *iofst, nbits);
+
+
+
+
130 gbit (cgrib, &isign, *iofst, 1);
+
131 gbit (cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
+
+
133 ligdstmpl[i] = -1 * ligdstmpl[i];
+
+
135 *iofst = *iofst + nbits;
+
136 ibyttem = ibyttem + abs(mapgrid->
map [i]);
+
+
+
+
+
+
+
+
+
+
+
+
+
149 ligdstmpl = realloc(ligdstmpl, newlen *
sizeof (
g2int ));
+
150 *igdstmpl = ligdstmpl;
+
+
152 for (i = *mapgridlen; i < newlen; i++)
+
+
154 nbits = abs(mapgrid->
ext [j]) * 8;
+
155 if (mapgrid->
ext [j] >= 0)
+
+
157 gbit (cgrib, ligdstmpl + i, *iofst, nbits);
+
+
+
+
161 gbit (cgrib, &isign, *iofst, 1);
+
162 gbit (cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
+
+
164 ligdstmpl[i] = -1 * ligdstmpl[i];
+
+
166 *iofst = *iofst + nbits;
+
167 ibyttem = ibyttem + abs(mapgrid->
ext [j]);
+
+
+
170 *mapgridlen = newlen;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
188 nbits = ligds[2] * 8;
+
189 *idefnum = (lensec - 14 - ibyttem) / ligds[2];
+
+
191 lideflist = calloc(*idefnum,
sizeof (
g2int ));
+
+
+
+
+
+
+
198 *ideflist = lideflist;
+
199 gbits (cgrib, lideflist, *iofst, nbits, 0, *idefnum);
+
200 *iofst = *iofst + (nbits * *idefnum);
+
+
+
+
+
+
+
+
+
+
+
+g2int * ext
Number of octets of each entry in the extension part of the template.
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+g2int needext
Indicates whether or not the template needs to be extended.
+gtemplate * extgridtemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Grid Definition Template,...
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int maplen
Number of entries in the static part of the template.
+gtemplate * getgridtemplate(g2int number)
This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
+g2int * map
Number of octets of each entry in the static part of the template.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+g2int extlen
Number of entries in the template extension.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+#define G2_UNPACK3_BAD_GDT
In g2_unpack3(), undefined Grid Definition Template.
+Struct for GRIB template.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack4_8c.html b/ver-1.7.0/g2__unpack4_8c.html
new file mode 100644
index 00000000..6b90e323
--- /dev/null
+++ b/ver-1.7.0/g2__unpack4_8c.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack4.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack4.c .
+
+
+
◆ g2_unpack4()
+
+
+
+
+
+ g2int g2_unpack4
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ ipdsnum ,
+
+
+
+
+ g2int **
+ ipdstmpl ,
+
+
+
+
+ g2int *
+ mappdslen ,
+
+
+
+
+ float **
+ coordlist ,
+
+
+
+
+ g2int *
+ numcoord
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Array containing Section 4 of the GRIB2 message.
+ iofst Bit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
+ ipdsnum Product Definition Template Number (see Table 4.0 ).
+ ipdstmpl Pointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
+ mappdslen Number of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
+ coordlist Pointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
+ numcoord number of values in array coordlist.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 46 of file g2_unpack4.c .
+
+
References gtemplate::ext , gtemplate::extlen , extpdstemplate() , G2_NO_ERROR , G2_UNPACK4_BAD_PDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , gbits() , getpdstemplate() , gtemplate::map , gtemplate::maplen , gtemplate::needext , and rdieee() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack4_8c.js b/ver-1.7.0/g2__unpack4_8c.js
new file mode 100644
index 00000000..de5812de
--- /dev/null
+++ b/ver-1.7.0/g2__unpack4_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack4_8c =
+[
+ [ "g2_unpack4", "g2__unpack4_8c.html#a379383c777dfa1e788b8e573bdd90889", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack4_8c_source.html b/ver-1.7.0/g2__unpack4_8c_source.html
new file mode 100644
index 00000000..ab8ae62e
--- /dev/null
+++ b/ver-1.7.0/g2__unpack4_8c_source.html
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack4.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
47 g2int *mappdslen,
float **coordlist,
g2int *numcoord)
+
+
+
50 g2int needext, i, j, nbits, isecnum;
+
51 g2int lensec, isign, newlen;
+
+
+
+
+
+
+
+
+
60 gbit (cgrib, &lensec, *iofst, 32);
+
+
62 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
+
+
+
+
72 gbit (cgrib, numcoord, *iofst, 16);
+
+
74 gbit (cgrib, ipdsnum, *iofst, 16);
+
+
+
+
+
+
+
+
+
83 *mappdslen = mappds->
maplen ;
+
+
+
+
+
+
+
90 lipdstmpl = calloc(*mappdslen,
sizeof (
g2int ));
+
+
+
+
+
+
+
+
+
99 *ipdstmpl = lipdstmpl;
+
+
101 for (i = 0; i < mappds->
maplen ; i++)
+
+
103 nbits = abs(mappds->
map [i]) * 8;
+
104 if (mappds->
map [i] >= 0)
+
+
106 gbit (cgrib, lipdstmpl + i, *iofst, nbits);
+
+
+
+
110 gbit (cgrib, &isign, *iofst, 1);
+
111 gbit (cgrib, lipdstmpl + i, *iofst + 1, nbits - 1);
+
112 if (isign == 1) lipdstmpl[i] = -1 * lipdstmpl[i];
+
+
114 *iofst = *iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
126 lipdstmpl = realloc(lipdstmpl, newlen *
sizeof (
g2int ));
+
127 *ipdstmpl = lipdstmpl;
+
+
+
130 for (i = *mappdslen; i < newlen; i++)
+
+
132 nbits = abs(mappds->
ext [j]) * 8;
+
133 if (mappds->
ext [j] >= 0)
+
+
135 gbit (cgrib, lipdstmpl + i, *iofst, nbits);
+
+
+
+
139 gbit (cgrib, &isign, *iofst, 1);
+
140 gbit (cgrib, lipdstmpl + i, *iofst+1, nbits-1);
+
+
142 lipdstmpl[i] = -1 * lipdstmpl[i];
+
+
144 *iofst = *iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
159 coordieee = calloc(*numcoord,
sizeof (
g2int ));
+
160 lcoordlist = calloc(*numcoord,
sizeof (
float ));
+
161 if (coordieee == 0 || lcoordlist == 0)
+
+
+
+
+
+
+
+
+
+
+
+
173 *coordlist = lcoordlist;
+
+
175 gbits (cgrib, coordieee, *iofst, 32, 0, *numcoord);
+
176 rdieee (coordieee, *coordlist, *numcoord);
+
+
178 *iofst = *iofst + (32 * (*numcoord));
+
+
+
+
+
+
+gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
+g2int * ext
Number of octets of each entry in the extension part of the template.
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
+g2int g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, float **coordlist, g2int *numcoord)
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+g2int needext
Indicates whether or not the template needs to be extended.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int maplen
Number of entries in the static part of the template.
+g2int * map
Number of octets of each entry in the static part of the template.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
+int64_t g2int
Long integer type.
+void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+g2int extlen
Number of entries in the template extension.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+Struct for GRIB template.
+#define G2_UNPACK4_BAD_PDT
In g2_unpack4(), undefined Product Definition Template.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack5_8c.html b/ver-1.7.0/g2__unpack5_8c.html
new file mode 100644
index 00000000..d5e72326
--- /dev/null
+++ b/ver-1.7.0/g2__unpack5_8c.html
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack5.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack5.c .
+
+
+
◆ g2_unpack5()
+
+
+
+
+
+ g2int g2_unpack5
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ ndpts ,
+
+
+
+
+ g2int *
+ idrsnum ,
+
+
+
+
+ g2int **
+ idrstmpl ,
+
+
+
+
+ g2int *
+ mapdrslen
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib char array containing Section 5 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
+ ndpts Number of data points unpacked and returned.
+ idrsnum Data Representation Template Number (see Code Table 5.0).
+ idrstmpl Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N.
+ mapdrslen- Number of elements in idrstmpl. i.e. number of entries in Data Representation Template 5.N (N=idrsnum).
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 42 of file g2_unpack5.c .
+
+
References gtemplate::ext , extdrstemplate() , gtemplate::extlen , G2_NO_ERROR , G2_UNPACK5_BAD_DRT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , getdrstemplate() , gtemplate::map , gtemplate::maplen , and gtemplate::needext .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack5_8c.js b/ver-1.7.0/g2__unpack5_8c.js
new file mode 100644
index 00000000..8f8fe21b
--- /dev/null
+++ b/ver-1.7.0/g2__unpack5_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack5_8c =
+[
+ [ "g2_unpack5", "g2__unpack5_8c.html#a0127b9d6f3a258a9d0dd87f986d86b93", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack5_8c_source.html b/ver-1.7.0/g2__unpack5_8c_source.html
new file mode 100644
index 00000000..140487db
--- /dev/null
+++ b/ver-1.7.0/g2__unpack5_8c_source.html
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack5.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
45 g2int needext, i, j, nbits, isecnum;
+
46 g2int lensec, isign, newlen;
+
+
+
+
+
+
52 gbit (cgrib, &lensec, *iofst, 32);
+
+
54 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
+
+
+
+
64 gbit (cgrib, ndpts, *iofst, 32);
+
+
66 gbit (cgrib, idrsnum, *iofst, 16);
+
+
+
+
+
+
+
+
+
75 *mapdrslen = mapdrs->
maplen ;
+
+
+
+
+
+
+
82 lidrstmpl = calloc(*mapdrslen,
sizeof (
g2int ));
+
+
+
+
+
+
+
+
+
+
+
93 *idrstmpl = lidrstmpl;
+
+
95 for (i = 0; i < mapdrs->
maplen ; i++)
+
+
97 nbits = abs(mapdrs->
map [i]) * 8;
+
98 if (mapdrs->
map [i] >= 0)
+
+
100 gbit (cgrib, lidrstmpl + i, *iofst, nbits);
+
+
+
+
104 gbit (cgrib, &isign, *iofst, 1);
+
105 gbit (cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
+
+
107 lidrstmpl[i] = -1 * lidrstmpl[i];
+
+
109 *iofst = *iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
121 lidrstmpl = realloc(lidrstmpl, newlen *
sizeof (
g2int ));
+
122 *idrstmpl = lidrstmpl;
+
+
+
+
126 for (i = *mapdrslen; i < newlen; i++)
+
+
128 nbits = abs(mapdrs->
ext [j]) * 8;
+
129 if (mapdrs->
ext [j] >= 0)
+
+
131 gbit (cgrib, lidrstmpl + i, *iofst, nbits);
+
+
+
+
135 gbit (cgrib, &isign, *iofst, 1);
+
136 gbit (cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
+
+
138 lidrstmpl[i] = -1 * lidrstmpl[i];
+
+
140 *iofst = *iofst + nbits;
+
+
+
+
+
+
+
+
+
+
+
+
+
+g2int g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen)
This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+g2int * ext
Number of octets of each entry in the extension part of the template.
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
+g2int needext
Indicates whether or not the template needs to be extended.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+gtemplate * extdrstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Data Representation Template,...
+g2int maplen
Number of entries in the static part of the template.
+#define G2_UNPACK5_BAD_DRT
In g2_unpack5(), undefined Data Representation Template.
+g2int * map
Number of octets of each entry in the static part of the template.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+g2int extlen
Number of entries in the template extension.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+Struct for GRIB template.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack6_8c.html b/ver-1.7.0/g2__unpack6_8c.html
new file mode 100644
index 00000000..b55ab633
--- /dev/null
+++ b/ver-1.7.0/g2__unpack6_8c.html
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack6.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack6.c .
+
+
+
◆ g2_unpack6()
+
+
+
+
+
+ g2int g2_unpack6
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int
+ ngpts ,
+
+
+
+
+ g2int *
+ ibmap ,
+
+
+
+
+ g2int **
+ bmap
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+
Parameters
+
+ cgrib char array containing Section 6 of the GRIB2 message.
+ iofst Bit offset of the beginning of Section 6 in cgrib.
+ ngpts Number of grid points specified in the bit-map
+ ibmap Bitmap indicator (see Code Table 6.0)
+0 bitmap applies and is included in Section 6.
+1-253 Predefined bitmap applies
+254 Previously defined bitmap applies to this field
+255 Bit map does not apply to this product.
+
+
+ bmap Pointer to an integer array containing decoded bitmap. (if ibmap=0)
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 33 of file g2_unpack6.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , and gbits() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack6_8c.js b/ver-1.7.0/g2__unpack6_8c.js
new file mode 100644
index 00000000..6879523f
--- /dev/null
+++ b/ver-1.7.0/g2__unpack6_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack6_8c =
+[
+ [ "g2_unpack6", "g2__unpack6_8c.html#a83638f96ee10ef44c4dddcebf41d8ee6", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack6_8c_source.html b/ver-1.7.0/g2__unpack6_8c_source.html
new file mode 100644
index 00000000..79dee696
--- /dev/null
+++ b/ver-1.7.0/g2__unpack6_8c_source.html
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack6.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
43 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
48 fprintf(stderr,
"g2_unpack6: Not Section 6 data.\n" );
+
+
+
+
52 gbit (cgrib, ibmap, *iofst, 8);
+
+
+
+
+
+
58 lbmap = calloc(ngpts,
sizeof (
g2int ));
+
+
+
+
+
63 intbmap = calloc(ngpts,
sizeof (
g2int ));
+
64 gbits (cgrib, intbmap, *iofst, 1, 0, ngpts);
+
65 *iofst = *iofst + ngpts;
+
66 for (j = 0; j < ngpts; j++)
+
67 lbmap[j] = (
g2int )intbmap[j];
+
+
+
+
+
+
+
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+g2int g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap)
This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack7_8c.html b/ver-1.7.0/g2__unpack7_8c.html
new file mode 100644
index 00000000..f4ac06aa
--- /dev/null
+++ b/ver-1.7.0/g2__unpack7_8c.html
@@ -0,0 +1,241 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack7.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack Section 7 (Data Section) as defined in GRIB Edition 2.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include <memory.h>
+
#include <string.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Unpack Section 7 (Data Section) as defined in GRIB Edition 2.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition in file g2_unpack7.c .
+
+
+
◆ g2_unpack7()
+
+
+
+
+
+ g2int g2_unpack7
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int
+ igdsnum ,
+
+
+
+
+ g2int *
+ igdstmpl ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float **
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2002-12-20 Gilbert Added GDT info to arguments and added 5.51 processing.
+
+2003-08-29 Gilbert New templates using PNG and JPEG2000 algorithms/templates.
+
+2004-11-29 Gilbert JPEG2000 now allowed to use WMO Template 5.40 PNG allowed to use 5.41
+
+2004-12-16 Taylor Added check on comunpack return code.
+
+2008-12-23 Wesley Initialize Number of data points unpacked
+
+
Parameters
+
+ cgrib char array containing Section 7 of the GRIB2 message
+ iofst Bit offset of the beginning of Section 7 in cgrib.
+ igdsnum Grid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
+ igdstmpl Pointer to an integer array containing the data values for the specified Grid Definition Template (N=igdsnum). Each element of this integer array contains an entry (in the order specified) of Grid Definition Template 3.N. (Only used for DRS Template 5.51).
+ idrsnum Data Representation Template Number (see Code Table 5.0)
+ idrstmpl Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N
+ ndpts Number of data points unpacked and returned.
+ fld Pointer to a float array containing the unpacked data field.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 55 of file g2_unpack7.c .
+
+
References comunpack() , G2_NO_ERROR , G2_UNPACK7_BAD_DRT , G2_UNPACK7_CORRUPT_SEC , G2_UNPACK7_WRONG_GDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , jpcunpack() , pngunpack() , rdieee() , simunpack() , and specunpack() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/g2__unpack7_8c.js b/ver-1.7.0/g2__unpack7_8c.js
new file mode 100644
index 00000000..4989a9e2
--- /dev/null
+++ b/ver-1.7.0/g2__unpack7_8c.js
@@ -0,0 +1,4 @@
+var g2__unpack7_8c =
+[
+ [ "g2_unpack7", "g2__unpack7_8c.html#a3469bd6d6e13e1180753a5629ace639d", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/g2__unpack7_8c_source.html b/ver-1.7.0/g2__unpack7_8c_source.html
new file mode 100644
index 00000000..094593a6
--- /dev/null
+++ b/ver-1.7.0/g2__unpack7_8c_source.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: g2_unpack7.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
64 gbit (cgrib, &lensec, *iofst, 32);
+
+
66 gbit (cgrib, &isecnum, *iofst, 8);
+
+
+
+
+
+
+
73 if (!(lfld = calloc(ndpts ? ndpts : 1,
sizeof (
float ))))
+
+
+
+
+
+
79 simunpack (cgrib + ipos, idrstmpl, ndpts, lfld);
+
80 else if (idrsnum == 2 || idrsnum == 3)
+
+
82 if (
comunpack (cgrib+ipos, lensec, idrsnum, idrstmpl, ndpts, lfld))
+
+
+
85 else if (idrsnum == 50)
+
+
87 simunpack (cgrib + ipos, idrstmpl, ndpts - 1, lfld + 1);
+
88 rdieee (idrstmpl + 4, lfld, 1);
+
+
90 else if (idrsnum == 51)
+
+
92 if (igdsnum >= 50 && igdsnum <= 53)
+
93 specunpack (cgrib + ipos, idrstmpl, ndpts, igdstmpl[0], igdstmpl[2],
+
+
+
+
97 fprintf(stderr,
"g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n" ,
+
+
+
+
+
+
+
+
105 #if defined USE_JPEG2000 || defined USE_OPENJPEG
+
106 else if (idrsnum == 40 || idrsnum == 40000)
+
+
108 jpcunpack (cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
+
+
+
+
112 else if (idrsnum == 41 || idrsnum == 40010)
+
+
114 pngunpack (cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
+
+
+
+
+
119 fprintf(stderr,
"g2_unpack7: Data Representation Template 5.%d not yet "
+
120 "implemented.\n" , (
int )idrsnum);
+
+
+
+
+
+
+
127 *iofst = *iofst + (8 * lensec);
+
+
+
+
+
+#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
+#define G2_NO_ERROR
Function succeeded.
+#define G2_UNPACK7_CORRUPT_SEC
In g2_unpack7(), corrupt section 7.
+void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+#define G2_UNPACK7_BAD_DRT
In g2_unpack7(), unrecognized Data Representation Template.
+g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
+g2int simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
+int comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in ...
+g2int g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
+g2int specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, float *fld)
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...
+#define G2_UNPACK7_WRONG_GDT
In g2_unpack7(), need one of GDT 3.50 through 3.53 to decode DRT 5.51.
+
+
+
+
diff --git a/ver-1.7.0/gbits_8c.html b/ver-1.7.0/gbits_8c.html
new file mode 100644
index 00000000..98e41e33
--- /dev/null
+++ b/ver-1.7.0/gbits_8c.html
@@ -0,0 +1,387 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gbits.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Functions to pack and unpack bits to/from a packed bit string.
+More...
+
+
Go to the source code of this file.
+
+
+void gbit (unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
+ Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array. More...
+
+void gbits (unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
+ Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array. More...
+
+void sbit (unsigned char *out, g2int *in, g2int iskip, g2int nbits)
+ Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array. More...
+
+void sbits (unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
+ Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array. More...
+
+
+
+
Functions to pack and unpack bits to/from a packed bit string.
+
Author NOAA Programmer
+
+
Definition in file gbits.c .
+
+
+
◆ gbit()
+
+
+
+
+
+ void gbit
+ (
+ unsigned char *
+ in ,
+
+
+
+
+ g2int *
+ iout ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits
+
+
+
+ )
+
+
+
+
+
+
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.
+
Parameters
+
+ in pointer to character array input.
+ iout pointer to unpacked array output.
+ iskip initial number of bits to skip.
+ nbits number of bits to take.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 20 of file gbits.c .
+
+
References gbits() .
+
+
Referenced by comunpack() , g2_addfield() , g2_addgrid() , g2_addlocal() , g2_getfld() , g2_gribend() , g2_info() , g2_unpack1() , g2_unpack2() , g2_unpack3() , g2_unpack4() , g2_unpack5() , g2_unpack6() , g2_unpack7() , g2c_check_msg() , and seekgb() .
+
+
+
+
+
◆ gbits()
+
+
+
+
+
+ void gbits
+ (
+ unsigned char *
+ in ,
+
+
+
+
+ g2int *
+ iout ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ nskip ,
+
+
+
+
+ g2int
+ n
+
+
+
+ )
+
+
+
+
+
+
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.
+
Parameters
+
+ in Pointer to character array input.
+ iout Pointer to unpacked array output.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to take.
+ nskip Additional number of bits to skip on each iteration.
+ n Number of iterations.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 57 of file gbits.c .
+
+
Referenced by comunpack() , g2_unpack3() , g2_unpack4() , g2_unpack6() , gbit() , pngunpack_int() , simunpack() , and specunpack() .
+
+
+
+
+
◆ sbit()
+
+
+
+
+
+ void sbit
+ (
+ unsigned char *
+ out ,
+
+
+
+
+ g2int *
+ in ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits
+
+
+
+ )
+
+
+
+
+
+
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.
+
Parameters
+
+ out Pointer to packed array output. Must be allocated large enough to hold output.
+ in Pointer to unpacked array input.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to pack.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 38 of file gbits.c .
+
+
References sbits() .
+
+
Referenced by compack() , g2_addfield() , g2_addgrid() , g2_addlocal() , g2_create() , g2_gribend() , misspack() , and simpack() .
+
+
+
+
+
◆ sbits()
+
+
+
+
+
+ void sbits
+ (
+ unsigned char *
+ out ,
+
+
+
+
+ g2int *
+ in ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ nskip ,
+
+
+
+
+ g2int
+ n
+
+
+
+ )
+
+
+
+
+
+
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.
+
Parameters
+
+ out Pointer to packed array output. Must be allocated large enough to hold output.
+ in Pointer to unpacked array input.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to pack.
+ nskip Additional number of bits to skip on each iteration.
+ n Number of iterations.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 114 of file gbits.c .
+
+
Referenced by compack() , g2_addfield() , g2_addgrid() , jpcpack_int() , misspack() , pngpack_int() , sbit() , and simpack() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/gbits_8c.js b/ver-1.7.0/gbits_8c.js
new file mode 100644
index 00000000..30d630f5
--- /dev/null
+++ b/ver-1.7.0/gbits_8c.js
@@ -0,0 +1,7 @@
+var gbits_8c =
+[
+ [ "gbit", "gbits_8c.html#a1efb9739e947d94010aeba6daf62eca3", null ],
+ [ "gbits", "gbits_8c.html#a31ebdbbf262b7478d6a7cc4326f76ade", null ],
+ [ "sbit", "gbits_8c.html#af9e044ba7da32a5415e351ed647ef676", null ],
+ [ "sbits", "gbits_8c.html#a92b32e56ff8941c5026d460f4fe2aec3", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/gbits_8c_source.html b/ver-1.7.0/gbits_8c_source.html
new file mode 100644
index 00000000..740e18c9
--- /dev/null
+++ b/ver-1.7.0/gbits_8c_source.html
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gbits.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
60 g2int i, tbit, bitcnt, ibit, itmp;
+
+
62 static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
+
+
+
+
66 for (i = 0; i < n; i++)
+
+
+
+
+
71 nbit = nbit + nbits + nskip;
+
+
+
74 tbit = (bitcnt < (8 - ibit)) ? bitcnt : 8 - ibit;
+
75 itmp = (int)*(in + index) & ones[7 - ibit];
+
76 if (tbit != 8 - ibit) itmp >>= (8 - ibit - tbit);
+
+
78 bitcnt = bitcnt - tbit;
+
+
+
+
+
83 itmp = itmp << 8 | (int)*(in + index);
+
+
+
+
+
+
+
+
91 itmp = ( itmp << bitcnt ) |
+
92 (((
int )*(in + index) >> (8 - bitcnt)) & ones[bitcnt - 1]);
+
+
+
+
+
+
+
+
+
+
+
117 g2int i, bitcnt, tbit, ibit, itmp, imask, itmp2, itmp3;
+
+
119 static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
+
+
+
+
123 nbit = iskip + nbits - 1;
+
124 for (i = 0; i < n; i++)
+
+
+
+
+
+
130 nbit = nbit + nbits + nskip;
+
+
+
+
+
135 tbit = (bitcnt < (ibit+1)) ? bitcnt : ibit + 1;
+
136 imask = ones[tbit - 1] << (7 - ibit);
+
137 itmp2 = (itmp << (7 - ibit)) & imask;
+
138 itmp3 = (int)*(out + index) & (255 - imask);
+
139 out[index] = (
unsigned char)(itmp2 | itmp3);
+
140 bitcnt = bitcnt - tbit;
+
+
+
+
+
+
+
+
+
149 out[index] = (
unsigned char)(itmp & 255);
+
+
+
+
+
+
+
+
+
158 itmp2 = itmp & ones[bitcnt - 1];
+
159 itmp3 = (int)*(out + index) & (255 - ones[bitcnt - 1]);
+
160 out[index] = (
unsigned char)(itmp2 | itmp3);
+
+
+
+
+
+
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+int64_t g2int
Long integer type.
+void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+
+
+
+
diff --git a/ver-1.7.0/getdim_8c.html b/ver-1.7.0/getdim_8c.html
new file mode 100644
index 00000000..9ffe86eb
--- /dev/null
+++ b/ver-1.7.0/getdim_8c.html
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: getdim.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Return the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int getdim (unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
+ This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format. More...
+
+
+
+
Return the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition in file getdim.c .
+
+
+
◆ getdim()
+
+
+
+
+
+ g2int getdim
+ (
+ unsigned char *
+ csec3 ,
+
+
+
+
+ g2int *
+ width ,
+
+
+
+
+ g2int *
+ height ,
+
+
+
+
+ g2int *
+ iscan
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
+
Parameters
+
+ csec3 Character array that contains the packed GRIB2 GDS.
+ width x (or i) dimension of the grid. 0 if grid is not recognized.
+ height y (or j) dimension of the grid. 0 if grid is not recognized.
+ iscan Scanning mode (see Table 3.4 ). 0 of grid not recognized.
+
+
+
+
Returns Always returns 0.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition at line 29 of file getdim.c .
+
+
References g2_unpack3() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/getdim_8c.js b/ver-1.7.0/getdim_8c.js
new file mode 100644
index 00000000..5e739da4
--- /dev/null
+++ b/ver-1.7.0/getdim_8c.js
@@ -0,0 +1,4 @@
+var getdim_8c =
+[
+ [ "getdim", "getdim_8c.html#aabc49a338fae74f6dfc9e98b6cb59de7", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/getdim_8c_source.html b/ver-1.7.0/getdim_8c_source.html
new file mode 100644
index 00000000..c0857c14
--- /dev/null
+++ b/ver-1.7.0/getdim_8c_source.html
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: getdim.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
31 g2int *igdstmpl = NULL, *list_opt = NULL;
+
+
33 g2int iofst, igdtlen, num_opt, jerr;
+
+
+
36 if (!(jerr =
g2_unpack3 (csec3, &iofst, &igds, &igdstmpl, &igdtlen,
+
37 &list_opt, &num_opt)))
+
+
+
+
+
+
+
+
+
+
47 *height = igdstmpl[8];
+
48 *iscan = igdstmpl[18];
+
+
+
+
+
+
54 *height = igdstmpl[8];
+
55 *iscan = igdstmpl[15];
+
+
+
+
+
+
61 *height = igdstmpl[8];
+
62 *iscan = igdstmpl[17];
+
+
+
+
+
+
68 *height = igdstmpl[8];
+
69 *iscan = igdstmpl[17];
+
+
+
+
+
+
+
+
+
78 *height = igdstmpl[8];
+
79 *iscan = igdstmpl[18];
+
+
+
+
+
+
85 *height = igdstmpl[8];
+
86 *iscan = igdstmpl[16];
+
+
+
+
+
+
92 *height = igdstmpl[8];
+
93 *iscan = igdstmpl[15];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+g2int getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid De...
+Header file with internal function prototypes NCEPLIBS-g2c library.
+int64_t g2int
Long integer type.
+g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+
+
+
+
diff --git a/ver-1.7.0/getpoly_8c.html b/ver-1.7.0/getpoly_8c.html
new file mode 100644
index 00000000..15ecacf7
--- /dev/null
+++ b/ver-1.7.0/getpoly_8c.html
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: getpoly.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Return the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section used spherical harmonic coefficients using GDT 5.50 through 5.53.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int getpoly (unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
+ This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section (GDS) used spherical harmonic coefficients using GDT 5.50 through 5.53. More...
+
+
+
+
Return the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section used spherical harmonic coefficients using GDT 5.50 through 5.53.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition in file getpoly.c .
+
+
+
◆ getpoly()
+
+
+
+
+
+ g2int getpoly
+ (
+ unsigned char *
+ csec3 ,
+
+
+
+
+ g2int *
+ jj ,
+
+
+
+
+ g2int *
+ kk ,
+
+
+
+
+ g2int *
+ mm
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section (GDS) used spherical harmonic coefficients using GDT 5.50 through 5.53.
+
If 51 - complex data spectral packing is used as the data representation template number (see Table 5.0 ), then the Grid Definition Template Number in section 3 should be one of:
+50: Spherical Harmonic Coefficients (See Template 3.50)
+51: Rotated Spherical Harmonic Coefficients (See Template 3.51)
+52: Stretched Spherical Harmonic Coefficients (See Template 3.52)
+53: Rotated and Stretched Spherical Harmonic Coefficients (See Template 3.53)
+
+
Parameters
+
+ csec3 Character array that contains the packed GRIB2 GDS.
+ jj J pentagonal resolution parameter.
+ kk K pentagonal resolution parameter.
+ mm M pentagonal resolution parameter.
+
+
+
+
Returns always returns 0.
+
Note Returns jj, kk, and mm set to zero, if grid template not recognized.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition at line 40 of file getpoly.c .
+
+
References g2_unpack3() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/getpoly_8c.js b/ver-1.7.0/getpoly_8c.js
new file mode 100644
index 00000000..4a760148
--- /dev/null
+++ b/ver-1.7.0/getpoly_8c.js
@@ -0,0 +1,4 @@
+var getpoly_8c =
+[
+ [ "getpoly", "getpoly_8c.html#aa8f99915cc3bf0efa7544cf3c2e1b552", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/getpoly_8c_source.html b/ver-1.7.0/getpoly_8c_source.html
new file mode 100644
index 00000000..db654c68
--- /dev/null
+++ b/ver-1.7.0/getpoly_8c_source.html
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: getpoly.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
43 g2int *igdstmpl, *list_opt;
+
+
45 g2int iofst, igdtlen, num_opt;
+
+
+
48 if (!
g2_unpack3 (csec3, &iofst, &igds, &igdstmpl, &igdtlen,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Header file with internal function prototypes NCEPLIBS-g2c library.
+int64_t g2int
Long integer type.
+g2int getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Def...
+g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+
+
+
+
diff --git a/ver-1.7.0/globals.html b/ver-1.7.0/globals.html
new file mode 100644
index 00000000..9767a13d
--- /dev/null
+++ b/ver-1.7.0/globals.html
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Globals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+
+
- a -
+
+
+
+
+
+
diff --git a/ver-1.7.0/globals_defs.html b/ver-1.7.0/globals_defs.html
new file mode 100644
index 00000000..b92fe302
--- /dev/null
+++ b/ver-1.7.0/globals_defs.html
@@ -0,0 +1,340 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Globals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- a -
+
+
+
- b -
+
+
+
- f -
+
+
+
- g -
+
+
+
- l -
+
+
+
- m -
+
+
+
- t -
+
+
+
+
+
+
diff --git a/ver-1.7.0/globals_func.html b/ver-1.7.0/globals_func.html
new file mode 100644
index 00000000..a61b55fc
--- /dev/null
+++ b/ver-1.7.0/globals_func.html
@@ -0,0 +1,396 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Globals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- c -
+
+
+
- d -
+
+
+
- e -
+
+
+
- g -
+g2_addfield()
+: g2_addfield.c
+, grib2.h
+
+g2_addgrid()
+: grib2.h
+, g2_addgrid.c
+
+g2_addlocal()
+: g2_addlocal.c
+, grib2.h
+
+g2_create()
+: grib2.h
+, g2_create.c
+
+g2_free()
+: g2_free.c
+, grib2.h
+
+g2_getfld()
+: g2_getfld.c
+, grib2.h
+
+g2_gribend()
+: g2_gribend.c
+, grib2.h
+
+g2_info()
+: grib2.h
+, g2_info.c
+
+g2_miss()
+: g2_miss.c
+
+g2_unpack1()
+: g2_unpack1.c
+, grib2.h
+
+g2_unpack2()
+: g2_unpack2.c
+, grib2.h
+
+g2_unpack3()
+: g2_unpack3.c
+, grib2.h
+
+g2_unpack4()
+: g2_unpack4.c
+, grib2.h
+
+g2_unpack5()
+: g2_unpack5.c
+, grib2.h
+
+g2_unpack6()
+: g2_unpack6.c
+, grib2.h
+
+g2_unpack7()
+: grib2.h
+, g2_unpack7.c
+
+g2c_check_msg()
+: grib2_int.h
+, util.c
+
+g2c_set_log_level()
+: util.c
+, grib2.h
+
+gbit()
+: grib2_int.h
+, gbits.c
+
+gbits()
+: grib2_int.h
+, gbits.c
+
+getdim()
+: getdim.c
+, grib2_int.h
+
+getdrsindex()
+: drstemplates.c
+
+getdrstemplate()
+: drstemplates.c
+, grib2_int.h
+
+getgridindex()
+: gridtemplates.c
+
+getgridtemplate()
+: gridtemplates.c
+, grib2_int.h
+
+getpdsindex()
+: pdstemplates.c
+
+getpdstemplate()
+: grib2_int.h
+, pdstemplates.c
+
+getpoly()
+: getpoly.c
+, grib2_int.h
+
+
+
+
+
- i -
+
+
+
- j -
+
+
+
- m -
+
+
+
- p -
+
+
+
- r -
+
+
+
- s -
+
+
+
- u -
+
+
+
+
+
+
diff --git a/ver-1.7.0/globals_type.html b/ver-1.7.0/globals_type.html
new file mode 100644
index 00000000..f235d0d3
--- /dev/null
+++ b/ver-1.7.0/globals_type.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Globals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/globals_vars.html b/ver-1.7.0/globals_vars.html
new file mode 100644
index 00000000..ba0b65c5
--- /dev/null
+++ b/ver-1.7.0/globals_vars.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Globals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/grib2_8h.html b/ver-1.7.0/grib2_8h.html
new file mode 100644
index 00000000..c0cd285c
--- /dev/null
+++ b/ver-1.7.0/grib2_8h.html
@@ -0,0 +1,3772 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: grib2.h File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Header file for NCEPLIBS-g2c library.
+More...
+
#include <stdio.h>
+#include <stdint.h>
+
+
Go to the source code of this file.
+
+
+#define G2_ADD_MSG_COMPLETE -2
+ GRIB message already complete. More...
+
+#define G2_ADD_MSG_INIT -1
+ GRIB message was not initialized - call g2_create() first. More...
+
+#define G2_ADDFIELD_BAD_BITMAP -8
+ In g2_addfield() no bitmap in the GRIB message. More...
+
+#define G2_ADDFIELD_BAD_DRT -7
+ In g2_addfield() unsupported Data Representationi Template. More...
+
+#define G2_ADDFIELD_BAD_GDS -6
+ In g2_addfield() section 3 (GDS) not previously defined in message. More...
+
+#define G2_ADDFIELD_BAD_GDT -9
+ In g2_addfield() GDT of one of 5.50 through 5.53 required when using DRT 5.51. More...
+
+#define G2_ADDFIELD_BAD_PDT -5
+ In g2_addfield() could not find requested Product Definition Template. More...
+
+#define G2_ADDFIELD_ERR -10
+ In g2_addfield() error packing data field. More...
+
+#define G2_ADDGRID_BAD_GDT -5
+ In g2_addgrid() Could not find requested Grid Definition Template. More...
+
+#define G2_BAD_SEC -4
+ Previous Section was unexpected. More...
+
+#define G2_BAD_SEC_COUNTS -3
+ Sum of Section byte counts doesn't add to total byte count. More...
+
+#define G2_CREATE_GRIB_VERSION -1
+ Wrong GRIB version for g2_create() , must be 2. More...
+
+#define G2_GETFLD_BAD_END 7
+ g2_getfld() didn't find "7777" at end of message. More...
+
+#define G2_GETFLD_BAD_SEC1 15
+ Error in g2_getfld() unpacking section 1. More...
+
+#define G2_GETFLD_BAD_SEC2 16
+ Error in g2_getfld() unpacking section 2. More...
+
+#define G2_GETFLD_BAD_SEC3 10
+ Error in g2_getfld() unpacking section 3. More...
+
+#define G2_GETFLD_BAD_SEC4 11
+ Error in g2_getfld() unpacking section 4. More...
+
+#define G2_GETFLD_BAD_SEC5 12
+ Error in g2_getfld() unpacking section 5. More...
+
+#define G2_GETFLD_BAD_SEC6 13
+ Error in g2_getfld() unpacking section 6. More...
+
+#define G2_GETFLD_BAD_SEC7 14
+ Error in g2_getfld() unpacking section 7. More...
+
+#define G2_GETFLD_GRIB_VERSION 2
+ Wrong GRIB version for g2_getfld() , must be 2. More...
+
+#define G2_GETFLD_INVAL 3
+ g2_getfld() data field request number was not positive. More...
+
+#define G2_GETFLD_INVAL_SEC 8
+ g2_getfld() encountered unrecognized section. More...
+
+#define G2_GETFLD_NO_BITMAP 17
+ In g2_getfld() previous bitmap specified, yet none exists. More...
+
+#define G2_GETFLD_NO_DRT 9
+ In g2_getfld() , Data Representation Template not implemented. More...
+
+#define G2_GETFLD_NO_GRIB 1
+ g2_getfld() can't find beginning characters "GRIB". More...
+
+#define G2_GETFLD_WRONG_END 4
+ g2_info() found "7777" not where expected. More...
+
+#define G2_GETFLD_WRONG_NFLDS 6
+ In g2_getfld() message did not contain the requested number of data fields. More...
+
+#define G2_GRIBEND_MSG_INIT -1
+ In g2_gribend() GRIB message was not initialized - call g2_create() first. More...
+
+#define G2_INFO_BAD_END 5
+ g2_info() didn't find "7777" at end of message. More...
+
+#define G2_INFO_GRIB_VERSION 2
+ Wrong GRIB version for g2_info() , must be 2. More...
+
+#define G2_INFO_INVAL_SEC 6
+ g2_info() found invalid section number. More...
+
+#define G2_INFO_NO_GRIB 1
+ g2_info() can't find beginning characters "GRIB". More...
+
+#define G2_INFO_NO_SEC1 3
+ g2_info() can't find section 1. More...
+
+#define G2_INFO_WRONG_END 4
+ g2_info() found "7777" not where expected. More...
+
+#define G2_JASPER_DECODE -3
+ In dec_jpeg2000() error decoding image with jasper. More...
+
+#define G2_JASPER_DECODE_COLOR -5
+ In dec_jpeg2000() decoded image had multiple color components. More...
+
+#define G2_JASPER_ENCODE -3
+ In enc_jpeg2000() error encoding image with jasper. More...
+
+#define G2_JASPER_INIT -2
+ In enc_jpeg2000() /dec_jpeg2000() error initializing jasper library. More...
+
+#define G2_JPCUNPACK_MEM 1
+ In jpcunpack() or other unpack function: out of memory. More...
+
+#define G2_JPEG2000_ENABLED 1
+ Decoding/encoding JPEG2000 is enabled. More...
+
+#define G2_NO_ERROR 0
+ Function succeeded. More...
+
+#define G2_PNG_ENABLED 1
+ Decoding/encoding PNG is enabled. More...
+
+#define G2_SPECUNPACK_TYPE -3
+ In specunpack() Can't handle 64 or 128 bit floats. More...
+
+#define G2_UNPACK3_BAD_GDT 5
+ In g2_unpack3() , undefined Grid Definition Template. More...
+
+#define G2_UNPACK4_BAD_PDT 5
+ In g2_unpack4() , undefined Product Definition Template. More...
+
+#define G2_UNPACK5_BAD_DRT 7
+ In g2_unpack5() , undefined Data Representation Template. More...
+
+#define G2_UNPACK6_BAD_BITMAP 4
+ In g2_unpack6() , unrecognized pre-defined bit-map. More...
+
+#define G2_UNPACK7_BAD_DRT 4
+ In g2_unpack7() , unrecognized Data Representation Template. More...
+
+#define G2_UNPACK7_CORRUPT_SEC 7
+ In g2_unpack7() , corrupt section 7. More...
+
+#define G2_UNPACK7_WRONG_GDT 5
+ In g2_unpack7() , need one of GDT 3.50 through 3.53 to decode DRT 5.51. More...
+
+#define G2_UNPACK_BAD_SEC 2
+ Bad section number in unpacking function. More...
+
+#define G2_UNPACK_NO_MEM 6
+ Error allocating memory in unpack function. More...
+
+#define G2_VERSION "1.7.0"
+ Current version of NCEPLIBS-g2c library. More...
+
+#define G2C_MSG_COMPLETE -51
+ GRIB message already complete. More...
+
+#define G2C_NO_ERROR 0
+ No error. More...
+
+#define G2C_NOT_GRIB -50
+ GRIB header not found. More...
+
+
+
+g2int g2_addfield (unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
+ This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message. More...
+
+g2int g2_addgrid (unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum)
+ This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message. More...
+
+g2int g2_addlocal (unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
+ This routine adds a Local Use Section (Section 2) to a GRIB2 message. More...
+
+g2int g2_create (unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
+ This routine initializes a new GRIB2 message and packs GRIB2 Section 0 (Indicator Section) and Section 1 (Identification Section) . More...
+
+void g2_free (gribfield *gfld)
+ This routine frees up memory that was allocated for struct gribfield. More...
+
+g2int g2_getfld (unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
+ This subroutine returns all the metadata, template values, bit-map (if applicable), and the unpacked data for a given data field. More...
+
+g2int g2_gribend (unsigned char *cgrib)
+ This routine finalizes a GRIB2 message after all grids and fields have been added. More...
+
+g2int g2_info (unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal)
+ This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections. More...
+
+g2int g2_unpack1 (unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
+ This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2. More...
+
+g2int g2_unpack2 (unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2)
+ This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2. More...
+
+g2int g2_unpack3 (unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
+ This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2. More...
+
+g2int g2_unpack4 (unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, float **coordlist, g2int *numcoord)
+ This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2. More...
+
+g2int g2_unpack5 (unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen)
+ This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2. More...
+
+g2int g2_unpack6 (unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap)
+ This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2. More...
+
+g2int g2_unpack7 (unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
+ This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More...
+
+int g2c_set_log_level (int new_level)
+ Use this to set the global log level. More...
+
+void jpcpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field into a JPEG2000 code stream. More...
+
+void jpcpackd (double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field into a JPEG2000 code stream. More...
+
+g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
+ Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+g2int jpcunpackd (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
+ Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+void pngpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a float data field into PNG image format. More...
+
+void pngpackd (double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a double data field into PNG image format. More...
+
+g2int pngunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
+ This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010. More...
+
+g2int pngunpackd (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
+ This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010. More...
+
+void seekgb (FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
+ This subprogram searches a file for the next GRIB Message. More...
+
+
+
+
Header file for NCEPLIBS-g2c library.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-25 Gilbert Initial
+
+2009-01-14 Vuong Changed struct template to gtemplate
+
+2021-11-9 Ed Hartnett Moved many prototypes to new internal header grib2_int.h .
+
+2022-04-15 Ed Hartnett Added error codes related to JPEG.
+
+2022-08-15 Ed Hartnett Added compression functions for double.
+
+
Author Stephen Gilbert
+
Date 2002-10-25
+
Author Ed Hartnett
+
+
Definition in file grib2.h .
+
+
+
◆ gribfield
+
+
+
+
Struct for GRIB field.
+
+
Definition at line 41 of file grib2.h .
+
+Data Fields
+
+g2int *
+
+bmap
+
+Integer array containing decoded bitmap, if ibmap=0 or ibap=254. Otherwise NULL.
+
+
+ float *
+
+coord_list
+
+Array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels (part of Section 4).
+
+g2int
+
+discipline
+
+Message Discipline (see Table 0.0 ).
+
+g2int
+
+expanded
+
+Logical value indicating whether the data field was expanded to the grid in the case where a bit-map is present. If true, the data points in fld match the grid points and zeros were inserted at grid points where data was bit-mapped out. If false, the data values in ld were not expanded to the grid and are just a consecutive array of data points corresponding to each value of "1" in bmap.
+
+
+ float *
+
+fld
+
+Array of ndpts unpacked data points.
+
+g2int
+
+griddef
+
+Source of grid definition (see Table 3.0 ).
+0 Specified in Table 3.1 .
+1 Predetermined grid Defined by originating centre.
+
+
+
+
+
+g2int
+
+ibmap
+
+Bitmap indicator (see Table 6.0 ).
+0 bitmap applies and is included in Section 6.
+1-253 = Predefined bitmap applies
+254 = Previously defined bitmap applies to this field
+255 = Bit map does not apply to this product.
+
+
+
+g2int
+
+idrtlen
+
+Number of elements in idrtmpl.
+
+g2int *
+
+idrtmpl
+
+Contains the data values for the Data Representation Template specified by idrtnum.
+
+g2int
+
+idrtnum
+
+Data Representation Template Number (see Table 5.0 ).
+
+g2int *
+
+idsect
+
+Contains the entries in the Identification Section (Section 1) .
+idsect[0] Identification of originating Centre (see Table 0 ). 7 is the identification for the US National Weather Service.
+idsect[1] Identification of originating Sub-centre. (See Table C ).
+idsect[2] GRIB Master Tables Version Number (see Table 1.0 ).
+0 Experimental
+1 Initial operational version number
+
+
+idsect[3] GRIB Local Tables Version Number (see Table 1.1 ).
+0 Local tables not used
+1-254 Number of local tables version used
+
+
+idsect[4] Significance of Reference Time (See Table 1.2 ).
+0 Analysis
+1 Start of forecast
+2 Verifying time of forecast
+3 Observation time
+
+
+idsect[5] Year (4 digits)
+idsect[6] Month
+idsect[7) Day
+idsect[8] Hour
+idsect[9] Minute
+idsect[10] Second
+idsect[11] Production status of processed data (see Table 1.3 ).
+0 Operational products
+1 Operational test products
+2 Research products
+3 Re-analysis products
+
+
+idsect[12] Type of processed data (see Table 1.4 ).
+0 Analysis products
+1 Forecast products
+2 Analysis and forecast products
+3 Control forecast products
+4 Perturbed forecast products
+5 Control and perturbed forecast products
+6 Processed satellite observations
+7 Processed radar observations
+
+
+
+
+
+g2int
+
+idsectlen
+
+Number of elements in idsect.
+
+g2int
+
+ifldnum
+
+Field number within GRIB message.
+
+g2int
+
+igdtlen
+
+Number of elements in igdtmpl - i.e. number of entries in Grid Defintion Template.
+
+
+g2int *
+
+igdtmpl
+
+Contains the data values for the Grid Definition Template specified by igdtnum.
+
+g2int
+
+igdtnum
+
+Grid Definition Template Number (See Table 3.1 ).
+
+g2int
+
+interp_opt
+
+Interpretation of list for optional points definition. (See Table 3.11 ).
+
+
+g2int
+
+ipdtlen
+
+Number of elements in ipdtmpl - i.e. number of entries in Product Defintion Template.
+
+
+g2int *
+
+ipdtmpl
+
+Contains the data values for the Product Definition Template specified by ipdtnum.
+
+g2int
+
+ipdtnum
+
+Product Definition Template Number (see Table 4.0 ).
+
+g2int *
+
+list_opt
+
+(Used if numoct_opt .ne. 0) This array contains the number of grid points contained in each row (or column) (part of Section 3). NULL if numoct_opt = 0.
+
+
+ unsigned char *
+
+local
+
+Pointer to character array containing contents of Local Section 2, if included.
+
+g2int
+
+locallen
+
+Length of array local.
+
+g2int
+
+ndpts
+
+Number of data points unpacked and returned.
+
+g2int
+
+ngrdpts
+
+Number of grid points in the defined grid.
+
+g2int
+
+num_coord
+
+Number of values in array coord_list.
+
+g2int
+
+num_opt
+
+(Used if numoct_opt .ne. 0) The number of entries in array ideflist - i.e. number of rows (or columns) for which optional grid points are defined. This value is set to zero, if numoct_opt=0.
+
+
+g2int
+
+numoct_opt
+
+Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
+
+
+g2int
+
+unpacked
+
+Logical value indicating whether the bitmap and data values were unpacked. If false, bmap and fld pointers are NULL.
+
+
+g2int
+
+version
+
+GRIB edition number (2).
+
+
+
+
+
+
+
◆ G2_ADD_MSG_COMPLETE
+
+
+
+
+
+ #define G2_ADD_MSG_COMPLETE -2
+
+
+
+
+
GRIB message already complete.
+
Cannot add new section.
+
+
Definition at line 311 of file grib2.h .
+
+
+
+
+
◆ G2_ADD_MSG_INIT
+
+
+
+
+
+ #define G2_ADD_MSG_INIT -1
+
+
+
+
+
GRIB message was not initialized - call g2_create() first.
+
+
Definition at line 310 of file grib2.h .
+
+
+
+
+
◆ G2_ADDFIELD_BAD_BITMAP
+
+
+
+
+
+ #define G2_ADDFIELD_BAD_BITMAP -8
+
+
+
+
+
+
◆ G2_ADDFIELD_BAD_DRT
+
+
+
+
+
+ #define G2_ADDFIELD_BAD_DRT -7
+
+
+
+
+
+
◆ G2_ADDFIELD_BAD_GDS
+
+
+
+
+
+ #define G2_ADDFIELD_BAD_GDS -6
+
+
+
+
+
In g2_addfield() section 3 (GDS) not previously defined in message.
+
+
Definition at line 314 of file grib2.h .
+
+
+
+
+
◆ G2_ADDFIELD_BAD_GDT
+
+
+
+
+
+ #define G2_ADDFIELD_BAD_GDT -9
+
+
+
+
+
In g2_addfield() GDT of one of 5.50 through 5.53 required when using DRT 5.51.
+
+
Definition at line 317 of file grib2.h .
+
+
+
+
+
◆ G2_ADDFIELD_BAD_PDT
+
+
+
+
+
+ #define G2_ADDFIELD_BAD_PDT -5
+
+
+
+
+
In g2_addfield() could not find requested Product Definition Template.
+
+
Definition at line 313 of file grib2.h .
+
+
+
+
+
◆ G2_ADDFIELD_ERR
+
+
+
+
+
+ #define G2_ADDFIELD_ERR -10
+
+
+
+
+
+
◆ G2_ADDGRID_BAD_GDT
+
+
+
+
+
+ #define G2_ADDGRID_BAD_GDT -5
+
+
+
+
+
In g2_addgrid() Could not find requested Grid Definition Template.
+
+
Definition at line 319 of file grib2.h .
+
+
+
+
+
◆ G2_BAD_SEC
+
+
+
+
+
+ #define G2_BAD_SEC -4
+
+
+
+
+
Previous Section was unexpected.
+
+
Definition at line 300 of file grib2.h .
+
+
+
+
+
◆ G2_BAD_SEC_COUNTS
+
+
+
+
+
+ #define G2_BAD_SEC_COUNTS -3
+
+
+
+
+
Sum of Section byte counts doesn't add to total byte count.
+
+
Definition at line 312 of file grib2.h .
+
+
+
+
+
◆ G2_CREATE_GRIB_VERSION
+
+
+
+
+
+ #define G2_CREATE_GRIB_VERSION -1
+
+
+
+
+
+
◆ G2_GETFLD_BAD_END
+
+
+
+
+
+ #define G2_GETFLD_BAD_END 7
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC1
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC1 15
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC2
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC2 16
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC3
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC3 10
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC4
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC4 11
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC5
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC5 12
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC6
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC6 13
+
+
+
+
+
+
◆ G2_GETFLD_BAD_SEC7
+
+
+
+
+
+ #define G2_GETFLD_BAD_SEC7 14
+
+
+
+
+
+
◆ G2_GETFLD_GRIB_VERSION
+
+
+
+
+
+ #define G2_GETFLD_GRIB_VERSION 2
+
+
+
+
+
+
◆ G2_GETFLD_INVAL
+
+
+
+
+
+ #define G2_GETFLD_INVAL 3
+
+
+
+
+
g2_getfld() data field request number was not positive.
+
+
Definition at line 285 of file grib2.h .
+
+
+
+
+
◆ G2_GETFLD_INVAL_SEC
+
+
+
+
+
+ #define G2_GETFLD_INVAL_SEC 8
+
+
+
+
+
+
◆ G2_GETFLD_NO_BITMAP
+
+
+
+
+
+ #define G2_GETFLD_NO_BITMAP 17
+
+
+
+
+
In g2_getfld() previous bitmap specified, yet none exists.
+
+
Definition at line 298 of file grib2.h .
+
+
+
+
+
◆ G2_GETFLD_NO_DRT
+
+
+
+
+
+ #define G2_GETFLD_NO_DRT 9
+
+
+
+
+
In g2_getfld() , Data Representation Template not implemented.
+
+
Definition at line 290 of file grib2.h .
+
+
+
+
+
◆ G2_GETFLD_NO_GRIB
+
+
+
+
+
+ #define G2_GETFLD_NO_GRIB 1
+
+
+
+
+
+
◆ G2_GETFLD_WRONG_END
+
+
+
+
+
+ #define G2_GETFLD_WRONG_END 4
+
+
+
+
+
+
◆ G2_GETFLD_WRONG_NFLDS
+
+
+
+
+
+ #define G2_GETFLD_WRONG_NFLDS 6
+
+
+
+
+
In g2_getfld() message did not contain the requested number of data fields.
+
+
Definition at line 287 of file grib2.h .
+
+
+
+
+
◆ G2_GRIBEND_MSG_INIT
+
+
+
+
+
+ #define G2_GRIBEND_MSG_INIT -1
+
+
+
+
+
+
◆ G2_INFO_BAD_END
+
+
+
+
+
+ #define G2_INFO_BAD_END 5
+
+
+
+
+
g2_info() didn't find "7777" at end of message.
+
+
Definition at line 281 of file grib2.h .
+
+
+
+
+
◆ G2_INFO_GRIB_VERSION
+
+
+
+
+
+ #define G2_INFO_GRIB_VERSION 2
+
+
+
+
+
+
◆ G2_INFO_INVAL_SEC
+
+
+
+
+
+ #define G2_INFO_INVAL_SEC 6
+
+
+
+
+
+
◆ G2_INFO_NO_GRIB
+
+
+
+
+
+ #define G2_INFO_NO_GRIB 1
+
+
+
+
+
g2_info() can't find beginning characters "GRIB".
+
+
Definition at line 277 of file grib2.h .
+
+
+
+
+
◆ G2_INFO_NO_SEC1
+
+
+
+
+
+ #define G2_INFO_NO_SEC1 3
+
+
+
+
+
+
◆ G2_INFO_WRONG_END
+
+
+
+
+
+ #define G2_INFO_WRONG_END 4
+
+
+
+
+
+
◆ G2_JASPER_DECODE
+
+
+
+
+
+ #define G2_JASPER_DECODE -3
+
+
+
+
+
+
◆ G2_JASPER_DECODE_COLOR
+
+
+
+
+
+ #define G2_JASPER_DECODE_COLOR -5
+
+
+
+
+
+
◆ G2_JASPER_ENCODE
+
+
+
+
+
+ #define G2_JASPER_ENCODE -3
+
+
+
+
+
+
◆ G2_JASPER_INIT
+
+
+
+
+
+ #define G2_JASPER_INIT -2
+
+
+
+
+
+
◆ G2_JPCUNPACK_MEM
+
+
+
+
+
+ #define G2_JPCUNPACK_MEM 1
+
+
+
+
+
In jpcunpack() or other unpack function: out of memory.
+
+
Definition at line 320 of file grib2.h .
+
+
+
+
+
◆ G2_JPEG2000_ENABLED
+
+
+
+
+
+ #define G2_JPEG2000_ENABLED 1
+
+
+
+
+
Decoding/encoding JPEG2000 is enabled.
+
+
Definition at line 25 of file grib2.h .
+
+
+
+
+
◆ G2_NO_ERROR
+
+
+
+
+
+ #define G2_NO_ERROR 0
+
+
+
+
+
Function succeeded.
+
+
Definition at line 275 of file grib2.h .
+
+
+
+
+
◆ G2_PNG_ENABLED
+
+
+
+
+
+ #define G2_PNG_ENABLED 1
+
+
+
+
+
Decoding/encoding PNG is enabled.
+
+
Definition at line 24 of file grib2.h .
+
+
+
+
+
◆ G2_SPECUNPACK_TYPE
+
+
+
+
+
+ #define G2_SPECUNPACK_TYPE -3
+
+
+
+
+
+
◆ G2_UNPACK3_BAD_GDT
+
+
+
+
+
+ #define G2_UNPACK3_BAD_GDT 5
+
+
+
+
+
+
◆ G2_UNPACK4_BAD_PDT
+
+
+
+
+
+ #define G2_UNPACK4_BAD_PDT 5
+
+
+
+
+
+
◆ G2_UNPACK5_BAD_DRT
+
+
+
+
+
+ #define G2_UNPACK5_BAD_DRT 7
+
+
+
+
+
+
◆ G2_UNPACK6_BAD_BITMAP
+
+
+
+
+
+ #define G2_UNPACK6_BAD_BITMAP 4
+
+
+
+
+
+
◆ G2_UNPACK7_BAD_DRT
+
+
+
+
+
+ #define G2_UNPACK7_BAD_DRT 4
+
+
+
+
+
+
◆ G2_UNPACK7_CORRUPT_SEC
+
+
+
+
+
+ #define G2_UNPACK7_CORRUPT_SEC 7
+
+
+
+
+
+
◆ G2_UNPACK7_WRONG_GDT
+
+
+
+
+
+ #define G2_UNPACK7_WRONG_GDT 5
+
+
+
+
+
In g2_unpack7() , need one of GDT 3.50 through 3.53 to decode DRT 5.51.
+
+
Definition at line 308 of file grib2.h .
+
+
+
+
+
◆ G2_UNPACK_BAD_SEC
+
+
+
+
+
+ #define G2_UNPACK_BAD_SEC 2
+
+
+
+
+
Bad section number in unpacking function.
+
+
Definition at line 301 of file grib2.h .
+
+
+
+
+
◆ G2_UNPACK_NO_MEM
+
+
+
+
+
+ #define G2_UNPACK_NO_MEM 6
+
+
+
+
+
Error allocating memory in unpack function.
+
+
Definition at line 302 of file grib2.h .
+
+
+
+
+
◆ G2_VERSION
+
+
+
+
+
+ #define G2_VERSION "1.7.0"
+
+
+
+
+
Current version of NCEPLIBS-g2c library.
+
+
Definition at line 22 of file grib2.h .
+
+
+
+
+
◆ G2C_MSG_COMPLETE
+
+
+
+
+
+ #define G2C_MSG_COMPLETE -51
+
+
+
+
+
GRIB message already complete.
+
+
Definition at line 330 of file grib2.h .
+
+
+
+
+
◆ G2C_NO_ERROR
+
+
+
+
+
+ #define G2C_NO_ERROR 0
+
+
+
+
+
No error.
+
+
Definition at line 328 of file grib2.h .
+
+
+
+
+
◆ G2C_NOT_GRIB
+
+
+
+
+
+ #define G2C_NOT_GRIB -50
+
+
+
+
+
GRIB header not found.
+
+
Definition at line 329 of file grib2.h .
+
+
+
+
+
+
◆ g2float
+
+
+
+
+
Float type.
+
This typedef is provided for backward compatibility and is not used by the library any more. Use float in new code.
+
+
Definition at line 36 of file grib2.h .
+
+
+
+
+
◆ g2int
+
+
+
+
+
+ typedef int64_t g2int
+
+
+
+
+
Long integer type.
+
+
Definition at line 28 of file grib2.h .
+
+
+
+
+
◆ g2intu
+
+
+
+
+
+ typedef uint64_t g2intu
+
+
+
+
+
Unsigned long integer type.
+
This typedef is provided for backward compatibility and is not used by the library any more.
+
+
Definition at line 32 of file grib2.h .
+
+
+
+
+
◆ gribfield
+
+
+
+
+
Struct for GRIB field.
+
+
Definition at line 217 of file grib2.h .
+
+
+
+
+
+
◆ g2_addfield()
+
+
+
+
+
+ g2int g2_addfield
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int
+ ipdsnum ,
+
+
+
+
+ g2int *
+ ipdstmpl ,
+
+
+
+
+ float *
+ coordlist ,
+
+
+
+
+ g2int
+ numcoord ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ngrdpts ,
+
+
+
+
+ g2int
+ ibmap ,
+
+
+
+
+ g2int *
+ bmap
+
+
+
+ )
+
+
+
+
+
+
This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+
They are Product Definition Section , Data Representation Section , Bit-Map Section and Data Section , respectively.
+
This routine is used with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_gribend() to create a complete GRIB2 message. Function g2_create() must be called first to initialize a new GRIB2 message. Function g2_addgrid() must be called after g2_create() and before this routine to add the appropriate grid description to the GRIB2 message. A call to g2_gribend() is required to complete GRIB2 message after all fields have been added.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-11-05 Gilbert Initial
+
+2002-12-23 Gilbert Added complex spherical harmonic packing
+
+2003-08-27 Gilbert Added support for new templates using PNG and JPEG2000 algorithms/templates.
+
+2004-11-29 Gilbert JPEG2000 now can use WMO Template 5.40 PNG can use WMO Template 5.41. Added packing algorithm check.
+
+2005-05-10 Gilbert Imposed minimum size on cpack.
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Char array that contains the GRIB2 message to which sections 4 through 7 should be added. Must be allocated large enough to store the entire GRIB2 message.
+ ipdsnum Product Definition Template Number (see Code Table 4.0 ).
+ ipdstmpl Contains the data values for the Product Definition Template specified by ipdsnum.
+ coordlist Array containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
+ numcoord number of values in array coordlist.
+ idrsnum Data Representation Template Number (see Code Table 5.0 ).
+ idrstmpl The data values for the Data Representation Template specified by idrsnum. Note that some values in this template (eg. reference values, number of bits, etc...) may be changed by the data packing algorithms. Use this to specify scaling factors and order of spatial differencing, if desired.
+ fld Array of data points to pack.
+ ngrdpts Number of data points in grid. i.e. size of fld and bmap.
+ ibmap Bitmap indicator (see Code Table 6.0 )
+0 = bitmap applies and is included in Section 6.
+1-253 = Predefined bitmap applies.
+254 = Previously defined bitmap applies to this field.
+255 = Bit map does not apply to this product.
+
+
+ bmap Integer array containing bitmap to be added (if ibmap = 0).
+
+
+
+
Returns
+
+
Note Note that the Sections 4 through 7 can only follow Section 3 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbert
+
Date 2002-11-05
+
+
Definition at line 98 of file g2_addfield.c .
+
+
References cmplxpack() , gtemplate::ext , gtemplate::extlen , extpdstemplate() , G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_ADDFIELD_BAD_BITMAP , G2_ADDFIELD_BAD_DRT , G2_ADDFIELD_BAD_GDS , G2_ADDFIELD_BAD_GDT , G2_ADDFIELD_BAD_PDT , G2_ADDFIELD_ERR , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , getdim() , getdrstemplate() , getpdstemplate() , getpoly() , jpcpack() , gtemplate::map , gtemplate::maplen , mkieee() , gtemplate::needext , pngpack() , sbit() , sbits() , simpack() , and specpack() .
+
+
+
+
+
◆ g2_addgrid()
+
+
+
+
+
+ g2int g2_addgrid
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ igds ,
+
+
+
+
+ g2int *
+ igdstmpl ,
+
+
+
+
+ g2int *
+ ideflist ,
+
+
+
+
+ g2int
+ idefnum
+
+
+
+ )
+
+
+
+
+
+
This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+
It 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.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-11-01 Gilbert Initial.
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ 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.
+igds[0] Source of grid definition (see Code Table 3.0 ).
+igds[1] Number of grid points in the defined grid.
+igds[2] Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
+igds[3] Interpretation of list for optional points definition. (See Code Table 3.11 ).
+igds[4] Grid Definition Template Number (See Code Table 3.1 ).
+
+
+ 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.
+
+
+
+
Returns
+> 0 Current size of updated GRIB2 message
+G2_ADD_MSG_INIT GRIB message was not initialized. Need to call routine gribcreate first.
+G2_ADD_MSG_COMPLETE GRIB message already complete. Cannot add new section.
+G2_BAD_SEC_COUNTS Sum of Section byte counts doesn't add to total byte count
+G2_BAD_SEC Previous Section was not 1, 2 or 7.
+G2_ADDGRID_BAD_GDT Could not find requested Grid Definition Template.
+
+
+
Note The Grid Def Section (Section 3) can only follow Section 1, 2 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition at line 70 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_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , getgridtemplate() , gtemplate::map , gtemplate::maplen , gtemplate::needext , sbit() , and sbits() .
+
+
+
+
+
◆ g2_addlocal()
+
+
+
+
+
+ g2int g2_addlocal
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ unsigned char *
+ csec2 ,
+
+
+
+
+ g2int
+ lcsec2
+
+
+
+ )
+
+
+
+
+
+
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
+
It is used with routines g2_create() , g2_addgrid() , g2_addfield() , and g2_gribend() to create a complete GRIB2 message.
+
Parameters
+
+ cgrib Char array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
+ csec2 Character array containing information to be added in Section 2.
+ lcsec2 Number of bytes of character array csec2 to be added to Section 2.
+
+
+
+
Returns > 0 = Current size of updated GRIB2 message.
+
+
Note The Local Use Section (Section 2) can only follow Section 1 or Section 7 in a GRIB2 message.
+
Author Stephen Gilbeert
+
Date 2002-11-01
+
+
Definition at line 40 of file g2_addlocal.c .
+
+
References G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , and sbit() .
+
+
+
+
+
◆ g2_create()
+
+
+
+
+
+ g2int g2_create
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ listsec0 ,
+
+
+
+
+ g2int *
+ listsec1
+
+
+
+ )
+
+
+
+
+
+
This routine initializes a new GRIB2 message and packs 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
+
+ [in] cgrib Character array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
+ [in] listsec0 Contains information needed for GRIB Indicator Section 0. Must be dimensioned >= 2.
+listsec0[0] Discipline-GRIB Master Table Number (Code Table 0.0 ).
+listsec0[1] GRIB Edition Number (currently 2).
+
+
+ [in] listsec1 Contains information needed for GRIB Identification Section 1. Must be dimensioned >= 13.
+listsec1[0] Id of orginating centre (Table 0 ).
+listsec1[1] Id of orginating sub-centre (Table C ).
+listsec1[2] GRIB Master Tables Version Number (Table 1.0 ).
+listsec1[3] GRIB Local Tables Version Number (Table 1.1 ).
+listsec1[4] Significance of Reference Time (Table 1.2 )
+listsec1[5] Reference Time - Year (4 digits)
+listsec1[6] Reference Time - Month
+listsec1[7] Reference Time - Day
+listsec1[8] Reference Time - Hour
+listsec1[9] Reference Time - Minute
+listsec1[10] Reference Time - Second
+listsec1[11] Production status of data (Table 1.3 ).
+listsec1[12] Type of processed data (Table 1.4 ).
+
+
+
+
+
+
Returns
+> 0 Current size of new GRIB2 message
+G2_CREATE_GRIB_VERSION Tried 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.
+
Author Stephen Gilbeert
+
Date 2002-10-31
+
+
Definition at line 68 of file g2_create.c .
+
+
References G2_CREATE_GRIB_VERSION , LENSEC0 , MAPSEC1LEN , and sbit() .
+
+
+
+
+
◆ g2_free()
+
+
+
+
+
+ void g2_free
+ (
+ gribfield *
+ gfld )
+
+
+
+
+
+
This routine frees up memory that was allocated for struct gribfield.
+
Parameters
+
+ gfld pointer to gribfield structure (defined in include file grib2.h ) returned from routine g2_getfld() .
+
+
+
+
Note This routine must be called to free up memory used by the decode routine, g2_getfld() , when user no longer needs to reference this data.
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition at line 24 of file g2_free.c .
+
+
References gribfield::bmap , gribfield::coord_list , gribfield::fld , gribfield::idrtmpl , gribfield::idsect , gribfield::igdtmpl , gribfield::ipdtmpl , gribfield::list_opt , and gribfield::local .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_getfld()
+
+
+
+
+
+ g2int g2_getfld
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int
+ ifldnum ,
+
+
+
+
+ g2int
+ unpack ,
+
+
+
+
+ g2int
+ expand ,
+
+
+
+
+ gribfield **
+ gfld
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns all the metadata, template values, bit-map (if applicable), and the unpacked data for a given data field.
+
All of the information returned is stored in a gribfield structure, which is defined in file grib2.h . Users of this routine will need to include grib2.h in their source code that calls this routine.
+
Since there can be multiple data fields packed into a GRIB2 message, the calling routine indicates which field is being requested with the ifldnum argument.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-28 Gilbert Initial
+
+2013-08-08 Vuong Free up memory in array igds - free(igds)
+
+
Parameters
+
+ cgrib Character pointer to the GRIB2 message.
+ ifldnum Specifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
+ unpack Boolean value indicating whether to unpack bitmap/data field.
+1 unpack bitmap (if present) and data values.
+0 do not unpack bitmap and data values.
+
+
+ expand Boolean value indicating whether the data points should be expanded to the correspond grid, if a bit-map is present. This argument is ignored if unpack == 0 OR if the returned field does not contain a bit-map.
+1 if possible, expand data field to grid, inserting zero values at gridpoints that are bitmapped out. (SEE REMARKS2)
+0 do not expand data field, leaving it an array of consecutive data points for each "1" in the bitmap.
+
+
+ gfld pointer to structure gribfield containing all decoded data for the data field.
+
+
+
+
Returns
+
+
Note Struct gribfield is allocated by this routine and it also contains pointers to many arrays of data that were allocated during decoding. Users are encouraged to free up this memory, when it is no longer needed, by an explicit call to routine g2_free() .
+
+Example:
+
+
+
+
...
+
g2_free(gfld);
+
Routine g2_info() can be used to first determine how many data fields exist in a given GRIB message.
+
Note It may not always be possible to expand a bit-mapped data field. If a pre-defined bit-map is used and not included in the GRIB2 message itself, this routine would not have the necessary information to expand the data. In this case, gfld->expanded would would be set to 0 (false), regardless of the value of input argument expand.
+
Author Stephen Gilbert
+
Date 2002-10-28
+
+
Definition at line 91 of file g2_getfld.c .
+
+
References gribfield::bmap , gribfield::coord_list , gribfield::discipline , gribfield::expanded , gribfield::fld , g2_free() , G2_GETFLD_BAD_END , G2_GETFLD_BAD_SEC1 , G2_GETFLD_BAD_SEC2 , G2_GETFLD_BAD_SEC3 , G2_GETFLD_BAD_SEC4 , G2_GETFLD_BAD_SEC5 , G2_GETFLD_BAD_SEC6 , G2_GETFLD_BAD_SEC7 , G2_GETFLD_GRIB_VERSION , G2_GETFLD_INVAL , G2_GETFLD_INVAL_SEC , G2_GETFLD_NO_BITMAP , G2_GETFLD_NO_GRIB , G2_GETFLD_WRONG_END , G2_GETFLD_WRONG_NFLDS , G2_NO_ERROR , g2_unpack1() , g2_unpack2() , g2_unpack3() , g2_unpack4() , g2_unpack5() , g2_unpack6() , g2_unpack7() , gbit() , gribfield::griddef , gribfield::ibmap , gribfield::idrtlen , gribfield::idrtmpl , gribfield::idrtnum , gribfield::idsect , gribfield::idsectlen , gribfield::ifldnum , gribfield::igdtlen , gribfield::igdtmpl , gribfield::igdtnum , gribfield::interp_opt , gribfield::ipdtlen , gribfield::ipdtmpl , gribfield::ipdtnum , gribfield::list_opt , gribfield::local , gribfield::locallen , gribfield::ndpts , gribfield::ngrdpts , gribfield::num_coord , gribfield::num_opt , gribfield::numoct_opt , gribfield::unpacked , and gribfield::version .
+
+
+
+
+
◆ g2_gribend()
+
+
+
+
+
+ g2int g2_gribend
+ (
+ unsigned char *
+ cgrib )
+
+
+
+
+
+
This routine finalizes a GRIB2 message after all grids and fields have been added.
+
It adds the End Section ("7777") to the end of the GRIB message and calculates the length and stores it in the appropriate place in Section 0. This routine is used with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_addfield() to create a complete GRIB2 message.
+
Parameters
+
+
+
+
Returns
+
+
Note This routine is intended for use with routines g2_create() , g2_addlocal() , g2_addgrid() , and g2_addfield() to create a complete GRIB2 message.
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 37 of file g2_gribend.c .
+
+
References G2_ADD_MSG_COMPLETE , G2_ADD_MSG_INIT , G2_BAD_SEC , G2_BAD_SEC_COUNTS , g2c_check_msg() , G2C_MSG_COMPLETE , G2C_NOT_GRIB , gbit() , and sbit() .
+
+
+
+
+
◆ g2_info()
+
+
+
+
+
+ g2int g2_info
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ listsec0 ,
+
+
+
+
+ g2int *
+ listsec1 ,
+
+
+
+
+ g2int *
+ numfields ,
+
+
+
+
+ g2int *
+ numlocal
+
+
+
+ )
+
+
+
+
+
+
This subroutine searches through a GRIB2 message and returns the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.
+
Also various checks are performed to see if the message is a valid GRIB2 message.
+
Parameters
+
+ cgrib Character pointer to the GRIB2 message.
+ listsec0 pointer to an array containing information decoded from GRIB Indicator Section 0. Must be allocated with >= 3 elements.
+listsec0(0) Discipline-GRIB Master Table Number (Code Table 0.0 ).
+listsec0[1] GRIB Edition Number (currently 2).
+listsec0[2] Length of GRIB message.
+
+
+ listsec1 Pointer to an array containing information read from GRIB Identification Section 1. Must be allocated with >= 13 elements.
+listsec1[0] Id of orginating centre (Table 0 ).
+listsec1[1] Id of orginating sub-centre (Table C ).
+listsec1[2] GRIB Master Tables Version Number (Table 1.0 ).
+listsec1[3] GRIB Local Tables Version Number (Table 1.1 ).
+listsec1[4] Significance of Reference Time (Table 1.2 )
+listsec1[5] Reference Time - Year (4 digits)
+listsec1[6] Reference Time - Month
+listsec1[7] Reference Time - Day
+listsec1[8] Reference Time - Hour
+listsec1[9] Reference Time - Minute
+listsec1[10] Reference Time - Second
+listsec1[11] Production status of data (Table 1.3 ).
+listsec1[12] Type of processed data (Table 1.4 ).
+
+
+ numfields The number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
+ numlocal The number of Local Use Sections ( Section 2 ) found in the GRIB message.
+
+
+
+
Returns 0 foe success, otherwise:
+
+
Author Stephen Gilbeert
+
Date 2002-10-28
+
+
Definition at line 67 of file g2_info.c .
+
+
References G2_INFO_BAD_END , G2_INFO_GRIB_VERSION , G2_INFO_INVAL_SEC , G2_INFO_NO_GRIB , G2_INFO_NO_SEC1 , G2_INFO_WRONG_END , and gbit() .
+
+
+
+
+
◆ g2_unpack1()
+
+
+
+
+
+ g2int g2_unpack1
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int **
+ ids ,
+
+
+
+
+ g2int *
+ idslen
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
+
Parameters
+
+ cgrib char array containing Section 1 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 1 in cgrib.
+ ids Pointer that gets an array which contians the information read from Section 1, the Identification section. This array is allocated by this function, and must be freed by caller (using g2_free() ).
+ids[0] Identification of originating Centre (see Table 0 ).
+ids[1] Identification of originating Sub-centre (see Table C ).
+ids[2] GRIB Master Tables Version Number (see Table 1.0 ).
+ids[3] GRIB Local Tables Version Number (see Table 1.1 ).
+ids[4] Significance of Reference Time (see Table 1.2 ).
+ids[5] Year (4 digits)
+ids[6] Month
+ids[7] Day
+ids[8] Hour
+ids[9] Minute
+ids[10] Second
+ids[11] Production status of processed data (see Table 1.3 ).
+ids[12] Type of processed data (see Table 1.4 ).
+
+
+ idslen Number of elements in ids.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition at line 55 of file g2_unpack1.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , and gbit() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_unpack2()
+
+
+
+
+
+ g2int g2_unpack2
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ lencsec2 ,
+
+
+
+
+ unsigned char **
+ csec2
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2008-12-23 Wesley Initialize lencsec2 Length of Local Use data
+
+2010-08-05 Vuong If section 2 has zero length, ierr=0
+
+
Parameters
+
+ cgrib char array containing Section 2 of the GRIB2 message.
+ iofst Pointer that contains the bit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
+ lencsec2 Length (in octets) of Local Use data.
+ csec2 Pointer to a pointer that will get an allocated array containing local use data. This memory must be freed by the caller.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 38 of file g2_unpack2.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , and gbit() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_unpack3()
+
+
+
+
+
+ g2int g2_unpack3
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int **
+ igds ,
+
+
+
+
+ g2int **
+ igdstmpl ,
+
+
+
+
+ g2int *
+ mapgridlen ,
+
+
+
+
+ g2int **
+ ideflist ,
+
+
+
+
+ g2int *
+ idefnum
+
+
+
+ )
+
+
+
+
+
+
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Char array ontaining Section 3 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 3 in cgrib.
+ igds Contains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned.
+igds[0] Source of grid definition (see Table 3.0 ).
+igds[1] Number of grid points in the defined grid.
+igds[2] Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
+igds[3] Interpretation of list for optional points definition. (See Table 3.11 )
+igds[4] Grid Definition Template Number (see Table 3.1 ).
+
+
+ igdstmpl Pointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
+ mapgridlen Number of elements in igdstmpl. i.e. number of entries in Grid Defintion Template specified by igds[4].
+ ideflist (Used if igds[2] .ne. 0) Pointer to integer array containing the number of grid points contained in each row (or column).
+ idefnum (Used if igds[2] .ne. 0) The number of entries in array ideflist - i.e. number of rows (or columns) for which optional grid points are defined.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 57 of file g2_unpack3.c .
+
+
References gtemplate::ext , extgridtemplate() , gtemplate::extlen , G2_NO_ERROR , G2_UNPACK3_BAD_GDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , gbits() , getgridtemplate() , gtemplate::map , gtemplate::maplen , and gtemplate::needext .
+
+
Referenced by g2_getfld() , getdim() , and getpoly() .
+
+
+
+
+
◆ g2_unpack4()
+
+
+
+
+
+ g2int g2_unpack4
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ ipdsnum ,
+
+
+
+
+ g2int **
+ ipdstmpl ,
+
+
+
+
+ g2int *
+ mappdslen ,
+
+
+
+
+ float **
+ coordlist ,
+
+
+
+
+ g2int *
+ numcoord
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib Array containing Section 4 of the GRIB2 message.
+ iofst Bit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
+ ipdsnum Product Definition Template Number (see Table 4.0 ).
+ ipdstmpl Pointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
+ mappdslen Number of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
+ coordlist Pointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
+ numcoord number of values in array coordlist.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 46 of file g2_unpack4.c .
+
+
References gtemplate::ext , gtemplate::extlen , extpdstemplate() , G2_NO_ERROR , G2_UNPACK4_BAD_PDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , gbits() , getpdstemplate() , gtemplate::map , gtemplate::maplen , gtemplate::needext , and rdieee() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_unpack5()
+
+
+
+
+
+ g2int g2_unpack5
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int *
+ ndpts ,
+
+
+
+
+ g2int *
+ idrsnum ,
+
+
+
+
+ g2int **
+ idrstmpl ,
+
+
+
+
+ g2int *
+ mapdrslen
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+
Parameters
+
+ cgrib char array containing Section 5 of the GRIB2 message.
+ iofst Bit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
+ ndpts Number of data points unpacked and returned.
+ idrsnum Data Representation Template Number (see Code Table 5.0).
+ idrstmpl Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N.
+ mapdrslen- Number of elements in idrstmpl. i.e. number of entries in Data Representation Template 5.N (N=idrsnum).
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 42 of file g2_unpack5.c .
+
+
References gtemplate::ext , extdrstemplate() , gtemplate::extlen , G2_NO_ERROR , G2_UNPACK5_BAD_DRT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , getdrstemplate() , gtemplate::map , gtemplate::maplen , and gtemplate::needext .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_unpack6()
+
+
+
+
+
+ g2int g2_unpack6
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int
+ ngpts ,
+
+
+
+
+ g2int *
+ ibmap ,
+
+
+
+
+ g2int **
+ bmap
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+
Parameters
+
+ cgrib char array containing Section 6 of the GRIB2 message.
+ iofst Bit offset of the beginning of Section 6 in cgrib.
+ ngpts Number of grid points specified in the bit-map
+ ibmap Bitmap indicator (see Code Table 6.0)
+0 bitmap applies and is included in Section 6.
+1-253 Predefined bitmap applies
+254 Previously defined bitmap applies to this field
+255 Bit map does not apply to this product.
+
+
+ bmap Pointer to an integer array containing decoded bitmap. (if ibmap=0)
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 33 of file g2_unpack6.c .
+
+
References G2_NO_ERROR , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , and gbits() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2_unpack7()
+
+
+
+
+
+ g2int g2_unpack7
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ iofst ,
+
+
+
+
+ g2int
+ igdsnum ,
+
+
+
+
+ g2int *
+ igdstmpl ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float **
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-31 Gilbert Initial
+
+2002-12-20 Gilbert Added GDT info to arguments and added 5.51 processing.
+
+2003-08-29 Gilbert New templates using PNG and JPEG2000 algorithms/templates.
+
+2004-11-29 Gilbert JPEG2000 now allowed to use WMO Template 5.40 PNG allowed to use 5.41
+
+2004-12-16 Taylor Added check on comunpack return code.
+
+2008-12-23 Wesley Initialize Number of data points unpacked
+
+
Parameters
+
+ cgrib char array containing Section 7 of the GRIB2 message
+ iofst Bit offset of the beginning of Section 7 in cgrib.
+ igdsnum Grid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
+ igdstmpl Pointer to an integer array containing the data values for the specified Grid Definition Template (N=igdsnum). Each element of this integer array contains an entry (in the order specified) of Grid Definition Template 3.N. (Only used for DRS Template 5.51).
+ idrsnum Data Representation Template Number (see Code Table 5.0)
+ idrstmpl Pointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N
+ ndpts Number of data points unpacked and returned.
+ fld Pointer to a float array containing the unpacked data field.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-10-31
+
+
Definition at line 55 of file g2_unpack7.c .
+
+
References comunpack() , G2_NO_ERROR , G2_UNPACK7_BAD_DRT , G2_UNPACK7_CORRUPT_SEC , G2_UNPACK7_WRONG_GDT , G2_UNPACK_BAD_SEC , G2_UNPACK_NO_MEM , gbit() , jpcunpack() , pngunpack() , rdieee() , simunpack() , and specunpack() .
+
+
Referenced by g2_getfld() .
+
+
+
+
+
◆ g2c_set_log_level()
+
+
+
+
+
+ int g2c_set_log_level
+ (
+ int
+ new_level )
+
+
+
+
+
+
Use this to set the global log level.
+
Set it to -1 to turn off all logging. Set it to 0 to show only errors, and to higher numbers to show more and more logging details. If logging is not enabled when building NCEPLIBS-g2c, this function will do nothing.
+
Parameters
+
+ new_level The new logging level.
+
+
+
+
Returns G2_NO_ERROR No error.
+
Author Ed Hartnett
+
+
Definition at line 124 of file util.c .
+
+
References G2C_NO_ERROR , and LOG .
+
+
+
+
+
◆ jpcpack()
+
+
+
+
+
+ void jpcpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Author Stephen Gilbert, Ed Hartnett
+
+
Definition at line 253 of file jpcpack.c .
+
+
References jpcpack_int() .
+
+
+
+
+
◆ jpcpackd()
+
+
+
+
+
+ void jpcpackd
+ (
+ double *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Author Ed Hartnett
+
+
Definition at line 294 of file jpcpack.c .
+
+
References jpcpack_int() .
+
+
+
+
+
◆ jpcunpack()
+
+
+
+
+
+ g2int jpcunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values as an array of float.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephem Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 108 of file jpcunpack.c .
+
+
References jpcunpack_int() .
+
+
+
+
+
◆ jpcunpackd()
+
+
+
+
+
+ g2int jpcunpackd
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ double *
+ fld
+
+
+
+ )
+
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values as an array of double.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Ed Hartnett
+
Date 2022-08-12
+
+
Definition at line 135 of file jpcunpack.c .
+
+
References jpcunpack_int() .
+
+
+
+
+
◆ pngpack()
+
+
+
+
+
+ void pngpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a float data field into PNG image format.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
+
Parameters
+
+ fld Pointer to array of float that contains the data values to pack.
+ width Number of points in the x direction.
+ height Number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template 5.41 or 5.40010.
+0 Reference value - ignored on input, set by pngpack routine.
+1 Binary Scale Factor - used on input.
+2 Decimal Scale Factor - used on input.
+3 number of bits for each grayscale pixel value - ignored on input.
+4 Original field type - currently ignored on input, set = 0 on output. Data values assumed to be reals.
+
+
+ cpack The packed data field.
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 224 of file pngpack.c .
+
+
References pngpack_int() .
+
+
+
+
+
◆ pngpackd()
+
+
+
+
+
+ void pngpackd
+ (
+ double *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a double data field into PNG image format.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
+
Parameters
+
+ fld Pointer to array of double that contains the data values to pack.
+ width Number of points in the x direction.
+ height Number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template 5.41 or 5.40010.
+0 Reference value - ignored on input, set by pngpack routine.
+1 Binary Scale Factor - used on input.
+2 Decimal Scale Factor - used on input.
+3 number of bits for each grayscale pixel value - ignored on input.
+4 Original field type - currently ignored on input, set = 0 on output. Data values assumed to be reals.
+
+
+ cpack The packed data field.
+ lcpack length of packed field cpack.
+
+
+
+
Author Ed Hartnett
+
Date Aug 8, 2022
+
+
Definition at line 259 of file pngpack.c .
+
+
References pngpack_int() .
+
+
+
+
+
◆ pngunpack()
+
+
+
+
+
+ g2int pngunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
+
Parameters
+
+ cpack The packed data field (character*1 array).
+ len length of packed field cpack().
+ idrstmpl Pointer to array of values for Data Representation Template 5.41 or 5.40010.
+ ndpts The number of data values to unpack.
+ fld Contains the unpacked data values.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephen Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 105 of file pngunpack.c .
+
+
References pngunpack_int() .
+
+
+
+
+
◆ pngunpackd()
+
+
+
+
+
+ g2int pngunpackd
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ double *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
+
Parameters
+
+ cpack The packed data field (character*1 array).
+ len length of packed field cpack().
+ idrstmpl Pointer to array of values for Data Representation Template 5.41 or 5.40010.
+ ndpts The number of data values to unpack.
+ fld Contains the unpacked data values.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Ed Hartnett
+
Date Aug 8, 2022
+
+
Definition at line 128 of file pngunpack.c .
+
+
References pngunpack_int() .
+
+
+
+
+
◆ seekgb()
+
+
+
+
+
+ void seekgb
+ (
+ FILE *
+ lugb ,
+
+
+
+
+ g2int
+ iseek ,
+
+
+
+
+ g2int
+ mseek ,
+
+
+
+
+ g2int *
+ lskip ,
+
+
+
+
+ g2int *
+ lgrib
+
+
+
+ )
+
+
+
+
+
+
This subprogram searches a file for the next GRIB Message.
+
The search is done starting at byte offset iseek of the file referenced by lugb for mseek bytes at a time. If found, the starting position and length of the message are returned in lskip and lgrib, respectively. The search is terminated when an EOF or I/O error is encountered.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-28 GILBERT Modified from Iredell's skgb subroutine
+
+2009-01-16 VUONG Changed lskip to 4 instead of sizof(g2int)
+
+
Parameters
+
+ lugb FILE pointer for the file to search. File must be opened before this routine is called.
+ iseek number of bytes in the file to skip before search.
+ mseek number of bytes to search at a time (must be at least 16).
+ lskip number of bytes to skip from the beggining of the file to where the GRIB message starts.
+ lgrib number of bytes in message (set to 0, if no message found).
+
+
+
+
Author Stephen Gilbert
+
Date 2002-10-28
+
+
Definition at line 39 of file seekgb.c .
+
+
References BITS_PER_BYTE , and gbit() .
+
+
+
+
+
+Header file for NCEPLIBS-g2c library.
+
+g2int g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
This subroutine returns all the metadata, template values, bit-map (if applicable),...
+
+
+
+
diff --git a/ver-1.7.0/grib2_8h.js b/ver-1.7.0/grib2_8h.js
new file mode 100644
index 00000000..865fa64b
--- /dev/null
+++ b/ver-1.7.0/grib2_8h.js
@@ -0,0 +1,121 @@
+var grib2_8h =
+[
+ [ "gribfield", "grib2_8h.html#structgribfield", [
+ [ "bmap", "grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369", null ],
+ [ "coord_list", "grib2_8h.html#a967c330a784570751d24078576317278", null ],
+ [ "discipline", "grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574", null ],
+ [ "expanded", "grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20", null ],
+ [ "fld", "grib2_8h.html#ad98aa9cc23b61713ef77a84772688427", null ],
+ [ "griddef", "grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138", null ],
+ [ "ibmap", "grib2_8h.html#a10a46b6a25d615784dced13e914d0726", null ],
+ [ "idrtlen", "grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc", null ],
+ [ "idrtmpl", "grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457", null ],
+ [ "idrtnum", "grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f", null ],
+ [ "idsect", "grib2_8h.html#ad81615f4a659f2454762301e0e810793", null ],
+ [ "idsectlen", "grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826", null ],
+ [ "ifldnum", "grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454", null ],
+ [ "igdtlen", "grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e", null ],
+ [ "igdtmpl", "grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53", null ],
+ [ "igdtnum", "grib2_8h.html#a065d206f38d552c49af642e3cf6056b3", null ],
+ [ "interp_opt", "grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940", null ],
+ [ "ipdtlen", "grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e", null ],
+ [ "ipdtmpl", "grib2_8h.html#a49b9e8c090596e02abc193b1974b8022", null ],
+ [ "ipdtnum", "grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911", null ],
+ [ "list_opt", "grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d", null ],
+ [ "local", "grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1", null ],
+ [ "locallen", "grib2_8h.html#a0e2cadad47b161868b97e60f00409982", null ],
+ [ "ndpts", "grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c", null ],
+ [ "ngrdpts", "grib2_8h.html#a1fd25a21842b45215676696fcddb2a09", null ],
+ [ "num_coord", "grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce", null ],
+ [ "num_opt", "grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b", null ],
+ [ "numoct_opt", "grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0", null ],
+ [ "unpacked", "grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47", null ],
+ [ "version", "grib2_8h.html#ac1a18226d7790431bad8b065f85befa5", null ]
+ ] ],
+ [ "G2_ADD_MSG_COMPLETE", "grib2_8h.html#a5aaef5008fd9be5c044b207231cf767f", null ],
+ [ "G2_ADD_MSG_INIT", "grib2_8h.html#a9627c88b7c7dd863cb3af9fb3e10011b", null ],
+ [ "G2_ADDFIELD_BAD_BITMAP", "grib2_8h.html#a496eb9c096d0ecdc712ebea3ffd3a37d", null ],
+ [ "G2_ADDFIELD_BAD_DRT", "grib2_8h.html#a5a92ce5b0b8da884e2924dba7f1e1a95", null ],
+ [ "G2_ADDFIELD_BAD_GDS", "grib2_8h.html#a28e1af8be9f9c34241c0c8ce780c2707", null ],
+ [ "G2_ADDFIELD_BAD_GDT", "grib2_8h.html#aaead77879d197777943ee9c53e0672ef", null ],
+ [ "G2_ADDFIELD_BAD_PDT", "grib2_8h.html#a7661683648959dad5ea1d2def2cb766d", null ],
+ [ "G2_ADDFIELD_ERR", "grib2_8h.html#ad37ad5e44291e1b229321755b4838c3a", null ],
+ [ "G2_ADDGRID_BAD_GDT", "grib2_8h.html#a3687ada1cdabe6b44b62620a3e4e612b", null ],
+ [ "G2_BAD_SEC", "grib2_8h.html#a362f4c8ddcb007058bccba7eab1ff8e0", null ],
+ [ "G2_BAD_SEC_COUNTS", "grib2_8h.html#a06d37843d3f4b3f46cb240206ce430b0", null ],
+ [ "G2_CREATE_GRIB_VERSION", "grib2_8h.html#ae740c66315236fc68d4f337558587505", null ],
+ [ "G2_GETFLD_BAD_END", "grib2_8h.html#ae5716ebe302534d9fc24cf328bade4df", null ],
+ [ "G2_GETFLD_BAD_SEC1", "grib2_8h.html#a57517913da70932f0c56f076207ea90b", null ],
+ [ "G2_GETFLD_BAD_SEC2", "grib2_8h.html#a4f8b8ce8eb11ed2de38710863323f41a", null ],
+ [ "G2_GETFLD_BAD_SEC3", "grib2_8h.html#ad101a194bd4c5c6c0a0dd9aaa6fb9905", null ],
+ [ "G2_GETFLD_BAD_SEC4", "grib2_8h.html#a94364236b4274588b2b4b6b851555e15", null ],
+ [ "G2_GETFLD_BAD_SEC5", "grib2_8h.html#a6065be2bee7e56c7eb0d3673a70be727", null ],
+ [ "G2_GETFLD_BAD_SEC6", "grib2_8h.html#ab2d294bedc5fda5e67800bef91b6de44", null ],
+ [ "G2_GETFLD_BAD_SEC7", "grib2_8h.html#a115c0b1461732602197d7129cb783938", null ],
+ [ "G2_GETFLD_GRIB_VERSION", "grib2_8h.html#a3c94f1f792106e97d1e4cc2fe674e9ef", null ],
+ [ "G2_GETFLD_INVAL", "grib2_8h.html#a2915a7e9bd01c1b2bd33a6e362c88acc", null ],
+ [ "G2_GETFLD_INVAL_SEC", "grib2_8h.html#afeef0a49033cd2735140f87dfe0fe49f", null ],
+ [ "G2_GETFLD_NO_BITMAP", "grib2_8h.html#aee39ba22e9351cf0b7f2813bd1b5dd7e", null ],
+ [ "G2_GETFLD_NO_DRT", "grib2_8h.html#ac2734aa4f2d3f10a642b3d7919563dcc", null ],
+ [ "G2_GETFLD_NO_GRIB", "grib2_8h.html#a9600b70ed48d9ee91c366c3d2aaaebb3", null ],
+ [ "G2_GETFLD_WRONG_END", "grib2_8h.html#a8ebd7f4cdc757b37d8cf344c17329936", null ],
+ [ "G2_GETFLD_WRONG_NFLDS", "grib2_8h.html#a49e78acc21d879a88d3fb21866878ef6", null ],
+ [ "G2_GRIBEND_MSG_INIT", "grib2_8h.html#a07313bd28e479d86f64ff744b10a2b78", null ],
+ [ "G2_INFO_BAD_END", "grib2_8h.html#ae174af0c4aa67c5d6217688d45aad4c5", null ],
+ [ "G2_INFO_GRIB_VERSION", "grib2_8h.html#a55b6bf7ad57b4c202827f3326ad2c4df", null ],
+ [ "G2_INFO_INVAL_SEC", "grib2_8h.html#a436d91157da728072516d50f5c349507", null ],
+ [ "G2_INFO_NO_GRIB", "grib2_8h.html#af26cc0775753191aabf4720876452b48", null ],
+ [ "G2_INFO_NO_SEC1", "grib2_8h.html#a14417ca1b452ff2e6681ebd4f00c2dee", null ],
+ [ "G2_INFO_WRONG_END", "grib2_8h.html#af935bef94850a5b24e554393ce0a8eef", null ],
+ [ "G2_JASPER_DECODE", "grib2_8h.html#a9d842d23dc3c41db9237ba890a255776", null ],
+ [ "G2_JASPER_DECODE_COLOR", "grib2_8h.html#ad18c15e7859be9a08cbd4a42283fed36", null ],
+ [ "G2_JASPER_ENCODE", "grib2_8h.html#a5c647eb48e460797f21e6d90960203f1", null ],
+ [ "G2_JASPER_INIT", "grib2_8h.html#a2cb509d4701384beb0cce5644abae4fb", null ],
+ [ "G2_JPCUNPACK_MEM", "grib2_8h.html#ade01e29b36d4a7b1de09c84c39786fbd", null ],
+ [ "G2_JPEG2000_ENABLED", "grib2_8h.html#a0a07a1092a64ae871ab45b147de85318", null ],
+ [ "G2_NO_ERROR", "grib2_8h.html#a94af4623709fa1c08f8035b98e7ca56b", null ],
+ [ "G2_PNG_ENABLED", "grib2_8h.html#acaa1f7159ddd54e667beca9658c797a0", null ],
+ [ "G2_SPECUNPACK_TYPE", "grib2_8h.html#ac046d29b8feb2f0333e7a5c8803aba4d", null ],
+ [ "G2_UNPACK3_BAD_GDT", "grib2_8h.html#a97570f9ca7b7f018cad85d5f8e5be4e3", null ],
+ [ "G2_UNPACK4_BAD_PDT", "grib2_8h.html#a6441abadc54f311dbef926fdbd7a6e5a", null ],
+ [ "G2_UNPACK5_BAD_DRT", "grib2_8h.html#a073c8c6c97479d96e86cdaf1bed26f41", null ],
+ [ "G2_UNPACK6_BAD_BITMAP", "grib2_8h.html#a2f05416b54c82d3ec6aa050c2dd033a4", null ],
+ [ "G2_UNPACK7_BAD_DRT", "grib2_8h.html#a01fe4ac54380851cc28581d59dfa9bf4", null ],
+ [ "G2_UNPACK7_CORRUPT_SEC", "grib2_8h.html#a3b6b5bd21386f9f7d49f1f628a9c895c", null ],
+ [ "G2_UNPACK7_WRONG_GDT", "grib2_8h.html#a9485e54be066c97916f22b4d6046cd1b", null ],
+ [ "G2_UNPACK_BAD_SEC", "grib2_8h.html#a1eb0a21681ad4d1a9af3e357f59dc08b", null ],
+ [ "G2_UNPACK_NO_MEM", "grib2_8h.html#a76dad0fdc4926df76a417a2992b81d66", null ],
+ [ "G2_VERSION", "grib2_8h.html#abdcadc6336632657f0b90b4cff01709f", null ],
+ [ "G2C_MSG_COMPLETE", "grib2_8h.html#a575d0594c327da0f6001abd1ae17128a", null ],
+ [ "G2C_NO_ERROR", "grib2_8h.html#a9ea0feeb2757a4caa81858e6957ea3d7", null ],
+ [ "G2C_NOT_GRIB", "grib2_8h.html#abda58c1fda90dc4b6d105e8d9853819e", null ],
+ [ "g2float", "grib2_8h.html#a2e615ee29fc8d17a681017e4384847c2", null ],
+ [ "g2int", "grib2_8h.html#af0b63b0e0f41f07f562a4367e2a60838", null ],
+ [ "g2intu", "grib2_8h.html#a95bb698b6bd148aae1b3b841fb0da83b", null ],
+ [ "gribfield", "grib2_8h.html#afd3ef3eb9f8b9a64a7b749a892de46c5", null ],
+ [ "g2_addfield", "grib2_8h.html#ad403b8c1a156f062c3ded89224e6b46b", null ],
+ [ "g2_addgrid", "grib2_8h.html#a14908ea75d83021b0ec10ae8c084567c", null ],
+ [ "g2_addlocal", "grib2_8h.html#aa9490d67c089f6a15fd9941f273752c3", null ],
+ [ "g2_create", "grib2_8h.html#a0e8970973e1cefc142240f961a796108", null ],
+ [ "g2_free", "grib2_8h.html#a084c47c8f83bb5a5c7799753ac7b6f02", null ],
+ [ "g2_getfld", "grib2_8h.html#abad9d3ba0ee798acd442850573fc6b8e", null ],
+ [ "g2_gribend", "grib2_8h.html#a84081fb5d32251234409b9ec2d72a0e8", null ],
+ [ "g2_info", "grib2_8h.html#abf8ecb0fe00805abfce20115357b4fa3", null ],
+ [ "g2_unpack1", "grib2_8h.html#a5a9f3222320afe0f957406b53ad36223", null ],
+ [ "g2_unpack2", "grib2_8h.html#a4b190a45b5223fa43746cf16c80bef47", null ],
+ [ "g2_unpack3", "grib2_8h.html#ae0f9483c798b7819852b21fa0ae51590", null ],
+ [ "g2_unpack4", "grib2_8h.html#a379383c777dfa1e788b8e573bdd90889", null ],
+ [ "g2_unpack5", "grib2_8h.html#a0127b9d6f3a258a9d0dd87f986d86b93", null ],
+ [ "g2_unpack6", "grib2_8h.html#a83638f96ee10ef44c4dddcebf41d8ee6", null ],
+ [ "g2_unpack7", "grib2_8h.html#a3469bd6d6e13e1180753a5629ace639d", null ],
+ [ "g2c_set_log_level", "grib2_8h.html#a9a2353e67d13207769db5bd68e343abe", null ],
+ [ "jpcpack", "grib2_8h.html#ac5fa531e1573e7ae501a4e2826d22e89", null ],
+ [ "jpcpackd", "grib2_8h.html#aae606a6769d1d2d74a9476f52ca03c2f", null ],
+ [ "jpcunpack", "grib2_8h.html#a067a3f608a80a9fdd89ed9f59ed7c7f6", null ],
+ [ "jpcunpackd", "grib2_8h.html#ad6178825e48182a0c7e62951aae0b0d2", null ],
+ [ "pngpack", "grib2_8h.html#a1353956d6cc706acd63e87ce21c69fd2", null ],
+ [ "pngpackd", "grib2_8h.html#ac449247d0b5e9f7a297a154f3791a41d", null ],
+ [ "pngunpack", "grib2_8h.html#a25efad18886998fd8f7172ddccaa9076", null ],
+ [ "pngunpackd", "grib2_8h.html#a0e15cdfb0f46d45f44eca76bf13bc7c8", null ],
+ [ "seekgb", "grib2_8h.html#a27edb1018106a2e02743be31afc5ea0c", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/grib2_8h_source.html b/ver-1.7.0/grib2_8h_source.html
new file mode 100644
index 00000000..ae10db18
--- /dev/null
+++ b/ver-1.7.0/grib2_8h_source.html
@@ -0,0 +1,351 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: grib2.h Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
22 #define G2_VERSION "1.7.0"
+
24 #define G2_PNG_ENABLED 1
+
25 #define G2_JPEG2000_ENABLED 1
+
28 typedef int64_t g2int;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
222 unsigned char **csec2);
+
+
+
+
226 g2int *mappdslen,
float **coordlist,
g2int *numcoord);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
255 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
259 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
263 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
267 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
+
+
+
+
275 #define G2_NO_ERROR 0
+
276 #define G2_CREATE_GRIB_VERSION -1
+
277 #define G2_INFO_NO_GRIB 1
+
278 #define G2_INFO_GRIB_VERSION 2
+
279 #define G2_INFO_NO_SEC1 3
+
280 #define G2_INFO_WRONG_END 4
+
281 #define G2_INFO_BAD_END 5
+
282 #define G2_INFO_INVAL_SEC 6
+
283 #define G2_GETFLD_NO_GRIB 1
+
284 #define G2_GETFLD_GRIB_VERSION 2
+
285 #define G2_GETFLD_INVAL 3
+
286 #define G2_GETFLD_WRONG_END 4
+
287 #define G2_GETFLD_WRONG_NFLDS 6
+
288 #define G2_GETFLD_BAD_END 7
+
289 #define G2_GETFLD_INVAL_SEC 8
+
290 #define G2_GETFLD_NO_DRT 9
+
291 #define G2_GETFLD_BAD_SEC1 15
+
292 #define G2_GETFLD_BAD_SEC2 16
+
293 #define G2_GETFLD_BAD_SEC3 10
+
294 #define G2_GETFLD_BAD_SEC4 11
+
295 #define G2_GETFLD_BAD_SEC5 12
+
296 #define G2_GETFLD_BAD_SEC6 13
+
297 #define G2_GETFLD_BAD_SEC7 14
+
298 #define G2_GETFLD_NO_BITMAP 17
+
299 #define G2_GRIBEND_MSG_INIT -1
+
300 #define G2_BAD_SEC -4
+
301 #define G2_UNPACK_BAD_SEC 2
+
302 #define G2_UNPACK_NO_MEM 6
+
303 #define G2_UNPACK3_BAD_GDT 5
+
304 #define G2_UNPACK4_BAD_PDT 5
+
305 #define G2_UNPACK5_BAD_DRT 7
+
306 #define G2_UNPACK6_BAD_BITMAP 4
+
307 #define G2_UNPACK7_CORRUPT_SEC 7
+
308 #define G2_UNPACK7_WRONG_GDT 5
+
309 #define G2_UNPACK7_BAD_DRT 4
+
310 #define G2_ADD_MSG_INIT -1
+
311 #define G2_ADD_MSG_COMPLETE -2
+
312 #define G2_BAD_SEC_COUNTS -3
+
313 #define G2_ADDFIELD_BAD_PDT -5
+
314 #define G2_ADDFIELD_BAD_GDS -6
+
315 #define G2_ADDFIELD_BAD_DRT -7
+
316 #define G2_ADDFIELD_BAD_BITMAP -8
+
317 #define G2_ADDFIELD_BAD_GDT -9
+
318 #define G2_ADDFIELD_ERR -10
+
319 #define G2_ADDGRID_BAD_GDT -5
+
320 #define G2_JPCUNPACK_MEM 1
+
321 #define G2_SPECUNPACK_TYPE -3
+
322 #define G2_JASPER_INIT -2
+
323 #define G2_JASPER_ENCODE -3
+
324 #define G2_JASPER_DECODE -3
+
325 #define G2_JASPER_DECODE_COLOR -5
+
+
328 #define G2C_NO_ERROR 0
+
329 #define G2C_NOT_GRIB -50
+
330 #define G2C_MSG_COMPLETE -51
+
+
+
+g2int g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
+g2int g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
This routine initializes a new GRIB2 message and packs GRIB2 Section 0 (Indicator Section) and Sectio...
+g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
+g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
+g2int g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen)
This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+
+void jpcpackd(double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+g2int g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+g2int ngrdpts
Number of grid points in the defined grid.
+g2int unpacked
Logical value indicating whether the bitmap and data values were unpacked.
+void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
+g2int ifldnum
Field number within GRIB message.
+g2int g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum)
This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
+g2int idrtlen
Number of elements in idrtmpl.
+g2int ibmap
Bitmap indicator (see Table 6.0).
+g2int griddef
Source of grid definition (see Table 3.0).
+g2int g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, float **coordlist, g2int *numcoord)
This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+void seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
This subprogram searches a file for the next GRIB Message.
+g2int numoct_opt
Number of octets needed for each additional grid points definition.
+g2int g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
+g2int pngunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
+g2int g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal)
This subroutine searches through a GRIB2 message and returns the number of gridded fields found in th...
+g2int * idsect
Contains the entries in the Identification Section (Section 1).
+g2int g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap)
This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+int g2c_set_log_level(int new_level)
Use this to set the global log level.
+g2int g2_gribend(unsigned char *cgrib)
This routine finalizes a GRIB2 message after all grids and fields have been added.
+g2int g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld)
This subroutine returns all the metadata, template values, bit-map (if applicable),...
+void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a float data field into PNG image format.
+g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
+g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
+g2int interp_opt
Interpretation of list for optional points definition.
+g2int ipdtlen
Number of elements in ipdtmpl - i.e.
+g2int g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2)
This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
+void pngpackd(double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a double data field into PNG image format.
+g2int discipline
Message Discipline (see Table 0.0).
+g2int num_opt
(Used if numoct_opt .ne.
+float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
+g2int ipdtnum
Product Definition Template Number (see Table 4.0).
+int64_t g2int
Long integer type.
+g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+float * fld
Array of ndpts unpacked data points.
+unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
+g2int idrtnum
Data Representation Template Number (see Table 5.0).
+g2int num_coord
Number of values in array coord_list.
+g2int expanded
Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
+
+g2int version
GRIB edition number (2).
+g2int locallen
Length of array local.
+g2int ndpts
Number of data points unpacked and returned.
+g2int igdtlen
Number of elements in igdtmpl - i.e.
+g2int * list_opt
(Used if numoct_opt .ne.
+g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
+g2int igdtnum
Grid Definition Template Number (See Table 3.1).
+void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
+g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
+g2int idsectlen
Number of elements in idsect.
+uint64_t g2intu
Unsigned long integer type.
+g2int jpcunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representati...
+
+
+
+
diff --git a/ver-1.7.0/grib2_8h_structgribfield.js b/ver-1.7.0/grib2_8h_structgribfield.js
new file mode 100644
index 00000000..8753acf3
--- /dev/null
+++ b/ver-1.7.0/grib2_8h_structgribfield.js
@@ -0,0 +1,33 @@
+var grib2_8h_structgribfield =
+[
+ [ "bmap", "grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369", null ],
+ [ "coord_list", "grib2_8h.html#a967c330a784570751d24078576317278", null ],
+ [ "discipline", "grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574", null ],
+ [ "expanded", "grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20", null ],
+ [ "fld", "grib2_8h.html#ad98aa9cc23b61713ef77a84772688427", null ],
+ [ "griddef", "grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138", null ],
+ [ "ibmap", "grib2_8h.html#a10a46b6a25d615784dced13e914d0726", null ],
+ [ "idrtlen", "grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc", null ],
+ [ "idrtmpl", "grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457", null ],
+ [ "idrtnum", "grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f", null ],
+ [ "idsect", "grib2_8h.html#ad81615f4a659f2454762301e0e810793", null ],
+ [ "idsectlen", "grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826", null ],
+ [ "ifldnum", "grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454", null ],
+ [ "igdtlen", "grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e", null ],
+ [ "igdtmpl", "grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53", null ],
+ [ "igdtnum", "grib2_8h.html#a065d206f38d552c49af642e3cf6056b3", null ],
+ [ "interp_opt", "grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940", null ],
+ [ "ipdtlen", "grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e", null ],
+ [ "ipdtmpl", "grib2_8h.html#a49b9e8c090596e02abc193b1974b8022", null ],
+ [ "ipdtnum", "grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911", null ],
+ [ "list_opt", "grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d", null ],
+ [ "local", "grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1", null ],
+ [ "locallen", "grib2_8h.html#a0e2cadad47b161868b97e60f00409982", null ],
+ [ "ndpts", "grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c", null ],
+ [ "ngrdpts", "grib2_8h.html#a1fd25a21842b45215676696fcddb2a09", null ],
+ [ "num_coord", "grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce", null ],
+ [ "num_opt", "grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b", null ],
+ [ "numoct_opt", "grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0", null ],
+ [ "unpacked", "grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47", null ],
+ [ "version", "grib2_8h.html#ac1a18226d7790431bad8b065f85befa5", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/grib2_8h_structgtemplate.js b/ver-1.7.0/grib2_8h_structgtemplate.js
new file mode 100644
index 00000000..21119c99
--- /dev/null
+++ b/ver-1.7.0/grib2_8h_structgtemplate.js
@@ -0,0 +1,10 @@
+var grib2_8h_structgtemplate =
+[
+ [ "ext", "grib2_8h.html#a312a417c8e6f68bea7bfe86268c16594", null ],
+ [ "extlen", "grib2_8h.html#a743151a1bde2a21603926e1541baa5de", null ],
+ [ "map", "grib2_8h.html#a88e12020d460546cafcef9c445c3df20", null ],
+ [ "maplen", "grib2_8h.html#aea3cb225770444c7e40855ee401a5b29", null ],
+ [ "needext", "grib2_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf", null ],
+ [ "num", "grib2_8h.html#a973b6764b40aed427d419046b63d75b3", null ],
+ [ "type", "grib2_8h.html#ad28b4af0030473208605c2cf2c5e3f36", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/grib2__int_8h.html b/ver-1.7.0/grib2__int_8h.html
new file mode 100644
index 00000000..1ada790c
--- /dev/null
+++ b/ver-1.7.0/grib2__int_8h.html
@@ -0,0 +1,2775 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: grib2_int.h File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+More...
+
#include <stdio.h>
+
#include <stdint.h>
+
#include <assert.h>
+
#include "grib2.h "
+
+
Go to the source code of this file.
+
+
+void cmplxpack (float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
+
+void compack (float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
+
+int comunpack (unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float *fld)
+ This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or Template 5.3 . More...
+
+int dec_jpeg2000 (char *injpc, g2int bufsize, g2int *outfld)
+ This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software . More...
+
+int dec_png (unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
+ Decode PNG. More...
+
+int enc_jpeg2000 (unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen)
+ This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software . More...
+
+int enc_png (unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
+ Encode PNG. More...
+
+gtemplate * extdrstemplate (g2int number, g2int *list)
+ This subroutine generates the remaining octet map for a given Data Representation Template, if required. More...
+
+gtemplate * extgridtemplate (g2int number, g2int *list)
+ This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More...
+
+gtemplate * extpdstemplate (g2int number, g2int *list)
+ This subroutine generates the remaining octet map for a given Product Definition Template, if required. More...
+
+int g2c_check_msg (unsigned char *cgrib, g2int *lencurr, int verbose)
+ Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already terminated with '7777'. More...
+
+void gbit (unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
+ Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array. More...
+
+void gbits (unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
+ Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array. More...
+
+g2int getdim (unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
+ This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format. More...
+
+gtemplate * getdrstemplate (g2int number)
+ This subroutine returns DRS template information for a specified Data Representation Template. More...
+
+gtemplate * getgridtemplate (g2int number)
+ This subroutine returns grid template information for a specified Grid Definition Template for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml ). More...
+
+gtemplate * getpdstemplate (g2int number)
+ This subroutine returns PDS template information for a specified Product Definition Template. More...
+
+g2int getpoly (unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
+ This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section (GDS) used spherical harmonic coefficients using GDT 5.50 through 5.53. More...
+
+double int_power (double x, g2int y)
+ Function similar to C pow() power function. More...
+
+void jpcpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field into a JPEG2000 code stream. More...
+
+g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
+ Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+void misspack (float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This function packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
+
+void mkieee (float *a, g2int *rieee, g2int num)
+ This subroutine stores a list of real values in 32-bit IEEE floating point format. More...
+
+int pack_gp (g2int *kfildo, g2int *ic, g2int *nxy, g2int *is523, g2int *minpk, g2int *inc, g2int *missp, g2int *misss, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *ndg, g2int *lx, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *lbitref, g2int *ier)
+ Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min (jmin( )), the number of bits necessary to hold the values in each group (lbit( )), the number of values in each group (nov( )), the number of bits necessary to pack the jmin( ) values (ibit), the number of bits necessary to pack the lbit( ) values (jbit), and the number of bits necessary to pack the nov( ) values (kbit). More...
+
+void pngpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a float data field into PNG image format. More...
+
+g2int pngunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
+ This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010. More...
+
+void rdieee (g2int *rieee, float *a, g2int num)
+ This subroutine reads a list of real values in 32-bit IEEE floating point format. More...
+
+void sbit (unsigned char *out, g2int *in, g2int iskip, g2int nbits)
+ Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array. More...
+
+void sbits (unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
+ Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array. More...
+
+void simpack (float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 documention. More...
+
+g2int simunpack (unsigned char *cpack, g2int *idrstmpl, g2int ndpts, float *fld)
+ This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.0. More...
+
+void specpack (float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs a spectral data field using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 Data Representation Template 5.51 . More...
+
+g2int specunpack (unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, float *fld)
+ This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51 . More...
+
+
+
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2021-11-08 Ed Hartnett Initial
+
+
Author Ed Hartnett
+
Date 2021-11-08
+
+
Definition in file grib2_int.h .
+
+
+
◆ gtemplate
+
+
+
+
Struct for GRIB template.
+
+
Definition at line 28 of file grib2_int.h .
+
+Data Fields
+
+g2int *
+
+ext
+
+Number of octets of each entry in the extension part of the template.
+
+g2int
+
+extlen
+
+Number of entries in the template extension.
+
+g2int *
+
+map
+
+Number of octets of each entry in the static part of the template.
+
+g2int
+
+maplen
+
+Number of entries in the static part of the template.
+
+g2int
+
+needext
+
+Indicates whether or not the template needs to be extended.
+
+g2int
+
+num
+
+The template number.
+
+g2int
+
+type
+
+The template type: 3 Grid Defintion Template. 4 Product Defintion Template. 5 Data Representation Template.
+
+
+
+
+
+
+
+
◆ ALOG2
+
+
+
+
+
+ #define ALOG2 (0.69314718)
+
+
+
+
+
+
◆ G2C_JASPER_JPEG_FORMAT_NAME
+
+
+
+
+
+ #define G2C_JASPER_JPEG_FORMAT_NAME "jpc"
+
+
+
+
+
Name of JPEG codec in Jasper.
+
+
Definition at line 23 of file grib2_int.h .
+
+
+
+
+
◆ LOG
+
+
+
+
+
+ #define LOG
+ (
+
+ e )
+
+
+
+
+
+
Ignore logging to stdout.
+
Library was not built with LOGGING=ON.
+
+
Definition at line 138 of file grib2_int.h .
+
+
+
+
+
+
◆ gtemplate
+
+
+
+
+
Struct for GRIB template.
+
+
Definition at line 56 of file grib2_int.h .
+
+
+
+
+
+
◆ cmplxpack()
+
+
+
+
+
+ void cmplxpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+
It supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3). It also fills in GRIB2 Data Representation Template 5.2 or 5.3 with the appropriate values.
+
Parameters
+
+ fld Contains the data values to pack.
+ ndpts The number of data values in array fld
+ idrsnum Data Representation Template number. Must equal 2 or 3.
+ idrstmpl Contains the array of values for Data Representation Template 5.2 or 5.3
+0 Reference value - ignored on input, set by compack routine.
+1 Binary Scale Factor
+2 Decimal Scale Factor
+6 Missing value management
+7 Primary missing value
+8 Secondary missing value
+16 Order of Spatial Differencing ( 1 or 2 )
+
+
+ cpack The packed data field.
+ lcpack length of packed field cpack. Will be set to -1 if missing value management field is not 1 or 2.
+
+
+
+
Author Stephen Gilbert
+
Date 2004-08-27
+
+
Definition at line 36 of file cmplxpack.c .
+
+
References compack() , and misspack() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ compack()
+
+
+
+
+
+ void compack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+
It supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3). It also fills in GRIB2 Data Representation Template 5.2 or Template 5.3 with the appropriate values.
+
Parameters
+
+ fld Contains the data values to pack.
+ ndpts The number of data values in array fld.
+ idrsnum Data Representation Template number. Must equal 2 or 3.
+ idrstmpl Contains the array of values for Data Representation Template 5.2 or 5.3.
+0 Reference value - ignored on input, set my compack() .
+1 Binary Scale Factor
+2 Decimal Scale Factor
+6 Missing value management
+7 Primary missing value
+8 Secondary missing value
+16 Order of Spatial Differencing (1 or 2)
+
+
+ cpack The packed data field.
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2002-11-07
+
+
Definition at line 42 of file compack.c .
+
+
References ALOG2 , int_power() , mkieee() , pack_gp() , sbit() , and sbits() .
+
+
Referenced by cmplxpack() .
+
+
+
+
+
◆ comunpack()
+
+
+
+
+
+ int comunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ lensec ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or Template 5.3 .
+
Supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3).
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-10-29 Gilbert Initial
+
+2004-12-16 Gilbert Added test (from Arthur Taylor/MDL) verifying group widths/lengths
+
+
Parameters
+
+ cpack pointer to the packed data field.
+ lensec length of section 7 (used for error checking).
+ idrsnum Data Representation Template number. Must equal 2 or 3.
+ idrstmpl pointer to the array of values for Data Representation Template 5.2 or 5.3
+ ndpts The number of data values to unpack
+ fld Contains the unpacked data values. Must be allocated with at least ndpts * sizeof(float) bytes before calling this routine.
+
+
+
+
Returns 0 for success, error code otherwise.
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition at line 42 of file comunpack.c .
+
+
References gbit() , gbits() , int_power() , and rdieee() .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
◆ dec_jpeg2000()
+
+
+
+
+
+ int dec_jpeg2000
+ (
+ char *
+ injpc ,
+
+
+
+
+ g2int
+ bufsize ,
+
+
+
+
+ g2int *
+ outfld
+
+
+
+ )
+
+
+
+
+
+
This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software .
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-12-02 Gilbert Initial
+
+2022-04-15 Hartnett Converted to use jas_ instead of jpc_ functions.
+
+
Parameters
+
+ injpc Input JPEG2000 code stream.
+ bufsize Length (in bytes) of the input JPEG2000 code stream.
+ outfld Output matrix of grayscale image values.
+
+
+
+
Returns
+
+
Author Stephen Gilbert
+
Date 2002-12-02
+
Author Ed Hartnett
+
+
Definition at line 38 of file dec_jpeg2000.c .
+
+
References G2_JASPER_DECODE , G2_JASPER_DECODE_COLOR , G2_JASPER_INIT , and G2C_JASPER_JPEG_FORMAT_NAME .
+
+
Referenced by jpcunpack_int() .
+
+
+
+
+
◆ dec_png()
+
+
+
+
+
+ int dec_png
+ (
+ unsigned char *
+ pngbuf ,
+
+
+
+
+ g2int *
+ width ,
+
+
+
+
+ g2int *
+ height ,
+
+
+
+
+ unsigned char *
+ cout
+
+
+
+ )
+
+
+
+
+
+
Decode PNG.
+
Parameters
+
+ pngbuf Pointer to PNG buffer.
+ width Pointer to width.
+ height Pointer to height.
+ cout Output buffer.
+
+
+
+
Returns 0 for success, error code otherwise.
+
Author Stephen Gilbert
+
+
Definition at line 61 of file dec_png.c .
+
+
References user_read_data() .
+
+
Referenced by pngunpack_int() .
+
+
+
+
+
◆ enc_jpeg2000()
+
+
+
+
+
+ int enc_jpeg2000
+ (
+ unsigned char *
+ cin ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ ltype ,
+
+
+
+
+ g2int
+ ratio ,
+
+
+
+
+ g2int
+ retry ,
+
+
+
+
+ char *
+ outjpc ,
+
+
+
+
+ g2int
+ jpclen
+
+
+
+ )
+
+
+
+
+
+
This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software .
+
+Program History Log
+
+
+Date Programmer Comments
+
+2002-12-02 Gilbert Initial
+
+2004-12-16 Gilbert Added retry argument allowing increased guard bits.
+
+2022-04-15 Hartnett Converted to use jas_ instead of jpc_ functions.
+
+
Parameters
+
+ cin Packed matrix of Grayscale image values to encode.
+ width width of image.
+ height height of image.
+ nbits depth (in bits) of image. i.e number of bits used to hold each data value.
+ ltype indicator of lossless or lossy compression.
+1, for lossy compression
+!= 1, for lossless compression
+
+
+ ratio target compression ratio. (ratio:1) Used only when ltype == 1.
+ retry If 1 try increasing number of guard bits.
+ outjpc Output encoded JPEG2000 code stream.
+ jpclen Number of bytes allocated for the output JPEG2000 code stream in outjpc.
+
+
+
+
Returns
+> 0 = Length in bytes of encoded JPEG2000 code stream
+G2_JASPER_INIT Error initializing jasper library.
+G2_JASPER_ENCODE Error encode jpeg2000 code stream.
+
+
+
Note Requires JasPer Software version 1.500.4 or 1.700.2 or later.
+
Author Stephen Gilbert
+
Date 2002-12-02
+
Author Ed Hartnett
+
+
Definition at line 51 of file enc_jpeg2000.c .
+
+
References G2_JASPER_ENCODE , G2_JASPER_INIT , G2C_JASPER_JPEG_FORMAT_NAME , and MAXOPTSSIZE .
+
+
Referenced by jpcpack_int() .
+
+
+
+
+
◆ enc_png()
+
+
+
+
+
+ int enc_png
+ (
+ unsigned char *
+ data ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ unsigned char *
+ pngbuf
+
+
+
+ )
+
+
+
+
+
+
Encode PNG.
+
Parameters
+
+ data data.
+ width width.
+ height height.
+ nbits number of bits.
+ pngbuf PNG buffer.
+
+
+
+
Returns PNG length, or negative number for error.
+
Author Stephen Gilbert
+
+
Definition at line 75 of file enc_png.c .
+
+
References user_flush_data() , and user_write_data() .
+
+
Referenced by pngpack_int() .
+
+
+
+
+
◆ extdrstemplate()
+
+
+
+
+
This subroutine generates the remaining octet map for a given Data Representation Template, if required.
+
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
+
Parameters
+
+ number The number of the Data Representation Template that is being requested.
+ list The list of values for each entry in the the Data Representation Template.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL pointer, if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-11
+
+
Definition at line 212 of file drstemplates.c .
+
+
References getdrsindex() , and getdrstemplate() .
+
+
Referenced by g2_unpack5() .
+
+
+
+
+
◆ extgridtemplate()
+
+
+
+
+
This subroutine generates the remaining octet map for a given Grid Definition Template, if required.
+
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
+
This function allocates memory for the extension. The pointer ext in the gtemplate struct must be freed to prevent memory leaks.
+
Parameters
+
+ number The number of the Grid Definition Template that is being requested.
+ list The list of values for each entry in the Grid Definition Template.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL pointer, if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-09
+
+
Definition at line 229 of file gridtemplates.c .
+
+
References getgridindex() , and getgridtemplate() .
+
+
Referenced by g2_addgrid() , and g2_unpack3() .
+
+
+
+
+
◆ extpdstemplate()
+
+
+
+
+
This subroutine generates the remaining octet map for a given Product Definition Template, if required.
+
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
+
This function allocates memory in the ext field of the gtemplate struct. This memory must be freed by the caller.
+
Parameters
+
+ number number of the Product Definition Template 4.NN that is being requested.
+ list The list of values for each entry in the the Product Definition Template.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL pointer if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-11
+
+
Definition at line 329 of file pdstemplates.c .
+
+
References getpdsindex() , and getpdstemplate() .
+
+
Referenced by g2_addfield() , and g2_unpack4() .
+
+
+
+
+
◆ g2c_check_msg()
+
+
+
+
+
+ int g2c_check_msg
+ (
+ unsigned char *
+ cgrib ,
+
+
+
+
+ g2int *
+ lencurr ,
+
+
+
+
+ int
+ verbose
+
+
+
+ )
+
+
+
+
+
+
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already terminated with '7777'.
+
Parameters
+
+ cgrib Buffer that contains the GRIB message.
+ lencurr Pointer that gets the length of the GRIB message.
+ verbose If non-zero, print any error messages to stdout.
+
+
+
+
Returns
+
+
Author Ed Hartnett
+
Date Nov 11, 2021
+
+
Definition at line 26 of file util.c .
+
+
References G2C_MSG_COMPLETE , G2C_NO_ERROR , G2C_NOT_GRIB , and gbit() .
+
+
Referenced by g2_addfield() , g2_addgrid() , g2_addlocal() , and g2_gribend() .
+
+
+
+
+
◆ gbit()
+
+
+
+
+
+ void gbit
+ (
+ unsigned char *
+ in ,
+
+
+
+
+ g2int *
+ iout ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits
+
+
+
+ )
+
+
+
+
+
+
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.
+
Parameters
+
+ in pointer to character array input.
+ iout pointer to unpacked array output.
+ iskip initial number of bits to skip.
+ nbits number of bits to take.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 20 of file gbits.c .
+
+
References gbits() .
+
+
Referenced by comunpack() , g2_addfield() , g2_addgrid() , g2_addlocal() , g2_getfld() , g2_gribend() , g2_info() , g2_unpack1() , g2_unpack2() , g2_unpack3() , g2_unpack4() , g2_unpack5() , g2_unpack6() , g2_unpack7() , g2c_check_msg() , and seekgb() .
+
+
+
+
+
◆ gbits()
+
+
+
+
+
+ void gbits
+ (
+ unsigned char *
+ in ,
+
+
+
+
+ g2int *
+ iout ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ nskip ,
+
+
+
+
+ g2int
+ n
+
+
+
+ )
+
+
+
+
+
+
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.
+
Parameters
+
+ in Pointer to character array input.
+ iout Pointer to unpacked array output.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to take.
+ nskip Additional number of bits to skip on each iteration.
+ n Number of iterations.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 57 of file gbits.c .
+
+
Referenced by comunpack() , g2_unpack3() , g2_unpack4() , g2_unpack6() , gbit() , pngunpack_int() , simunpack() , and specunpack() .
+
+
+
+
+
◆ getdim()
+
+
+
+
+
+ g2int getdim
+ (
+ unsigned char *
+ csec3 ,
+
+
+
+
+ g2int *
+ width ,
+
+
+
+
+ g2int *
+ height ,
+
+
+
+
+ g2int *
+ iscan
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
+
Parameters
+
+ csec3 Character array that contains the packed GRIB2 GDS.
+ width x (or i) dimension of the grid. 0 if grid is not recognized.
+ height y (or j) dimension of the grid. 0 if grid is not recognized.
+ iscan Scanning mode (see Table 3.4 ). 0 of grid not recognized.
+
+
+
+
Returns Always returns 0.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition at line 29 of file getdim.c .
+
+
References g2_unpack3() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ getdrstemplate()
+
+
+
+
+
This subroutine returns DRS template information for a specified Data Representation Template.
+
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
+
Parameters
+
+ number The number of the Data Representation Template that is being requested.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-11
+
+
Definition at line 166 of file drstemplates.c .
+
+
References getdrsindex() , and templatesdrs .
+
+
Referenced by extdrstemplate() , g2_addfield() , and g2_unpack5() .
+
+
+
+
+
◆ getgridtemplate()
+
+
+
+
+
This subroutine returns grid template information for a specified Grid Definition Template for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml ).
+
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
+
This function allocates storage for the template. The returned pointer must be freed by the caller.
+
Parameters
+
+ number The number of the Grid Definition Template that is being requested.
+
+
+
+
Returns Pointer to the returned template struct (must be freed by caller). Returns NULL pointer, if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-09
+
+
Definition at line 180 of file gridtemplates.c .
+
+
References getgridindex() , and templatesgrid .
+
+
Referenced by extgridtemplate() , g2_addgrid() , and g2_unpack3() .
+
+
+
+
+
◆ getpdstemplate()
+
+
+
+
+
This subroutine returns PDS template information for a specified Product Definition Template.
+
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
+
This function allocates memory for the gtemplate struct, which must be freed by the caller.
+
Parameters
+
+ number the number of the Product Definition Template that is being requested.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL pointer if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-11
+
+
Definition at line 281 of file pdstemplates.c .
+
+
References getpdsindex() , and templatespds .
+
+
Referenced by extpdstemplate() , g2_addfield() , and g2_unpack4() .
+
+
+
+
+
◆ getpoly()
+
+
+
+
+
+ g2int getpoly
+ (
+ unsigned char *
+ csec3 ,
+
+
+
+
+ g2int *
+ jj ,
+
+
+
+
+ g2int *
+ kk ,
+
+
+
+
+ g2int *
+ mm
+
+
+
+ )
+
+
+
+
+
+
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Definition Section (GDS) used spherical harmonic coefficients using GDT 5.50 through 5.53.
+
If 51 - complex data spectral packing is used as the data representation template number (see Table 5.0 ), then the Grid Definition Template Number in section 3 should be one of:
+50: Spherical Harmonic Coefficients (See Template 3.50)
+51: Rotated Spherical Harmonic Coefficients (See Template 3.51)
+52: Stretched Spherical Harmonic Coefficients (See Template 3.52)
+53: Rotated and Stretched Spherical Harmonic Coefficients (See Template 3.53)
+
+
Parameters
+
+ csec3 Character array that contains the packed GRIB2 GDS.
+ jj J pentagonal resolution parameter.
+ kk K pentagonal resolution parameter.
+ mm M pentagonal resolution parameter.
+
+
+
+
Returns always returns 0.
+
Note Returns jj, kk, and mm set to zero, if grid template not recognized.
+
Author Stephen Gilbert
+
Date 2002-12-11
+
+
Definition at line 40 of file getpoly.c .
+
+
References g2_unpack3() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ int_power()
+
+
+
+
+
+ double int_power
+ (
+ double
+ x ,
+
+
+
+
+ g2int
+ y
+
+
+
+ )
+
+
+
+
+
+
Function similar to C pow() power function.
+
Parameters
+
+ x The base value whose power is to be calculated.
+ y The power value.
+
+
+
+
Returns x**y
+
Author Wesley Ebisuzaki
+
+
Definition at line 18 of file int_power.c .
+
+
Referenced by compack() , comunpack() , jpcpack_int() , jpcunpack_int() , misspack() , mkieee() , pngpack_int() , pngunpack_int() , rdieee() , simpack() , simunpack() , and specunpack() .
+
+
+
+
+
◆ jpcpack()
+
+
+
+
+
+ void jpcpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Author Stephen Gilbert, Ed Hartnett
+
+
Definition at line 253 of file jpcpack.c .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ jpcunpack()
+
+
+
+
+
+ g2int jpcunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values as an array of float.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephem Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 108 of file jpcunpack.c .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
◆ misspack()
+
+
+
+
+
+ void misspack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This function packs up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+
It supports GRIB2 complex packing templates with or without spatial differences (See Template 5.2 and Template 5.3 ).
+
This function fills in GRIB2 Data Representation template arrays with the appropriate values.
+
Parameters
+
+ fld Contains the data values to pack
+ ndpts The number of data values in array fld
+ idrsnum Data Representation Template number. Must equal 2 or 3.
+ idrstmpl Contains the array of values for Data Representation Template 5.2 or 5.3.
+0 Reference value - ignored on input, set by misspack routine.
+1 Binary Scale Factor - used on input.
+2 Decimal Scale Factor- used on input.
+6 Missing value management.
+7 Primary missing value.
+8 Secondary missing value.
+16 Order of Spatial Differencing (1 or 2).
+
+
+ cpack The packed data field (character*1 array).
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2000-06-21
+
+
Definition at line 42 of file misspack.c .
+
+
References ALOG2 , int_power() , mkieee() , pack_gp() , rdieee() , sbit() , and sbits() .
+
+
Referenced by cmplxpack() .
+
+
+
+
+
◆ mkieee()
+
+
+
+
+
+ void mkieee
+ (
+ float *
+ a ,
+
+
+
+
+ g2int *
+ rieee ,
+
+
+
+
+ g2int
+ num
+
+
+
+ )
+
+
+
+
+
+
This subroutine stores a list of real values in 32-bit IEEE floating point format.
+
Parameters
+
+ a Input array of floating point values.
+ num Number of floating point values to convert.
+ rieee Output array of data values in 32-bit IEEE format stored in g2int integer array. rieee must be allocated with at least 4*num bytes of memory before calling this function.
+
+
+
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition at line 22 of file mkieee.c .
+
+
References int_power() .
+
+
Referenced by compack() , g2_addfield() , jpcpack_int() , misspack() , pngpack_int() , simpack() , and specpack() .
+
+
+
+
+
◆ pack_gp()
+
+
+
+
+
+ int pack_gp
+ (
+ g2int *
+ kfildo ,
+
+
+
+
+ g2int *
+ ic ,
+
+
+
+
+ g2int *
+ nxy ,
+
+
+
+
+ g2int *
+ is523 ,
+
+
+
+
+ g2int *
+ minpk ,
+
+
+
+
+ g2int *
+ inc ,
+
+
+
+
+ g2int *
+ missp ,
+
+
+
+
+ g2int *
+ misss ,
+
+
+
+
+ g2int *
+ jmin ,
+
+
+
+
+ g2int *
+ jmax ,
+
+
+
+
+ g2int *
+ lbit ,
+
+
+
+
+ g2int *
+ nov ,
+
+
+
+
+ g2int *
+ ndg ,
+
+
+
+
+ g2int *
+ lx ,
+
+
+
+
+ g2int *
+ ibit ,
+
+
+
+
+ g2int *
+ jbit ,
+
+
+
+
+ g2int *
+ kbit ,
+
+
+
+
+ g2int *
+ novref ,
+
+
+
+
+ g2int *
+ lbitref ,
+
+
+
+
+ g2int *
+ ier
+
+
+
+ )
+
+
+
+
+
+
Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min (jmin( )), the number of bits necessary to hold the values in each group (lbit( )), the number of values in each group (nov( )), the number of bits necessary to pack the jmin( ) values (ibit), the number of bits necessary to pack the lbit( ) values (jbit), and the number of bits necessary to pack the nov( ) values (kbit).
+
The routine is designed to determine the groups such that a small number of bits is necessary to pack the data without excessive computations. If all values in the group are zero, the number of bits to use in packing is defined as zero when there can be no missing values; when there can be missing values, the number of bits must be at least 1 to have the capability to recognize the missing value. However, if all values in a group are missing, the number of bits needed is 0, and the unpacker recognizes this. All variables are g2int. Even though the groups are initially of size minpk or larger, an adjustment between two groups (the lookback procedure) may make a group smaller than minpk. The control on group size is that the sum of the sizes of the two consecutive groups, each of size minpk or larger, is not decreased. When determining the number of bits necessary for packing, the largest value that can be accommodated in, say, mbits, is 2**mbits-1; this largest value (and the next smallest value) is reserved for the missing value indicator (only) when is523 ne 0. If the dimension ndg is not large enough to hold all the groups, the local value of minpk is increased by 50 percent. This is repeated until ndg will suffice. A diagnostic is printed whenever this happens, which should be very rarely. If it happens often, ndg in subroutine pack should be increased and a corresponding increase in subroutine unpack made. Considerable code is provided so that no more checking for missing values within loops is done than necessary; the added efficiency of this is relatively minor, but does no harm. For grib2, the reference value for the length of groups in nov( ) and for the number of bits necessary to pack group values are determined, and subtracted before jbit and kbit are determined.
+
When 1 or more groups are large compared to the others, the width of all groups must be as large as the largest. A subroutine reduce breaks up large groups into 2 or more to reduce total bits required. If reduce should abort, pack_gp will be executed again without the call to reduce.
+
PROGRAM HISTORY LOG:
+February 1994 Glahn tdl mos-2000
+June 1995 Glahn modified for lmiss error.
+July 1996 Glahn added misss
+February 1997 Glahn removed 4 redundant tests for missp.eq.0; inserted a test to better handle a string of 9999's
+February 1997 Glahn added loops to eliminate test for misss when misss = 0
+March 1997 Glahn corrected for secondary missing value
+March 1997 Glahn corrected for use of local value of minpk
+March 1997 Glahn corrected for secondary missing value
+March 1997 Glahn changed calculating number of bits through exponents to an array (improved overall packing performance by about 35 percent!). allowed 0 bits for packing jmin( ), lbit( ), and nov( ).
+May 1997 Glahn a number of changes for efficiency. mod functions eliminated and one ifthen added. jount removed. recomputation of bits not made unless necessary after moving points from one group to another. nendb adjusted to eliminate possibility of very small group at the end. about 8 percent improvement in overall packing. iskipa removed; there is always a group b that can become group a. control on size of group b (statement below 150) added. added adda, and use of ge and le instead of gt and lt in loops between 150 and 160. ibitbs added to shorten trips through loop.
+March 2000 Glahn modified for grib2; changed name from packgp
+january 2001 Glahn comments; ier = 706 substituted for stops; added return1; removed statement number 110; added ier and * return
+November 2001 Glahn changed some diagnostic formats to allow printing larger numbers
+November 2001 Glahn added misslx( ) to put maximum value into jmin( ) when all values missing to agree with grib standard.
+November 2001 Glahn changed two tests on missp and misss eq 0 to tests on is523. however, missp and misss cannot in general be = 0.
+November 2001 Glahn added call to reduce; defined itest before loops to reduce computation; started large group when all same value
+December 2001 Glahn modified and added a few comments
+January 2002 Glahn removed loop before 150 to determine a group of all same value
+January 2002 Glahn changed mallow from 9999999 to 2**30+1, and made it a parameter
+March 2002 Glahn added non fatal ier = 716, 717; removed nendb=nxy above 150; added iersav=0; comments
+
+
DATA SET USE
+kfildo - unit number for output (print) file. (output)
+
+
Parameters
+
+ kfildo unit number for output (print) file. (input)
+ ic array to hold data for packing. the values do not have to be positive at this point, but must be in the range -2**30 to +2**30 (the the value of mallow). these g2int values will be retained exactly through packing and unpacking. (input)
+ nxy number of values in ic( ). also treated as its dimension. (input)
+ is523 missing value management 0=data contains no missing values 1=data contains primary missing values 2=data contains primary and secondary missing values (input)
+ minpk the minimum size of each group, except possibly the last one. (input)
+ inc the number of values to add to an already existing group in determining whether or not to start a new group. ideally, this would be 1, but each time inc values are attempted, the max and min of the next minpk values must be found. this is "a loop within a
+loop," and a slightly larger value may give about as good results with slightly less computational time. if inc is le 0, 1 is used, and a diagnostic is output. note: it is expected that inc will equal 1. the code uses inc primarily in the loops starting at statement 180. if inc were 1, there would not need to be loops as such. however, kinc (the local value of inc) is set ge 1 when near the end of the data to forestall a very small group at the end. (input)
+ missp when missing points can be present in the data, they will have the value missp or misss. missp is the primary missing value and misss is the secondary missing value . these must not be values that would occur with subtracting the minimum (reference) value or scaling. for example, missp = 0 would not be advisable. (input)
+ misss secondary missing value indicator (see missp). (input)
+ jmin the minimum of each group (j=1,lx). (output)
+ jmax the maximum of each group (j=1,lx). this is not really needed, but since the max of each group must be found, saving it here is cheap in case the user wants it. (output)
+ lbit the number of bits necessary to pack each group (j=1,lx). it is assumed the minimum of each group will be removed before packing, and the values to pack will, therefore, all be positive. however, ic( ) does not necessarily contain all positive values. if the overall minimum has been removed (the usual case), then ic( ) will contain only positive values. (output)
+ nov the number of values in each group (j=1,lx). (output)
+ ndg the dimension of jmin, jmax, lbit, and nov. (input)
+ lx the number of groups determined. (output)
+ ibit the number of bits necessary to pack the jmin(j) values, j=1,lx. (output)
+ jbit the number of bits necessary to pack the lbit(j) values, j=1,lx. (output)
+ kbit the number of bits necessary to pack the nov(j) values, j=1,lx. (output)
+ novref reference value for nov( ). (output)
+ lbitref reference value for lbit( ). (output)
+ ier Error code
+0 No error.
+706 value will not pack in 30 bits–fatal
+714 error in reduce–non-fatal
+715 ngp not large enough in reduce–non-fatal
+716 minpk inceased–non-fatal
+717 inc set
+1–non-fatal
+alternate return when ier ne 0 and fatal error.
+
+
+
+
+
+
Returns 0 - check ier for error code. INTERNAL VARIABLES
+
+ cfeed = contains the character representation
+ of a printer form feed.
+ ifeed = contains the g2int value of a printer
+ form feed.
+ kinc = working copy of inc. may be modified.
+ mina = minimum value in group a.
+ maxa = maximum value in group a.
+ nenda = the place in ic( ) where group a ends.
+ kstart = the place in ic( ) where group a starts.
+ ibita = number of bits needed to hold values in group a.
+ minb = minimum value in group b.
+ maxb = maximum value in group b.
+ nendb = the place in ic( ) where group b ends.
+ ibitb = number of bits needed to hold values in group b.
+ minc = minimum value in group c.
+ maxc = maximum value in group c.
+ ktotal = count of number of values in ic( ) processed.
+ nount = number of values added to group a.
+ lmiss = 0 when is523 = 0. when packing into a
+ specific number of bits, say mbits,
+ the maximum value that can be handled is
+ 2**mbits-1. when is523 = 1, indicating
+ primary missing values, this maximum value
+ is reserved to hold the primary missing value
+ indicator and lmiss = 1. when is523 = 2,
+ the value just below the maximum i.e.,
+ 2**mbits-2 is reserved to hold the secondary
+ missing value indicator and lmiss = 2.
+ lminpk = local value of minpk. this will be adjusted
+ upward whenever ndg is not large enough to hold
+ all the groups.
+ mallow = the largest allowable value for packing.
+ mislla = set to 1 when all values in group a are missing.
+ this is used to distinguish between a real
+ minimum when all values are not missing
+ and a minimum that has been set to zero when
+ all values are missing. 0 otherwise.
+ note that this does not distinguish between
+ primary and secondary missings when secondary
+ missings are present. this means that
+ lbit( ) will not be zero with the resulting
+ compression efficiency when secondary missings
+ are present. also note that a check has been
+ made earlier to determine that secondary
+ missings are really there.
+ misllb = set to 1 when all values in group b are missing.
+ this is used to distinguish between a real
+ minimum when all values are not missing
+ and a minimum that has been set to zero when
+ all values are missing. 0 otherwise.
+ misllc = performs the same function for group c that
+ mislla and misllb do for groups b and c,
+ respectively.
+ ibxx2(j) = an array that when this routine is first entered
+ is set to 2**j, j=0,30. ibxx2(30) = 2**30, which
+ is the largest value packable, because 2**31
+ is larger than the g2int word size.
+ ifirst = set by data statement to 0. changed to 1 on
+ first
+ entry when ibxx2( ) is filled.
+ minak = keeps track of the location in ic( ) where the
+ minimum value in group a is located.
+ maxak = does the same as minak, except for the maximum.
+ minbk = the same as minak for group b.
+ maxbk = the same as maxak for group b.
+ minck = the same as minak for group c.
+ maxck = the same as maxak for group c.
+ adda = keeps track whether or not an attempt to add
+ points to group a was made. if so, then adda
+ keeps from trying to put one back into b.
+ (g2int)
+ ibitbs = keeps current value if ibitb so that loop
+ ending at 166 doesn't have to start at
+ ibitb = 0 every time.
+ misslx(j) = mallow except when a group is all one value (and
+ lbit(j) = 0) and that value is missing. in
+ that case, misslx(j) is missp or misss. this
+ gets inserted into jmin(j) later as the
+ missing indicator; it can't be put in until
+ the end, because jmin( ) is used to calculate
+ the maximum number of bits (ibits) needed to
+ pack jmin( ).
+
+
+
Definition at line 255 of file pack_gp.c .
+
+
References FALSE_ , reduce() , and TRUE_ .
+
+
Referenced by compack() , and misspack() .
+
+
+
+
+
◆ pngpack()
+
+
+
+
+
+ void pngpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a float data field into PNG image format.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
+
Parameters
+
+ fld Pointer to array of float that contains the data values to pack.
+ width Number of points in the x direction.
+ height Number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template 5.41 or 5.40010.
+0 Reference value - ignored on input, set by pngpack routine.
+1 Binary Scale Factor - used on input.
+2 Decimal Scale Factor - used on input.
+3 number of bits for each grayscale pixel value - ignored on input.
+4 Original field type - currently ignored on input, set = 0 on output. Data values assumed to be reals.
+
+
+ cpack The packed data field.
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 224 of file pngpack.c .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ pngunpack()
+
+
+
+
+
+ g2int pngunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
+
Parameters
+
+ cpack The packed data field (character*1 array).
+ len length of packed field cpack().
+ idrstmpl Pointer to array of values for Data Representation Template 5.41 or 5.40010.
+ ndpts The number of data values to unpack.
+ fld Contains the unpacked data values.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephen Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 105 of file pngunpack.c .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
◆ rdieee()
+
+
+
+
+
+ void rdieee
+ (
+ g2int *
+ rieee ,
+
+
+
+
+ float *
+ a ,
+
+
+
+
+ g2int
+ num
+
+
+
+ )
+
+
+
+
+
+
+
◆ sbit()
+
+
+
+
+
+ void sbit
+ (
+ unsigned char *
+ out ,
+
+
+
+
+ g2int *
+ in ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits
+
+
+
+ )
+
+
+
+
+
+
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.
+
Parameters
+
+ out Pointer to packed array output. Must be allocated large enough to hold output.
+ in Pointer to unpacked array input.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to pack.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 38 of file gbits.c .
+
+
References sbits() .
+
+
Referenced by compack() , g2_addfield() , g2_addgrid() , g2_addlocal() , g2_create() , g2_gribend() , misspack() , and simpack() .
+
+
+
+
+
◆ sbits()
+
+
+
+
+
+ void sbits
+ (
+ unsigned char *
+ out ,
+
+
+
+
+ g2int *
+ in ,
+
+
+
+
+ g2int
+ iskip ,
+
+
+
+
+ g2int
+ nbits ,
+
+
+
+
+ g2int
+ nskip ,
+
+
+
+
+ g2int
+ n
+
+
+
+ )
+
+
+
+
+
+
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.
+
Parameters
+
+ out Pointer to packed array output. Must be allocated large enough to hold output.
+ in Pointer to unpacked array input.
+ iskip Initial number of bits to skip.
+ nbits Number of bits to pack.
+ nskip Additional number of bits to skip on each iteration.
+ n Number of iterations.
+
+
+
+
Author NOAA Programmer
+
+
Definition at line 114 of file gbits.c .
+
+
Referenced by compack() , g2_addfield() , g2_addgrid() , jpcpack_int() , misspack() , pngpack_int() , sbit() , and simpack() .
+
+
+
+
+
◆ simpack()
+
+
+
+
+
+ void simpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 documention.
+
It also fills in GRIB2 Data Representation Template 5.0 with the appropriate values.
+
Parameters
+
+ fld Contains the data values to pack.
+ ndpts The number of data values in array fld.
+ idrstmpl Contains the array of values for [Data Representation Template 5.0](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-0.shtml ).
+0 Reference value - ignored on input - set by simpack routine.
+1 Binary Scale Factor - unchanged from input.
+2 Decimal Scale Factor - unchanged from input.
+3 Number of bits used to pack data, if value is > 0 and <= 31. If this input value is 0 or outside above range then the num of bits is calculated based on given data and scale factors.
+4 Original field type - currently ignored on input. Data values assumed to be reals. Set to 0 by simpack routine.
+
+
+ cpack The packed data field
+ lcpack length of packed field starting at cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2002-11-06
+
+
Definition at line 34 of file simpack.c .
+
+
References ALOG2 , int_power() , mkieee() , sbit() , and sbits() .
+
+
Referenced by g2_addfield() , and specpack() .
+
+
+
+
+
◆ simunpack()
+
+
+
+
+
+ g2int simunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.0.
+
Parameters
+
+ cpack pointer to the packed data field.
+ idrstmpl pointer to the array of values for Data Representation Template 5.0.
+ ndpts The number of data values to unpack.
+ fld Contains the unpacked data values. fld must be `* allocated with at least ndpts * sizeof(float) bytes before calling this routine.
+
+
+
+
Returns 0 for success, error code otherwise.
+
Author Stephen Gilbert
+
Date 2002-10-29
+
+
Definition at line 26 of file simunpack.c .
+
+
References G2_JPCUNPACK_MEM , G2_NO_ERROR , gbits() , int_power() , and rdieee() .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
◆ specpack()
+
+
+
+
+
+ void specpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ JJ ,
+
+
+
+
+ g2int
+ KK ,
+
+
+
+
+ g2int
+ MM ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs a spectral data field using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 Data Representation Template 5.51 .
+
Parameters
+
+ fld Contains the data values to be packed.
+ ndpts The number of data values to pack.
+ JJ J - pentagonal resolution parameter.
+ KK K - pentagonal resolution parameter.
+ MM M - pentagonal resolution parameter.
+ idrstmpl Contains the array of 10 values for [Data Representation Template 5.51](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-51.shtml ).
+ cpack Pointer that gets the packed data field. Must be allocated by caller.
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2002-12-19
+
+
Definition at line 33 of file specpack.c .
+
+
References mkieee() , and simpack() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ specunpack()
+
+
+
+
+
+ g2int specunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ JJ ,
+
+
+
+
+ g2int
+ KK ,
+
+
+
+
+ g2int
+ MM ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51 .
+
Parameters
+
+ cpack pointer to the packed data field.
+ idrstmpl pointer to the array of values for Data Representation Template 5.51.
+ ndpts The number of data values to unpack (real and imaginary parts).
+ JJ pentagonal resolution parameter.
+ KK pentagonal resolution parameter.
+ MM pentagonal resolution parameter.
+ fld Contains the unpacked data values. fld must be allocated with at least ndpts * sizeof(float) bytes before calling this routine.
+
+
+
+
Returns 0 for success, -3 for wrong type.
+
Author Stephen Gilbert
+
Date 2000-06-21
+
+
Definition at line 35 of file specunpack.c .
+
+
References G2_NO_ERROR , G2_SPECUNPACK_TYPE , gbits() , int_power() , and rdieee() .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/grib2__int_8h.js b/ver-1.7.0/grib2__int_8h.js
new file mode 100644
index 00000000..af755835
--- /dev/null
+++ b/ver-1.7.0/grib2__int_8h.js
@@ -0,0 +1,49 @@
+var grib2__int_8h =
+[
+ [ "gtemplate", "grib2__int_8h.html#structgtemplate", [
+ [ "ext", "grib2__int_8h.html#a312a417c8e6f68bea7bfe86268c16594", null ],
+ [ "extlen", "grib2__int_8h.html#a743151a1bde2a21603926e1541baa5de", null ],
+ [ "map", "grib2__int_8h.html#a88e12020d460546cafcef9c445c3df20", null ],
+ [ "maplen", "grib2__int_8h.html#aea3cb225770444c7e40855ee401a5b29", null ],
+ [ "needext", "grib2__int_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf", null ],
+ [ "num", "grib2__int_8h.html#a973b6764b40aed427d419046b63d75b3", null ],
+ [ "type", "grib2__int_8h.html#ad28b4af0030473208605c2cf2c5e3f36", null ]
+ ] ],
+ [ "ALOG2", "grib2__int_8h.html#aca7ef7356b1550ae26423a6d8012f5fd", null ],
+ [ "G2C_JASPER_JPEG_FORMAT_NAME", "grib2__int_8h.html#a05f66c598caeaf6ef1b9e25c15dc053b", null ],
+ [ "LOG", "grib2__int_8h.html#abb35b3e9ac2b0ff8cd7c0881988940c0", null ],
+ [ "gtemplate", "grib2__int_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63", null ],
+ [ "cmplxpack", "grib2__int_8h.html#a099225c582defca6ab562d9aad5bc20b", null ],
+ [ "compack", "grib2__int_8h.html#acbf694045589babceb7412ac6faadc39", null ],
+ [ "comunpack", "grib2__int_8h.html#ab6cce79f010456f1e882fa1c027062da", null ],
+ [ "dec_jpeg2000", "grib2__int_8h.html#aecc47ef133bb090df718275d41098613", null ],
+ [ "dec_png", "grib2__int_8h.html#a4c7dfb37dbbca9143143db5aeb2f6005", null ],
+ [ "enc_jpeg2000", "grib2__int_8h.html#af4af6d586d2f9ca5da713d025dccf781", null ],
+ [ "enc_png", "grib2__int_8h.html#a0b304f2dca88e94a76c1182fbc1f5938", null ],
+ [ "extdrstemplate", "grib2__int_8h.html#a29eb8a2ca16e15e491d7115725ff907c", null ],
+ [ "extgridtemplate", "grib2__int_8h.html#a0d65c7c29a06c12ebee26746476d49c9", null ],
+ [ "extpdstemplate", "grib2__int_8h.html#a64e5f115f7c4ec0b1b7d8af8376d12eb", null ],
+ [ "g2c_check_msg", "grib2__int_8h.html#a3acf35e5653f0dab59b3e6fd130f2d62", null ],
+ [ "gbit", "grib2__int_8h.html#a1efb9739e947d94010aeba6daf62eca3", null ],
+ [ "gbits", "grib2__int_8h.html#a31ebdbbf262b7478d6a7cc4326f76ade", null ],
+ [ "getdim", "grib2__int_8h.html#aabc49a338fae74f6dfc9e98b6cb59de7", null ],
+ [ "getdrstemplate", "grib2__int_8h.html#acf3195b5cecc028727faa8a921eba03e", null ],
+ [ "getgridtemplate", "grib2__int_8h.html#af67f9624982c81a36531989254a9b98a", null ],
+ [ "getpdstemplate", "grib2__int_8h.html#ad08ad7c4bee0466cd8ccafc1c1e76520", null ],
+ [ "getpoly", "grib2__int_8h.html#aa8f99915cc3bf0efa7544cf3c2e1b552", null ],
+ [ "int_power", "grib2__int_8h.html#a6b284a64a4b42cd86db872ae7e1eeaa8", null ],
+ [ "jpcpack", "grib2__int_8h.html#ac5fa531e1573e7ae501a4e2826d22e89", null ],
+ [ "jpcunpack", "grib2__int_8h.html#a067a3f608a80a9fdd89ed9f59ed7c7f6", null ],
+ [ "misspack", "grib2__int_8h.html#aaa78613e8bf42b3dbd6d3813371bc339", null ],
+ [ "mkieee", "grib2__int_8h.html#a1594a8cc9a699a73a870b9ec4231fbd3", null ],
+ [ "pack_gp", "grib2__int_8h.html#ab5fbec07e58a9d872a0fa1c04d74a81b", null ],
+ [ "pngpack", "grib2__int_8h.html#a1353956d6cc706acd63e87ce21c69fd2", null ],
+ [ "pngunpack", "grib2__int_8h.html#a25efad18886998fd8f7172ddccaa9076", null ],
+ [ "rdieee", "grib2__int_8h.html#af4e2650852f7bbbfb531c977fcbd42ca", null ],
+ [ "sbit", "grib2__int_8h.html#af9e044ba7da32a5415e351ed647ef676", null ],
+ [ "sbits", "grib2__int_8h.html#a92b32e56ff8941c5026d460f4fe2aec3", null ],
+ [ "simpack", "grib2__int_8h.html#ac0b7f3dd51c470b9fb883bc93d82ab49", null ],
+ [ "simunpack", "grib2__int_8h.html#af1de6ae0957904b78ff8cfd7eeb908fa", null ],
+ [ "specpack", "grib2__int_8h.html#ab712ca4ca13ff72a2a4f3738e9ef66ce", null ],
+ [ "specunpack", "grib2__int_8h.html#accf1040682acbd7ef03f54ca5250d683", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/grib2__int_8h_source.html b/ver-1.7.0/grib2__int_8h_source.html
new file mode 100644
index 00000000..0ffbd1ad
--- /dev/null
+++ b/ver-1.7.0/grib2__int_8h_source.html
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: grib2_int.h Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
21 #define ALOG2 (0.69314718)
+
23 #define G2C_JASPER_JPEG_FORMAT_NAME "jpc"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
73 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
77 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
81 unsigned char *cpack,
g2int *lcpack);
+
+
83 unsigned char *cpack,
g2int *lcpack);
+
+
+
86 g2int *idrstmpl,
unsigned char *cpack,
g2int *lcpack);
+
+
+
+
+
+
92 unsigned char *pngbuf);
+
+
+
+
96 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
+
+
+
+
104 unsigned char *cpack,
g2int *lcpack);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
130 void g2_log(
int severity,
const char *fmt, ...);
+
+
133 #define LOG(e) g2_log e
+
+
+
+
+
+
+
+
+
+
+gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
+g2int * ext
Number of octets of each entry in the extension part of the template.
+int comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in ...
+void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
+g2int type
The template type: 3 Grid Defintion Template.
+gtemplate * extdrstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Data Representation Template,...
+void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
+int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
Decode PNG.
+void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+g2int needext
Indicates whether or not the template needs to be extended.
+void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+gtemplate * extgridtemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Grid Definition Template,...
+double int_power(double x, g2int y)
Function similar to C pow() power function.
+g2int maplen
Number of entries in the static part of the template.
+int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
Encode PNG.
+void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+gtemplate * getgridtemplate(g2int number)
This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
+g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
+g2int * map
Number of octets of each entry in the static part of the template.
+void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
+void compack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
+int pack_gp(g2int *kfildo, g2int *ic, g2int *nxy, g2int *is523, g2int *minpk, g2int *inc, g2int *missp, g2int *misss, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *ndg, g2int *lx, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *lbitref, g2int *ier)
Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
+gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
+Header file for NCEPLIBS-g2c library.
+g2int getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid De...
+int64_t g2int
Long integer type.
+g2int num
The template number.
+void specpack(float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs a spectral data field using the complex packing algorithm for spherical harmoni...
+g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
+g2int simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
+void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
+g2int extlen
Number of entries in the template extension.
+void simpack(float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 docu...
+g2int specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, float *fld)
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...
+void misspack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This function packs up a data field using a complex packing algorithm as defined in the GRIB2 documen...
+int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
+void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a float data field into PNG image format.
+void cmplxpack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
+g2int getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Def...
+Struct for GRIB template.
+int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
Check for 'GRIB' at the beginning of a GRIB message, and check to see if the message is already termi...
+int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen)
This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 ...
+
+
+
+
diff --git a/ver-1.7.0/grib2__int_8h_structgtemplate.js b/ver-1.7.0/grib2__int_8h_structgtemplate.js
new file mode 100644
index 00000000..0e78985e
--- /dev/null
+++ b/ver-1.7.0/grib2__int_8h_structgtemplate.js
@@ -0,0 +1,10 @@
+var grib2__int_8h_structgtemplate =
+[
+ [ "ext", "grib2__int_8h.html#a312a417c8e6f68bea7bfe86268c16594", null ],
+ [ "extlen", "grib2__int_8h.html#a743151a1bde2a21603926e1541baa5de", null ],
+ [ "map", "grib2__int_8h.html#a88e12020d460546cafcef9c445c3df20", null ],
+ [ "maplen", "grib2__int_8h.html#aea3cb225770444c7e40855ee401a5b29", null ],
+ [ "needext", "grib2__int_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf", null ],
+ [ "num", "grib2__int_8h.html#a973b6764b40aed427d419046b63d75b3", null ],
+ [ "type", "grib2__int_8h.html#ad28b4af0030473208605c2cf2c5e3f36", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/gridtemplates_8c.html b/ver-1.7.0/gridtemplates_8c.html
new file mode 100644
index 00000000..c0962bfa
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8c.html
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gridtemplates.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).
+More...
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+
Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).
+
Each Template has three parts:
+The number of entries in the template (mapgridlen).
+A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values.
+A logical value (needext) that indicates whether the Template needs to be extended.
+
+
In some cases the number of entries in a template can vary depending upon values specified in the "static" part of the template. (See Template 3.120 as an example).
+
Note Array mapgrid contains the number of octets in which the corresponding template values will be stored. A negative value in mapgrid is used to indicate that the corresponding template entry can contain negative values. This information is used later when packing (or unpacking) the template data values. Negative data values in GRIB are stored with the left most bit set to one, and a negative number of octets value in mapgrid indicates that this possibility should be considered. The number of octets used to store the data value in this case would be the absolute value of the negative value in mapgrid.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2001-06-28 Gilbert Initial
+
+2007-08-16 Vuong Added GDT 3.204 Curvilinear Orthogonal Grid
+
+2008-07-08 Vuong Added GDT 3.32768 Rotate Lat/Lon E-grid (Arakawa)
+
+2009-01-14 Vuong Changed structure name template to gtemplate
+
+2010-05-11 Vuong Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+
+2013-08-06 Vuong Added GDT 3.4, 3.5, 3.12, 3.101, 3.140
+
+
Author Stephen Gilbert
+
Date 2001-06-28
+
+
Definition in file gridtemplates.c .
+
+
+
◆ MAXGRIDMAPLEN
+
+
+
+
+
+ #define MAXGRIDMAPLEN 200
+
+
+
+
+
Maximum template map length.
+
+
Definition at line 43 of file gridtemplates.c .
+
+
+
+
+
◆ MAXGRIDTEMP
+
+
+
+
+
+ #define MAXGRIDTEMP 31
+
+
+
+
+
Maximum number of templates.
+
+
Definition at line 42 of file gridtemplates.c .
+
+
+
+
+
+
◆ extgridtemplate()
+
+
+
+
+
This subroutine generates the remaining octet map for a given Grid Definition Template, if required.
+
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
+
This function allocates memory for the extension. The pointer ext in the gtemplate struct must be freed to prevent memory leaks.
+
Parameters
+
+ number The number of the Grid Definition Template that is being requested.
+ list The list of values for each entry in the Grid Definition Template.
+
+
+
+
Returns Pointer to the returned template struct. Returns NULL pointer, if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-09
+
+
Definition at line 229 of file gridtemplates.c .
+
+
References getgridindex() , and getgridtemplate() .
+
+
Referenced by g2_addgrid() , and g2_unpack3() .
+
+
+
+
+
◆ getgridindex()
+
+
+
+
+
+
+
+
+ static g2int getgridindex
+ (
+ g2int
+ number )
+
+
+
+
+
+static
+
+
+
+
+
+
◆ getgridtemplate()
+
+
+
+
+
This subroutine returns grid template information for a specified Grid Definition Template for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml ).
+
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
+
This function allocates storage for the template. The returned pointer must be freed by the caller.
+
Parameters
+
+ number The number of the Grid Definition Template that is being requested.
+
+
+
+
Returns Pointer to the returned template struct (must be freed by caller). Returns NULL pointer, if template not found.
+
Author Stephen Gilbert
+
Date 2000-05-09
+
+
Definition at line 180 of file gridtemplates.c .
+
+
References getgridindex() , and templatesgrid .
+
+
Referenced by extgridtemplate() , g2_addgrid() , and g2_unpack3() .
+
+
+
+
+
+
◆ templatesgrid
+
+
+
+
+
+
+
+
+ const struct gridtemplate templatesgrid[MAXGRIDTEMP ]
+
+
+
+
+static
+
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/gridtemplates_8c.js b/ver-1.7.0/gridtemplates_8c.js
new file mode 100644
index 00000000..7de303e8
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8c.js
@@ -0,0 +1,9 @@
+var gridtemplates_8c =
+[
+ [ "MAXGRIDMAPLEN", "gridtemplates_8c.html#ab19500a13d07a421b89afd9d011ae058", null ],
+ [ "MAXGRIDTEMP", "gridtemplates_8c.html#a4d1ba1f89b11d332fb06d9624d5156c9", null ],
+ [ "extgridtemplate", "gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9", null ],
+ [ "getgridindex", "gridtemplates_8c.html#addbeca29a7de77dc30f65a08b6b38941", null ],
+ [ "getgridtemplate", "gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a", null ],
+ [ "templatesgrid", "gridtemplates_8c.html#af8316127b8fcf96fb4d3ab2c5411cde9", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/gridtemplates_8c_source.html b/ver-1.7.0/gridtemplates_8c_source.html
new file mode 100644
index 00000000..8088d84d
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8c_source.html
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gridtemplates.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
42 #define MAXGRIDTEMP 31
+
43 #define MAXGRIDMAPLEN 200
+
+
+
+
+
+
+
+
+
+
+
+
62 { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
64 { 1, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+
+
66 { 2, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+
+
68 { 3, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+
+
+
71 { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
+
+
73 { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
+
+
75 {12, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,1,4,4,-4,-4,-4,-4} },
+
+
77 {101, 4, 0, {1,4,1,-4} },
+
+
79 {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
+
+
+
82 {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+
+
84 {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+
+
86 {30, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+
+
88 {31, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+
+
90 {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
92 {41, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+
+
94 {42, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+
+
96 {43, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+
+
98 {50, 5, 0, {4,4,4,1,1} },
+
+
100 {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+
+
102 {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+
+
104 {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+
+
106 {90, 21, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,4,4,1,4,4,4,4} },
+
+
108 {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+
+
110 {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+
+
112 {120, 7, 1, {4,4,-4,4,4,4,1} },
+
+
114 {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
116 {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
118 {32769, 21, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,4,4} },
+
+
120 {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+
+
122 {1100, 28, 0, {1,1,4,1,4,1,4,4,4,4,-4,4,1,-4,4,1,4,1,-4,1,1,-4,2,1,1,1,1,1} },
+
+
124 {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
201 printf(
"getgridtemplate: GDT Template 3.%d not defined.\n" , (
int )number);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
245 new ->extlen = list[1] * 2;
+
246 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
247 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
+
+
+
+
255 else if (number == 4)
+
+
257 new ->extlen = list[7];
+
258 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
259 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
263 new ->extlen = list[8];
+
264 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
265 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
+
270 else if (number == 5)
+
+
272 new ->extlen = list[7];
+
273 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
274 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
278 new ->extlen = list[8];
+
279 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
280 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
+
285 else if (number == 1000)
+
+
287 new ->extlen = list[19];
+
288 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
289 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
+
294 else if (number == 1200)
+
+
296 new ->extlen = list[15];
+
297 new ->ext = malloc(
sizeof (
g2int ) * new->extlen);
+
298 for (i = 0; i <
new ->extlen; i++)
+
+
+
+
+
+
+
+
+
+gtemplate * extgridtemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Grid Definition Template,...
+g2int needext
Indicates whether or not the template needs to be extended.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+#define MAXGRIDMAPLEN
Maximum template map length.
+static const struct gridtemplate templatesgrid[MAXGRIDTEMP]
Templates grid.
+int64_t g2int
Long integer type.
+#define MAXGRIDTEMP
Maximum number of templates.
+static g2int getgridindex(g2int number)
This function returns the index of specified Grid Definition Template in array templates for [Section...
+gtemplate * getgridtemplate(g2int number)
This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
+Struct for GRIB template.
+
+
+
+
diff --git a/ver-1.7.0/gridtemplates_8h.html b/ver-1.7.0/gridtemplates_8h.html
new file mode 100644
index 00000000..f3d1c152
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8h.html
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gridtemplates.h File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.6.4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).
+More...
+
+
Go to the source code of this file.
+
+
+
This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).
+
Each Template has three parts:
+The number of entries in the template (mapgridlen).
+A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values.
+A logical value (needext) that indicates whether the Template needs to be extended.
+
+
In some cases the number of entries in a template can vary depending upon values specified in the "static" part of the template. (See Template 3.120 as an example).
+
Note Array mapgrid contains the number of octets in which the corresponding template values will be stored. A negative value in mapgrid is used to indicate that the corresponding template entry can contain negative values. This information is used later when packing (or unpacking) the template data values. Negative data values in GRIB are stored with the left most bit set to one, and a negative number of octets value in mapgrid indicates that this possibility should be considered. The number of octets used to store the data value in this case would be the absolute value of the negative value in mapgrid.
+
+Program History Log
+
+
+Date Programmer Comments
+
+2001-10-26 Gilbert Initial
+
+2007-08-16 Vuong Added GDT 3.204 Curvilinear Orthogonal Grid
+
+2008-07-08 Vuong Added GDT 3.32768 Rot Lat/Lon E-grid (Arakawa)
+
+2010-05-11 Vuong Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+
+2013-08-06 Vuong Added GDT 3.4, 3.5, 3.12, 3.101, 3.140
+
+
Author Stephen Gilbert
+
Date 2001-10-26
+
+
Definition in file gridtemplates.h .
+
+
+
◆ gridtemplate
+
+
+
+
+
+ struct gridtemplate
+
+
+
+
Struct for grid template.
+
+
Definition at line 49 of file gridtemplates.h .
+
+Data Fields
+
+g2int
+
+mapgrid[MAXGRIDMAPLEN ]
+
+Number of bytes for each template value.
+
+g2int
+
+mapgridlen
+
+The number of entries in the template.
+
+g2int
+
+needext
+
+Does template need extension?
+
+g2int
+
+template_num
+
+Template number.
+
+
+
+
+
+
+
◆ MAXGRIDMAPLEN
+
+
+
+
+
+ #define MAXGRIDMAPLEN 200
+
+
+
+
+
Maximum template map length.
+
+
Definition at line 44 of file gridtemplates.h .
+
+
+
+
+
◆ MAXGRIDTEMP
+
+
+
+
+
+ #define MAXGRIDTEMP 31
+
+
+
+
+
Maximum number of templates.
+
+
Definition at line 43 of file gridtemplates.h .
+
+
+
+
+
+
◆ templatesgrid
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/gridtemplates_8h.js b/ver-1.7.0/gridtemplates_8h.js
new file mode 100644
index 00000000..642c5727
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8h.js
@@ -0,0 +1,12 @@
+var gridtemplates_8h =
+[
+ [ "gridtemplate", "gridtemplates_8h.html#structgridtemplate", [
+ [ "mapgrid", "gridtemplates_8h.html#aec242883534f9f01fba9c21f4c6178a6", null ],
+ [ "mapgridlen", "gridtemplates_8h.html#aa83afad572393d4193125436f9f33e55", null ],
+ [ "needext", "gridtemplates_8h.html#aa3d5a179a13f0991613f4c21d65e0080", null ],
+ [ "template_num", "gridtemplates_8h.html#a46be4feeeff8e2ea52782da990217632", null ]
+ ] ],
+ [ "MAXGRIDMAPLEN", "gridtemplates_8h.html#ab19500a13d07a421b89afd9d011ae058", null ],
+ [ "MAXGRIDTEMP", "gridtemplates_8h.html#a4d1ba1f89b11d332fb06d9624d5156c9", null ],
+ [ "templatesgrid", "gridtemplates_8h.html#af8316127b8fcf96fb4d3ab2c5411cde9", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/gridtemplates_8h_source.html b/ver-1.7.0/gridtemplates_8h_source.html
new file mode 100644
index 00000000..bc19893e
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8h_source.html
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: gridtemplates.h Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.6.4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
39 #ifndef _gridtemplates_H
+
40 #define _gridtemplates_H
+
+
+
43 #define MAXGRIDTEMP 31
+
44 #define MAXGRIDMAPLEN 200
+
+
+
+
+
+
+
+
+
+
+
+
63 { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
65 { 1, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+
+
67 { 2, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+
+
69 { 3, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+
+
+
72 { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
+
+
74 { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
+
+
76 {12, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,1,4,4,-4,-4,-4,-4} },
+
+
78 {101, 4, 0, {1,4,1,-4} },
+
+
80 {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
+
+
+
83 {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+
+
85 {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+
+
87 {30, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+
+
89 {31, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+
+
91 {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
93 {41, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+
+
95 {42, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+
+
97 {43, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+
+
99 {50, 5, 0, {4,4,4,1,1} },
+
+
101 {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+
+
103 {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+
+
105 {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+
+
107 {90, 21, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,4,4,1,4,4,4,4} },
+
+
109 {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+
+
111 {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+
+
113 {120, 7, 1, {4,4,-4,4,4,4,1} },
+
+
115 {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
117 {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
+
119 {32769, 21, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,4,4} },
+
+
121 {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+
+
123 {1100, 28, 0, {1,1,4,1,4,1,4,4,4,4,-4,4,1,-4,4,1,4,1,-4,1,1,-4,2,1,1,1,1,1} },
+
+
125 {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
+
+
+
Header file for NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
+
g2int template_num
Template number.
+
#define MAXGRIDTEMP
Maximum number of templates.
+
g2int needext
Does template need extension?
+
g2int mapgridlen
The number of entries in the template.
+
#define MAXGRIDMAPLEN
Maximum template map length.
+
g2int mapgrid[MAXGRIDMAPLEN]
Number of bytes for each template value.
+
const struct gridtemplate templatesgrid[MAXGRIDTEMP]
Templates grid.
+
Struct for grid template.
+
+
+
+
+
+
diff --git a/ver-1.7.0/gridtemplates_8h_structgridtemplate.js b/ver-1.7.0/gridtemplates_8h_structgridtemplate.js
new file mode 100644
index 00000000..9713c90c
--- /dev/null
+++ b/ver-1.7.0/gridtemplates_8h_structgridtemplate.js
@@ -0,0 +1,7 @@
+var gridtemplates_8h_structgridtemplate =
+[
+ [ "mapgrid", "gridtemplates_8h.html#aec242883534f9f01fba9c21f4c6178a6", null ],
+ [ "mapgridlen", "gridtemplates_8h.html#aa83afad572393d4193125436f9f33e55", null ],
+ [ "needext", "gridtemplates_8h.html#aa3d5a179a13f0991613f4c21d65e0080", null ],
+ [ "template_num", "gridtemplates_8h.html#a46be4feeeff8e2ea52782da990217632", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/index.html b/ver-1.7.0/index.html
new file mode 100644
index 00000000..1df31562
--- /dev/null
+++ b/ver-1.7.0/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: Main Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Documentation for Previous Versions of NCEPLIBS-g2c
+
+
+Introduction
+
This document briefly describes the routines available for encoding/decoding GRIB Edition 2 (GRIB2) messages with the NCEPLIBS-g2c library.
+
A GRIB Edition 2 message is a machine independent format for storing one or more gridded data fields. Each GRIB2 message consists of the following sections:
+
+SECTION 0 - Indicator Section
+SECTION 1 - Identification Section
+SECTION 2 - (Local Use Section) - optional }
+SECTION 3 - Grid Definition Section } }
+SECTION 4 - Product Definition Section } } }(repeated)
+SECTION 5 - Data Representation Section } }(repeated) }
+SECTION 6 - Bit-map Section }(repeated) } }
+SECTION 7 - Data Section } } }
+SECTION 8 - End Section } } }
+ Sequences of GRIB sections 2 to 7, 3 to 7, or sections 4 to 7 may be repeated within a single GRIB message. All sections within such repeated sequences must be present and shall appear in the numerical order noted above. Unrepeated sections remain in effect until redefined.
+
For detailed information on GRIB2 see the NCEP WMO GRIB2 Documentation .
+
+GRIB2 Encoding Routines
+
Since a GRIB2 message can contain gridded fields for many parameters on a number of different grids, several routines are used to encode a message. This should give users more flexibility in how to organize data within one or more GRIB2 messages.
+
To start a new GRIB2 message, call function g2_create() . It encodes Sections 0 and 1 at the beginning of the message. This routine must be used to create each message.
+
Function g2_addlocal() can be used to add a Local Use Section (Section 2). Note that section is optional and need not appear in a GRIB2 message.
+
Function g2_addgrid() is used to encode a grid definition into Section 3 - The Grid Definition Section. This grid definition defines the geometry of the the data values in the fields that follow it. Function addgrid() can be called again to change the grid definition describing subsequent data fields.
+
Each data field is added to the GRIB2 message using routine g2_addfield() , which adds Sections 4, 5, 6, and 7 to the message.
+
After all desired data fields have been added to the GRIB2 message, a call to routine g2_gribend() is needed to add the final section 8 to the message and to update the length of the message. A call to g2_gribend() is required for each GRIB2 message.
+
+GRIB2 Decoding Routines
+
Function g2_info() can be used to find out how many Local Use sections and data fields are contained in a given GRIB2 message. In addition, this routine also returns the number of octets of the largest Local Use section in the message.
+
g2_getfld() can be used to get all information pertaining to the nth data field in the message. An option exists that lets the user decide if the function should unpack the Bit-map (if applicable) and the data values or just return the field description information.
+
+Extracting GRIB2 Fields from a GRIB2 file
+
Function g2_info() can be used to find out how many Local Use sections and data fields are contained in a given GRIB2 message.
+
+GRIB2 Tables/Templates
+
NCO Provides documentation on WMO GRIB2 at https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/
+
WMO's GRIB2 specification "FM 92-XII GRIB - General
+Regularly-distributed Information in Binary Form" contains descriptions of each template and code table information. This document can be found at https://codes.wmo.int/grib2/_codeflag (PDF and MSWord formats are available).
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/int__power_8c.html b/ver-1.7.0/int__power_8c.html
new file mode 100644
index 00000000..e69bdb30
--- /dev/null
+++ b/ver-1.7.0/int__power_8c.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: int_power.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Provide function similar to C pow() power function.
+More...
+
+
Go to the source code of this file.
+
+
+
Provide function similar to C pow() power function.
+
Author Wesley Ebisuzaki
+
+
Definition in file int_power.c .
+
+
+
◆ int_power()
+
+
+
+
+
+ double int_power
+ (
+ double
+ x ,
+
+
+
+
+ g2int
+ y
+
+
+
+ )
+
+
+
+
+
+
Function similar to C pow() power function.
+
Parameters
+
+ x The base value whose power is to be calculated.
+ y The power value.
+
+
+
+
Returns x**y
+
Author Wesley Ebisuzaki
+
+
Definition at line 18 of file int_power.c .
+
+
Referenced by compack() , comunpack() , jpcpack_int() , jpcunpack_int() , misspack() , mkieee() , pngpack_int() , pngunpack_int() , rdieee() , simpack() , simunpack() , and specunpack() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/int__power_8c.js b/ver-1.7.0/int__power_8c.js
new file mode 100644
index 00000000..016df97d
--- /dev/null
+++ b/ver-1.7.0/int__power_8c.js
@@ -0,0 +1,4 @@
+var int__power_8c =
+[
+ [ "int_power", "int__power_8c.html#a6b284a64a4b42cd86db872ae7e1eeaa8", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/int__power_8c_source.html b/ver-1.7.0/int__power_8c_source.html
new file mode 100644
index 00000000..859f3808
--- /dev/null
+++ b/ver-1.7.0/int__power_8c_source.html
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: int_power.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+double int_power(double x, g2int y)
Function similar to C pow() power function.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+int64_t g2int
Long integer type.
+
+
+
+
diff --git a/ver-1.7.0/jpcpack_8c.html b/ver-1.7.0/jpcpack_8c.html
new file mode 100644
index 00000000..90ec113d
--- /dev/null
+++ b/ver-1.7.0/jpcpack_8c.html
@@ -0,0 +1,407 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: jpcpack.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Pack up a data field into a JPEG2000 code stream.
+More...
+
#include <stdlib.h>
+
#include <math.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+void jpcpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field into a JPEG2000 code stream. More...
+
+static void jpcpack_int (void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a float or double array into a JPEG2000 code stream. More...
+
+void jpcpackd (double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This subroutine packs up a data field into a JPEG2000 code stream. More...
+
+
+
+
Pack up a data field into a JPEG2000 code stream.
+
Author Stephen Gilbert
+
Date 2003-08-17
+
+Program History Log
+
+
+Date Programmer Comments
+
+2003-08-17 Gilbert Initial.
+
+2004-11-92 Gilbert Fixed bug packing a near constant field.
+
+2004-07-19 Gilbert If jpeg2000 encoding fails, try again with different encoder options.
+
+2005-05-10 Gilbert Imposed minimum size on cpack.
+
+2022-08-12 Hartnett Now handle doubles too.
+
+
+
Definition in file jpcpack.c .
+
+
+
◆ jpcpack()
+
+
+
+
+
+ void jpcpack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Author Stephen Gilbert, Ed Hartnett
+
+
Definition at line 253 of file jpcpack.c .
+
+
References jpcpack_int() .
+
+
Referenced by g2_addfield() .
+
+
+
+
+
◆ jpcpack_int()
+
+
+
+
+
+
+
+
+ static void jpcpack_int
+ (
+ void *
+ fld ,
+
+
+
+
+ int
+ fld_is_double ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
This subroutine packs up a float or double array into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ fld_is_double If non-zero, then fld points to array of doubles, otherwise an array of floats.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Returns N/A
+
Author Stephen Gilbert, Ed Hartnett
+
+
Definition at line 57 of file jpcpack.c .
+
+
References ALOG2 , enc_jpeg2000() , int_power() , LOG , mkieee() , and sbits() .
+
+
Referenced by jpcpack() , and jpcpackd() .
+
+
+
+
+
◆ jpcpackd()
+
+
+
+
+
+ void jpcpackd
+ (
+ double *
+ fld ,
+
+
+
+
+ g2int
+ width ,
+
+
+
+
+ g2int
+ height ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This subroutine packs up a data field into a JPEG2000 code stream.
+
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
+
Parameters
+
+ fld Pointer to the float or double data values to pack.
+ width The number of points in the x direction.
+ height The number of points in the y direction.
+ idrstmpl Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
+0 Reference value - ignored on input, set by jpcpack routine.
+1 Binary Scale Factor - used on input, unchanged by jpcpack routine.
+2 Decimal Scale Factor - used on input, unchanged by jpcpack routine.
+3 number of bits for each data value - ignored on input
+4 Original field type - currently ignored on input Data values assumed to be reals. Set to 0 on output.
+5 if 0 use lossless compression, if 1 use lossy compression.
+6 Desired compression ratio, if idrstmpl[5]=1. Set to 255, if idrstmpl[5]=0.
+
+
+ cpack A pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
+ lcpack Pointer that gets the length of packed field in cpack. This must be set by the calling function to the size available in cpack.
+
+
+
+
Author Ed Hartnett
+
+
Definition at line 294 of file jpcpack.c .
+
+
References jpcpack_int() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/jpcpack_8c.js b/ver-1.7.0/jpcpack_8c.js
new file mode 100644
index 00000000..e53f0a2c
--- /dev/null
+++ b/ver-1.7.0/jpcpack_8c.js
@@ -0,0 +1,6 @@
+var jpcpack_8c =
+[
+ [ "jpcpack", "jpcpack_8c.html#ac5fa531e1573e7ae501a4e2826d22e89", null ],
+ [ "jpcpack_int", "jpcpack_8c.html#a9f24b8a932de264dd219b21a9e9a7d86", null ],
+ [ "jpcpackd", "jpcpack_8c.html#aae606a6769d1d2d74a9476f52ca03c2f", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/jpcpack_8c_source.html b/ver-1.7.0/jpcpack_8c_source.html
new file mode 100644
index 00000000..965f4bd9
--- /dev/null
+++ b/ver-1.7.0/jpcpack_8c_source.html
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: jpcpack.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
58 unsigned char *cpack,
g2int *lcpack)
+
+
+
61 static float alog2 =
ALOG2 ;
+
62 g2int j, nbits, imin, imax, maxdif;
+
63 g2int ndpts, nbytes, nsize, retry;
+
64 float bscale, dscale, rmax, rmin, temp;
+
+
+
+
+
+
70 LOG ((2,
"jpcpack_int() fld_is_double %d width %ld height %ld idrstmpl[1] %ld *lcpack %ld" ,
+
71 fld_is_double, width, height, idrstmpl[1], *lcpack));
+
+
73 ndpts = width * height;
+
+
+
76 LOG ((3,
"ndpts %ld bscale %g dscale %g" , ndpts, bscale, dscale));
+
+
+
+
+
+
+
+
+
85 for (j = 1; j < ndpts; j++)
+
+
+
+
+
+
+
+
93 maxdif = (
g2int )(rint(rmaxd * dscale) - rint(rmind * dscale));
+
+
95 maxdif = (
g2int )rint((rmaxd - rmind) * dscale * bscale);
+
+
+
+
99 for (j = 1; j < ndpts; j++)
+
+
+
+
+
+
+
106 if (idrstmpl[1] == 0)
+
107 maxdif = (
g2int )(rint(rmax * dscale) - rint(rmin * dscale));
+
+
109 maxdif = (
g2int )rint((rmax - rmin) * dscale * bscale);
+
+
111 LOG ((3,
"rmax %g rmaxd %g rmin %g rmind %g" , rmax, rmaxd, rmin, rmind));
+
+
+
+
+
116 if (((fld_is_double && rmind != rmaxd) || (!fld_is_double && rmin != rmax)) && maxdif != 0)
+
+
118 ifld = malloc(ndpts *
sizeof (
g2int ));
+
+
+
+
122 if (idrstmpl[1] == 0)
+
+
+
+
126 imin = (
g2int )rint((fld_is_double ? rmind : rmin) * dscale);
+
127 imax = (
g2int )rint((fld_is_double ? rmaxd : rmax) * dscale);
+
128 maxdif = imax - imin;
+
129 temp = log((
double )(maxdif + 1)) / alog2;
+
130 nbits = (
g2int )ceil(temp);
+
+
+
+
+
135 for (j = 0; j < ndpts; j++)
+
136 ifld[j] = (
g2int )rint(dfld[j] * dscale) - imin;
+
+
+
+
+
141 for (j = 0; j < ndpts; j++)
+
142 ifld[j] = (
g2int )rint(ffld[j] * dscale) - imin;
+
+
+
+
+
+
+
+
+
151 rmind = rmind * dscale;
+
152 rmaxd = rmaxd * dscale;
+
153 maxdif = (
g2int )rint((rmaxd - rmind) * bscale);
+
+
+
+
157 rmin = rmin * dscale;
+
158 rmax = rmax * dscale;
+
159 maxdif = (
g2int )rint((rmax - rmin) * bscale);
+
+
+
162 temp = log((
double )(maxdif + 1)) / alog2;
+
163 nbits = (
g2int )ceil(temp);
+
+
+
+
167 for (j = 0; j < ndpts; j++)
+
168 ifld[j] = (
g2int )rint(((dfld[j] * dscale) - rmind) * bscale);
+
+
+
+
172 for (j = 0; j < ndpts; j++)
+
173 ifld[j] = (
g2int )rint(((ffld[j] * dscale) - rmin) * bscale);
+
+
+
+
+
+
+
180 nbytes = (nbits + 7) / 8;
+
+
182 ctemp = calloc(ndpts, nbytes);
+
183 sbits (ctemp, ifld, 0, nbytes * 8, 0, ndpts);
+
+
185 idrstmpl[6], retry, (
char *)cpack, nsize)) <= 0)
+
+
187 printf(
"jpcpack: ERROR Packing JPC = %d\n" , (
int )*lcpack);
+
+
+
+
+
192 idrstmpl[6], retry, (
char *)cpack, nsize)) <= 0)
+
193 printf(
"jpcpack: Retry Failed.\n" );
+
+
195 printf(
"jpcpack: Retry Successful.\n" );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
209 mkieee (&rmin, idrstmpl, 1);
+
+
+
212 if (idrstmpl[5] == 0)
+
+
+
+
+
+
+
+
254 unsigned char *cpack,
g2int *lcpack)
+
+
256 jpcpack_int (fld, 0, width, height, idrstmpl, cpack, lcpack);
+
+
+
+
+
295 unsigned char *cpack,
g2int *lcpack)
+
+
297 jpcpack_int (fld, 1, width, height, idrstmpl, cpack, lcpack);
+
+
+
+static void jpcpack_int(void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a float or double array into a JPEG2000 code stream.
+double int_power(double x, g2int y)
Function similar to C pow() power function.
+#define LOG(e)
Ignore logging to stdout.
+Header file with internal function prototypes NCEPLIBS-g2c library.
+void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n)
Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
+void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
+int64_t g2int
Long integer type.
+int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen)
This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 ...
+
+void jpcpackd(double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This subroutine packs up a data field into a JPEG2000 code stream.
+
+
+
+
diff --git a/ver-1.7.0/jpcunpack_8c.html b/ver-1.7.0/jpcunpack_8c.html
new file mode 100644
index 00000000..abe298f7
--- /dev/null
+++ b/ver-1.7.0/jpcunpack_8c.html
@@ -0,0 +1,347 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: jpcunpack.c File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Unpack a data field that was packed into a JPEG2000 code stream.
+More...
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
+ Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+static g2int jpcunpack_int (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
+ Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+g2int jpcunpackd (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
+ Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
+
+
+
+
Unpack a data field that was packed into a JPEG2000 code stream.
+
Author Stephem Gilbert
+
Date 2003-08-27
+
+
Definition in file jpcunpack.c .
+
+
+
◆ jpcunpack()
+
+
+
+
+
+ g2int jpcunpack
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ float *
+ fld
+
+
+
+ )
+
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values as an array of float.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephem Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 108 of file jpcunpack.c .
+
+
References jpcunpack_int() .
+
+
Referenced by g2_unpack7() .
+
+
+
+
+
◆ jpcunpack_int()
+
+
+
+
+
+
+
+
+ static g2int jpcunpack_int
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ void *
+ fld ,
+
+
+
+
+ int
+ fld_is_double
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values.
+ fld_is_double Non-zero if the data are to be unpacked into a double array, otherwise data will be unpacked into a float array.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Stephem Gilbert
+
Date 2003-08-27
+
Author Ed Hartnett
+
+
Definition at line 33 of file jpcunpack.c .
+
+
References dec_jpeg2000() , G2_JPCUNPACK_MEM , G2_NO_ERROR , int_power() , and rdieee() .
+
+
Referenced by jpcunpack() , and jpcunpackd() .
+
+
+
+
+
◆ jpcunpackd()
+
+
+
+
+
+ g2int jpcunpackd
+ (
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int
+ len ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ double *
+ fld
+
+
+
+ )
+
+
+
+
+
+
Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+
Parameters
+
+ cpack The packed data.
+ len The length of the packed data.
+ idrstmpl Pointer to array of values for Data Representation Template 5.40 or 5.40000.
+ ndpts The number of data values to unpack.
+ fld A pointer that gets the unpacked data values as an array of double.
+
+
+
+
Returns 0 for success, 1 for memory allocation error.
+
Author Ed Hartnett
+
Date 2022-08-12
+
+
Definition at line 135 of file jpcunpack.c .
+
+
References jpcunpack_int() .
+
+
+
+
+
+
+
+
+
diff --git a/ver-1.7.0/jpcunpack_8c.js b/ver-1.7.0/jpcunpack_8c.js
new file mode 100644
index 00000000..d70c9d1d
--- /dev/null
+++ b/ver-1.7.0/jpcunpack_8c.js
@@ -0,0 +1,6 @@
+var jpcunpack_8c =
+[
+ [ "jpcunpack", "jpcunpack_8c.html#a067a3f608a80a9fdd89ed9f59ed7c7f6", null ],
+ [ "jpcunpack_int", "jpcunpack_8c.html#a4111b82028471a5c655190dcee21107c", null ],
+ [ "jpcunpackd", "jpcunpack_8c.html#ad6178825e48182a0c7e62951aae0b0d2", null ]
+];
\ No newline at end of file
diff --git a/ver-1.7.0/jpcunpack_8c_source.html b/ver-1.7.0/jpcunpack_8c_source.html
new file mode 100644
index 00000000..28920aa7
--- /dev/null
+++ b/ver-1.7.0/jpcunpack_8c_source.html
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+NCEPLIBS-g2c: jpcunpack.c Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
34 void *fld,
int fld_is_double)
+
+
+
+
38 float ref, bscale, dscale;
+
+
+
+
+
+
+
+
+
+
+
+
+
51 if (!(ifld = calloc(ndpts,
sizeof (
g2int ))))
+
+
53 fprintf(stderr,
"Could not allocate space in jpcunpack.\n Data field NOT upacked.\n" );
+
+
+
+
+
+
59 for (j = 0; j < ndpts; j++)
+
60 dfld[j] = (((
float )ifld[j] * bscale) + ref) * dscale;
+
+
+
+
64 for (j = 0; j < ndpts; j++)
+
65 ffld[j] = (((
float )ifld[j] * bscale) + ref) * dscale;
+
+
+
+
+
+
+
+
73 for (j = 0; j < ndpts; j++)
+
+
+
+
+
78 for (j = 0; j < ndpts; j++)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static g2int jpcunpack_int(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
+#define G2_NO_ERROR
Function succeeded.
+void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
+double int_power(double x, g2int y)
Function similar to C pow() power function.
+g2int jpcunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representati...
+Header file with internal function prototypes NCEPLIBS-g2c library.
+int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
+int64_t g2int
Long integer type.
+#define G2_JPCUNPACK_MEM
In jpcunpack() or other unpack function: out of memory.
+g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
+
+
+
+
diff --git a/ver-1.7.0/jquery.js b/ver-1.7.0/jquery.js
new file mode 100644
index 00000000..103c32d7
--- /dev/null
+++ b/ver-1.7.0/jquery.js
@@ -0,0 +1,35 @@
+/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML=" ",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML=" ";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCEPLIBS-g2c
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+More...
+
#include <stdlib.h>
+
#include <math.h>
+
#include "grib2_int.h "
+
+
Go to the source code of this file.
+
+
+void misspack (float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
+ This function packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
+
+
+
+
Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+
Author Stephen Gilbert
+
Date 2000-06-21
+
+
Definition in file misspack.c .
+
+
+
◆ misspack()
+
+
+
+
+
+ void misspack
+ (
+ float *
+ fld ,
+
+
+
+
+ g2int
+ ndpts ,
+
+
+
+
+ g2int
+ idrsnum ,
+
+
+
+
+ g2int *
+ idrstmpl ,
+
+
+
+
+ unsigned char *
+ cpack ,
+
+
+
+
+ g2int *
+ lcpack
+
+
+
+ )
+
+
+
+
+
+
This function packs up a data field using a complex packing algorithm as defined in the GRIB2 documention.
+
It supports GRIB2 complex packing templates with or without spatial differences (See Template 5.2 and Template 5.3 ).
+
This function fills in GRIB2 Data Representation template arrays with the appropriate values.
+
Parameters
+
+ fld Contains the data values to pack
+ ndpts The number of data values in array fld
+ idrsnum Data Representation Template number. Must equal 2 or 3.
+ idrstmpl Contains the array of values for Data Representation Template 5.2 or 5.3.
+0 Reference value - ignored on input, set by misspack routine.
+1 Binary Scale Factor - used on input.
+2 Decimal Scale Factor- used on input.
+6 Missing value management.
+7 Primary missing value.
+8 Secondary missing value.
+16 Order of Spatial Differencing (1 or 2).
+
+
+ cpack The packed data field (character*1 array).
+ lcpack length of packed field cpack.
+
+
+
+
Author Stephen Gilbert
+
Date 2000-06-21
+
+
Definition at line 42 of file misspack.c .
+
+
References ALOG2 , int_power() , mkieee() , pack_gp() , rdieee() , sbit() , and sbits() .
+
+
Referenced by cmplxpack() .
+
+
+
+
+
+
+
+
+