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: Data Types List + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Data Types List
+
+
+
Here are the data types with brief descriptions:
+ + + +
 CgribfieldStruct for GRIB field
 CgtemplateStruct for GRIB template
+
+
+
+ + + + diff --git a/ver-1.7.0/annotated_dup.js b/ver-1.7.0/annotated_dup.js new file mode 100644 index 00000000..db022a75 --- /dev/null +++ b/ver-1.7.0/annotated_dup.js @@ -0,0 +1,5 @@ +var annotated_dup = +[ + [ "gribfield", "grib2_8h.html#structgribfield", "grib2_8h_structgribfield" ], + [ "gtemplate", "grib2__int_8h.html#structgtemplate", "grib2__int_8h_structgtemplate" ] +]; \ No newline at end of file diff --git a/ver-1.7.0/bc_s.png b/ver-1.7.0/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/ver-1.7.0/bc_s.png differ diff --git a/ver-1.7.0/bdwn.png b/ver-1.7.0/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/ver-1.7.0/bdwn.png differ diff --git a/ver-1.7.0/classes.html b/ver-1.7.0/classes.html new file mode 100644 index 00000000..c0c83384 --- /dev/null +++ b/ver-1.7.0/classes.html @@ -0,0 +1,112 @@ + + + + + + + +NCEPLIBS-g2c: Data Types + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Data Types
+
+
+ + + + + + + + + +
  g  
+
gtemplate   
gribfield   
+ +
+
+ + + + diff --git a/ver-1.7.0/closed.png b/ver-1.7.0/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/ver-1.7.0/closed.png differ diff --git a/ver-1.7.0/cmplxpack_8c.html b/ver-1.7.0/cmplxpack_8c.html new file mode 100644 index 00000000..c06c96d6 --- /dev/null +++ b/ver-1.7.0/cmplxpack_8c.html @@ -0,0 +1,206 @@ + + + + + + + +NCEPLIBS-g2c: cmplxpack.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
cmplxpack.c File Reference
+
+
+ +

Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention. +More...

+
#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.

+
Author
Stephen Gilbert
+
Date
2004-08-27
+ +

Definition in file cmplxpack.c.

+

Function Documentation

+ +

◆ cmplxpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void cmplxpack (float * fld,
g2int ndpts,
g2int idrsnum,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldContains the data values to pack.
ndptsThe number of data values in array fld
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplContains 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 )
  • +
+
cpackThe packed data field.
lcpacklength 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().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/cmplxpack_8c.js b/ver-1.7.0/cmplxpack_8c.js new file mode 100644 index 00000000..79157781 --- /dev/null +++ b/ver-1.7.0/cmplxpack_8c.js @@ -0,0 +1,4 @@ +var cmplxpack_8c = +[ + [ "cmplxpack", "cmplxpack_8c.html#a099225c582defca6ab562d9aad5bc20b", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/cmplxpack_8c_source.html b/ver-1.7.0/cmplxpack_8c_source.html new file mode 100644 index 00000000..c0072b1d --- /dev/null +++ b/ver-1.7.0/cmplxpack_8c_source.html @@ -0,0 +1,124 @@ + + + + + + + +NCEPLIBS-g2c: cmplxpack.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
cmplxpack.c
+
+
+Go to the documentation of this file.
1 
+
7 #include "grib2_int.h"
+
8 
+
35 void
+
36 cmplxpack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
+
37  unsigned char *cpack, g2int *lcpack)
+
38 {
+
39  if (idrstmpl[6] == 0) /* No internal missing values */
+
40  compack(fld, ndpts, idrsnum, idrstmpl, cpack, lcpack);
+
41  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
+
42  misspack(fld, ndpts, idrsnum, idrstmpl, cpack, lcpack);
+
43  else
+
44  {
+
45  printf("cmplxpack: Don:t recognize Missing value option.");
+
46  *lcpack = -1;
+
47  }
+
48 
+
49 }
+
+
+
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 docum...
Definition: compack.c:42
+
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 docum...
Definition: cmplxpack.c:36
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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 documen...
Definition: misspack.c:42
+ + + + diff --git a/ver-1.7.0/compack_8c.html b/ver-1.7.0/compack_8c.html new file mode 100644 index 00000000..768c50ff --- /dev/null +++ b/ver-1.7.0/compack_8c.html @@ -0,0 +1,208 @@ + + + + + + + +NCEPLIBS-g2c: compack.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
compack.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.

+
Author
Stephen Gilbert
+
Date
2002-11-07
+ +

Definition in file compack.c.

+

Function Documentation

+ +

◆ compack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void compack (float * fld,
g2int ndpts,
g2int idrsnum,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldContains the data values to pack.
ndptsThe number of data values in array fld.
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplContains 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)
  • +
+
cpackThe packed data field.
lcpacklength 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().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/compack_8c.js b/ver-1.7.0/compack_8c.js new file mode 100644 index 00000000..d4e25d92 --- /dev/null +++ b/ver-1.7.0/compack_8c.js @@ -0,0 +1,4 @@ +var compack_8c = +[ + [ "compack", "compack_8c.html#acbf694045589babceb7412ac6faadc39", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/compack_8c_source.html b/ver-1.7.0/compack_8c_source.html new file mode 100644 index 00000000..8ef6d0af --- /dev/null +++ b/ver-1.7.0/compack_8c_source.html @@ -0,0 +1,494 @@ + + + + + + + +NCEPLIBS-g2c: compack.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
compack.c
+
+
+Go to the documentation of this file.
1 
+
8 #include <stdlib.h>
+
9 #include <math.h>
+
10 #include "grib2_int.h"
+
11 
+
41 void
+
42 compack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
+
43  unsigned char *cpack, g2int *lcpack)
+
44 {
+
45 
+
46  static g2int zero = 0;
+
47  g2int *ifld, *gref, *glen, *gwidth;
+
48  g2int *jmin, *jmax, *lbit;
+
49  g2int i, j, n, imin, imax, left;
+
50  g2int isd, itemp, ilmax, ngwidthref = 0, nbitsgwidth = 0;
+
51  g2int nglenref = 0, nglenlast = 0, iofst, ival1, ival2;
+
52  g2int minsd, nbitsd = 0, maxorig, nbitorig, ngroups;
+
53  g2int lg, ng, igmax, iwmax, nbitsgref;
+
54  g2int glength, grpwidth, nbitsglen = 0;
+
55  g2int kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
+
56  g2int missopt, miss1, miss2, ier;
+
57  float bscale, dscale, rmax, rmin, temp;
+
58  static float alog2 = ALOG2; /* ln(2.0) */
+
59  static g2int one = 1;
+
60 
+
61  bscale = int_power(2.0, -idrstmpl[1]);
+
62  dscale = int_power(10.0, idrstmpl[2]);
+
63 
+
64  /* Find max and min values in the data. */
+
65  rmax = fld[0];
+
66  rmin = fld[0];
+
67  for (j = 1; j < ndpts; j++)
+
68  {
+
69  if (fld[j] > rmax) rmax = fld[j];
+
70  if (fld[j] < rmin) rmin = fld[j];
+
71  }
+
72 
+
73  /* If max and min values are not equal, pack up field. If they are
+
74  * equal, we have a constant field, and the reference value (rmin)
+
75  * is the value for each point in the field and set nbits to 0. */
+
76  if (rmin != rmax)
+
77  {
+
78  iofst = 0;
+
79  ifld = calloc(ndpts, sizeof(g2int));
+
80  gref = calloc(ndpts, sizeof(g2int));
+
81  gwidth = calloc(ndpts, sizeof(g2int));
+
82  glen = calloc(ndpts, sizeof(g2int));
+
83 
+
84  /* Scale original data. */
+
85  if (idrstmpl[1] == 0)
+
86  { /* No binary scaling. */
+
87  imin = (g2int)rint(rmin*dscale);
+
88  /*imax = (g2int)rint(rmax*dscale); */
+
89  rmin = (float)imin;
+
90  for (j = 0; j < ndpts; j++)
+
91  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
+
92  }
+
93  else
+
94  { /* Use binary scaling factor */
+
95  rmin = rmin * dscale;
+
96  /*rmax = rmax*dscale; */
+
97  for (j = 0; j < ndpts; j++)
+
98  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
+
99  }
+
100 
+
101  /* Calculate Spatial differences, if using DRS Template
+
102  * 5.3. */
+
103  if (idrsnum == 3)
+
104  { /* spatial differences */
+
105  if (idrstmpl[16] !=1 && idrstmpl[16] != 2)
+
106  idrstmpl[16] = 1;
+
107  if (idrstmpl[16] == 1)
+
108  { /* first order */
+
109  ival1 = ifld[0];
+
110  for (j = ndpts-1; j > 0; j--)
+
111  ifld[j] = ifld[j] - ifld[j - 1];
+
112  ifld[0] = 0;
+
113  }
+
114  else if (idrstmpl[16] == 2)
+
115  { /* second order */
+
116  ival1 = ifld[0];
+
117  ival2 = ifld[1];
+
118  for (j = ndpts - 1; j > 1; j--)
+
119  ifld[j] = ifld[j] - (2 * ifld[j - 1]) + ifld[j - 2];
+
120  ifld[0] = 0;
+
121  ifld[1] = 0;
+
122  }
+
123 
+
124  /* Subtract min value from spatial diff field. */
+
125  isd = idrstmpl[16];
+
126  minsd = ifld[isd];
+
127  for (j = isd; j < ndpts; j++)
+
128  if (ifld[j] < minsd)
+
129  minsd = ifld[j];
+
130  for (j = isd; j < ndpts; j++)
+
131  ifld[j] = ifld[j] - minsd;
+
132 
+
133  /* Find num of bits need to store minsd and add 1 extra bit to indicate sign. */
+
134  temp = log((double)(abs(minsd) + 1)) / alog2;
+
135  nbitsd = (g2int)ceil(temp) + 1;
+
136 
+
137  /* Find num of bits need to store ifld[0] (and ifld[1] if
+
138  * using 2nd order differencing). */
+
139  maxorig = ival1;
+
140  if (idrstmpl[16] == 2 && ival2 > ival1)
+
141  maxorig = ival2;
+
142  temp = log((double)(maxorig + 1)) / alog2;
+
143  nbitorig = (g2int)ceil(temp) + 1;
+
144  if (nbitorig > nbitsd)
+
145  nbitsd = nbitorig;
+
146 
+
147  /* Increase number of bits to even multiple of 8 (octet). */
+
148  if ((nbitsd % 8) != 0)
+
149  nbitsd = nbitsd+(8-(nbitsd%8));
+
150 
+
151  /* Store extra spatial differencing info into the packed
+
152  * data section. */
+
153  if (nbitsd != 0)
+
154  {
+
155  /* pack first original value */
+
156  if (ival1 >= 0)
+
157  {
+
158  sbit(cpack, &ival1, iofst, nbitsd);
+
159  iofst = iofst+nbitsd;
+
160  }
+
161  else
+
162  {
+
163  sbit(cpack, &one, iofst, 1);
+
164  iofst = iofst + 1;
+
165  itemp = abs(ival1);
+
166  sbit(cpack, &itemp, iofst, nbitsd-1);
+
167  iofst = iofst + nbitsd - 1;
+
168  }
+
169  if (idrstmpl[16] == 2)
+
170  {
+
171  /* pack second original value */
+
172  if (ival2 >= 0)
+
173  {
+
174  sbit(cpack, &ival2, iofst, nbitsd);
+
175  iofst = iofst + nbitsd;
+
176  }
+
177  else
+
178  {
+
179  sbit(cpack, &one, iofst, 1);
+
180  iofst = iofst + 1;
+
181  itemp = abs(ival2);
+
182  sbit(cpack, &itemp, iofst, nbitsd - 1);
+
183  iofst = iofst + nbitsd - 1;
+
184  }
+
185  }
+
186 
+
187  /* pack overall min of spatial differences */
+
188  if (minsd >= 0)
+
189  {
+
190  sbit(cpack, &minsd, iofst, nbitsd);
+
191  iofst = iofst + nbitsd;
+
192  }
+
193  else
+
194  {
+
195  sbit(cpack, &one, iofst, 1);
+
196  iofst = iofst + 1;
+
197  itemp = abs(minsd);
+
198  sbit(cpack, &itemp, iofst, nbitsd - 1);
+
199  iofst = iofst + nbitsd - 1;
+
200  }
+
201  }
+
202  } /* end of spatial diff section */
+
203 
+
204  /* Use Dr. Glahn's algorithm for determining grouping. */
+
205  kfildo = 6;
+
206  minpk = 10;
+
207  inc = 1;
+
208  maxgrps = (ndpts / minpk) + 1;
+
209  jmin = calloc(maxgrps, sizeof(g2int));
+
210  jmax = calloc(maxgrps, sizeof(g2int));
+
211  lbit = calloc(maxgrps, sizeof(g2int));
+
212  missopt = 0;
+
213  pack_gp(&kfildo, ifld, &ndpts, &missopt, &minpk, &inc, &miss1, &miss2,
+
214  jmin, jmax, lbit, glen, &maxgrps, &ngroups, &ibit, &jbit,
+
215  &kbit, &novref, &lbitref, &ier);
+
216  for (ng = 0; ng<ngroups; ng++)
+
217  glen[ng] = glen[ng] + novref;
+
218  free(jmin);
+
219  free(jmax);
+
220  free(lbit);
+
221 
+
222  /* For each group, find the group's reference value and the
+
223  * number of bits needed to hold the remaining values. */
+
224  n = 0;
+
225  for (ng = 0; ng < ngroups; ng++)
+
226  {
+
227  /* find max and min values of group */
+
228  gref[ng] = ifld[n];
+
229  imax = ifld[n];
+
230  j = n + 1;
+
231  for (lg = 1; lg < glen[ng]; lg++)
+
232  {
+
233  if (ifld[j] < gref[ng])
+
234  gref[ng] = ifld[j];
+
235  if (ifld[j] > imax)
+
236  imax = ifld[j];
+
237  j++;
+
238  }
+
239 
+
240  /* calc num of bits needed to hold data */
+
241  if (gref[ng] != imax)
+
242  {
+
243  temp = log((double)(imax - gref[ng] + 1))/alog2;
+
244  gwidth[ng] = (g2int)ceil(temp);
+
245  }
+
246  else
+
247  gwidth[ng] = 0;
+
248  /* Subtract min from data */
+
249  j = n;
+
250  for (lg = 0; lg < glen[ng]; lg++)
+
251  {
+
252  ifld[j] = ifld[j] - gref[ng];
+
253  j++;
+
254  }
+
255  /* increment fld array counter */
+
256  n = n + glen[ng];
+
257  }
+
258 
+
259  /* Find max of the group references and calc num of bits
+
260  * needed to pack each groups reference value, then pack up
+
261  * group reference values. */
+
262  igmax = gref[0];
+
263  for (j = 1; j < ngroups; j++)
+
264  if (gref[j] > igmax)
+
265  igmax = gref[j];
+
266  if (igmax != 0)
+
267  {
+
268  temp = log((double)(igmax + 1)) / alog2;
+
269  nbitsgref = (g2int)ceil(temp);
+
270  sbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
+
271  itemp = nbitsgref * ngroups;
+
272  iofst = iofst + itemp;
+
273  /* Pad last octet with Zeros, if necessary. */
+
274  if ((itemp % 8) != 0)
+
275  {
+
276  left = 8 - (itemp % 8);
+
277  sbit(cpack, &zero, iofst, left);
+
278  iofst = iofst + left;
+
279  }
+
280  }
+
281  else
+
282  nbitsgref = 0;
+
283 
+
284  /* Find max/min of the group widths and calc num of bits
+
285  * needed to pack each groups width value, then pack up group
+
286  * width values. */
+
287  iwmax = gwidth[0];
+
288  ngwidthref = gwidth[0];
+
289  for (j = 1; j < ngroups; j++)
+
290  {
+
291  if (gwidth[j] > iwmax)
+
292  iwmax = gwidth[j];
+
293  if (gwidth[j] < ngwidthref)
+
294  ngwidthref = gwidth[j];
+
295  }
+
296  if (iwmax != ngwidthref)
+
297  {
+
298  temp = log((double)(iwmax - ngwidthref +1)) / alog2;
+
299  nbitsgwidth = (g2int)ceil(temp);
+
300  for (i = 0; i < ngroups; i++)
+
301  gwidth[i] = gwidth[i] - ngwidthref;
+
302  sbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
+
303  itemp = nbitsgwidth * ngroups;
+
304  iofst = iofst + itemp;
+
305  /* Pad last octet with Zeros, if necessary. */
+
306  if ((itemp % 8) != 0)
+
307  {
+
308  left = 8 - (itemp % 8);
+
309  sbit(cpack, &zero, iofst, left);
+
310  iofst = iofst + left;
+
311  }
+
312  }
+
313  else
+
314  {
+
315  nbitsgwidth = 0;
+
316  for (i = 0; i < ngroups; i++)
+
317  gwidth[i] = 0;
+
318  }
+
319 
+
320  /* Find max/min of the group lengths and calc num of bits
+
321  * needed to pack each groups length value, then pack up group
+
322  * length values. */
+
323  ilmax = glen[0];
+
324  nglenref = glen[0];
+
325  for (j = 1; j < ngroups - 1; j++)
+
326  {
+
327  if (glen[j] > ilmax)
+
328  ilmax = glen[j];
+
329  if (glen[j] < nglenref)
+
330  nglenref = glen[j];
+
331  }
+
332  nglenlast = glen[ngroups - 1];
+
333  if (ilmax != nglenref)
+
334  {
+
335  temp = log((double)(ilmax - nglenref + 1)) / alog2;
+
336  nbitsglen = (g2int)ceil(temp);
+
337  for (i = 0; i < ngroups - 1; i++)
+
338  glen[i] = glen[i] - nglenref;
+
339  sbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
+
340  itemp = nbitsglen * ngroups;
+
341  iofst = iofst + itemp;
+
342  /* Pad last octet with Zeros, if necessary, */
+
343  if ((itemp % 8) != 0)
+
344  {
+
345  left = 8 - (itemp % 8);
+
346  sbit(cpack, &zero, iofst, left);
+
347  iofst = iofst + left;
+
348  }
+
349  }
+
350  else
+
351  {
+
352  nbitsglen = 0;
+
353  for (i = 0; i < ngroups; i++)
+
354  glen[i] = 0;
+
355  }
+
356 
+
357  /* For each group, pack data values. */
+
358  n = 0;
+
359  for (ng = 0; ng < ngroups; ng++)
+
360  {
+
361  glength = glen[ng] + nglenref;
+
362  if (ng == (ngroups - 1))
+
363  glength = nglenlast;
+
364  grpwidth = gwidth[ng] + ngwidthref;
+
365  if (grpwidth != 0)
+
366  {
+
367  sbits(cpack, ifld + n, iofst, grpwidth, 0, glength);
+
368  iofst = iofst + (grpwidth * glength);
+
369  }
+
370  n = n + glength;
+
371  }
+
372  /* Pad last octet with Zeros, if necessary. */
+
373  if ((iofst % 8) != 0)
+
374  {
+
375  left = 8 - (iofst % 8);
+
376  sbit(cpack, &zero, iofst, left);
+
377  iofst = iofst + left;
+
378  }
+
379  *lcpack = iofst / 8;
+
380 
+
381  if (ifld)
+
382  free(ifld);
+
383  if (gref)
+
384  free(gref);
+
385  if (gwidth)
+
386  free(gwidth);
+
387  if (glen)
+
388  free(glen);
+
389  }
+
390  else
+
391  { /* Constant field (max = min) */
+
392  *lcpack = 0;
+
393  nbitsgref = 0;
+
394  ngroups = 0;
+
395  }
+
396 
+
397  /* Fill in ref value and number of bits in Template 5.2. */
+
398 
+
399  /* Ensure reference value is IEEE format. */
+
400  mkieee(&rmin, idrstmpl, 1);
+
401  idrstmpl[3] = nbitsgref;
+
402  idrstmpl[4] = 0; /* original data were reals */
+
403  idrstmpl[5] = 1; /* general group splitting */
+
404  idrstmpl[6] = 0; /* No internal missing values */
+
405  idrstmpl[7] = 0; /* Primary missing value */
+
406  idrstmpl[8] = 0; /* secondary missing value */
+
407  idrstmpl[9] = ngroups; /* Number of groups */
+
408  idrstmpl[10] = ngwidthref; /* reference for group widths */
+
409  idrstmpl[11] = nbitsgwidth; /* num bits used for group widths */
+
410  idrstmpl[12] = nglenref; /* Reference for group lengths */
+
411  idrstmpl[13] = 1; /* length increment for group lengths */
+
412  idrstmpl[14] = nglenlast; /* True length of last group */
+
413  idrstmpl[15] = nbitsglen; /* num bits used for group lengths */
+
414  if (idrsnum == 3)
+
415  {
+
416  idrstmpl[17] = nbitsd / 8; /* num bits used for extra spatial */
+
417  /* differencing values */
+
418  }
+
419 }
+
+
+
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 docum...
Definition: compack.c:42
+
int_power
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition: int_power.c:18
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
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 ...
Definition: gbits.c:114
+
mkieee
void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
Definition: mkieee.c:22
+
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 ...
Definition: pack_gp.c:255
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
ALOG2
#define ALOG2
ln(2.0)
Definition: grib2_int.h:21
+
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 ...
Definition: gbits.c:38
+ + + + diff --git a/ver-1.7.0/comunpack_8c.html b/ver-1.7.0/comunpack_8c.html new file mode 100644 index 00000000..78587cba --- /dev/null +++ b/ver-1.7.0/comunpack_8c.html @@ -0,0 +1,210 @@ + + + + + + + +NCEPLIBS-g2c: comunpack.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
comunpack.c File Reference
+
+
+ +

Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention. +More...

+
#include <stdio.h>
+#include <stdlib.h>
+#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

+
Author
Stephen Gilbert
+
Date
2002-10-29
+ +

Definition in file comunpack.c.

+

Function Documentation

+ +

◆ comunpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int comunpack (unsigned char * cpack,
g2int lensec,
g2int idrsnum,
g2intidrstmpl,
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
+ + + + + + + +
cpackpointer to the packed data field.
lenseclength of section 7 (used for error checking).
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplpointer to the array of values for Data Representation Template 5.2 or 5.3
ndptsThe number of data values to unpack
fldContains 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().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/comunpack_8c.js b/ver-1.7.0/comunpack_8c.js new file mode 100644 index 00000000..c851d567 --- /dev/null +++ b/ver-1.7.0/comunpack_8c.js @@ -0,0 +1,4 @@ +var comunpack_8c = +[ + [ "comunpack", "comunpack_8c.html#ab6cce79f010456f1e882fa1c027062da", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/comunpack_8c_source.html b/ver-1.7.0/comunpack_8c_source.html new file mode 100644 index 00000000..92f2d7c0 --- /dev/null +++ b/ver-1.7.0/comunpack_8c_source.html @@ -0,0 +1,414 @@ + + + + + + + +NCEPLIBS-g2c: comunpack.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comunpack.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 
+
41 int
+
42 comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum,
+
43  g2int *idrstmpl, g2int ndpts, float *fld)
+
44 {
+
45  g2int nbitsd=0, isign;
+
46  g2int j, iofst, ival1, ival2, minsd, itemp, l, k, n, non=0;
+
47  g2int *ifld, *ifldmiss=0;
+
48  g2int *gref, *gwidth, *glen;
+
49  g2int itype, ngroups, nbitsgref, nbitsgwidth, nbitsglen;
+
50  g2int msng1, msng2;
+
51  float ref, bscale, dscale, rmiss1, rmiss2;
+
52  g2int totBit, totLen;
+
53 
+
54  rdieee(idrstmpl, &ref, 1);
+
55  bscale = (float)int_power(2.0, idrstmpl[1]);
+
56  dscale = (float)int_power(10.0, -idrstmpl[2]);
+
57  nbitsgref = idrstmpl[3];
+
58  itype = idrstmpl[4];
+
59  ngroups = idrstmpl[9];
+
60  nbitsgwidth = idrstmpl[11];
+
61  nbitsglen = idrstmpl[15];
+
62  if (idrsnum == 3)
+
63  nbitsd=idrstmpl[17] * 8;
+
64 
+
65  /* Constant field */
+
66  if (ngroups == 0)
+
67  {
+
68  for (j = 0; j < ndpts; j++)
+
69  fld[j] = ref;
+
70  return(0);
+
71  }
+
72 
+
73  iofst = 0;
+
74  ifld = (g2int *)calloc(ndpts, sizeof(g2int));
+
75  gref = (g2int *)calloc(ngroups, sizeof(g2int));
+
76  gwidth = (g2int *)calloc(ngroups, sizeof(g2int));
+
77 
+
78  /* Get missing values, if supplied */
+
79  if (idrstmpl[6] == 1)
+
80  {
+
81  if (itype == 0)
+
82  rdieee(idrstmpl+7,&rmiss1,1);
+
83  else
+
84  rmiss1 = (float)idrstmpl[7];
+
85  }
+
86  if (idrstmpl[6] == 2)
+
87  {
+
88  if (itype == 0)
+
89  {
+
90  rdieee(idrstmpl+7,&rmiss1,1);
+
91  rdieee(idrstmpl+8,&rmiss2,1);
+
92  }
+
93  else {
+
94  rmiss1 = (float)idrstmpl[7];
+
95  rmiss2 = (float)idrstmpl[8];
+
96  }
+
97  }
+
98 
+
99  /* Extract Spatial differencing values, if using DRS Template 5.3 */
+
100  if (idrsnum == 3)
+
101  {
+
102  if (nbitsd != 0)
+
103  {
+
104  /* wne mistake here shoujld be unsigned int */
+
105  gbit(cpack, &ival1, iofst, nbitsd);
+
106  iofst = iofst + nbitsd;
+
107  if (idrstmpl[16] == 2)
+
108  {
+
109  /* wne mistake here shoujld be unsigned int */
+
110  gbit(cpack, &ival2, iofst, nbitsd);
+
111  iofst = iofst + nbitsd;
+
112  }
+
113  gbit(cpack, &isign, iofst, 1);
+
114  iofst = iofst + 1;
+
115  gbit(cpack, &minsd, iofst, nbitsd - 1);
+
116  iofst = iofst + nbitsd - 1;
+
117  if (isign == 1)
+
118  minsd = -minsd;
+
119  }
+
120  else {
+
121  ival1 = 0;
+
122  ival2 = 0;
+
123  minsd = 0;
+
124  }
+
125  }
+
126 
+
127  /* Extract Each Group's reference value */
+
128  if (nbitsgref != 0)
+
129  {
+
130  gbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
+
131  itemp = nbitsgref * ngroups;
+
132  iofst = iofst + itemp;
+
133  if (itemp % 8 != 0)
+
134  iofst = iofst + (8 - (itemp % 8));
+
135  }
+
136  else
+
137  {
+
138  for (j = 0; j < ngroups; j++)
+
139  gref[j] = 0;
+
140  }
+
141 
+
142  /* Extract Each Group's bit width */
+
143  if (nbitsgwidth != 0) {
+
144  gbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
+
145  itemp = nbitsgwidth * ngroups;
+
146  iofst = iofst + itemp;
+
147  if (itemp % 8 != 0)
+
148  iofst = iofst + (8 - (itemp % 8));
+
149  }
+
150  else {
+
151  for (j = 0; j < ngroups; j++)
+
152  gwidth[j] = 0;
+
153  }
+
154 
+
155  for (j = 0; j < ngroups; j++)
+
156  gwidth[j] = gwidth[j] + idrstmpl[10];
+
157 
+
158  /* Extract Each Group's length (number of values in each group) */
+
159  glen = calloc(ngroups, sizeof(g2int));
+
160  if (nbitsglen != 0)
+
161  {
+
162  gbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
+
163  itemp = nbitsglen * ngroups;
+
164  iofst = iofst + itemp;
+
165  if (itemp % 8 != 0)
+
166  iofst = iofst + (8 - (itemp % 8));
+
167  }
+
168  else
+
169  {
+
170  for (j = 0; j < ngroups; j++)
+
171  glen[j] = 0;
+
172  }
+
173  for (j = 0;j<ngroups;j++)
+
174  glen[j] = (glen[j]*idrstmpl[13])+idrstmpl[12];
+
175  glen[ngroups-1] = idrstmpl[14];
+
176 
+
177  /* Test to see if the group widths and lengths are consistent
+
178  * with number of values, and length of section 7. */
+
179  totBit = 0;
+
180  totLen = 0;
+
181  for (j = 0; j < ngroups; j++)
+
182  {
+
183  totBit += (gwidth[j] * glen[j]);
+
184  totLen += glen[j];
+
185  }
+
186  if (totLen != ndpts)
+
187  return 1;
+
188  if (totBit / 8. > lensec)
+
189  return 1;
+
190 
+
191  /* For each group, unpack data values */
+
192  if (idrstmpl[6] == 0)
+
193  { /* no missing values */
+
194  n = 0;
+
195  for (j = 0; j < ngroups; j++)
+
196  {
+
197  if (gwidth[j] != 0)
+
198  {
+
199  gbits(cpack, ifld + n, iofst, gwidth[j], 0, glen[j]);
+
200  for (k = 0; k < glen[j]; k++)
+
201  {
+
202  ifld[n] = ifld[n] + gref[j];
+
203  n = n + 1;
+
204  }
+
205  }
+
206  else
+
207  {
+
208  for (l = n; l < n + glen[j]; l++)
+
209  ifld[l] = gref[j];
+
210  n = n + glen[j];
+
211  }
+
212  iofst = iofst + (gwidth[j] * glen[j]);
+
213  }
+
214  }
+
215  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
+
216  {
+
217  /* missing values included */
+
218  ifldmiss = malloc(ndpts * sizeof(g2int));
+
219  for (j = 0; j < ndpts; j++)
+
220  ifldmiss[j] = 0;
+
221  n = 0;
+
222  non = 0;
+
223  for (j = 0; j < ngroups; j++)
+
224  {
+
225  if (gwidth[j] != 0)
+
226  {
+
227  msng1 = (g2int)int_power(2.0, gwidth[j]) - 1;
+
228  msng2 = msng1 - 1;
+
229  gbits(cpack, ifld + n, iofst, gwidth[j], 0, glen[j]);
+
230  iofst = iofst + (gwidth[j] * glen[j]);
+
231  for (k = 0; k < glen[j]; k++)
+
232  {
+
233  if (ifld[n] == msng1)
+
234  ifldmiss[n] = 1;
+
235  else if (idrstmpl[6] == 2 && ifld[n] == msng2)
+
236  ifldmiss[n] = 2;
+
237  else {
+
238  ifldmiss[n] = 0;
+
239  ifld[non++] = ifld[n] + gref[j];
+
240  }
+
241  n++;
+
242  }
+
243  }
+
244  else
+
245  {
+
246  msng1 = (g2int)int_power(2.0, nbitsgref) -1;
+
247  msng2 = msng1 - 1;
+
248  if (gref[j] == msng1)
+
249  {
+
250  for (l = n; l < n + glen[j]; l++)
+
251  ifldmiss[l] = 1;
+
252  }
+
253  else if (idrstmpl[6] == 2 && gref[j] == msng2)
+
254  {
+
255  for (l = n; l < n + glen[j]; l++)
+
256  ifldmiss[l] = 2;
+
257  }
+
258  else
+
259  {
+
260  for (l = n; l < n + glen[j]; l++)
+
261  ifldmiss[l] = 0;
+
262  for (l = non; l < non + glen[j]; l++)
+
263  ifld[l] = gref[j];
+
264  non += glen[j];
+
265  }
+
266  n = n + glen[j];
+
267  }
+
268  }
+
269  }
+
270 
+
271  if (gref)
+
272  free(gref);
+
273  if (gwidth)
+
274  free(gwidth);
+
275  if (glen)
+
276  free(glen);
+
277 
+
278  /* If using spatial differences, add overall min value, and sum up recursively */
+
279  if (idrsnum == 3)
+
280  { /* spatial differencing */
+
281  if (idrstmpl[16] == 1)
+
282  { /* first order */
+
283  ifld[0] = ival1;
+
284  if (idrstmpl[6] == 0)
+
285  itemp = ndpts; /* no missing values */
+
286  else
+
287  itemp = non;
+
288  for (n = 1; n < itemp; n++)
+
289  {
+
290  ifld[n] = ifld[n] + minsd;
+
291  ifld[n] = ifld[n] + ifld[n - 1];
+
292  }
+
293  }
+
294  else if (idrstmpl[16] == 2)
+
295  { /* second order */
+
296  ifld[0] = ival1;
+
297  ifld[1] = ival2;
+
298  if (idrstmpl[6] == 0)
+
299  itemp = ndpts; /* no missing values */
+
300  else
+
301  itemp = non;
+
302  for (n = 2; n < itemp; n++)
+
303  {
+
304  ifld[n] = ifld[n] + minsd;
+
305  ifld[n] = ifld[n] + (2 * ifld[n - 1]) - ifld[n - 2];
+
306  }
+
307  }
+
308  }
+
309 
+
310  /* Scale data back to original form */
+
311  if (idrstmpl[6] == 0)
+
312  { /* no missing values */
+
313  for (n = 0; n <ndpts; n++)
+
314  {
+
315  fld[n] = (((float)ifld[n] * bscale) + ref) * dscale;
+
316  }
+
317  }
+
318  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
+
319  {
+
320  /* missing values included */
+
321  non = 0;
+
322  for (n = 0; n < ndpts; n++)
+
323  {
+
324  if (ifldmiss[n] == 0)
+
325  {
+
326  fld[n] = (((float)ifld[non++] * bscale) + ref) * dscale;
+
327  }
+
328  else if (ifldmiss[n] == 1)
+
329  fld[n] = rmiss1;
+
330  else if (ifldmiss[n] == 2)
+
331  fld[n] = rmiss2;
+
332  }
+
333  if (ifldmiss)
+
334  free(ifldmiss);
+
335  }
+
336 
+
337  if (ifld)
+
338  free(ifld);
+
339 
+
340  return 0;
+
341 }
+
+
+
rdieee
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
int_power
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition: int_power.c:18
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
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...
Definition: gbits.c:20
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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 ...
Definition: comunpack.c:42
+
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...
Definition: gbits.c:57
+ + + + diff --git a/ver-1.7.0/dec__jpeg2000_8c.html b/ver-1.7.0/dec__jpeg2000_8c.html new file mode 100644 index 00000000..14ffb866 --- /dev/null +++ b/ver-1.7.0/dec__jpeg2000_8c.html @@ -0,0 +1,197 @@ + + + + + + + +NCEPLIBS-g2c: dec_jpeg2000.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
dec_jpeg2000.c File Reference
+
+
+ +

Decodes JPEG2000 code stream. +More...

+
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "grib2_int.h"
+#include "jasper/jasper.h"
+
+

Go to the source code of this file.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Decodes JPEG2000 code stream.

+
Author
Stephen Gilbert
+
Date
2002-12-02
+ +

Definition in file dec_jpeg2000.c.

+

Function Documentation

+ +

◆ dec_jpeg2000()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int dec_jpeg2000 (char * injpc,
g2int bufsize,
g2intoutfld 
)
+
+ +

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
+ + + + +
injpcInput JPEG2000 code stream.
bufsizeLength (in bytes) of the input JPEG2000 code stream.
outfldOutput 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().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/dec__jpeg2000_8c.js b/ver-1.7.0/dec__jpeg2000_8c.js new file mode 100644 index 00000000..c9406b8c --- /dev/null +++ b/ver-1.7.0/dec__jpeg2000_8c.js @@ -0,0 +1,4 @@ +var dec__jpeg2000_8c = +[ + [ "dec_jpeg2000", "dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/dec__jpeg2000_8c_source.html b/ver-1.7.0/dec__jpeg2000_8c_source.html new file mode 100644 index 00000000..44dfaf66 --- /dev/null +++ b/ver-1.7.0/dec__jpeg2000_8c_source.html @@ -0,0 +1,209 @@ + + + + + + + +NCEPLIBS-g2c: dec_jpeg2000.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dec_jpeg2000.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include <string.h>
+
9 #include "grib2_int.h"
+
10 #include "jasper/jasper.h"
+
11 
+
37 int
+
38 dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
+
39 {
+
40  g2int i, j, k;
+
41  jas_image_t *image = NULL;
+
42  jas_stream_t *jpcstream;
+
43  jas_image_cmpt_t *pcmpt;
+
44  char *opts = NULL;
+
45  jas_matrix_t *data;
+
46  int fmt;
+
47 
+
48  /* Initialize Jasper. */
+
49 #ifdef JASPER3
+
50  jas_conf_clear();
+
51  /* static jas_std_allocator_t allocator; */
+
52  /* jas_std_allocator_init(&allocator); */
+
53  /* jas_conf_set_allocator(JAS_CAST(jas_std_allocator_t *, &allocator)); */
+
54  jas_conf_set_max_mem_usage(10000000);
+
55  jas_conf_set_multithread(true);
+
56  if (jas_init_library())
+
57  return G2_JASPER_INIT;
+
58  if (jas_init_thread())
+
59  return G2_JASPER_INIT;
+
60 #else
+
61  if (jas_init())
+
62  return G2_JASPER_INIT;
+
63 #endif /* JASPER3 */
+
64 
+
65  /* Create jas_stream_t containing input JPEG200 codestream in
+
66  * memory. */
+
67  jpcstream = jas_stream_memopen(injpc, bufsize);
+
68 
+
69  /* Get jasper ID of JPEG encoder. */
+
70  fmt = jas_image_strtofmt(G2C_JASPER_JPEG_FORMAT_NAME);
+
71 
+
72  /* Decode JPEG200 codestream into jas_image_t structure. */
+
73  if (!(image = jas_image_decode(jpcstream, fmt, opts)))
+
74  return G2_JASPER_DECODE;
+
75 
+
76  pcmpt = image->cmpts_[0];
+
77  /*
+
78  printf(" SAGOUT DECODE:\n");
+
79  printf(" tlx %d \n", image->tlx_);
+
80  printf(" tly %d \n", image->tly_);
+
81  printf(" brx %d \n", image->brx_);
+
82  printf(" bry %d \n", image->bry_);
+
83  printf(" numcmpts %d \n", image->numcmpts_);
+
84  printf(" maxcmpts %d \n", image->maxcmpts_);
+
85  printf(" colorspace %d \n", image->clrspc_);
+
86  printf(" inmem %d \n", image->inmem_);
+
87  printf(" COMPONENT:\n");
+
88  printf(" tlx %d \n", pcmpt->tlx_);
+
89  printf(" tly %d \n", pcmpt->tly_);
+
90  printf(" hstep %d \n", pcmpt->hstep_);
+
91  printf(" vstep %d \n", pcmpt->vstep_);
+
92  printf(" width %d \n", pcmpt->width_);
+
93  printf(" height %d \n", pcmpt->height_);
+
94  printf(" prec %d \n", pcmpt->prec_);
+
95  printf(" sgnd %d \n", pcmpt->sgnd_);
+
96  printf(" cps %d \n", pcmpt->cps_);
+
97  printf(" type %d \n", pcmpt->type_);
+
98  */
+
99 
+
100  /* Expecting jpeg2000 image to be grayscale only. No color components. */
+
101  if (image->numcmpts_ != 1)
+
102  return G2_JASPER_DECODE_COLOR;
+
103 
+
104  /* Create a data matrix of grayscale image values decoded from the
+
105  * jpeg2000 codestream. */
+
106  data = jas_matrix_create(jas_image_height(image), jas_image_width(image));
+
107  jas_image_readcmpt(image, 0, 0, 0, jas_image_width(image),
+
108  jas_image_height(image), data);
+
109 
+
110  /* Copy data matrix to output integer array. */
+
111  k = 0;
+
112  for (i = 0; i < pcmpt->height_; i++)
+
113  for (j = 0; j < pcmpt->width_; j++)
+
114  outfld[k++] = data->rows_[i][j];
+
115 
+
116  /* Clean up JasPer work structures. */
+
117  jas_matrix_destroy(data);
+
118  jas_stream_close(jpcstream);
+
119  jas_image_destroy(image);
+
120 
+
121  /* Finalize jasper. */
+
122 #ifdef JASPER3
+
123  jas_cleanup_thread();
+
124  jas_cleanup_library();
+
125 #else
+
126  jas_cleanup();
+
127 #endif /* JASPER3 */
+
128 
+
129  return 0;
+
130 }
+
+
+
G2_JASPER_INIT
#define G2_JASPER_INIT
In enc_jpeg2000()/dec_jpeg2000() error initializing jasper library.
Definition: grib2.h:322
+
G2C_JASPER_JPEG_FORMAT_NAME
#define G2C_JASPER_JPEG_FORMAT_NAME
Name of JPEG codec in Jasper.
Definition: grib2_int.h:23
+
G2_JASPER_DECODE_COLOR
#define G2_JASPER_DECODE_COLOR
In dec_jpeg2000() decoded image had multiple color components.
Definition: grib2.h:325
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
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....
Definition: dec_jpeg2000.c:38
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
G2_JASPER_DECODE
#define G2_JASPER_DECODE
In dec_jpeg2000() error decoding image with jasper.
Definition: grib2.h:324
+ + + + diff --git a/ver-1.7.0/dec__png_8c.html b/ver-1.7.0/dec__png_8c.html new file mode 100644 index 00000000..13bc878e --- /dev/null +++ b/ver-1.7.0/dec__png_8c.html @@ -0,0 +1,263 @@ + + + + + + + +NCEPLIBS-g2c: dec_png.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
dec_png.c File Reference
+
+
+ +

PNG functions. +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.

+ + + + + +

+Typedefs

typedef struct png_stream png_stream
 Typedef for PNG stream. More...
 
+ + + + + + + +

+Functions

int dec_png (unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
 Decode PNG. More...
 
void user_read_data (png_structp png_ptr, png_bytep data, png_uint_32 length)
 Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk. More...
 
+

Detailed Description

+

PNG functions.

+
Author
Stephen Gilbert
+ +

Definition in file dec_png.c.

+

Typedef Documentation

+ +

◆ png_stream

+ +
+
+ + + + +
typedef struct png_stream png_stream
+
+ +

Typedef for PNG stream.

+ +

Definition at line 20 of file dec_png.c.

+ +
+
+

Function Documentation

+ +

◆ dec_png()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int dec_png (unsigned char * pngbuf,
g2intwidth,
g2intheight,
unsigned char * cout 
)
+
+ +

Decode PNG.

+
Parameters
+ + + + + +
pngbufPointer to PNG buffer.
widthPointer to width.
heightPointer to height.
coutOutput 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().

+ +
+
+ +

◆ user_read_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void user_read_data (png_structp png_ptr,
png_bytep data,
png_uint_32 length 
)
+
+ +

Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk.

+
Parameters
+ + + + +
png_ptrPointer to PNG.
dataPointer to data.
lengthLength.
+
+
+
Author
Stephen Gilbert
+ +

Definition at line 35 of file dec_png.c.

+ +

Referenced by dec_png().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/dec__png_8c.js b/ver-1.7.0/dec__png_8c.js new file mode 100644 index 00000000..4b875c24 --- /dev/null +++ b/ver-1.7.0/dec__png_8c.js @@ -0,0 +1,6 @@ +var dec__png_8c = +[ + [ "png_stream", "dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3", null ], + [ "dec_png", "dec__png_8c.html#a4c7dfb37dbbca9143143db5aeb2f6005", null ], + [ "user_read_data", "dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/dec__png_8c_source.html b/ver-1.7.0/dec__png_8c_source.html new file mode 100644 index 00000000..a9364725 --- /dev/null +++ b/ver-1.7.0/dec__png_8c_source.html @@ -0,0 +1,225 @@ + + + + + + + +NCEPLIBS-g2c: dec_png.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dec_png.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include <string.h>
+
9 #include <png.h>
+
10 #include "grib2_int.h"
+
11 
+
15 struct png_stream
+
16 {
+
17  unsigned char *stream_ptr;
+
18  g2int stream_len;
+
19 };
+
20 typedef struct png_stream png_stream;
+
22 void user_read_data(png_structp, png_bytep, png_uint_32);
+
23 
+
34 void
+
35 user_read_data(png_structp png_ptr, png_bytep data, png_uint_32 length)
+
36 {
+
37  char *ptr;
+
38  g2int offset;
+
39  png_stream *mem;
+
40 
+
41  mem = (png_stream *)png_get_io_ptr(png_ptr);
+
42  ptr = (void *)mem->stream_ptr;
+
43  offset = mem->stream_len;
+
44  memcpy(data, ptr + offset, length);
+
45  mem->stream_len += length;
+
46 }
+
47 
+
60 int
+
61 dec_png(unsigned char *pngbuf, g2int *width, g2int *height,
+
62  unsigned char *cout)
+
63 {
+
64  int interlace, color, compres, filter, bit_depth;
+
65  g2int j, k, n, bytes, clen;
+
66  png_structp png_ptr;
+
67  png_infop info_ptr, end_info;
+
68  png_bytepp row_pointers;
+
69  png_stream read_io_ptr;
+
70  png_uint_32 h32, w32;
+
71 
+
72  /* Check if stream is a valid PNG format. */
+
73  if (png_sig_cmp(pngbuf, 0, 8) != 0)
+
74  return -3;
+
75 
+
76  /* Create and initialize png_structs. */
+
77  if (!(png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
+
78  NULL, NULL)))
+
79  return -1;
+
80 
+
81  if (!(info_ptr = png_create_info_struct(png_ptr)))
+
82  {
+
83  png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
+
84  return -2;
+
85  }
+
86 
+
87  if (!(end_info = png_create_info_struct(png_ptr)))
+
88  {
+
89  png_destroy_read_struct(&png_ptr, (png_infopp)info_ptr, (png_infopp)NULL);
+
90  return -2;
+
91  }
+
92 
+
93  /* Set Error callback. */
+
94  if (setjmp(png_jmpbuf(png_ptr)))
+
95  {
+
96  png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+
97  return -3;
+
98  }
+
99 
+
100  /* Initialize info for reading PNG stream from memory. */
+
101  read_io_ptr.stream_ptr = (png_voidp)pngbuf;
+
102  read_io_ptr.stream_len = 0;
+
103 
+
104  /* Set new custom read function. */
+
105  png_set_read_fn(png_ptr, (png_voidp)&read_io_ptr, (png_rw_ptr)user_read_data);
+
106 
+
107  /* Read and decode PNG stream. */
+
108  png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
109 
+
110  /* Get pointer to each row of image data. */
+
111  row_pointers = png_get_rows(png_ptr, info_ptr);
+
112 
+
113  /* Get image info, such as size, depth, colortype, etc... */
+
114  /*printf("SAGT:png %d %d %d\n", info_ptr->width, info_ptr->height, info_ptr->bit_depth);*/
+
115  // (void)png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *)width, (png_uint_32 *)height,
+
116  (void)png_get_IHDR(png_ptr, info_ptr, &w32, &h32,
+
117  &bit_depth, &color, &interlace, &compres, &filter);
+
118 
+
119  *height = h32;
+
120  *width = w32;
+
121 
+
122  /* Check if image was grayscale. */
+
123  /*
+
124  if (color != PNG_COLOR_TYPE_GRAY) {
+
125  fprintf(stderr, "dec_png: Grayscale image was expected. \n");
+
126  }
+
127  */
+
128  if (color == PNG_COLOR_TYPE_RGB)
+
129  bit_depth = 24;
+
130  else if (color == PNG_COLOR_TYPE_RGB_ALPHA)
+
131  bit_depth = 32;
+
132 
+
133  /* Copy image data to output string */
+
134  n = 0;
+
135  bytes = bit_depth / 8;
+
136  clen = (*width) * bytes;
+
137  for (j = 0; j < *height; j++)
+
138  {
+
139  for (k = 0; k < clen; k++)
+
140  {
+
141  cout[n] = *(row_pointers[j] + k);
+
142  n++;
+
143  }
+
144  }
+
145 
+
146  /* Clean up. */
+
147  png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+
148  return 0;
+
149 }
+
+
+
dec_png
int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
Decode PNG.
Definition: dec_png.c:61
+
user_read_data
void user_read_data(png_structp, png_bytep, png_uint_32)
Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk...
Definition: dec_png.c:35
+
png_stream
struct png_stream png_stream
Typedef for PNG stream.
Definition: dec_png.c:20
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+ + + + diff --git a/ver-1.7.0/decenc__openjpeg_8c.html b/ver-1.7.0/decenc__openjpeg_8c.html new file mode 100644 index 00000000..39205eaf --- /dev/null +++ b/ver-1.7.0/decenc__openjpeg_8c.html @@ -0,0 +1,114 @@ + + + + + + + +NCEPLIBS-g2c: decenc_openjpeg.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
decenc_openjpeg.c File Reference
+
+
+ +

JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c. +More...

+ +

Go to the source code of this file.

+

Detailed Description

+

JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c.

+

Copyright 2005-2019 ECMWF.

+

This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.

+

In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.

+
Author
ECMWF programmer
+ +

Definition in file decenc_openjpeg.c.

+
+
+ + + + diff --git a/ver-1.7.0/decenc__openjpeg_8c_source.html b/ver-1.7.0/decenc__openjpeg_8c_source.html new file mode 100644 index 00000000..766e9714 --- /dev/null +++ b/ver-1.7.0/decenc__openjpeg_8c_source.html @@ -0,0 +1,433 @@ + + + + + + + +NCEPLIBS-g2c: decenc_openjpeg.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
decenc_openjpeg.c
+
+
+Go to the documentation of this file.
1 
+
19 #if !defined USE_JPEG2000 && defined USE_OPENJPEG
+
20 
+
21 #include "grib2_int.h"
+
22 #include "openjpeg.h"
+
23 
+
24 #include <assert.h>
+
25 #include <stdio.h>
+
26 #include <stdlib.h>
+
27 #include <string.h>
+
28 
+
37 static void openjpeg_warning(const char *msg, void *client_data)
+
38 {
+
39  (void)client_data;
+
40  fprintf(stderr,"openjpeg: %s",msg);
+
41 }
+
42 
+
51 static void openjpeg_error(const char *msg, void *client_data)
+
52 {
+
53  (void)client_data;
+
54  fprintf(stderr,"openjpeg: %s",msg);
+
55 }
+
56 
+
65 static void openjpeg_info(const char *msg, void *client_data)
+
66 {
+
67  (void)msg;
+
68  (void)client_data;
+
69  /* fprintf(stderr,"openjpeg: %s",msg); */
+
70 }
+
71 
+
72 /* opj_* Helper code from
+
73  * https://groups.google.com/forum/#!topic/openjpeg/8cebr0u7JgY
+
74  */
+
75 /* These routines are added to use memory instead of a file for input and output */
+
76 /* struct need to treat memory as a stream */
+
77 typedef struct
+
78 {
+
79  OPJ_UINT8* pData; /* our data */
+
80  OPJ_SIZE_T dataSize; /* how big is our data */
+
81  OPJ_SIZE_T offset; /* where we are currently in our data */
+
82 } opj_memory_stream;
+
83 
+
95 static OPJ_SIZE_T opj_memory_stream_read(void *buffer, OPJ_SIZE_T nb_bytes, void * p_user_data)
+
96 {
+
97  opj_memory_stream* mstream = (opj_memory_stream*) p_user_data; /* Our data */
+
98  OPJ_SIZE_T nb_bytes_read = nb_bytes; /* Amount to move to buffer */
+
99 
+
100  /* Check if the current offset is outside our data buffer */
+
101  if (mstream->offset >= mstream->dataSize)
+
102  return (OPJ_SIZE_T) -1;
+
103 
+
104  /* Check if we are reading more than we have */
+
105  if (nb_bytes > (mstream->dataSize - mstream->offset))
+
106  nb_bytes_read = mstream->dataSize - mstream->offset;
+
107 
+
108  memcpy(buffer, &(mstream->pData[mstream->offset]), nb_bytes_read);
+
109  mstream->offset += nb_bytes_read; /* Update the pointer to the new location */
+
110  return nb_bytes_read;
+
111 }
+
112 
+
124 static OPJ_SIZE_T opj_memory_stream_write(void *buffer, OPJ_SIZE_T nb_bytes, void *user_data)
+
125 {
+
126  opj_memory_stream* mstream = (opj_memory_stream*) user_data; /* our data */
+
127  OPJ_SIZE_T nb_bytes_write = nb_bytes; /* Amount to move to buffer */
+
128 
+
129  /* Check if the current offset is outside our data buffer */
+
130  if (mstream->offset >= mstream->dataSize)
+
131  return (OPJ_SIZE_T)-1;
+
132 
+
133  /* Check if we are writing more than we have space for */
+
134  if (nb_bytes > (mstream->dataSize - mstream->offset))
+
135  nb_bytes_write = mstream->dataSize - mstream->offset;
+
136 
+
137  /* Copy the data from the internal buffer */
+
138  memcpy(&(mstream->pData[mstream->offset]), buffer, nb_bytes_write);
+
139  mstream->offset += nb_bytes_write; /* Update the pointer to the new location */
+
140  return nb_bytes_write;
+
141 }
+
142 
+
153 static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void *user_data)
+
154 {
+
155  opj_memory_stream* mstream = (opj_memory_stream*) user_data;
+
156  OPJ_SIZE_T l_nb_bytes;
+
157 
+
158  if (nb_bytes < 0)
+
159  return -1; /* No skipping backwards */
+
160  l_nb_bytes = (OPJ_SIZE_T) nb_bytes; /* Allowed because it is positive */
+
161  /* Do not allow jumping past the end */
+
162  if (l_nb_bytes > mstream->dataSize - mstream->offset)
+
163  l_nb_bytes = mstream->dataSize - mstream->offset;
+
164  mstream->offset += l_nb_bytes;
+
165  return (OPJ_OFF_T)l_nb_bytes; /* Return how far we jumped */
+
166 }
+
167 
+
178 static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T nb_bytes, void * user_data)
+
179 {
+
180  opj_memory_stream* mstream = (opj_memory_stream*) user_data;
+
181 
+
182  if (nb_bytes < 0)
+
183  return OPJ_FALSE; /* Not before the buffer */
+
184  if (nb_bytes >(OPJ_OFF_T) mstream->dataSize)
+
185  return OPJ_FALSE; /* Not after the buffer */
+
186  mstream->offset = (OPJ_SIZE_T) nb_bytes; /* Move to new position */
+
187  return OPJ_TRUE;
+
188 }
+
189 
+
197 static void opj_memory_stream_do_nothing(void * p_user_data)
+
198 {
+
199  OPJ_ARG_NOT_USED(p_user_data);
+
200 }
+
201 
+
212 static opj_stream_t* opj_stream_create_default_memory_stream(opj_memory_stream* memoryStream, OPJ_BOOL is_read_stream)
+
213 {
+
214  opj_stream_t* stream;
+
215 
+
216  if (!(stream = opj_stream_default_create(is_read_stream)))
+
217  return (NULL);
+
218  /* Set how to work with the frame buffer */
+
219  if (is_read_stream)
+
220  opj_stream_set_read_function(stream, opj_memory_stream_read);
+
221  else
+
222  opj_stream_set_write_function(stream, opj_memory_stream_write);
+
223 
+
224  opj_stream_set_seek_function(stream, opj_memory_stream_seek);
+
225  opj_stream_set_skip_function(stream, opj_memory_stream_skip);
+
226  opj_stream_set_user_data(stream, memoryStream, opj_memory_stream_do_nothing);
+
227  opj_stream_set_user_data_length(stream, memoryStream->dataSize);
+
228  return stream;
+
229 }
+
230 
+
252 int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+
253 {
+
254  int iret = 0;
+
255  OPJ_INT32 mask;
+
256 
+
257  opj_stream_t *stream = NULL;
+
258  opj_image_t *image = NULL;
+
259  opj_codec_t *codec = NULL;
+
260 
+
261  /* set decoding parameters to default values */
+
262  opj_dparameters_t parameters = {0,}; /* decompression parameters */
+
263  opj_set_default_decoder_parameters(&parameters);
+
264  parameters.decod_format = 1; /* JP2_FMT */
+
265 
+
266  /* get a decoder handle */
+
267  codec = opj_create_decompress(OPJ_CODEC_J2K);
+
268 
+
269  /* catch events using our callbacks */
+
270  opj_set_info_handler(codec, openjpeg_info, NULL);
+
271  opj_set_warning_handler(codec, openjpeg_warning, NULL);
+
272  opj_set_error_handler(codec, openjpeg_error,NULL);
+
273 
+
274  /* initialize our memory stream */
+
275  opj_memory_stream mstream;
+
276  mstream.pData = (OPJ_UINT8 *)injpc;
+
277  mstream.dataSize = (OPJ_SIZE_T)bufsize;
+
278  mstream.offset = 0;
+
279  /* open a byte stream from memory stream */
+
280  stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_READ);
+
281 
+
282  /* setup the decoder decoding parameters using user parameters */
+
283  if (!opj_setup_decoder(codec, &parameters)) {
+
284  fprintf(stderr,"openjpeg: failed to setup decoder");
+
285  iret = -3;
+
286  goto cleanup;
+
287  }
+
288  if (!opj_read_header(stream, codec, &image)) {
+
289  fprintf(stderr,"openjpeg: failed to read the header");
+
290  iret = -3;
+
291  goto cleanup;
+
292  }
+
293  if (!opj_decode(codec, stream, image)) {
+
294  fprintf(stderr,"openjpeg: failed to decode");
+
295  iret = -3;
+
296  goto cleanup;
+
297  }
+
298 
+
299  if ( (image->numcomps != 1) || (image->x1 * image->y1)==0 ) {
+
300  iret = -3;
+
301  goto cleanup;
+
302  }
+
303 
+
304  assert(image->comps[0].sgnd == 0);
+
305  assert(image->comps[0].prec < sizeof(mask)*8-1);
+
306 
+
307  mask = (1 << image->comps[0].prec) - 1;
+
308 
+
309  for(unsigned int i = 0; i < image->comps[0].w * image->comps[0].h ; i++)
+
310  outfld[i] = (g2int) (image->comps[0].data[i] & mask);
+
311 
+
312  if (!opj_end_decompress(codec, stream)) {
+
313  fprintf(stderr,"openjpeg: failed in opj_end_decompress");
+
314  iret = -3;
+
315  }
+
316 
+
317 cleanup:
+
318  /* close the byte stream */
+
319  if (codec) opj_destroy_codec(codec);
+
320  if (stream) opj_stream_destroy(stream);
+
321  if (image) opj_image_destroy(image);
+
322 
+
323  return iret;
+
324 }
+
325 
+
359 int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
+
360  g2int ltype, g2int ratio, g2int retry, char *outjpc,
+
361  g2int jpclen)
+
362 {
+
363  (void) retry;
+
364  int iret = 0;
+
365  const int numcomps = 1;
+
366 
+
367  opj_codec_t *codec = NULL;
+
368  opj_image_t *image = NULL;
+
369  opj_stream_t *stream = NULL;
+
370 
+
371  /* set encoding parameters to default values */
+
372  opj_cparameters_t parameters = {0,}; /* compression parameters */
+
373  opj_set_default_encoder_parameters(&parameters);
+
374 
+
375  parameters.tcp_numlayers = 1;
+
376  parameters.cp_disto_alloc = 1;
+
377  if (ltype == 1) {
+
378  assert(ratio != 255);
+
379  parameters.tcp_rates[0] = 1.0f/(float)ratio;
+
380  }
+
381 
+
382  /* By default numresolution = 6 (must be between 1 and 32)
+
383  * This may be too large for some of our datasets, eg. 1xn, so adjust ...
+
384  */
+
385  parameters.numresolution = 6;
+
386  while ((width < (1 << (parameters.numresolution - 1))) ||
+
387  (height < (1 << (parameters.numresolution - 1))))
+
388  {
+
389  parameters.numresolution--;
+
390  }
+
391 
+
392  /* initialize image component */
+
393  opj_image_cmptparm_t cmptparm = {0,};
+
394  cmptparm.prec = (OPJ_UINT32)nbits;
+
395  cmptparm.bpp = (OPJ_UINT32)nbits;
+
396  cmptparm.sgnd = 0;
+
397  cmptparm.dx = 1;
+
398  cmptparm.dy = 1;
+
399  cmptparm.w = (OPJ_UINT32)width;
+
400  cmptparm.h = (OPJ_UINT32)height;
+
401 
+
402  /* create the image */
+
403  image = opj_image_create(numcomps, &cmptparm, OPJ_CLRSPC_GRAY);
+
404  if (!image)
+
405  {
+
406  iret = -3;
+
407  goto cleanup;
+
408  }
+
409  image->x0 = 0;
+
410  image->y0 = 0;
+
411  image->x1 = (OPJ_UINT32)width;
+
412  image->y1 = (OPJ_UINT32)height;
+
413 
+
414  assert(cmptparm.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */
+
415 
+
416  /* Simple packing */
+
417  for (int i = 0; i < width * height; i++)
+
418  image->comps[0].data[i] = cin[i];
+
419 
+
420  /* get a J2K compressor handle */
+
421  codec = opj_create_compress(OPJ_CODEC_J2K);
+
422 
+
423  opj_set_info_handler(codec, openjpeg_info, NULL);
+
424  opj_set_warning_handler(codec, openjpeg_warning, NULL);
+
425  opj_set_error_handler(codec, openjpeg_error,NULL);
+
426 
+
427  /* setup the encoder parameters using the current image and user parameters */
+
428  if (!opj_setup_encoder(codec, &parameters, image))
+
429  {
+
430  fprintf(stderr,"openjpeg: failed to setup encoder");
+
431  iret = -3;
+
432  goto cleanup;
+
433  }
+
434 
+
435  /* open a byte stream for writing */
+
436  opj_memory_stream mstream;
+
437  mstream.pData = (OPJ_UINT8 *)outjpc;
+
438  mstream.offset = 0;
+
439  mstream.dataSize = (OPJ_SIZE_T)jpclen;
+
440  stream = opj_stream_create_default_memory_stream(&mstream, OPJ_STREAM_WRITE);
+
441  if (!stream)
+
442  {
+
443  fprintf(stderr,"openjpeg: failed create default memory stream");
+
444  iret = -3;
+
445  goto cleanup;
+
446  }
+
447 
+
448  if (!opj_start_compress(codec, image, stream))
+
449  {
+
450  fprintf(stderr,"openjpeg: failed to setup encoder");
+
451  iret = -3;
+
452  goto cleanup;
+
453  }
+
454 
+
455  /* encode image */
+
456  if (!opj_encode(codec, stream))
+
457  {
+
458  fprintf(stderr,"openjpeg: opj_encode failed");
+
459  iret = -3;
+
460  goto cleanup;
+
461  }
+
462 
+
463  if (!opj_end_compress(codec, stream))
+
464  {
+
465  fprintf(stderr,"openjpeg: opj_end_compress failed");
+
466  iret = -3;
+
467  goto cleanup;
+
468  }
+
469  iret = (int)mstream.offset;
+
470 
+
471 cleanup:
+
472  if (codec)
+
473  opj_destroy_codec(codec);
+
474  if (stream)
+
475  opj_stream_destroy(stream);
+
476  if (image)
+
477  opj_image_destroy(image);
+
478 
+
479  return iret;
+
480 }
+
481 
+
482 #endif
+
+
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
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....
Definition: dec_jpeg2000.c:38
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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 ...
Definition: enc_jpeg2000.c:51
+ + + + diff --git a/ver-1.7.0/dir_1120c50dc01af8bc3323139f424a1f58.html b/ver-1.7.0/dir_1120c50dc01af8bc3323139f424a1f58.html new file mode 100644 index 00000000..5adae8ed --- /dev/null +++ b/ver-1.7.0/dir_1120c50dc01af8bc3323139f424a1f58.html @@ -0,0 +1,108 @@ + + + + + + + +NCEPLIBS-g2c: src Directory Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
src Directory Reference
+
+
+ + + + + +

+Files

file  grib2.h [code]
 Header file for NCEPLIBS-g2c library.
 
+
+
+ + + + diff --git a/ver-1.7.0/dir_49e56c817e5e54854c35e136979f97ca.html b/ver-1.7.0/dir_49e56c817e5e54854c35e136979f97ca.html new file mode 100644 index 00000000..66bbed1f --- /dev/null +++ b/ver-1.7.0/dir_49e56c817e5e54854c35e136979f97ca.html @@ -0,0 +1,101 @@ + + + + + + + +NCEPLIBS-g2c: docs Directory Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
docs Directory Reference
+
+
+
+
+ + + + diff --git a/ver-1.7.0/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/ver-1.7.0/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 00000000..fe9e0a12 --- /dev/null +++ b/ver-1.7.0/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,243 @@ + + + + + + + +NCEPLIBS-g2c: src Directory Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
src Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  cmplxpack.c [code]
 Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
 
file  compack.c [code]
 Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
 
file  comunpack.c [code]
 Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.
 
file  dec_jpeg2000.c [code]
 Decodes JPEG2000 code stream.
 
file  dec_png.c [code]
 PNG functions.
 
file  decenc_openjpeg.c [code]
 JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c.
 
file  drstemplates.c [code]
 Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion.
 
file  enc_jpeg2000.c [code]
 Encodes JPEG2000 code stream.
 
file  enc_png.c [code]
 Functions for dealing with PNG.
 
file  g2_addfield.c [code]
 Pack up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
 
file  g2_addgrid.c [code]
 Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
 
file  g2_addlocal.c [code]
 Add a Local Use Section (Section 2) to a GRIB2 message.
 
file  g2_create.c [code]
 Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
 
file  g2_free.c [code]
 Free up memory that was allocated for struct gribfield.
 
file  g2_getfld.c [code]
 Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field.
 
file  g2_gribend.c [code]
 Finalize a GRIB2 message after all grids and fields have been added.
 
file  g2_info.c [code]
 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.
 
file  g2_miss.c [code]
 Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field.
 
file  g2_unpack1.c [code]
 Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.
 
file  g2_unpack2.c [code]
 Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2.
 
file  g2_unpack3.c [code]
 Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
 
file  g2_unpack4.c [code]
 Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.
 
file  g2_unpack5.c [code]
 Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2.
 
file  g2_unpack6.c [code]
 Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
 
file  g2_unpack7.c [code]
 Unpack Section 7 (Data Section) as defined in GRIB Edition 2.
 
file  gbits.c [code]
 Functions to pack and unpack bits to/from a packed bit string.
 
file  getdim.c [code]
 Return the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
 
file  getpoly.c [code]
 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.
 
file  grib2_int.h [code]
 Header file with internal function prototypes NCEPLIBS-g2c library.
 
file  gridtemplates.c [code]
 Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).
 
file  int_power.c [code]
 Provide function similar to C pow() power function.
 
file  jpcpack.c [code]
 Pack up a data field into a JPEG2000 code stream.
 
file  jpcunpack.c [code]
 Unpack a data field that was packed into a JPEG2000 code stream.
 
file  misspack.c [code]
 Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
 
file  mkieee.c [code]
 
file  pack_gp.c [code]
 
file  pdstemplates.c [code]
 Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS).
 
file  pngpack.c [code]
 Function to pack data with PNG compression.
 
file  pngunpack.c [code]
 Contains a function to unpack data packed with PNG compression.
 
file  rdieee.c [code]
 Read a list of real values in 32-bit IEEE floating point format.
 
file  reduce.c [code]
 Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.
 
file  seekgb.c [code]
 Searches a file for the next GRIB message.
 
file  simpack.c [code]
 Pack up a data field using the simple packing algorithm.
 
file  simunpack.c [code]
 
file  specpack.c [code]
 Pack a spectral data field using the complex packing algorithm for spherical harmonic data.
 
file  specunpack.c [code]
 Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data.
 
file  util.c [code]
 Internal utility functions for the g2c library.
 
+
+
+ + + + diff --git a/ver-1.7.0/doc.png b/ver-1.7.0/doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/ver-1.7.0/doc.png differ diff --git a/ver-1.7.0/doxygen.css b/ver-1.7.0/doxygen.css new file mode 100644 index 00000000..73ecbb2c --- /dev/null +++ b/ver-1.7.0/doxygen.css @@ -0,0 +1,1771 @@ +/* The standard CSS for doxygen 1.8.17 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, p.intertd, p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #FFFFFF; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #FFFFFF; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #FFFFFF; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +blockquote.DocNodeRTL { + border-left: 0; + border-right: 2px solid #9CAFD4; + margin: 0 4px 0 24px; + padding: 0 16px 0 12px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.section.DocNodeRTL { + margin-right: 0px; + padding-right: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.note.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.deprecated.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.todo.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.test.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.bug.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +.PageDocRTL-title div.toc { + float: left !important; + text-align: right; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +.PageDocRTL-title div.toc li { + background-position-x: right !important; + padding-left: 0 !important; + padding-right: 10px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.PageDocRTL-title div.toc li.level1 { + margin-left: 0 !important; + margin-right: 0; +} + +.PageDocRTL-title div.toc li.level2 { + margin-left: 0 !important; + margin-right: 15px; +} + +.PageDocRTL-title div.toc li.level3 { + margin-left: 0 !important; + margin-right: 30px; +} + +.PageDocRTL-title div.toc li.level4 { + margin-left: 0 !important; + margin-right: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +/* +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTableHead tr { +} + +table.markdownTableBodyLeft td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft { + text-align: left +} + +th.markdownTableHeadRight { + text-align: right +} + +th.markdownTableHeadCenter { + text-align: center +} +*/ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +.DocNodeRTL { + text-align: right; + direction: rtl; +} + +.DocNodeLTR { + text-align: left; + direction: ltr; +} + +table.DocNodeRTL { + width: auto; + margin-right: 0; + margin-left: auto; +} + +table.DocNodeLTR { + width: auto; + margin-right: auto; + margin-left: 0; +} + +tt, code, kbd, samp +{ + display: inline-block; + direction:ltr; +} +/* @end */ + +u { + text-decoration: underline; +} + diff --git a/ver-1.7.0/doxygen.svg b/ver-1.7.0/doxygen.svg new file mode 100644 index 00000000..d42dad52 --- /dev/null +++ b/ver-1.7.0/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ver-1.7.0/drstemplates_8c.html b/ver-1.7.0/drstemplates_8c.html new file mode 100644 index 00000000..aa0c6011 --- /dev/null +++ b/ver-1.7.0/drstemplates_8c.html @@ -0,0 +1,355 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
drstemplates.c File Reference
+
+
+ +

Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion. +More...

+
#include <stdlib.h>
+#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Macros

#define MAXDRSMAPLEN   200
 maximum template map length More...
 
#define MAXDRSTEMP   9
 maximum number of templates More...
 
+ + + + + + + + + + +

+Functions

gtemplateextdrstemplate (g2int number, g2int *list)
 This subroutine generates the remaining octet map for a given Data Representation Template, if required. More...
 
static g2int getdrsindex (g2int number)
 This function returns the index of specified Data Representation Template. More...
 
gtemplategetdrstemplate (g2int number)
 This subroutine returns DRS template information for a specified Data Representation Template. More...
 
+ + + + +

+Variables

static const struct drstemplate templatesdrs [MAXDRSTEMP]
 Stuct holding data for GRIB2 Data Representation Section (DRS) template. More...
 
+

Detailed Description

+

Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion.

+

Each Template has three parts:

    +
  1. The number of entries in the template (mapdrslen).
  2. +
  3. A map of the template (mapdrs), which contains the number of octets in which to pack each of the template values.
  4. +
  5. 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 5.1 as an example.)
  6. +
+
Note
Array mapdrs contains the number of octets in which the corresponding template values will be stored. A negative value in mapdrs 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 mapdrs 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 mapdrs.
+

+Program History Log

+ + + + + + + +
Date Programmer Comments
2001-06-28 Gilbert Initial
2009-01-14 Vuong Changed structure name template to gtemplate
+
Author
Stephen Gilbert
+
Date
2001-06-28
+ +

Definition in file drstemplates.c.

+

Macro Definition Documentation

+ +

◆ MAXDRSMAPLEN

+ +
+
+ + + + +
#define MAXDRSMAPLEN   200
+
+ +

maximum template map length

+ +

Definition at line 39 of file drstemplates.c.

+ +
+
+ +

◆ MAXDRSTEMP

+ +
+
+ + + + +
#define MAXDRSTEMP   9
+
+ +

maximum number of templates

+ +

Definition at line 38 of file drstemplates.c.

+ +
+
+

Function Documentation

+ +

◆ extdrstemplate()

+ +
+
+ + + + + + + + + + + + + + + + + + +
gtemplate* extdrstemplate (g2int number,
g2intlist 
)
+
+ +

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
+ + + +
numberThe number of the Data Representation Template that is being requested.
listThe 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().

+ +
+
+ +

◆ getdrsindex()

+ +
+
+ + + + + +
+ + + + + + + + +
static g2int getdrsindex (g2int number)
+
+static
+
+ +

This function returns the index of specified Data Representation Template.

+
Parameters
+ + +
numberThe number of the Data Representation Template that is being requested.
+
+
+
Returns
Index of the DRT in array gtemplates, if it exists. -1, otherwise.
+
Author
Stephen Gilbert
+
Date
2001-06-28
+ +

Definition at line 134 of file drstemplates.c.

+ +

References MAXDRSTEMP, and templatesdrs.

+ +

Referenced by extdrstemplate(), and getdrstemplate().

+ +
+
+ +

◆ getdrstemplate()

+ +
+
+ + + + + + + + +
gtemplate* getdrstemplate (g2int number)
+
+ +

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
+ + +
numberThe 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().

+ +
+
+

Variable Documentation

+ +

◆ templatesdrs

+ +
+
+ + + + + +
+ + + + +
const struct drstemplate templatesdrs[MAXDRSTEMP]
+
+static
+
+ +

Stuct holding data for GRIB2 Data Representation Section (DRS) template.

+ +

Definition at line 56 of file drstemplates.c.

+ +

Referenced by getdrsindex(), and getdrstemplate().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/drstemplates_8c.js b/ver-1.7.0/drstemplates_8c.js new file mode 100644 index 00000000..96e7a8f5 --- /dev/null +++ b/ver-1.7.0/drstemplates_8c.js @@ -0,0 +1,9 @@ +var drstemplates_8c = +[ + [ "MAXDRSMAPLEN", "drstemplates_8c.html#ade593949cef71416060205db106c2828", null ], + [ "MAXDRSTEMP", "drstemplates_8c.html#a94872ea1f11e8ea068177a6506e0a3e4", null ], + [ "extdrstemplate", "drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c", null ], + [ "getdrsindex", "drstemplates_8c.html#a307a8ced5bd81dd2bf110596fc9e6532", null ], + [ "getdrstemplate", "drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e", null ], + [ "templatesdrs", "drstemplates_8c.html#a08f7c019317d1e6235a863ee8ce6e9e2", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/drstemplates_8c_source.html b/ver-1.7.0/drstemplates_8c_source.html new file mode 100644 index 00000000..a1a6990e --- /dev/null +++ b/ver-1.7.0/drstemplates_8c_source.html @@ -0,0 +1,240 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.c Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
drstemplates.c
+
+
+Go to the documentation of this file.
1 
+
35 #include <stdlib.h>
+
36 #include "grib2_int.h"
+
37 
+
38 #define MAXDRSTEMP 9
+
39 #define MAXDRSMAPLEN 200
+
44 struct drstemplate
+
45 {
+
46  g2int template_num;
+
47  g2int mapdrslen;
+
48  g2int needext;
+
49  g2int mapdrs[MAXDRSMAPLEN];
+
50 };
+
51 
+
56 static const struct drstemplate templatesdrs[MAXDRSTEMP] =
+
57 {
+
60  { 0, 5, 0, {4,-2,-2,1,1} },
+
61 
+
64  { 2, 16, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1} },
+
65 
+
68  { 3, 18, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1,1,1} },
+
69 
+
72  { 50, 5, 0, {4,-2,-2,1,4} },
+
73 
+
76  { 51, 10, 0, {4,-2,-2,1,-4,2,2,2,4,1} },
+
77 
+
78  /* 5.1: Matrix values at gridpoint - Simple packing.
+
79  * Comment from Stephen Gilbert in 2021:
+
80  *
+
81  * This encoder/decoder was written in the early days of GRIB2
+
82  * adoption as a standard. It was used to help WMO validate the
+
83  * templates in the specification by sharing GRIB2 encoded message
+
84  * with other organizations to verify that the data could be
+
85  * transmitted and processed successfully.
+
86  *
+
87  * We did not have a use case for DRS template 5.1 at that time
+
88  * and did not produce any GRIB2 messages using that template. It
+
89  * appears that other organizations did not work on it as
+
90  * well. The latest GRIB2 specification still includes the DRS
+
91  * Template 5.1 definition, but there is a disclaimer to use it
+
92  * with caution, since it has not yet been validated. I assume we
+
93  * commented it out because it was not validated, which means it's
+
94  * definition could possibly change during any validation attempts
+
95  * in the future.
+
96  */
+
97 
+
98  /* { 1, 15, 1, {4,-2,-2,1,1,1,4,2,2,1,1,1,1,1,1} }, */
+
99 
+
102  { 40, 7, 0, {4,-2,-2,1,1,1,1} },
+
103 
+
106  { 41, 5, 0, {4,-2,-2,1,1} },
+
107 
+
112  { 40000, 7, 0, {4,-2,-2,1,1,1,1} },
+
113 
+
118  { 40010, 5, 0, {4,-2,-2,1,1} }
+
119 } ;
+
120 
+
133 static g2int
+ +
135 {
+
136  g2int j, getdrsindex = -1;
+
137 
+
138  for (j = 0; j < MAXDRSTEMP; j++)
+
139  {
+
140  if (number == templatesdrs[j].template_num)
+
141  {
+
142  getdrsindex = j;
+
143  return(getdrsindex);
+
144  }
+
145  }
+
146 
+
147  return(getdrsindex);
+
148 }
+
149 
+
165 gtemplate *
+ +
167 {
+
168  g2int index;
+
169  gtemplate *new;
+
170 
+
171  index = getdrsindex(number);
+
172 
+
173  if (index != -1)
+
174  {
+
175  new = malloc(sizeof(gtemplate));
+
176  new->type = 5;
+
177  new->num = templatesdrs[index].template_num;
+
178  new->maplen = templatesdrs[index].mapdrslen;
+
179  new->needext = templatesdrs[index].needext;
+
180  new->map = (g2int *)templatesdrs[index].mapdrs;
+
181  new->extlen = 0;
+
182  new->ext = NULL;
+
183  return(new);
+
184  }
+
185  else
+
186  {
+
187  printf("getdrstemplate: DRS Template 5.%d not defined.\n", (int)number);
+
188  return(NULL);
+
189  }
+
190 
+
191  return(NULL);
+
192 }
+
193 
+
211 gtemplate *
+
212 extdrstemplate(g2int number, g2int *list)
+
213 {
+
214  gtemplate *new;
+
215 
+
216  if (getdrsindex(number) == -1)
+
217  return NULL;
+
218 
+
219  new = getdrstemplate(number);
+
220 
+
221  if (!new->needext)
+
222  return(new);
+
223 
+
224  /* This template is commented out (see comment in struct
+
225  * drstemplate for explanation). */
+
226  /* if (number == 1) */
+
227  /* { */
+
228  /* new->extlen = list[10] + list[12]; */
+
229  /* new->ext = malloc(sizeof(g2int) * new->extlen); */
+
230  /* for (i = 0; i < new->extlen; i++) */
+
231  /* { */
+
232  /* new->ext[i] = 4; */
+
233  /* } */
+
234  /* } */
+
235 
+
236  return new;
+
237 }
+
+
+
getdrstemplate
gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
Definition: drstemplates.c:166
+
MAXDRSMAPLEN
#define MAXDRSMAPLEN
maximum template map length
Definition: drstemplates.c:39
+
templatesdrs
static const struct drstemplate templatesdrs[MAXDRSTEMP]
Stuct holding data for GRIB2 Data Representation Section (DRS) template.
Definition: drstemplates.c:56
+
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
+
extdrstemplate
gtemplate * extdrstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Data Representation Template,...
Definition: drstemplates.c:212
+
getdrsindex
static g2int getdrsindex(g2int number)
This function returns the index of specified Data Representation Template.
Definition: drstemplates.c:134
+
g2int
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
MAXDRSTEMP
#define MAXDRSTEMP
maximum number of templates
Definition: drstemplates.c:38
+
gtemplate
Struct for GRIB template.
Definition: grib2_int.h:28
+ + + + diff --git a/ver-1.7.0/drstemplates_8h.html b/ver-1.7.0/drstemplates_8h.html new file mode 100644 index 00000000..2bd0f821 --- /dev/null +++ b/ver-1.7.0/drstemplates_8h.html @@ -0,0 +1,247 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.h File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.6.4 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
drstemplates.h File Reference
+
+
+ +

This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS). +More...

+
#include "grib2.h"
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  drstemplate
 Stuct for GRIB2 Data Representation Section (DRS) template. More...
 
+ + + + + + + +

+Macros

#define MAXDRSMAPLEN   200
 maximum template map length More...
 
#define MAXDRSTEMP   9
 maximum number of templates More...
 
+ + + + +

+Variables

const struct drstemplate templatesdrs [MAXDRSTEMP]
 Stuct holding data for GRIB2 Data Representation Section (DRS) template. More...
 
+

Detailed Description

+

This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS).

+

The information decribing each template is stored in the drstemplate structure defined below.

+

Each Template has three parts:

    +
  1. The number of entries in the template (mapdrslen).
  2. +
  3. A map of the template (mapdrs), which contains the number of octets in which to pack each of the template values.
  4. +
  5. 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 5.1 as an example.)
  6. +
+
Note
Array mapdrs contains the number of octets in which the corresponding template values will be stored. A negative value in mapdrs 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 mapdrs 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 mapdrs.
+
Author
Stephen Gilbeert
+
Date
2002-10-26
+ +

Definition in file drstemplates.h.

+

Data Type Documentation

+ +

◆ drstemplate

+ +
+
+ + + + +
struct drstemplate
+
+

Stuct for GRIB2 Data Representation Section (DRS) template.

+ +

Definition at line 42 of file drstemplates.h.

+
+ + + + + + + + + + + + + +
Data Fields
+g2int +mapdrs[MAXDRSMAPLEN] +A map of the template.
+g2int +mapdrslen +Length of map of the template.
+g2int +needext +Whether the Template needs to be extended.
+g2int +template_num +The number of entries in the template.
+ +
+
+

Macro Definition Documentation

+ +

◆ MAXDRSMAPLEN

+ +
+
+ + + + +
#define MAXDRSMAPLEN   200
+
+ +

maximum template map length

+ +

Definition at line 37 of file drstemplates.h.

+ +
+
+ +

◆ MAXDRSTEMP

+ +
+
+ + + + +
#define MAXDRSTEMP   9
+
+ +

maximum number of templates

+ +

Definition at line 36 of file drstemplates.h.

+ +
+
+

Variable Documentation

+ +

◆ templatesdrs

+ +
+
+ + + + +
const struct drstemplate templatesdrs[MAXDRSTEMP]
+
+ +

Stuct holding data for GRIB2 Data Representation Section (DRS) template.

+ +

Definition at line 1 of file drstemplates.h.

+ +

Referenced by getdrsindex(), and getdrstemplate().

+ +
+
+
+
+ + + + diff --git a/ver-1.7.0/drstemplates_8h.js b/ver-1.7.0/drstemplates_8h.js new file mode 100644 index 00000000..08dbd925 --- /dev/null +++ b/ver-1.7.0/drstemplates_8h.js @@ -0,0 +1,12 @@ +var drstemplates_8h = +[ + [ "drstemplate", "drstemplates_8h.html#structdrstemplate", [ + [ "mapdrs", "drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4", null ], + [ "mapdrslen", "drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9", null ], + [ "needext", "drstemplates_8h.html#a6f2f478357352200fbac1f72091de752", null ], + [ "template_num", "drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4", null ] + ] ], + [ "MAXDRSMAPLEN", "drstemplates_8h.html#ade593949cef71416060205db106c2828", null ], + [ "MAXDRSTEMP", "drstemplates_8h.html#a94872ea1f11e8ea068177a6506e0a3e4", null ], + [ "templatesdrs", "drstemplates_8h.html#a08f7c019317d1e6235a863ee8ce6e9e2", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/drstemplates_8h_source.html b/ver-1.7.0/drstemplates_8h_source.html new file mode 100644 index 00000000..6d4bbbdd --- /dev/null +++ b/ver-1.7.0/drstemplates_8h_source.html @@ -0,0 +1,150 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.h Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.6.4 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
drstemplates.h
+
+
+Go to the documentation of this file.
1 
+
31 #ifndef _drstemplates_H
+
32 #define _drstemplates_H
+
33 
+
34 #include "grib2.h"
+
35 
+
36 #define MAXDRSTEMP 9
+
37 #define MAXDRSMAPLEN 200
+ +
43 {
+ + + + +
48 };
+
49 
+
54 const struct drstemplate templatesdrs[MAXDRSTEMP] =
+
55 {
+
58  { 0, 5, 0, {4,-2,-2,1,1} },
+
59 
+
62  { 2, 16, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1} },
+
63 
+
66  { 3, 18, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1,1,1} },
+
67 
+
70  { 50, 5, 0, {4,-2,-2,1,4} },
+
71 
+
74  { 51, 10, 0, {4,-2,-2,1,-4,2,2,2,4,1} },
+
75 
+
76  /* 5.1: Matrix values at gridpoint - Simple packing */
+
77  /* { 1, 15, 1, {4,-2,-2,1,1,1,4,2,2,1,1,1,1,1,1} }, */
+
78 
+
81  { 40, 7, 0, {4,-2,-2,1,1,1,1} },
+
82 
+
85  { 41, 5, 0, {4,-2,-2,1,1} },
+
86 
+
88  { 40000, 7, 0, {4,-2,-2,1,1,1,1} },
+
89 
+
91  { 40010, 5, 0, {4,-2,-2,1,1} }
+
92 } ;
+
93 
+
94 #endif /* _drstemplates_H */
+
const struct drstemplate templatesdrs[MAXDRSTEMP]
Stuct holding data for GRIB2 Data Representation Section (DRS) template.
Definition: drstemplates.h:54
+
g2int needext
Whether the Template needs to be extended.
Definition: drstemplates.h:46
+
g2int mapdrslen
Length of map of the template.
Definition: drstemplates.h:45
+
#define MAXDRSTEMP
maximum number of templates
Definition: drstemplates.h:36
+
g2int template_num
The number of entries in the template.
Definition: drstemplates.h:44
+
g2int mapdrs[MAXDRSMAPLEN]
A map of the template.
Definition: drstemplates.h:47
+
#define MAXDRSMAPLEN
maximum template map length
Definition: drstemplates.h:37
+
Stuct for GRIB2 Data Representation Section (DRS) template.
Definition: drstemplates.h:43
+
Header file for NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:20
+
+
+ + + + diff --git a/ver-1.7.0/drstemplates_8h_structdrstemplate.js b/ver-1.7.0/drstemplates_8h_structdrstemplate.js new file mode 100644 index 00000000..febe2403 --- /dev/null +++ b/ver-1.7.0/drstemplates_8h_structdrstemplate.js @@ -0,0 +1,7 @@ +var drstemplates_8h_structdrstemplate = +[ + [ "mapdrs", "drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4", null ], + [ "mapdrslen", "drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9", null ], + [ "needext", "drstemplates_8h.html#a6f2f478357352200fbac1f72091de752", null ], + [ "template_num", "drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/dynsections.js b/ver-1.7.0/dynsections.js new file mode 100644 index 00000000..c8e84aaa --- /dev/null +++ b/ver-1.7.0/dynsections.js @@ -0,0 +1,127 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +NCEPLIBS-g2c: enc_jpeg2000.c File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
NCEPLIBS-g2c +  1.7.0 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
enc_jpeg2000.c File Reference
+
+
+ +

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.

+ + + + + +

+Macros

#define MAXOPTSSIZE   1024
 Maximum size of options. More...
 
+ + + + +

+Functions

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...
 
+

Detailed Description

+

Encodes JPEG2000 code stream.

+
Author
Stephen Gilbert
+
Date
2002-12-02
+ +

Definition in file enc_jpeg2000.c.

+

Macro Definition Documentation

+ +

◆ MAXOPTSSIZE

+ +
+
+ + + + +
#define MAXOPTSSIZE   1024
+
+ +

Maximum size of options.

+ +

Definition at line 11 of file enc_jpeg2000.c.

+ +
+
+

Function Documentation

+ +

◆ 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
+ + + + + + + + + + +
cinPacked matrix of Grayscale image values to encode.
widthwidth of image.
heightheight of image.
nbitsdepth (in bits) of image. i.e number of bits used to hold each data value.
ltypeindicator of lossless or lossy compression.
    +
  • 1, for lossy compression
  • +
  • != 1, for lossless compression
  • +
+
ratiotarget compression ratio. (ratio:1) Used only when ltype == 1.
retryIf 1 try increasing number of guard bits.
outjpcOutput encoded JPEG2000 code stream.
jpclenNumber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
enc_jpeg2000.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 #include "jasper/jasper.h"
+
10 
+
11 #define MAXOPTSSIZE 1024
+
50 int
+
51 enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
+
52  g2int ltype, g2int ratio, g2int retry, char *outjpc,
+
53  g2int jpclen)
+
54 {
+
55  int ier, rwcnt;
+
56  jas_image_t image;
+
57  jas_stream_t *jpcstream, *istream;
+
58  jas_image_cmpt_t cmpt, *pcmpt;
+
59  char opts[MAXOPTSSIZE];
+
60  int fmt;
+
61 
+
62  /* Set lossy compression options, if requested. */
+
63  if (ltype != 1)
+
64  opts[0] = (char)0;
+
65  else
+
66  snprintf(opts,MAXOPTSSIZE,"mode=real\nrate=%f",1.0/(float)ratio);
+
67 
+
68  if (retry == 1) /* option to increase number of guard bits */
+
69  strcat(opts,"\nnumgbits=4");
+
70 
+
71  /* Initialize the JasPer image structure describing the grayscale
+
72  * image to encode into the JPEG2000 code stream. */
+
73  image.tlx_ = 0;
+
74  image.tly_ = 0;
+
75  image.brx_ = (jas_image_coord_t)width;
+
76  image.bry_ = (jas_image_coord_t)height;
+
77  image.numcmpts_ = 1;
+
78  image.maxcmpts_ = 1;
+
79  image.clrspc_ = JAS_CLRSPC_SGRAY; /* grayscale Image */
+
80  image.cmprof_ = 0;
+
81 
+
82  cmpt.tlx_ = 0;
+
83  cmpt.tly_ = 0;
+
84  cmpt.hstep_ = 1;
+
85  cmpt.vstep_ = 1;
+
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);
+
89  cmpt.prec_ = nbits;
+
90  cmpt.sgnd_ = 0;
+
91  cmpt.cps_ = (nbits + 7) / 8;
+
92 
+
93  pcmpt = &cmpt;
+
94  image.cmpts_ = &pcmpt;
+
95 
+
96  /* Initialize Jasper. */
+
97 #ifdef JASPER3
+
98  jas_conf_clear();
+
99  /* static jas_std_allocator_t allocator; */
+
100  /* jas_std_allocator_init(&allocator); */
+
101  /* jas_conf_set_allocator(JAS_CAST(jas_std_allocator_t *, &allocator)); */
+
102  jas_conf_set_max_mem_usage(10000000);
+
103  jas_conf_set_multithread(true);
+
104  if (jas_init_library())
+
105  return G2_JASPER_INIT;
+
106  if (jas_init_thread())
+
107  return G2_JASPER_INIT;
+
108 #else
+
109  if (jas_init())
+
110  return G2_JASPER_INIT;
+
111 #endif /* JASPER3 */
+
112 
+
113  /* Open a JasPer stream containing the input grayscale values. */
+
114  istream = jas_stream_memopen((char *)cin, height * width * cmpt.cps_);
+
115  cmpt.stream_ = istream;
+
116 
+
117  /* Open an output stream that will contain the encoded jpeg2000
+
118  * code stream. */
+
119  jpcstream = jas_stream_memopen(outjpc, (int)jpclen);
+
120 
+
121  /* Get jasper ID of JPEG encoder. */
+
122  fmt = jas_image_strtofmt(G2C_JASPER_JPEG_FORMAT_NAME);
+
123 
+
124  /* Encode image. */
+
125  if ((ier = jas_image_encode(&image, jpcstream, fmt, opts)))
+
126  return G2_JASPER_ENCODE;
+
127 
+
128  /* Rememeber the length in bytes of the encoded JPEG code
+
129  * stream. */
+
130  rwcnt = jpcstream->rwcnt_;
+
131 
+
132  /* Clean up JasPer work structures. */
+
133  ier = jas_stream_close(istream);
+
134  ier = jas_stream_close(jpcstream);
+
135 
+
136  /* Finalize jasper. */
+
137 #ifdef JASPER3
+
138  jas_cleanup_thread();
+
139  jas_cleanup_library();
+
140 #else
+
141  jas_cleanup();
+
142 #endif /* JASPER3 */
+
143 
+
144  /* Return size of jpeg2000 code stream. */
+
145  return rwcnt;
+
146 }
+
+
+
#define MAXOPTSSIZE
Maximum size of options.
Definition: enc_jpeg2000.c:11
+
#define G2_JASPER_INIT
In enc_jpeg2000()/dec_jpeg2000() error initializing jasper library.
Definition: grib2.h:322
+
#define G2C_JASPER_JPEG_FORMAT_NAME
Name of JPEG codec in Jasper.
Definition: grib2_int.h:23
+
#define G2_JASPER_ENCODE
In enc_jpeg2000() error encoding image with jasper.
Definition: grib2.h:323
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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 ...
Definition: enc_jpeg2000.c:51
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
enc_png.c File Reference
+
+
+ +

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.

+ + + + + +

+Typedefs

typedef struct png_stream png_stream
 Typedef for PNG stream. More...
 
+ + + + + + + + + + +

+Functions

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...
 
+

Detailed Description

+

Functions for dealing with PNG.

+
Author
Stephen Gilbert
+ +

Definition in file enc_png.c.

+

Typedef Documentation

+ +

◆ png_stream

+ +
+
+ + + + +
typedef struct png_stream png_stream
+
+ +

Typedef for PNG stream.

+ +

Definition at line 21 of file enc_png.c.

+ +
+
+

Function Documentation

+ +

◆ enc_png()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int enc_png (unsigned char * data,
g2int width,
g2int height,
g2int nbits,
unsigned char * pngbuf 
)
+
+ +

Encode PNG.

+
Parameters
+ + + + + + +
datadata.
widthwidth.
heightheight.
nbitsnumber of bits.
pngbufPNG 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_ptrPointer 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_ptrpointer
datadata
lengthlength
+
+
+
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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
enc_png.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include <string.h>
+
9 #include <png.h>
+
10 #include "grib2_int.h"
+
11 
+
15 struct png_stream
+
16 {
+
17  unsigned char *stream_ptr;
+
18  g2int stream_len;
+
19 };
+
20 
+
21 typedef struct png_stream png_stream;
+
23 void user_write_data(png_structp, png_bytep, png_uint_32);
+
24 void user_flush_data(png_structp);
+
25 
+
36 void
+
37 user_write_data(png_structp png_ptr, png_bytep data, png_uint_32 length)
+
38 {
+
39  unsigned char *ptr;
+
40  g2int offset;
+
41  png_stream *mem;
+
42 
+
43  mem = (png_stream *)png_get_io_ptr(png_ptr);
+
44  ptr = mem->stream_ptr;
+
45  offset = mem->stream_len;
+
46  memcpy(ptr + offset, data, length);
+
47  mem->stream_len += length;
+
48 }
+
49 
+
57 void user_flush_data(png_structp png_ptr)
+
58 {
+
59 }
+
60 
+
74 int
+
75 enc_png(unsigned char *data, g2int width, g2int height, g2int nbits,
+
76  unsigned char *pngbuf)
+
77 {
+
78  int color_type;
+
79  g2int j, bytes, pnglen, bit_depth;
+
80  png_structp png_ptr;
+
81  png_infop info_ptr;
+
82  png_bytep **row_pointers;
+
83  png_stream write_io_ptr;
+
84 
+
85  /* Create and initialize png_structs. */
+
86  if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)))
+
87  return -1;
+
88 
+
89  if (!(info_ptr = png_create_info_struct(png_ptr)))
+
90  {
+
91  png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
+
92  return -2;
+
93  }
+
94 
+
95  /* Set Error callback. */
+
96  if (setjmp(png_jmpbuf(png_ptr)))
+
97  {
+
98  png_destroy_write_struct(&png_ptr, &info_ptr);
+
99  return -3;
+
100  }
+
101 
+
102  /* Initialize info for writing PNG stream to memory. */
+
103  write_io_ptr.stream_ptr = (png_voidp)pngbuf;
+
104  write_io_ptr.stream_len = 0;
+
105 
+
106  /* Set new custom write functions. */
+
107  png_set_write_fn(png_ptr, (png_voidp)&write_io_ptr, (png_rw_ptr)user_write_data,
+
108  (png_flush_ptr)user_flush_data);
+
109 
+
110  /* Set the image size, colortype, filter type, etc... */
+
111  bit_depth = nbits;
+
112  color_type = PNG_COLOR_TYPE_GRAY;
+
113  if (nbits == 24)
+
114  {
+
115  bit_depth = 8;
+
116  color_type = PNG_COLOR_TYPE_RGB;
+
117  }
+
118  else if (nbits == 32)
+
119  {
+
120  bit_depth = 8;
+
121  color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+
122  }
+
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);
+
126 
+
127  /* Put image data into the PNG info structure. */
+
128  bytes = nbits / 8;
+
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);
+
133 
+
134  /* Do the PNG encoding, and write out PNG stream. */
+
135  png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
136 
+
137  /* Clean up. */
+
138  png_destroy_write_struct(&png_ptr, &info_ptr);
+
139  free(row_pointers);
+
140  pnglen = write_io_ptr.stream_len;
+
141  return pnglen;
+
142 }
+
+
+
int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
Encode PNG.
Definition: enc_png.c:75
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
struct png_stream png_stream
Typedef for PNG stream.
Definition: enc_png.c:21
+
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.
Definition: enc_png.c:37
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
void user_flush_data(png_structp)
Dummy Custom flush function.
Definition: enc_png.c:57
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 cmplxpack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
 compack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
 comunpack.cUnpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention
 dec_jpeg2000.cDecodes JPEG2000 code stream
 dec_png.cPNG functions
 decenc_openjpeg.cJPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c
 drstemplates.cFunctions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion
 enc_jpeg2000.cEncodes JPEG2000 code stream
 enc_png.cFunctions for dealing with PNG
 g2_addfield.cPack up Sections 4 through 7 for a given field and adds them to a GRIB2 message
 g2_addgrid.cPack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message
 g2_addlocal.cAdd a Local Use Section (Section 2) to a GRIB2 message
 g2_create.cInitializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)
 g2_free.cFree up memory that was allocated for struct gribfield
 g2_getfld.cReturn all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field
 g2_gribend.cFinalize a GRIB2 message after all grids and fields have been added
 g2_info.cSearch 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.cCheck the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field
 g2_unpack1.cUnpack Section 1 (Identification Section) as defined in GRIB Edition 2
 g2_unpack2.cUnpack Section 2 (Local Use Section) as defined in GRIB Edition 2
 g2_unpack3.cUnpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2
 g2_unpack4.cUnpack Section 4 (Product Definition Section) as defined in GRIB Edition 2
 g2_unpack5.cUnpack Section 5 (Data Representation Section) as defined in GRIB Edition 2
 g2_unpack6.cUnpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2
 g2_unpack7.cUnpack Section 7 (Data Section) as defined in GRIB Edition 2
 gbits.cFunctions to pack and unpack bits to/from a packed bit string
 getdim.cReturn the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format
 getpoly.cReturn 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.hHeader file for NCEPLIBS-g2c library
 grib2_int.hHeader file with internal function prototypes NCEPLIBS-g2c library
 gridtemplates.cReturns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS)
 int_power.cProvide function similar to C pow() power function
 jpcpack.cPack up a data field into a JPEG2000 code stream
 jpcunpack.cUnpack a data field that was packed into a JPEG2000 code stream
 misspack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
 mkieee.c
 pack_gp.c
 pdstemplates.cFunctions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS)
 pngpack.cFunction to pack data with PNG compression
 pngunpack.cContains a function to unpack data packed with PNG compression
 rdieee.cRead a list of real values in 32-bit IEEE floating point format
 reduce.cDetermines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment
 seekgb.cSearches a file for the next GRIB message
 simpack.cPack up a data field using the simple packing algorithm
 simunpack.c
 specpack.cPack a spectral data field using the complex packing algorithm for spherical harmonic data
 specunpack.cUnpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data
 util.cInternal 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_addfield.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_addfield()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_addfield (unsigned char * cgrib,
g2int ipdsnum,
g2intipdstmpl,
float * coordlist,
g2int numcoord,
g2int idrsnum,
g2intidrstmpl,
float * fld,
g2int ngrdpts,
g2int ibmap,
g2intbmap 
)
+
+ +

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
+ + + + + + + + + + + + +
cgribChar 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.
ipdsnumProduct Definition Template Number (see Code Table 4.0).
ipdstmplContains the data values for the Product Definition Template specified by ipdsnum.
coordlistArray containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
numcoordnumber of values in array coordlist.
idrsnumData Representation Template Number (see Code Table 5.0).
idrstmplThe 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.
fldArray of data points to pack.
ngrdptsNumber of data points in grid. i.e. size of fld and bmap.
ibmapBitmap 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.
  • +
+
bmapInteger 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_addfield.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
97 g2int
+
98 g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl,
+
99  float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl,
+
100  float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
+
101 {
+
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;
+
110  g2int *coordieee;
+
111  float *pfld;
+
112  gtemplate *mappds, *mapdrs;
+
113 #if defined USE_PNG || defined USE_JPEG2000 || defined USE_OPENJPEG
+
114  unsigned int allones = 4294967295u;
+
115  g2int width, height, iscan, itemp;
+
116 #endif
+
117  int ret;
+
118 
+
119  /* Check for GRIB header and terminator. Translate the error codes
+
120  * to the legacy G2 error codes. */
+
121  if ((ret = g2c_check_msg(cgrib, &lencurr, 1)))
+
122  {
+
123  if (ret == G2C_NOT_GRIB)
+
124  return G2_ADD_MSG_INIT;
+
125  if (ret == G2C_MSG_COMPLETE)
+
126  return G2_ADD_MSG_COMPLETE;
+
127  }
+
128 
+
129  /* Loop through all current sections of the GRIB message to find
+
130  * the last section number. */
+
131  len = 16; /* length of Section 0 */
+
132  for (;;)
+
133  {
+
134  /* Get number and length of next section. */
+
135  iofst = len * 8;
+
136  gbit(cgrib, &ilen, iofst, 32);
+
137  iofst = iofst + 32;
+
138  gbit(cgrib, &isecnum, iofst, 8);
+
139  iofst = iofst + 8;
+
140 
+
141  /* Check if previous Section 3 exists. */
+
142  if (isecnum == 3)
+
143  {
+
144  issec3 = 1;
+
145  lpos3 = len;
+
146  }
+
147  /* Check if a previous defined bitmap exists. */
+
148  if (isecnum == 6)
+
149  {
+
150  gbit(cgrib, &ibmprev, iofst, 8);
+
151  iofst = iofst + 8;
+
152  if (ibmprev >= 0 && ibmprev <= 253)
+
153  isprevbmap = 1;
+
154  }
+
155  len = len + ilen;
+
156 
+
157  /* Exit loop if last section reached. */
+
158  if (len == lencurr)
+
159  break;
+
160 
+
161  /* If byte count for each section doesn't match current */
+
162  /* total length, then there is a problem. */
+
163  if (len > lencurr)
+
164  {
+
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);
+
168  return G2_BAD_SEC_COUNTS;
+
169  }
+
170  }
+
171 
+
172  /* Sections 4 through 7 can only be added after section 3 or 7. */
+
173  if (isecnum != 3 && isecnum != 7)
+
174  {
+
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",
+
177  isecnum);
+
178  return G2_BAD_SEC;
+
179  }
+
180  else if (!issec3)
+
181  {
+
182  /* Sections 4 through 7 can only be added if section 3 was previously defined. */
+
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");
+
186  return G2_ADDFIELD_BAD_GDS;
+
187  }
+
188 
+
189  /* Add Section 4 - Product Definition Section. */
+
190  ibeg = lencurr * 8; /* Calculate offset for beginning of section 4 */
+
191  iofst = ibeg + 32; /* leave space for length of section */
+
192  sbit(cgrib, &four, iofst, 8); /* Store section number (4) */
+
193  iofst = iofst + 8;
+
194  sbit(cgrib, &numcoord, iofst, 16); /* Store num of coordinate values */
+
195  iofst = iofst + 16;
+
196  sbit(cgrib, &ipdsnum, iofst, 16); /* Store Prod Def Template num. */
+
197  iofst = iofst + 16;
+
198 
+
199  /* Get Product Definition Template. */
+
200  if (!(mappds = getpdstemplate(ipdsnum)))
+
201  return G2_ADDFIELD_BAD_PDT;
+
202 
+
203  /* Extend the Product Definition Template, if necessary. The */
+
204  /* number of values in a specific template may vary depending on */
+
205  /* data specified in the "static" part of the template. */
+
206  if (mappds->needext)
+
207  {
+
208  free(mappds);
+
209  mappds = extpdstemplate(ipdsnum, ipdstmpl);
+
210  }
+
211 
+
212  /* Pack up each input value in array ipdstmpl into the the */
+
213  /* appropriate number of octets, which are specified in */
+
214  /* corresponding entries in array mappds. */
+
215  for (i = 0; i < mappds->maplen; i++)
+
216  {
+
217  nbits = abs(mappds->map[i]) * 8;
+
218  if ((mappds->map[i] >= 0) || (ipdstmpl[i] >= 0))
+
219  sbit(cgrib, ipdstmpl + i, iofst, nbits);
+
220  else
+
221  {
+
222  sbit(cgrib, &one, iofst, 1);
+
223  temp = abs(ipdstmpl[i]);
+
224  sbit(cgrib, &temp, iofst + 1, nbits-1);
+
225  }
+
226  iofst = iofst + nbits;
+
227  }
+
228 
+
229  /* Pack template extension, if appropriate. */
+
230  j = mappds->maplen;
+
231  if (mappds->needext && (mappds->extlen > 0))
+
232  {
+
233  for (i = 0; i < mappds->extlen; i++)
+
234  {
+
235  nbits = abs(mappds->ext[i]) * 8;
+
236  if (mappds->ext[i] >= 0 || ipdstmpl[j] >= 0)
+
237  sbit(cgrib, ipdstmpl + j, iofst, nbits);
+
238  else
+
239  {
+
240  sbit(cgrib, &one, iofst, 1);
+
241  temp = abs(ipdstmpl[j]);
+
242  sbit(cgrib, &temp, iofst + 1, nbits - 1);
+
243  }
+
244  iofst = iofst + nbits;
+
245  j++;
+
246  }
+
247  }
+
248  if (mappds->ext)
+
249  free(mappds->ext);
+
250  free(mappds);
+
251 
+
252  /* Add Optional list of vertical coordinate values after the */
+
253  /* Product Definition Template, if necessary. */
+
254  if (numcoord != 0)
+
255  {
+
256  coordieee = calloc(numcoord, sizeof(g2int));
+
257  mkieee(coordlist, coordieee, numcoord);
+
258  sbits(cgrib, coordieee, iofst, 32, 0, numcoord);
+
259  iofst = iofst + (32 * numcoord);
+
260  free(coordieee);
+
261  }
+
262 
+
263  /* Calculate length of section 4 and store it in octets 1-4 of */
+
264  /* section 4. */
+
265  lensec4 = (iofst - ibeg) / 8;
+
266  sbit(cgrib, &lensec4, ibeg, 32);
+
267 
+
268  /* Pack Data using appropriate algorithm Get Data Representation */
+
269  /* Template */
+
270  if (!(mapdrs = getdrstemplate(idrsnum)))
+
271  return G2_ADDFIELD_BAD_PDT;
+
272 
+
273  /* Contract data field, removing data at invalid grid points, if */
+
274  /* bit-map is provided with field. */
+
275  if (ibmap == 0 || ibmap == 254)
+
276  {
+
277  pfld = malloc(ngrdpts * sizeof(float));
+
278  ndpts = 0;
+
279  for (j = 0; j < ngrdpts; j++)
+
280  {
+
281  if (bmap[j] == 1)
+
282  pfld[ndpts++] = fld[j];
+
283  }
+
284  }
+
285  else
+
286  {
+
287  ndpts = ngrdpts;
+
288  pfld = fld;
+
289  }
+
290 
+
291  /* Allocate storage for the packed data. */
+
292  nsize = ndpts * 4;
+
293  if (nsize < minsize)
+
294  nsize = minsize;
+
295  cpack = malloc(nsize);
+
296 
+
297  /* Call packing function based on idrsnum. */
+
298  if (idrsnum == 0) /* Simple Packing */
+
299  simpack(pfld, ndpts, idrstmpl, cpack, &lcpack);
+
300  else if (idrsnum == 2 || idrsnum == 3) /* Complex Packing */
+
301  cmplxpack(pfld, ndpts, idrsnum, idrstmpl, cpack, &lcpack);
+
302  else if (idrsnum == 50) /* Sperical Harmonic Simple Packing */
+
303  {
+
304  simpack(pfld + 1, ndpts - 1, idrstmpl, cpack, &lcpack);
+
305  mkieee(pfld, idrstmpl + 4, 1); /* ensure RE(0, 0) value is IEEE format */
+
306  }
+
307  else if (idrsnum == 51) /* Sperical Harmonic Complex Packing */
+
308  {
+
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);
+
312  else
+
313  {
+
314  printf("g2_addfield: Cannot pack DRT 5.51.\n");
+
315  return G2_ADDFIELD_BAD_GDT;
+
316  }
+
317  }
+
318 #if defined USE_JPEG2000 || defined USE_OPENJPEG
+
319  else if (idrsnum == 40 || idrsnum == 40000)
+
320  { /* JPEG2000 encoding */
+
321  if (ibmap == 255)
+
322  {
+
323  getdim(cgrib + lpos3, &width, &height, &iscan);
+
324  if (width == 0 || height == 0)
+
325  {
+
326  width = ndpts;
+
327  height = 1;
+
328  }
+
329  else if (width == allones || height == allones)
+
330  {
+
331  width = ndpts;
+
332  height = 1;
+
333  }
+
334  else if ((iscan & 32) == 32)
+
335  { /* Scanning mode: bit 3 */
+
336  itemp = width;
+
337  width = height;
+
338  height = itemp;
+
339  }
+
340  }
+
341  else
+
342  {
+
343  width = ndpts;
+
344  height = 1;
+
345  }
+
346  lcpack = nsize;
+
347  jpcpack(pfld, width, height, idrstmpl, cpack, &lcpack);
+
348  }
+
349 #endif /* USE_JPEG2000 */
+
350 #ifdef USE_PNG
+
351  else if (idrsnum == 41 || idrsnum == 40010)
+
352  { /* PNG encoding */
+
353  if (ibmap == 255)
+
354  {
+
355  getdim(cgrib + lpos3, &width, &height, &iscan);
+
356  if (width == 0 || height == 0)
+
357  {
+
358  width = ndpts;
+
359  height = 1;
+
360  }
+
361  else if (width == allones || height == allones)
+
362  {
+
363  width = ndpts;
+
364  height = 1;
+
365  }
+
366  else if ((iscan & 32) == 32)
+
367  { /* Scanning mode: bit 3 */
+
368  itemp = width;
+
369  width = height;
+
370  height = itemp;
+
371  }
+
372  }
+
373  else
+
374  {
+
375  width = ndpts;
+
376  height = 1;
+
377  }
+
378  pngpack(pfld, width, height, idrstmpl, cpack, &lcpack);
+
379  }
+
380 #endif /* USE_PNG */
+
381  else
+
382  {
+
383  printf("g2_addfield: Data Representation Template 5.%ld not yet implemented.\n", idrsnum);
+
384  return G2_ADDFIELD_BAD_DRT;
+
385  }
+
386 
+
387  /* Free temp space. */
+
388  if (ibmap == 0 || ibmap == 254)
+
389  {
+
390  if (fld != pfld)
+
391  free(pfld);
+
392  }
+
393 
+
394  /* The packing functions return an lcpack of -1 if there was an
+
395  * error packing. */
+
396  if (lcpack < 0)
+
397  {
+
398  if (cpack)
+
399  free(cpack);
+
400  return G2_ADDFIELD_ERR;
+
401  }
+
402 
+
403  /* Add Section 5 - Data Representation Section */
+
404  ibeg = iofst; /* Calculate offset for beginning of section 5 */
+
405  iofst = ibeg + 32; /* leave space for length of section */
+
406  sbit(cgrib, &five, iofst, 8); /* Store section number (5) */
+
407  iofst = iofst + 8;
+
408  sbit(cgrib, &ndpts, iofst, 32); /* Store num of actual data points */
+
409  iofst = iofst + 32;
+
410  sbit(cgrib, &idrsnum, iofst, 16); /* Store Data Repr. Template num. */
+
411  iofst = iofst + 16;
+
412 
+
413  /* Pack up each input value in array idrstmpl into the */
+
414  /* the appropriate number of octets, which are specified in */
+
415  /* corresponding entries in array mapdrs. */
+
416  for (i = 0; i < mapdrs->maplen; i++)
+
417  {
+
418  nbits = abs(mapdrs->map[i]) * 8;
+
419  if (mapdrs->map[i] >= 0 || idrstmpl[i] >= 0)
+
420  sbit(cgrib, idrstmpl + i, iofst, nbits);
+
421  else
+
422  {
+
423  sbit(cgrib, &one, iofst, 1);
+
424  temp = abs(idrstmpl[i]);
+
425  sbit(cgrib, &temp, iofst + 1, nbits - 1);
+
426  }
+
427  iofst = iofst + nbits;
+
428  }
+
429  free(mapdrs);
+
430 
+
431  /* Calculate length of section 5 and store it in octets */
+
432  /* 1-4 of section 5. */
+
433  lensec5 = (iofst - ibeg) / 8;
+
434  sbit(cgrib, &lensec5, ibeg, 32);
+
435 
+
436  /* Add Section 6 - Bit-Map Section */
+
437  ibeg = iofst; /* Calculate offset for beginning of section 6 */
+
438  iofst = ibeg + 32; /* leave space for length of section */
+
439  sbit(cgrib, &six, iofst, 8); /* Store section number (6) */
+
440  iofst = iofst + 8;
+
441  sbit(cgrib, &ibmap, iofst, 8); /* Store Bit Map indicator */
+
442  iofst = iofst + 8;
+
443 
+
444  /* Store bitmap, if supplied */
+
445  if (ibmap == 0)
+
446  {
+
447  sbits(cgrib, bmap, iofst, 1, 0, ngrdpts); /* Store BitMap */
+
448  iofst = iofst + ngrdpts;
+
449  }
+
450 
+
451  /* If specifying a previously defined bit-map, make sure */
+
452  /* one already exists in the current GRIB message. */
+
453  if (ibmap == 254 && !isprevbmap)
+
454  {
+
455  printf("g2_addfield: Requested previously defined bitmap,");
+
456  printf(" but one does not exist in the current GRIB message.\n");
+
457  return G2_ADDFIELD_BAD_BITMAP;
+
458  }
+
459 
+
460  /* Calculate length of section 6 and store it in octets */
+
461  /* 1-4 of section 6. Pad to end of octect, if necessary. */
+
462  left = 8 - (iofst % 8);
+
463  if (left != 8)
+
464  {
+
465  sbit(cgrib, &zero, iofst, left); /* Pad with zeros to fill Octet */
+
466  iofst = iofst + left;
+
467  }
+
468  lensec6 = (iofst - ibeg) / 8;
+
469  sbit(cgrib, &lensec6, ibeg, 32);
+
470 
+
471  /* Add Section 7 - Data Section */
+
472  ibeg = iofst; /* Calculate offset for beginning of section 7 */
+
473  iofst = ibeg + 32; /* leave space for length of section */
+
474  sbit(cgrib, &seven, iofst, 8); /* Store section number (7) */
+
475  iofst = iofst + 8;
+
476 
+
477  /* Store Packed Binary Data values, if non-constant field. */
+
478  if (lcpack != 0)
+
479  {
+
480  ioctet = iofst / 8;
+
481  /*cgrib(ioctet + 1:ioctet + lcpack)=cpack(1:lcpack) */
+
482  for (j = 0; j < lcpack; j++)
+
483  cgrib[ioctet + j] = cpack[j];
+
484  iofst = iofst + (8 * lcpack);
+
485  }
+
486 
+
487  /* Calculate length of section 7 and store it in octets */
+
488  /* 1-4 of section 7. */
+
489  lensec7 = (iofst - ibeg) / 8;
+
490  sbit(cgrib, &lensec7, ibeg, 32);
+
491 
+
492  if (cpack)
+
493  free(cpack);
+
494 
+
495  /* Update current byte total of message in Section 0 */
+
496  newlen = lencurr + lensec4 + lensec5 + lensec6 + lensec7;
+
497  sbit(cgrib, &newlen, 96, 32);
+
498 
+
499  return newlen;
+
500 }
+
+
+
gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
Definition: pdstemplates.c:329
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
#define G2_ADDFIELD_ERR
In g2_addfield() error packing data field.
Definition: grib2.h:318
+
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...
Definition: getdim.c:29
+
#define G2_ADDFIELD_BAD_DRT
In g2_addfield() unsupported Data Representationi Template.
Definition: grib2.h:315
+
gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
Definition: drstemplates.c:166
+
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.
Definition: jpcpack.c:253
+
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...
Definition: cmplxpack.c:36
+
#define G2_ADDFIELD_BAD_BITMAP
In g2_addfield() no bitmap in the GRIB message.
Definition: grib2.h:316
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
#define G2_BAD_SEC
Previous Section was unexpected.
Definition: grib2.h:300
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int maplen
Number of entries in the static part of the template.
Definition: grib2_int.h:39
+
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 ...
Definition: gbits.c:114
+
g2int * map
Number of octets of each entry in the static part of the template.
Definition: grib2_int.h:43
+
void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
Definition: mkieee.c:22
+
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...
Definition: gbits.c:20
+
gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
Definition: pdstemplates.c:281
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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...
Definition: specpack.c:33
+
#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
Definition: grib2.h:312
+
#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:311
+
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...
Definition: getpoly.c:40
+
#define G2C_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:330
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
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...
Definition: simpack.c:34
+
#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
Definition: grib2.h:310
+
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 ...
Definition: gbits.c:38
+
#define G2C_NOT_GRIB
GRIB header not found.
Definition: grib2.h:329
+
#define G2_ADDFIELD_BAD_GDS
In g2_addfield() section 3 (GDS) not previously defined in message.
Definition: grib2.h:314
+
#define G2_ADDFIELD_BAD_GDT
In g2_addfield() GDT of one of 5.50 through 5.53 required when using DRT 5.51.
Definition: grib2.h:317
+
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.
Definition: pngpack.c:224
+
#define G2_ADDFIELD_BAD_PDT
In g2_addfield() could not find requested Product Definition Template.
Definition: grib2.h:313
+
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.
Definition: g2_addfield.c:98
+
Struct for GRIB template.
Definition: grib2_int.h:28
+
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...
Definition: util.c:26
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_addgrid.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_addgrid()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_addgrid (unsigned char * cgrib,
g2intigds,
g2intigdstmpl,
g2intideflist,
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
+ + + + + + +
cgribChar array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message.
igdsContains 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).
  • +
+
igdstmplContains 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_addgrid.c
+
+
+Go to the documentation of this file.
1 
+
8 #include <stdio.h>
+
9 #include <stdlib.h>
+
10 #include "grib2_int.h"
+
11 
+
69 g2int
+
70 g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist,
+
71  g2int idefnum)
+
72 {
+
73  static g2int one = 1, three = 3, miss = 65535;
+
74  g2int lensec3, iofst, ibeg, lencurr, len;
+
75  g2int i, j, temp, ilen, isecnum, nbits;
+
76  gtemplate *mapgrid = 0;
+
77  int ret;
+
78 
+
79  /* Check for GRIB header and terminator. Translate the error codes
+
80  * to the legacy G2 error codes. */
+
81  if ((ret = g2c_check_msg(cgrib, &lencurr, 1)))
+
82  {
+
83  if (ret == G2C_NOT_GRIB)
+
84  return G2_ADD_MSG_INIT;
+
85  if (ret == G2C_MSG_COMPLETE)
+
86  return G2_ADD_MSG_COMPLETE;
+
87  }
+
88 
+
89  /* Loop through all current sections of the GRIB message to find
+
90  * the last section number. */
+
91  len = 16; /* length of Section 0 */
+
92  for (;;)
+
93  {
+
94  /* Get section number and length of next section. */
+
95  iofst = len * 8;
+
96  gbit(cgrib, &ilen, iofst, 32);
+
97  iofst = iofst + 32;
+
98  gbit(cgrib, &isecnum, iofst, 8);
+
99  len = len + ilen;
+
100 
+
101  /* Exit loop if last section reached. */
+
102  if (len == lencurr)
+
103  break;
+
104 
+
105  /* If byte count for each section doesn't match current total
+
106  * length, then there is a problem. */
+
107  if (len > lencurr)
+
108  {
+
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);
+
112  return G2_BAD_SEC_COUNTS;
+
113  }
+
114  }
+
115 
+
116  /* Section 3 can only be added after sections 1, 2 and 7. */
+
117  if (isecnum != 1 && isecnum != 2 && isecnum != 7)
+
118  {
+
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");
+
121  return G2_BAD_SEC;
+
122  }
+
123 
+
124  /* Add Section 3 - Grid Definition Section. */
+
125  ibeg = lencurr * 8; /* Calculate offset for beginning of section 3 */
+
126  iofst = ibeg + 32; /* leave space for length of section */
+
127  sbit(cgrib, &three, iofst, 8); /* Store section number (3) */
+
128  iofst = iofst + 8;
+
129  sbit(cgrib, igds+0, iofst, 8); /* Store source of Grid def. */
+
130  iofst = iofst + 8;
+
131  sbit(cgrib, igds+1, iofst, 32); /* Store number of data pts. */
+
132  iofst = iofst + 32;
+
133  sbit(cgrib, igds+2, iofst, 8); /* Store number of extra octets. */
+
134  iofst = iofst + 8;
+
135  sbit(cgrib, igds+3, iofst, 8); /* Store interp. of extra octets. */
+
136  iofst = iofst + 8;
+
137 
+
138  /* if Octet 6 is not equal to zero, Grid Definition Template may
+
139  * not be supplied. */
+
140  if (igds[0] == 0)
+
141  sbit(cgrib, igds+4, iofst, 16); /* Store Grid Def Template num. */
+
142  else
+
143  sbit(cgrib, &miss, iofst, 16); /* Store missing value as Grid Def Template num. */
+
144  iofst = iofst + 16;
+
145 
+
146  /* Get Grid Definition Template. */
+
147  if (igds[0] == 0)
+
148  {
+
149  if (!(mapgrid = getgridtemplate(igds[4])))
+
150  return G2_ADDGRID_BAD_GDT;
+
151 
+
152  /* Extend the Grid Definition Template, if necessary. The
+
153  * number of values in a specific template may vary depending
+
154  * on data specified in the "static" part of the template. */
+
155  if (mapgrid->needext)
+
156  {
+
157  free(mapgrid);
+
158  mapgrid = extgridtemplate(igds[4], igdstmpl);
+
159  }
+
160  }
+
161 
+
162  /* Pack up each input value in array igdstmpl into the
+
163  * appropriate number of octets, which are specified in
+
164  * corresponding entries in array mapgrid. */
+
165  for (i = 0; i < mapgrid->maplen; i++)
+
166  {
+
167  nbits = abs(mapgrid->map[i]) * 8;
+
168  if ((mapgrid->map[i] >= 0) || (igdstmpl[i] >= 0))
+
169  sbit(cgrib, igdstmpl+i, iofst, nbits);
+
170  else
+
171  {
+
172  sbit(cgrib, &one, iofst, 1);
+
173  temp = abs(igdstmpl[i]);
+
174  sbit(cgrib, &temp, iofst+1, nbits-1);
+
175  }
+
176  iofst = iofst + nbits;
+
177  }
+
178 
+
179  /* Pack template extension, if appropriate. */
+
180  j = mapgrid->maplen;
+
181  if (mapgrid->needext && mapgrid->extlen > 0)
+
182  {
+
183  for (i = 0; i < mapgrid->extlen; i++)
+
184  {
+
185  nbits = abs(mapgrid->ext[i]) * 8;
+
186  if (mapgrid->ext[i] >= 0 || igdstmpl[j] >= 0)
+
187  sbit(cgrib, igdstmpl + j, iofst, nbits);
+
188  else
+
189  {
+
190  sbit(cgrib, &one, iofst, 1);
+
191  temp = abs(igdstmpl[j]);
+
192  sbit(cgrib, &temp, iofst + 1, nbits - 1);
+
193  }
+
194  iofst = iofst + nbits;
+
195  j++;
+
196  }
+
197  }
+
198  if (mapgrid->ext)
+
199  free(mapgrid->ext);
+
200  free(mapgrid);
+
201 
+
202  /* If requested, insert optional list of numbers defining number
+
203  * of points in each row or column. This is used for non regular
+
204  * grids. */
+
205  if (igds[2] != 0)
+
206  {
+
207  nbits = igds[2] * 8;
+
208  sbits(cgrib, ideflist, iofst, nbits, 0, idefnum);
+
209  iofst = iofst + (nbits * idefnum);
+
210  }
+
211 
+
212  /* Calculate length of section 3 and store it in octets 1-4 of section 3. */
+
213  lensec3 = (iofst - ibeg) / 8;
+
214  sbit(cgrib, &lensec3, ibeg, 32);
+
215 
+
216  /* Update current byte total of message in Section 0. */
+
217  lencurr += lensec3;
+
218  sbit(cgrib, &lencurr, 96, 32);
+
219 
+
220  return lencurr;
+
221 }
+
+
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
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.
Definition: grib2.h:300
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int maplen
Number of entries in the static part of the template.
Definition: grib2_int.h:39
+
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 ...
Definition: gbits.c:114
+
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.
Definition: grib2_int.h:43
+
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...
Definition: gbits.c:20
+
#define G2_ADDGRID_BAD_GDT
In g2_addgrid() Could not find requested Grid Definition Template.
Definition: grib2.h:319
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
Definition: grib2.h:312
+
#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:311
+
#define G2C_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:330
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
Definition: grib2.h:310
+
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 ...
Definition: gbits.c:38
+
#define G2C_NOT_GRIB
GRIB header not found.
Definition: grib2.h:329
+
Struct for GRIB template.
Definition: grib2_int.h:28
+
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...
Definition: util.c:26
+
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.
Definition: g2_addgrid.c:70
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_addlocal.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Add a Local Use Section (Section 2) to a GRIB2 message.

+
Author
Stephen Gilbeert
+
Date
2002-11-01
+ +

Definition in file g2_addlocal.c.

+

Function Documentation

+ +

◆ 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
+ + + + +
cgribChar array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
csec2Character array containing information to be added in Section 2.
lcsec2Number 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_addlocal.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include "grib2_int.h"
+
8 
+
39 g2int
+
40 g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
+
41 {
+
42  static g2int two = 2;
+
43  g2int j, k, lensec2, iofst, ibeg, lencurr, ilen, len, istart;
+
44  g2int isecnum;
+
45  int ret;
+
46 
+
47  /* Check for GRIB header and terminator. Translate the error codes
+
48  * to the legacy G2 error codes. */
+
49  if ((ret = g2c_check_msg(cgrib, &lencurr, 1)))
+
50  {
+
51  if (ret == G2C_NOT_GRIB)
+
52  return G2_ADD_MSG_INIT;
+
53  if (ret == G2C_MSG_COMPLETE)
+
54  return G2_ADD_MSG_COMPLETE;
+
55  }
+
56 
+
57  /* Loop through all current sections of the GRIB message to find
+
58  * the last section number. */
+
59  len = 16; /* length of Section 0 */
+
60  for (;;)
+
61  {
+
62  /* Get section number and length of next section. */
+
63  iofst = len * 8;
+
64  gbit(cgrib, &ilen, iofst, 32);
+
65  iofst = iofst + 32;
+
66  gbit(cgrib, &isecnum, iofst, 8);
+
67  len = len + ilen;
+
68 
+
69  /* Exit loop if last section reached. */
+
70  if (len == lencurr)
+
71  break;
+
72 
+
73  /* If byte count for each section doesn't match current total
+
74  * length, then there is a problem. */
+
75  if (len > lencurr)
+
76  {
+
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);
+
80  return G2_BAD_SEC_COUNTS;
+
81  }
+
82  }
+
83 
+
84  /* Section 2 can only be added after sections 1 and 7. */
+
85  if (isecnum != 1 && isecnum != 7)
+
86  {
+
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);
+
89  return G2_BAD_SEC;
+
90  }
+
91 
+
92  /* Add Section 2 - Local Use Section. */
+
93  ibeg = lencurr * 8; /* Calculate offset for beginning of section 2 */
+
94  iofst = ibeg + 32; /* leave space for length of section */
+
95  sbit(cgrib, &two, iofst, 8); /* Store section number (2) */
+
96  istart = lencurr + 5;
+
97  k = 0;
+
98  for (j = istart; j < istart + lcsec2; j++)
+
99  cgrib[j] = csec2[k++];
+
100 
+
101  /* Calculate length of section 2 and store it in octets 1-4 of
+
102  * section 2. */
+
103  lensec2 = lcsec2 + 5; /* bytes */
+
104  sbit(cgrib, &lensec2, ibeg, 32);
+
105 
+
106  /* Update current byte total of message in Section 0. */
+
107  lencurr += lensec2;
+
108  sbit(cgrib, &lencurr, 96, 32);
+
109 
+
110  return lencurr;
+
111 }
+
+
+
#define G2_BAD_SEC
Previous Section was unexpected.
Definition: grib2.h:300
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
Definition: g2_addlocal.c:40
+
#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
Definition: grib2.h:312
+
#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:311
+
#define G2C_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:330
+
#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
Definition: grib2.h:310
+
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 ...
Definition: gbits.c:38
+
#define G2C_NOT_GRIB
GRIB header not found.
Definition: grib2.h:329
+
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...
Definition: util.c:26
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_create.c File Reference
+
+
+ +

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.

+ + + + + + + + +

+Macros

#define LENSEC0   16
 Length of GRIB Section 0. More...
 
#define MAPSEC1LEN   13
 Length of Map Section 1. More...
 
+ + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Macro Definition Documentation

+ +

◆ 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.

+ +
+
+

Function Documentation

+ +

◆ g2_create()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_create (unsigned char * cgrib,
g2intlistsec0,
g2intlistsec1 
)
+
+ +

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]cgribCharacter array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
[in]listsec0Contains 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]listsec1Contains 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_create.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include "grib2_int.h"
+
9 
+
10 #define MAPSEC1LEN 13
+
11 #define LENSEC0 16
+
67 g2int
+
68 g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
+
69 {
+
70  g2int zero = 0, one = 1;
+
71 
+
72  /* The mapsec1 array tells us how many bytes are used in the GRIB
+
73  * message by each element of the listsec1 array. For example the
+
74  * first two elements of listsec1 are identifcation of originating
+
75  * section and sub-section - these are each 2-byte entries in the
+
76  * GRIB section 1 table, the IDENTIFICATION SECTION. (See
+
77  * https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect1.shtml). */
+
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;
+
80 
+
81  /* Only GRIB Edition 2 is acceptable. */
+
82  if (listsec0[1] != 2)
+
83  {
+
84  printf("g2_create: can only code GRIB edition 2.");
+ +
86  }
+
87 
+
88  /* Pack Section 0 - Indicator Section (except for total length of
+
89  * GRIB message). */
+
90  cgrib[0] = 0x47; /* 'G' */
+
91  cgrib[1] = 0x52; /* 'R' */
+
92  cgrib[2] = 0x49; /* 'I' */
+
93  cgrib[3] = 0x42; /* 'B' */
+
94  sbit(cgrib, &zero, 32, 16); /* reserved for future use */
+
95  sbit(cgrib, listsec0 + 0, 48, 8); /* Discipline */
+
96  sbit(cgrib, listsec0 + 1, 56, 8); /* GRIB edition number */
+
97 
+
98  /* Pack Section 1 - Identification Section. */
+
99  ibeg = LENSEC0 * 8; /* Calculate offset for beginning of section 1. */
+
100  iofst = ibeg + 32; /* Leave space for length of section. */
+
101  sbit(cgrib, &one, iofst, 8); /* Store section number (1). */
+
102  iofst = iofst + 8;
+
103 
+
104  /* Pack up each input value in array listsec1 into the the
+
105  * appropriate number of octets, which are specified in
+
106  * corresponding entries in array mapsec1. */
+
107  for (i = 0; i < MAPSEC1LEN; i++)
+
108  {
+
109  nbits = mapsec1[i] * 8;
+
110  sbit(cgrib, listsec1 + i, iofst, nbits);
+
111  iofst = iofst + nbits;
+
112  }
+
113 
+
114  /* Calculate length of section 1 and store it in octets 1-4 of
+
115  * section 1. */
+
116  lensec1 = (iofst - ibeg) / 8;
+
117  sbit(cgrib, &lensec1, ibeg, 32);
+
118 
+
119  /* Put current byte total of message into Section 0. */
+
120  sbit(cgrib, &zero, 64, 32);
+
121  len = LENSEC0 + lensec1;
+
122  sbit(cgrib, &len, 96, 32);
+
123  return (len);
+
124 }
+
+
+
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...
Definition: g2_create.c:68
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
#define LENSEC0
Length of GRIB Section 0.
Definition: g2_create.c:11
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_CREATE_GRIB_VERSION
Wrong GRIB version for g2_create(), must be 2.
Definition: grib2.h:276
+
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 ...
Definition: gbits.c:38
+
#define MAPSEC1LEN
Length of Map Section 1.
Definition: g2_create.c:10
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_free.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

void g2_free (gribfield *gfld)
 This routine frees up memory that was allocated for struct gribfield. More...
 
+

Detailed Description

+

Free up memory that was allocated for struct gribfield.

+
Author
Stephen Gilbeert
+
Date
2002-10-28
+ +

Definition in file g2_free.c.

+

Function Documentation

+ +

◆ g2_free()

+ +
+
+ + + + + + + + +
void g2_free (gribfieldgfld)
+
+ +

This routine frees up memory that was allocated for struct gribfield.

+
Parameters
+ + +
gfldpointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_free.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 
+
23 void
+ +
25 {
+
26  if (gfld->idsect)
+
27  free(gfld->idsect);
+
28  if (gfld->local)
+
29  free(gfld->local);
+
30  if (gfld->list_opt)
+
31  free(gfld->list_opt);
+
32  if (gfld->igdtmpl)
+
33  free(gfld->igdtmpl);
+
34  if (gfld->ipdtmpl)
+
35  free(gfld->ipdtmpl);
+
36  if (gfld->coord_list)
+
37  free(gfld->coord_list);
+
38  if (gfld->idrtmpl)
+
39  free(gfld->idrtmpl);
+
40  if (gfld->bmap)
+
41  free(gfld->bmap);
+
42  if (gfld->fld)
+
43  free(gfld->fld);
+
44  free(gfld);
+
45 
+
46  return;
+
47 }
+
+
+
g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
Definition: grib2.h:152
+
g2int * idsect
Contains the entries in the Identification Section (Section 1).
Definition: grib2.h:96
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
Definition: grib2.h:186
+
void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
Definition: g2_free.c:24
+
float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
Definition: grib2.h:172
+
float * fld
Array of ndpts unpacked data points.
Definition: grib2.h:214
+
unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
Definition: grib2.h:103
+
Struct for GRIB field.
Definition: grib2.h:41
+
g2int * list_opt
(Used if numoct_opt .ne.
Definition: grib2.h:140
+
g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
Definition: grib2.h:211
+
g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
Definition: grib2.h:164
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_getfld.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ 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
+ + + + + + +
cgribCharacter pointer to the GRIB2 message.
ifldnumSpecifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
unpackBoolean value indicating whether to unpack bitmap/data field.
    +
  • 1 unpack bitmap (if present) and data values.
  • +
  • 0 do not unpack bitmap and data values.
  • +
+
expandBoolean 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.
  • +
+
gfldpointer 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:

+
#include "grib2.h"
+
gribfield *gfld;
+
ret=g2_getfld(cgrib,1,1,1,&gfld);
+
...
+
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.
+
Struct for GRIB field.
Definition: grib2.h:41
+
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),...
Definition: g2_getfld.c:91
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_getfld.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 
+
90 g2int
+
91 g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand,
+
92  gribfield **gfld)
+
93 {
+
94 
+
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;
+
98  g2int *igds;
+
99  g2int *bmpsave;
+
100  float *newfld;
+
101  gribfield *lgfld;
+
102  g2int jerr;
+
103 
+
104  /* Allocate storage for the field struct. The caller must free
+
105  * this memory. */
+
106  lgfld = calloc(1, sizeof(gribfield));
+
107  *gfld = lgfld;
+
108 
+
109  /* Check for valid request number. */
+
110  if (ifldnum <= 0)
+
111  {
+
112  printf("g2_getfld: Request for field number must be positive.\n");
+
113  free(lgfld);
+
114  return G2_GETFLD_INVAL;
+
115  }
+
116 
+
117  /* Check for beginning of GRIB message in the first 100 bytes. */
+
118  istart = -1;
+
119  for (j = 0; j < 100; j++)
+
120  {
+
121  if (cgrib[j] == 'G' && cgrib[j + 1] == 'R' &&cgrib[j + 2] == 'I' &&
+
122  cgrib[j + 3] == 'B')
+
123  {
+
124  istart = j;
+
125  break;
+
126  }
+
127  }
+
128  if (istart == -1)
+
129  {
+
130  printf("g2_getfld: Beginning characters GRIB not found.\n");
+
131  free(lgfld);
+
132  return G2_GETFLD_NO_GRIB;
+
133  }
+
134 
+
135  /* Unpack Section 0 - Indicator Section. */
+
136  iofst = 8 * (istart + 6);
+
137  gbit(cgrib, &disc, iofst, 8); /* Discipline */
+
138  iofst = iofst + 8;
+
139  gbit(cgrib, &ver, iofst, 8); /* GRIB edition number */
+
140  iofst = iofst + 8;
+
141  iofst = iofst + 32;
+
142  gbit(cgrib, &lengrib, iofst, 32); /* Length of GRIB message */
+
143  iofst = iofst + 32;
+
144  lensec0 = 16;
+
145  ipos = istart + lensec0;
+
146 
+
147  /* Currently handles only GRIB Edition 2. */
+
148  if (ver != 2)
+
149  {
+
150  printf("g2_getfld: can only decode GRIB edition 2.\n");
+
151  free(lgfld);
+
152  return G2_GETFLD_GRIB_VERSION;
+
153  }
+
154 
+
155  /* Loop through the remaining sections keeping track of the
+
156  * length of each. Also keep the latest Grid Definition Section
+
157  * info. Unpack the requested field number. */
+
158  for (;;)
+
159  {
+
160  /* Check to see if we are at end of GRIB message */
+
161  if (cgrib[ipos] == '7' && cgrib[ipos + 1] == '7' && cgrib[ipos + 2] == '7' &&
+
162  cgrib[ipos + 3] == '7')
+
163  {
+
164  ipos = ipos + 4;
+
165 
+
166  /* If end of GRIB message not where expected, issue
+
167  * error. */
+
168  if (ipos != istart + lengrib)
+
169  {
+
170  printf("g2_getfld: '7777' found, but not where expected.\n");
+
171  free(lgfld);
+
172  return G2_GETFLD_WRONG_END;
+
173  }
+
174  break;
+
175  }
+
176 
+
177  /* Get length of Section and Section number. */
+
178  iofst = ipos * 8;
+
179  gbit(cgrib, &lensec, iofst, 32); /* Get Length of Section */
+
180  iofst = iofst + 32;
+
181  gbit(cgrib, &isecnum, iofst, 8); /* Get Section number */
+
182  iofst = iofst + 8;
+
183 
+
184  /* Check to see if section number is valid. */
+
185  if (isecnum < 1 || isecnum > 7)
+
186  {
+
187  printf("g2_getfld: Unrecognized Section Encountered=%ld\n", isecnum);
+
188  free(lgfld);
+
189  return G2_GETFLD_INVAL_SEC;
+
190  }
+
191 
+
192  /* If found Section 1, decode elements in Identification Section. */
+
193  if (isecnum == 1)
+
194  {
+
195  iofst = iofst - 40; /* reset offset to beginning of section */
+
196  if (g2_unpack1(cgrib, &iofst, &lgfld->idsect, &lgfld->idsectlen))
+
197  {
+
198  g2_free(lgfld);
+
199  return G2_GETFLD_BAD_SEC1;
+
200  }
+
201  }
+
202 
+
203  /* If found Section 2, Grab local section. Save in case this
+
204  * is the latest one before the requested field. */
+
205  if (isecnum == 2)
+
206  {
+
207  iofst = iofst - 40; /* reset offset to beginning of section */
+
208  if (lgfld->local)
+
209  free(lgfld->local);
+
210  if (g2_unpack2(cgrib, &iofst, &lgfld->locallen, &lgfld->local))
+
211  {
+
212  g2_free(lgfld);
+
213  return G2_GETFLD_BAD_SEC2;
+
214  }
+
215  }
+
216 
+
217  /* If found Section 3, unpack the GDS info using the
+
218  * appropriate template. Save in case this is the latest grid
+
219  * before the requested field. */
+
220  if (isecnum == 3)
+
221  {
+
222  iofst = iofst - 40; /* reset offset to beginning of section */
+
223  if (lgfld->igdtmpl)
+
224  free(lgfld->igdtmpl);
+
225  if (lgfld->list_opt)
+
226  free(lgfld->list_opt);
+
227  if (g2_unpack3(cgrib, &iofst, &igds, &lgfld->igdtmpl,
+
228  &lgfld->igdtlen, &lgfld->list_opt, &lgfld->num_opt))
+
229  {
+
230  g2_free(lgfld);
+
231  return G2_GETFLD_BAD_SEC3;
+
232  }
+
233 
+
234  have3 = 1;
+
235  lgfld->griddef = igds[0];
+
236  lgfld->ngrdpts = igds[1];
+
237  lgfld->numoct_opt = igds[2];
+
238  lgfld->interp_opt = igds[3];
+
239  lgfld->igdtnum = igds[4];
+
240  free(igds);
+
241  }
+
242 
+
243  /* If found Section 4, check to see if this field is the one
+
244  * requested. */
+
245  if (isecnum == 4)
+
246  {
+
247  numfld = numfld + 1;
+
248  if (numfld == ifldnum)
+
249  {
+
250  lgfld->discipline = disc;
+
251  lgfld->version = ver;
+
252  lgfld->ifldnum = ifldnum;
+
253  lgfld->unpacked = unpack;
+
254  lgfld->expanded = 0;
+
255  iofst = iofst - 40; /* reset offset to beginning of section */
+
256  if (g2_unpack4(cgrib, &iofst, &lgfld->ipdtnum, &lgfld->ipdtmpl,
+
257  &lgfld->ipdtlen, &lgfld->coord_list, &lgfld->num_coord))
+
258  {
+
259  g2_free(lgfld);
+
260  return G2_GETFLD_BAD_SEC4;
+
261  }
+
262 
+
263  have4 = 1;
+
264  }
+
265  }
+
266 
+
267  /* If found Section 5, check to see if this field is the one
+
268  * requested. */
+
269  if (isecnum == 5 && numfld == ifldnum)
+
270  {
+
271  iofst = iofst - 40; /* reset offset to beginning of section */
+
272  if (g2_unpack5(cgrib, &iofst, &lgfld->ndpts, &lgfld->idrtnum,
+
273  &lgfld->idrtmpl, &lgfld->idrtlen))
+
274  {
+
275  g2_free(lgfld);
+
276  return G2_GETFLD_BAD_SEC5;
+
277  }
+
278 
+
279  have5 = 1;
+
280  }
+
281 
+
282  /* If found Section 6, Unpack bitmap. Save in case this is
+
283  * the latest bitmap before the requested field. */
+
284  if (isecnum == 6)
+
285  {
+
286  if (unpack)
+
287  { /* unpack bitmap */
+
288  iofst = iofst - 40; /* reset offset to beginning of section */
+
289  bmpsave = lgfld->bmap; /* save pointer to previous bitmap */
+
290  if (g2_unpack6(cgrib, &iofst, lgfld->ngrdpts, &lgfld->ibmap,
+
291  &lgfld->bmap))
+
292  {
+
293  g2_free(lgfld);
+
294  return G2_GETFLD_BAD_SEC6;
+
295  }
+
296 
+
297  have6 = 1;
+
298  if (lgfld->ibmap == 254) /* use previously specified bitmap */
+
299  {
+
300  if (bmpsave)
+
301  lgfld->bmap = bmpsave;
+
302  else
+
303  {
+
304  printf("g2_getfld: Prev bit-map specified, but none exist.\n");
+
305  return G2_GETFLD_NO_BITMAP;
+
306  }
+
307  }
+
308  else /* get rid of it */
+
309  if (bmpsave)
+
310  free(bmpsave);
+
311  }
+
312  else
+
313  { /* do not unpack bitmap */
+
314  gbit(cgrib, &lgfld->ibmap, iofst, 8); /* Get BitMap Indicator */
+
315  have6 = 1;
+
316  }
+
317  }
+
318 
+
319  /* If found Section 7, check to see if this field is the one
+
320  * requested. */
+
321  if (isecnum == 7 && numfld == ifldnum && unpack)
+
322  {
+
323  iofst = iofst - 40; /* reset offset to beginning of section */
+
324  if ((jerr = g2_unpack7(cgrib, &iofst, lgfld->igdtnum, lgfld->igdtmpl,
+
325  lgfld->idrtnum, lgfld->idrtmpl, lgfld->ndpts,
+
326  &lgfld->fld)))
+
327  {
+
328  printf("g2_getfld: return from g2_unpack7 = %d \n", (int)jerr);
+
329  g2_free(lgfld);
+
330  return G2_GETFLD_BAD_SEC7;
+
331  }
+
332 
+
333  have7 = 1;
+
334 
+
335  /* If bitmap is used with this field, expand data field */
+
336  /* to grid, if possible. */
+
337  if (lgfld->ibmap != 255 && lgfld->bmap != 0)
+
338  {
+
339  if (expand == 1)
+
340  {
+
341  n = 0;
+
342  newfld = calloc(lgfld->ngrdpts, sizeof(float));
+
343  for (j = 0; j < lgfld->ngrdpts; j++)
+
344  {
+
345  if (lgfld->bmap[j] == 1)
+
346  newfld[j] = lgfld->fld[n++];
+
347  }
+
348  free(lgfld->fld);
+
349  lgfld->fld = newfld;
+
350  lgfld->expanded = 1;
+
351  }
+
352  else
+
353  {
+
354  lgfld->expanded = 0;
+
355  }
+
356  }
+
357  else
+
358  {
+
359  lgfld->expanded = 1;
+
360  }
+
361  }
+
362 
+
363  /* Check to see if we read pass the end of the GRIB message
+
364  * and missed the terminator string '7777'. */
+
365  ipos = ipos + lensec; /* Update beginning of section pointer */
+
366  if (ipos > istart + lengrib)
+
367  {
+
368  printf("g2_getfld: '7777' not found at end of GRIB message.\n");
+
369  g2_free(lgfld);
+
370  return G2_GETFLD_BAD_END;
+
371  }
+
372 
+
373  /* If unpacking requested, return when all sections have been
+
374  * processed. */
+
375  if (unpack && have3 && have4 && have5 && have6 && have7)
+
376  return G2_NO_ERROR;
+
377 
+
378  /* If unpacking is not requested, return when sections 3
+
379  * through 6 have been processed. */
+
380  if (!unpack && have3 && have4 && have5 && have6)
+
381  return G2_NO_ERROR;
+
382  }
+
383 
+
384  /* If exited from above loop, the end of the GRIB message was
+
385  * reached before the requested field was found. */
+
386  printf("g2_getfld: GRIB message contained %ld different fields.\n", numfld);
+
387  printf("g2_getfld: The request was for field %ld.\n", ifldnum);
+
388  g2_free(lgfld);
+
389  return G2_GETFLD_WRONG_NFLDS;
+
390 }
+
+
+
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.
Definition: g2_unpack5.c:42
+
g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
Definition: grib2.h:152
+
#define G2_GETFLD_NO_BITMAP
In g2_getfld() previous bitmap specified, yet none exists.
Definition: grib2.h:298
+
#define G2_GETFLD_BAD_SEC7
Error in g2_getfld() unpacking section 7.
Definition: grib2.h:297
+
g2int ngrdpts
Number of grid points in the defined grid.
Definition: grib2.h:119
+
#define G2_GETFLD_BAD_SEC6
Error in g2_getfld() unpacking section 6.
Definition: grib2.h:296
+
g2int unpacked
Logical value indicating whether the bitmap and data values were unpacked.
Definition: grib2.h:190
+
g2int ifldnum
Field number within GRIB message.
Definition: grib2.h:109
+
#define G2_GETFLD_BAD_SEC3
Error in g2_getfld() unpacking section 3.
Definition: grib2.h:293
+
g2int idrtlen
Number of elements in idrtmpl.
Definition: grib2.h:182
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
g2int ibmap
Bitmap indicator (see Table 6.0).
Definition: grib2.h:207
+
g2int griddef
Source of grid definition (see Table 3.0).
Definition: grib2.h:116
+
g2int numoct_opt
Number of octets needed for each additional grid points definition.
Definition: grib2.h:124
+
g2int * idsect
Contains the entries in the Identification Section (Section 1).
Definition: grib2.h:96
+
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.
Definition: g2_unpack4.c:46
+
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.
Definition: grib2.h:287
+
#define G2_GETFLD_WRONG_END
g2_info() found "7777" not where expected.
Definition: grib2.h:286
+
g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
Definition: grib2.h:186
+
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.
Definition: g2_unpack2.c:38
+
#define G2_GETFLD_BAD_SEC4
Error in g2_getfld() unpacking section 4.
Definition: grib2.h:294
+
g2int interp_opt
Interpretation of list for optional points definition.
Definition: grib2.h:129
+
g2int ipdtlen
Number of elements in ipdtmpl - i.e.
Definition: grib2.h:160
+
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...
Definition: gbits.c:20
+
void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
Definition: g2_free.c:24
+
#define G2_GETFLD_BAD_SEC5
Error in g2_getfld() unpacking section 5.
Definition: grib2.h:295
+
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.
Definition: g2_unpack1.c:55
+
g2int discipline
Message Discipline (see Table 0.0).
Definition: grib2.h:48
+
g2int num_opt
(Used if numoct_opt .ne.
Definition: grib2.h:135
+
#define G2_GETFLD_BAD_END
g2_getfld() didn't find "7777" at end of message.
Definition: grib2.h:288
+
float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
Definition: grib2.h:172
+
g2int ipdtnum
Product Definition Template Number (see Table 4.0).
Definition: grib2.h:156
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_GETFLD_GRIB_VERSION
Wrong GRIB version for g2_getfld(), must be 2.
Definition: grib2.h:284
+
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.
Definition: g2_unpack3.c:57
+
float * fld
Array of ndpts unpacked data points.
Definition: grib2.h:214
+
unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
Definition: grib2.h:103
+
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.
Definition: g2_unpack6.c:33
+
g2int idrtnum
Data Representation Template Number (see Table 5.0).
Definition: grib2.h:179
+
#define G2_GETFLD_INVAL
g2_getfld() data field request number was not positive.
Definition: grib2.h:285
+
g2int num_coord
Number of values in array coord_list.
Definition: grib2.h:167
+
g2int expanded
Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
Definition: grib2.h:199
+
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.
Definition: g2_unpack7.c:55
+
Struct for GRIB field.
Definition: grib2.h:41
+
g2int version
GRIB edition number (2).
Definition: grib2.h:44
+
g2int locallen
Length of array local.
Definition: grib2.h:106
+
#define G2_GETFLD_INVAL_SEC
g2_getfld() encountered unrecognized section.
Definition: grib2.h:289
+
g2int ndpts
Number of data points unpacked and returned.
Definition: grib2.h:175
+
g2int igdtlen
Number of elements in igdtmpl - i.e.
Definition: grib2.h:148
+
g2int * list_opt
(Used if numoct_opt .ne.
Definition: grib2.h:140
+
g2int igdtnum
Grid Definition Template Number (See Table 3.1).
Definition: grib2.h:144
+
#define G2_GETFLD_BAD_SEC1
Error in g2_getfld() unpacking section 1.
Definition: grib2.h:291
+
#define G2_GETFLD_BAD_SEC2
Error in g2_getfld() unpacking section 2.
Definition: grib2.h:292
+
g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
Definition: grib2.h:211
+
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),...
Definition: g2_getfld.c:91
+
#define G2_GETFLD_NO_GRIB
g2_getfld() can't find beginning characters "GRIB".
Definition: grib2.h:283
+
g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
Definition: grib2.h:164
+
g2int idsectlen
Number of elements in idsect.
Definition: grib2.h:99
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_gribend.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

g2int g2_gribend (unsigned char *cgrib)
 This routine finalizes a GRIB2 message after all grids and fields have been added. More...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ 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
+ + +
cgribChar array containing all the data sections added be previous calls to g2_create(), g2_addlocal(), g2_addgrid(), and g2_addfield(). After function is called, contains the finalized GRIB2 message.
+
+
+
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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_gribend.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include "grib2_int.h"
+
8 
+
37 g2int g2_gribend(unsigned char *cgrib)
+
38 {
+
39  g2int iofst, lencurr, len, ilen, isecnum;
+
40  g2int lengrib;
+
41  unsigned char seven = 0x37; /* '7' */
+
42  int ret;
+
43 
+
44  /* Check for GRIB header and terminator. Translate the error codes
+
45  * to the legacy G2 error codes. */
+
46  if ((ret = g2c_check_msg(cgrib, &lencurr, 1)))
+
47  {
+
48  if (ret == G2C_NOT_GRIB)
+
49  return G2_ADD_MSG_INIT;
+
50  if (ret == G2C_MSG_COMPLETE)
+
51  return G2_ADD_MSG_COMPLETE;
+
52  }
+
53 
+
54  /* Loop through all current sections of the GRIB message to find
+
55  * the last section number. */
+
56  len = 16; /* Length of Section 0. */
+
57  for (;;)
+
58  {
+
59  /* Get number and length of next section. */
+
60  iofst = len * 8;
+
61  gbit(cgrib, &ilen, iofst, 32);
+
62  iofst = iofst + 32;
+
63  gbit(cgrib, &isecnum, iofst, 8);
+
64  len = len + ilen;
+
65 
+
66  /* Exit loop if last section reached. */
+
67  if (len == lencurr)
+
68  break;
+
69 
+
70  /* If byte count for each section doesn't match current
+
71  * total length, then there is a problem. */
+
72  if (len > lencurr)
+
73  {
+
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);
+
77  return G2_BAD_SEC_COUNTS;
+
78  }
+
79  }
+
80 
+
81  /* Can only add End Section (Section 8) after Section 7. */
+
82  if (isecnum != 7 )
+
83  {
+
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);
+
86  return G2_BAD_SEC;
+
87  }
+
88 
+
89  /* Add Section 8 - End Section */
+
90  cgrib[lencurr] = seven;
+
91  cgrib[lencurr + 1] = seven;
+
92  cgrib[lencurr + 2] = seven;
+
93  cgrib[lencurr + 3] = seven;
+
94 
+
95  /* Update current byte total of message in Section 0. */
+
96  lengrib = lencurr + 4;
+
97  sbit(cgrib, &lengrib, 96, 32);
+
98 
+
99  /* Return the length of the message. */
+
100  return lengrib;
+
101 }
+
+
+
g2int g2_gribend(unsigned char *cgrib)
This routine finalizes a GRIB2 message after all grids and fields have been added.
Definition: g2_gribend.c:37
+
#define G2_BAD_SEC
Previous Section was unexpected.
Definition: grib2.h:300
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_BAD_SEC_COUNTS
Sum of Section byte counts doesn't add to total byte count.
Definition: grib2.h:312
+
#define G2_ADD_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:311
+
#define G2C_MSG_COMPLETE
GRIB message already complete.
Definition: grib2.h:330
+
#define G2_ADD_MSG_INIT
GRIB message was not initialized - call g2_create() first.
Definition: grib2.h:310
+
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 ...
Definition: gbits.c:38
+
#define G2C_NOT_GRIB
GRIB header not found.
Definition: grib2.h:329
+
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...
Definition: util.c:26
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_info.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_info()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_info (unsigned char * cgrib,
g2intlistsec0,
g2intlistsec1,
g2intnumfields,
g2intnumlocal 
)
+
+ +

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
+ + + + + + +
cgribCharacter pointer to the GRIB2 message.
listsec0pointer 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.
  • +
+
listsec1Pointer 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).
  • +
+
numfieldsThe number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
numlocalThe 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_info.c
+
+
+Go to the documentation of this file.
1 
+
10 #include <stdio.h>
+
11 #include <stdlib.h>
+
12 #include "grib2_int.h"
+
13 
+
66 g2int
+
67 g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1,
+
68  g2int *numfields, g2int *numlocal)
+
69 {
+
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;
+
74 
+
75  *numlocal = 0;
+
76  *numfields = 0;
+
77 
+
78  /* Check for beginning of GRIB message in the first 100 bytes. */
+
79  istart = -1;
+
80  for (j = 0; j < 100; j++)
+
81  {
+
82  if (cgrib[j] == 'G' && cgrib[j + 1] == 'R' && cgrib[j + 2] == 'I' &&
+
83  cgrib[j + 3] == 'B')
+
84  {
+
85  istart = j;
+
86  break;
+
87  }
+
88  }
+
89  if (istart == -1)
+
90  {
+
91  printf("g2_info: Beginning characters GRIB not found.");
+
92  return G2_INFO_NO_GRIB;
+
93  }
+
94 
+
95  /* Unpack Section 0 - Indicator Section. */
+
96  iofst = 8 * (istart + 6);
+
97  gbit(cgrib, listsec0, iofst, 8); /* Discipline */
+
98  iofst = iofst + 8;
+
99  gbit(cgrib, listsec0 + 1, iofst, 8); /* GRIB edition number */
+
100  iofst = iofst + 8;
+
101  iofst = iofst + 32;
+
102  gbit(cgrib, &lengrib, iofst, 32); /* Length of GRIB message */
+
103  iofst = iofst + 32;
+
104  listsec0[2] = lengrib;
+
105  lensec0 = 16;
+
106  ipos = istart + lensec0;
+
107 
+
108  /* Currently handles only GRIB Edition 2. */
+
109  if (listsec0[1] != 2)
+
110  {
+
111  printf("g2_info: can only decode GRIB edition 2.");
+
112  return G2_INFO_GRIB_VERSION;
+
113  }
+
114 
+
115  /* Unpack Section 1 - Identification Section */
+
116  gbit(cgrib, &lensec1, iofst, 32); /* Length of Section 1 */
+
117  iofst = iofst + 32;
+
118  gbit(cgrib, &isecnum, iofst, 8); /* Section number (1) */
+
119  iofst = iofst + 8;
+
120  if (isecnum != 1)
+
121  {
+
122  printf("g2_info: Could not find section 1.");
+
123  return G2_INFO_NO_SEC1;
+
124  }
+
125 
+
126  /* Unpack each input value in array listsec1 into the
+
127  appropriate number of octets, which are specified in
+
128  corresponding entries in array mapsec1. */
+
129  for (i = 0; i < mapsec1len; i++)
+
130  {
+
131  nbits = mapsec1[i] * 8;
+
132  gbit(cgrib, listsec1 + i, iofst, nbits);
+
133  iofst = iofst + nbits;
+
134  }
+
135  ipos = ipos + lensec1;
+
136 
+
137  /* Loop through the remaining sections to see if they are
+
138  * valid. Also count the number of times Section 2 and Section
+
139  * 4 appear. */
+
140  for (;;)
+
141  {
+
142  if (cgrib[ipos] == '7' && cgrib[ipos + 1] == '7' && cgrib[ipos + 2] == '7' &&
+
143  cgrib[ipos + 3] == '7')
+
144  {
+
145  ipos = ipos + 4;
+
146  if (ipos != (istart + lengrib))
+
147  {
+
148  printf("g2_info: '7777' found, but not where expected.\n");
+
149  return G2_INFO_WRONG_END;
+
150  }
+
151  break;
+
152  }
+
153 
+
154  iofst = ipos * 8;
+
155  gbit(cgrib, &lensec, iofst, 32); /* Get Length of Section */
+
156  iofst = iofst + 32;
+
157  gbit(cgrib, &isecnum, iofst, 8); /* Get Section number */
+
158  iofst = iofst + 8;
+
159  ipos = ipos + lensec; /* Update beginning of section pointer */
+
160  if (ipos > (istart + lengrib))
+
161  {
+
162  printf("g2_info: '7777' not found at end of GRIB message.\n");
+
163  return G2_INFO_BAD_END;
+
164  }
+
165  if (isecnum >= 2 && isecnum <= 7)
+
166  {
+
167  /* Increment counter for total number of local sections
+
168  * or fields found. */
+
169  if (isecnum == 2)
+
170  (*numlocal)++;
+
171  else if (isecnum == 4)
+
172  (*numfields)++;
+
173  }
+
174  else
+
175  {
+
176  printf("g2_info: Invalid section number found in GRIB message: %ld\n", isecnum);
+
177  return G2_INFO_INVAL_SEC;
+
178  }
+
179  }
+
180 
+
181  return 0;
+
182 }
+
+
+
#define G2_INFO_NO_GRIB
g2_info() can't find beginning characters "GRIB".
Definition: grib2.h:277
+
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...
Definition: g2_info.c:67
+
#define G2_INFO_WRONG_END
g2_info() found "7777" not where expected.
Definition: grib2.h:280
+
#define G2_INFO_NO_SEC1
g2_info() can't find section 1.
Definition: grib2.h:279
+
#define G2_INFO_GRIB_VERSION
Wrong GRIB version for g2_info(), must be 2.
Definition: grib2.h:278
+
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...
Definition: gbits.c:20
+
#define G2_INFO_BAD_END
g2_info() didn't find "7777" at end of message.
Definition: grib2.h:281
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_INFO_INVAL_SEC
g2_info() found invalid section number.
Definition: grib2.h:282
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_miss.c File Reference
+
+
+ +

Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field. +More...

+
#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_miss()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void g2_miss (gribfieldgfld,
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
+ + + + +
gfldpointer to gribfield structure.
rmissList of the missing values used.
nmissNUmber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_miss.c
+
+
+Go to the documentation of this file.
1 
+
8 #include "grib2_int.h"
+
9 
+
23 void
+
24 g2_miss(gribfield *gfld, float *rmiss, int *nmiss)
+
25 {
+
26  g2int itype;
+
27 
+
28  /* Missing value management currnetly only used in DRT's 5.2 and
+
29  * 5.3. */
+
30  if (gfld->idrtnum != 2 && gfld->idrtnum != 3)
+
31  {
+
32  *nmiss = 0;
+
33  return;
+
34  }
+
35 
+
36  itype = gfld->idrtmpl[4];
+
37  if (gfld->idrtmpl[6] == 1)
+
38  {
+
39  *nmiss = 1;
+
40  if (itype == 0)
+
41  rdieee(gfld->idrtmpl + 7, rmiss+0, 1);
+
42  else
+
43  rmiss[0] = (float)gfld->idrtmpl[7];
+
44  }
+
45  else if (gfld->idrtmpl[6] == 2)
+
46  {
+
47  *nmiss = 2;
+
48  if (itype == 0)
+
49  {
+
50  rdieee(gfld->idrtmpl + 7, rmiss, 1);
+
51  rdieee(gfld->idrtmpl + 8, rmiss + 1, 1);
+
52  }
+
53  else
+
54  {
+
55  rmiss[0] = (float)gfld->idrtmpl[7];
+
56  rmiss[1] = (float)gfld->idrtmpl[8];
+
57  }
+
58  }
+
59  else
+
60  {
+
61  *nmiss = 0;
+
62  }
+
63 }
+
+
+
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
Definition: grib2.h:186
+
void g2_miss(gribfield *gfld, float *rmiss, int *nmiss)
This routine checks the Data Representation Template to see if missing value management is used,...
Definition: g2_miss.c:24
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
g2int idrtnum
Data Representation Template Number (see Table 5.0).
Definition: grib2.h:179
+
Struct for GRIB field.
Definition: grib2.h:41
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack1.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.

+
Author
Stephen Gilbert
+
Date
2002-10-29
+ +

Definition in file g2_unpack1.c.

+

Function Documentation

+ +

◆ g2_unpack1()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack1 (unsigned char * cgrib,
g2intiofst,
g2int ** ids,
g2intidslen 
)
+
+ +

This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

+
Parameters
+ + + + + +
cgribchar array containing Section 1 of the GRIB2 message.
iofstBit offset for the beginning of Section 1 in cgrib.
idsPointer 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).
  • +
+
idslenNumber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack1.c
+
+
+Go to the documentation of this file.
1 
+
9 #include <stdio.h>
+
10 #include <stdlib.h>
+
11 #include "grib2_int.h"
+
12 
+
54 g2int
+
55 g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
+
56 {
+
57 
+
58  g2int i, lensec, nbits, isecnum;
+
59  /* The map holds the number of bytes used by each value in section
+
60  * 1. */
+
61  g2int mapid[13] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
+
62 
+
63  *idslen = 13;
+
64 
+
65  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
+
66  *iofst = *iofst + 32;
+
67  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
68  *iofst = *iofst + 8;
+
69 
+
70  if (isecnum != 1)
+
71  {
+
72  *idslen = 13;
+
73  fprintf(stderr, "g2_unpack1: Not Section 1 data.\n");
+
74  return G2_UNPACK_BAD_SEC;
+
75  }
+
76 
+
77  /* Unpack each value into array ids from the appropriate number of
+
78  * octets, which are specified in` corresponding entries in array
+
79  * mapid. */
+
80  if (!(*ids = calloc(*idslen, sizeof(g2int))))
+
81  return G2_UNPACK_NO_MEM;
+
82 
+
83  for (i = 0; i < *idslen; i++)
+
84  {
+
85  nbits = mapid[i] * 8;
+
86  gbit(cgrib, *ids + i, *iofst, nbits);
+
87  *iofst = *iofst + nbits;
+
88  }
+
89 
+
90  return G2_NO_ERROR;
+
91 }
+
+
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
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...
Definition: gbits.c:20
+
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.
Definition: g2_unpack1.c:55
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack2.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_unpack2()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack2 (unsigned char * cgrib,
g2intiofst,
g2intlencsec2,
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
+ + + + + +
cgribchar array containing Section 2 of the GRIB2 message.
iofstPointer that contains the bit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
lencsec2Length (in octets) of Local Use data.
csec2Pointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack2.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
37 g2int
+
38 g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2,
+
39  unsigned char **csec2)
+
40 {
+
41  g2int isecnum;
+
42  g2int lensec, ipos, j;
+
43 
+
44  *lencsec2 = 0;
+
45  *csec2 = NULL;
+
46 
+
47  /* Get Length of Section. */
+
48  gbit(cgrib, &lensec, *iofst, 32);
+
49  *iofst = *iofst + 32;
+
50  *lencsec2 = lensec - 5;
+
51 
+
52  /* Get Section Number. */
+
53  gbit(cgrib, &isecnum, *iofst, 8);
+
54  *iofst = *iofst + 8;
+
55  ipos = *iofst / 8;
+
56 
+
57  if (isecnum != 2)
+
58  {
+
59  *lencsec2 = 0;
+
60  fprintf(stderr, "g2_unpack2: Not Section 2 data.\n");
+
61  return G2_UNPACK_BAD_SEC;
+
62  }
+
63 
+
64  /* If the length is 0, we are done. */
+
65  if (*lencsec2 == 0)
+
66  return G2_NO_ERROR;
+
67 
+
68  if (!(*csec2 = malloc(*lencsec2)))
+
69  {
+
70  *lencsec2 = 0;
+
71  return G2_UNPACK_NO_MEM;
+
72  }
+
73 
+
74  for (j = 0; j < *lencsec2; j++)
+
75  (*csec2)[j] = cgrib[ipos + j];
+
76 
+
77  *iofst = *iofst + (*lencsec2 * 8);
+
78 
+
79  return G2_NO_ERROR;
+
80 }
+
+
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
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.
Definition: g2_unpack2.c:38
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack3.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_unpack3()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack3 (unsigned char * cgrib,
g2intiofst,
g2int ** igds,
g2int ** igdstmpl,
g2intmapgridlen,
g2int ** ideflist,
g2intidefnum 
)
+
+ +

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
+ + + + + + + + +
cgribChar array ontaining Section 3 of the GRIB2 message.
iofstBit offset for the beginning of Section 3 in cgrib.
igdsContains 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).
  • +
+
igdstmplPointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
mapgridlenNumber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack3.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 
+
56 g2int
+
57 g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl,
+
58  g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
+
59 {
+
60  g2int i, j, nbits, isecnum;
+
61  g2int lensec, ibyttem = 0, isign, newlen;
+
62  g2int *ligds, *ligdstmpl = NULL, *lideflist = NULL;
+
63  gtemplate *mapgrid;
+
64 
+
65  *igds = NULL;
+
66  *igdstmpl = NULL;
+
67  *ideflist = NULL;
+
68 
+
69  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
+
70  *iofst = *iofst + 32;
+
71  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
72  *iofst = *iofst + 8;
+
73 
+
74  if (isecnum != 3)
+
75  {
+
76  *idefnum = 0;
+
77  *mapgridlen = 0;
+
78  return G2_UNPACK_BAD_SEC;
+
79  }
+
80 
+
81  ligds = calloc(5, sizeof(g2int));
+
82  *igds = ligds;
+
83 
+
84  gbit(cgrib, &ligds[0], *iofst, 8); /* Get source of Grid def. */
+
85  *iofst = *iofst + 8;
+
86  gbit(cgrib, &ligds[1], *iofst, 32); /* Get number of grid pts. */
+
87  *iofst = *iofst + 32;
+
88  gbit(cgrib, &ligds[2], *iofst, 8); /* Get num octets for opt. list */
+
89  *iofst = *iofst + 8;
+
90  gbit(cgrib, &ligds[3], *iofst, 8); /* Get interpret. for opt. list */
+
91  *iofst = *iofst + 8;
+
92  gbit(cgrib, &ligds[4], *iofst, 16); /* Get Grid Def Template num. */
+
93  *iofst = *iofst + 16;
+
94 
+
95  if (ligds[4] != 65535)
+
96  {
+
97  /* Get Grid Definition Template */
+
98  if (!(mapgrid = getgridtemplate(ligds[4])))
+
99  { /* undefined template */
+
100  free(ligds);
+
101  return G2_UNPACK3_BAD_GDT;
+
102  }
+
103  *mapgridlen = mapgrid->maplen;
+
104 
+
105  /* Unpack each value into array igdstmpl from the the
+
106  * appropriate number of octets, which are specified in
+
107  * corresponding entries in array mapgrid. */
+
108  if (*mapgridlen > 0)
+
109  {
+
110  if (!(ligdstmpl = calloc(*mapgridlen, sizeof(g2int))))
+
111  {
+
112  *mapgridlen = 0;
+
113  *igdstmpl = NULL;
+
114  if (mapgrid)
+
115  free(mapgrid);
+
116  return G2_UNPACK_NO_MEM;
+
117  }
+
118  *igdstmpl = ligdstmpl;
+
119  }
+
120  ibyttem = 0;
+
121  for (i = 0; i < *mapgridlen; i++)
+
122  {
+
123  nbits = abs(mapgrid->map[i]) * 8;
+
124  if (mapgrid->map[i] >= 0)
+
125  {
+
126  gbit(cgrib, ligdstmpl + i, *iofst, nbits);
+
127  }
+
128  else
+
129  {
+
130  gbit(cgrib, &isign, *iofst, 1);
+
131  gbit(cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
+
132  if (isign == 1)
+
133  ligdstmpl[i] = -1 * ligdstmpl[i];
+
134  }
+
135  *iofst = *iofst + nbits;
+
136  ibyttem = ibyttem + abs(mapgrid->map[i]);
+
137  }
+
138 
+
139  /* Check to see if the Grid Definition Template needs to be
+
140  * extended. The number of values in a specific template may
+
141  * vary depending on data specified in the "static" part of
+
142  * the gtemplate. */
+
143  if (mapgrid->needext == 1)
+
144  {
+
145  free(mapgrid);
+
146  mapgrid = extgridtemplate(ligds[4], ligdstmpl);
+
147  /* Unpack the rest of the Grid Definition Template */
+
148  newlen = mapgrid->maplen + mapgrid->extlen;
+
149  ligdstmpl = realloc(ligdstmpl, newlen * sizeof(g2int));
+
150  *igdstmpl = ligdstmpl;
+
151  j = 0;
+
152  for (i = *mapgridlen; i < newlen; i++)
+
153  {
+
154  nbits = abs(mapgrid->ext[j]) * 8;
+
155  if (mapgrid->ext[j] >= 0)
+
156  {
+
157  gbit(cgrib, ligdstmpl + i, *iofst, nbits);
+
158  }
+
159  else
+
160  {
+
161  gbit(cgrib, &isign, *iofst, 1);
+
162  gbit(cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
+
163  if (isign == 1)
+
164  ligdstmpl[i] = -1 * ligdstmpl[i];
+
165  }
+
166  *iofst = *iofst + nbits;
+
167  ibyttem = ibyttem + abs(mapgrid->ext[j]);
+
168  j++;
+
169  }
+
170  *mapgridlen = newlen;
+
171  }
+
172  if (mapgrid->ext)
+
173  free(mapgrid->ext);
+
174  if (mapgrid)
+
175  free(mapgrid);
+
176  }
+
177  else
+
178  { /* No Grid Definition Template */
+
179  *mapgridlen = 0;
+
180  *igdstmpl = 0;
+
181  }
+
182 
+
183  /* Unpack optional list of numbers defining number of points in
+
184  * each row or column, if included. This is used for non
+
185  * regular grids. */
+
186  if (ligds[2] != 0)
+
187  {
+
188  nbits = ligds[2] * 8;
+
189  *idefnum = (lensec - 14 - ibyttem) / ligds[2];
+
190  if (*idefnum > 0)
+
191  lideflist = calloc(*idefnum, sizeof(g2int));
+
192  if (!lideflist)
+
193  {
+
194  *idefnum = 0;
+
195  *ideflist = NULL;
+
196  return G2_UNPACK_NO_MEM;
+
197  }
+
198  *ideflist = lideflist;
+
199  gbits(cgrib, lideflist, *iofst, nbits, 0, *idefnum);
+
200  *iofst = *iofst + (nbits * *idefnum);
+
201  }
+
202  else
+
203  {
+
204  *idefnum = 0;
+
205  *ideflist = NULL;
+
206  }
+
207 
+
208  return G2_NO_ERROR; /* End of Section 3 processing */
+
209 }
+
+
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
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.
Definition: grib2_int.h:39
+
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.
Definition: grib2_int.h:43
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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.
Definition: g2_unpack3.c:57
+
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...
Definition: gbits.c:57
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+
#define G2_UNPACK3_BAD_GDT
In g2_unpack3(), undefined Grid Definition Template.
Definition: grib2.h:303
+
Struct for GRIB template.
Definition: grib2_int.h:28
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack4.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_unpack4()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack4 (unsigned char * cgrib,
g2intiofst,
g2intipdsnum,
g2int ** ipdstmpl,
g2intmappdslen,
float ** coordlist,
g2intnumcoord 
)
+
+ +

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
+ + + + + + + + +
cgribArray containing Section 4 of the GRIB2 message.
iofstBit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
ipdsnumProduct Definition Template Number (see Table 4.0).
ipdstmplPointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
mappdslenNumber of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
coordlistPointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
numcoordnumber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack4.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
45 g2int
+
46 g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl,
+
47  g2int *mappdslen, float **coordlist, g2int *numcoord)
+
48 {
+
49 
+
50  g2int needext, i, j, nbits, isecnum;
+
51  g2int lensec, isign, newlen;
+
52  g2int *coordieee;
+
53  g2int *lipdstmpl = 0;
+
54  float *lcoordlist;
+
55  gtemplate *mappds;
+
56 
+
57  *ipdstmpl = NULL;
+
58  *coordlist = NULL;
+
59 
+
60  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
+
61  *iofst = *iofst + 32;
+
62  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
63  *iofst = *iofst + 8;
+
64 
+
65  if (isecnum != 4)
+
66  {
+
67  *numcoord = 0;
+
68  *mappdslen = 0;
+
69  return G2_UNPACK_BAD_SEC;
+
70  }
+
71 
+
72  gbit(cgrib, numcoord, *iofst, 16); /* Get num of coordinate values */
+
73  *iofst = *iofst + 16;
+
74  gbit(cgrib, ipdsnum, *iofst, 16); /* Get Prod. Def Template num. */
+
75  *iofst = *iofst + 16;
+
76 
+
77  /* Get Product Definition Template */
+
78  if (!(mappds = getpdstemplate(*ipdsnum)))
+
79  {
+
80  *mappdslen = 0;
+
81  return G2_UNPACK4_BAD_PDT;
+
82  }
+
83  *mappdslen = mappds->maplen;
+
84  needext = mappds->needext;
+
85 
+
86  /* Unpack each value into array ipdstmpl from the the
+
87  * appropriate number of octets, which are specified in
+
88  * corresponding entries in array mappds. */
+
89  if (*mappdslen > 0)
+
90  lipdstmpl = calloc(*mappdslen, sizeof(g2int));
+
91  if (!lipdstmpl)
+
92  {
+
93  *mappdslen = 0;
+
94  *ipdstmpl = NULL;
+
95  if (mappds)
+
96  free(mappds);
+
97  return G2_UNPACK_NO_MEM;
+
98  }
+
99  *ipdstmpl = lipdstmpl;
+
100 
+
101  for (i = 0; i < mappds->maplen; i++)
+
102  {
+
103  nbits = abs(mappds->map[i]) * 8;
+
104  if (mappds->map[i] >= 0)
+
105  {
+
106  gbit(cgrib, lipdstmpl + i, *iofst, nbits);
+
107  }
+
108  else
+
109  {
+
110  gbit(cgrib, &isign, *iofst, 1);
+
111  gbit(cgrib, lipdstmpl + i, *iofst + 1, nbits - 1);
+
112  if (isign == 1) lipdstmpl[i] = -1 * lipdstmpl[i];
+
113  }
+
114  *iofst = *iofst + nbits;
+
115  }
+
116 
+
117  /* Check to see if the Product Definition Template needs to be
+
118  * extended. The number of values in a specific template may
+
119  * vary depending on data specified in the "static" part of the
+
120  * gtemplate. */
+
121  if (needext == 1)
+
122  {
+
123  free(mappds);
+
124  mappds = extpdstemplate(*ipdsnum, lipdstmpl);
+
125  newlen = mappds->maplen+mappds->extlen;
+
126  lipdstmpl = realloc(lipdstmpl, newlen * sizeof(g2int));
+
127  *ipdstmpl = lipdstmpl;
+
128  /* Unpack the rest of the Product Definition Template */
+
129  j = 0;
+
130  for (i = *mappdslen; i < newlen; i++)
+
131  {
+
132  nbits = abs(mappds->ext[j]) * 8;
+
133  if (mappds->ext[j] >= 0)
+
134  {
+
135  gbit(cgrib, lipdstmpl + i, *iofst, nbits);
+
136  }
+
137  else
+
138  {
+
139  gbit(cgrib, &isign, *iofst, 1);
+
140  gbit(cgrib, lipdstmpl + i, *iofst+1, nbits-1);
+
141  if (isign == 1)
+
142  lipdstmpl[i] = -1 * lipdstmpl[i];
+
143  }
+
144  *iofst = *iofst + nbits;
+
145  j++;
+
146  }
+
147  *mappdslen = newlen;
+
148  }
+
149  if (mappds->ext)
+
150  free(mappds->ext);
+
151  if (mappds)
+
152  free(mappds);
+
153 
+
154  /* Get Optional list of vertical coordinate values after the
+
155  * Product Definition Template, if necessary. */
+
156  *coordlist = NULL;
+
157  if (*numcoord != 0)
+
158  {
+
159  coordieee = calloc(*numcoord, sizeof(g2int));
+
160  lcoordlist = calloc(*numcoord, sizeof(float));
+
161  if (coordieee == 0 || lcoordlist == 0)
+
162  {
+
163  *numcoord = 0;
+
164  *coordlist = NULL;
+
165  if (coordieee)
+
166  free(coordieee);
+
167  if (lcoordlist)
+
168  free(lcoordlist);
+
169  return G2_UNPACK_NO_MEM;
+
170  }
+
171  else
+
172  {
+
173  *coordlist = lcoordlist;
+
174  }
+
175  gbits(cgrib, coordieee, *iofst, 32, 0, *numcoord);
+
176  rdieee(coordieee, *coordlist, *numcoord);
+
177  free(coordieee);
+
178  *iofst = *iofst + (32 * (*numcoord));
+
179  }
+
180 
+
181  return G2_NO_ERROR;
+
182 }
+
+
+
gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
Definition: pdstemplates.c:329
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
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.
Definition: g2_unpack4.c:46
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
g2int maplen
Number of entries in the static part of the template.
Definition: grib2_int.h:39
+
g2int * map
Number of octets of each entry in the static part of the template.
Definition: grib2_int.h:43
+
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...
Definition: gbits.c:20
+
gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
Definition: pdstemplates.c:281
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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...
Definition: gbits.c:57
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+
Struct for GRIB template.
Definition: grib2_int.h:28
+
#define G2_UNPACK4_BAD_PDT
In g2_unpack4(), undefined Product Definition Template.
Definition: grib2.h:304
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack5.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_unpack5()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack5 (unsigned char * cgrib,
g2intiofst,
g2intndpts,
g2intidrsnum,
g2int ** idrstmpl,
g2intmapdrslen 
)
+
+ +

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
+ + + + + + + +
cgribchar array containing Section 5 of the GRIB2 message.
iofstBit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
ndptsNumber of data points unpacked and returned.
idrsnumData Representation Template Number (see Code Table 5.0).
idrstmplPointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack5.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
41 g2int
+
42 g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum,
+
43  g2int **idrstmpl, g2int *mapdrslen)
+
44 {
+
45  g2int needext, i, j, nbits, isecnum;
+
46  g2int lensec, isign, newlen;
+
47  g2int *lidrstmpl = 0;
+
48  gtemplate *mapdrs;
+
49 
+
50  *idrstmpl = 0; /* NULL*/
+
51 
+
52  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
+
53  *iofst = *iofst + 32;
+
54  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
55  *iofst = *iofst + 8;
+
56 
+
57  if (isecnum != 5)
+
58  {
+
59  *ndpts = 0;
+
60  *mapdrslen = 0;
+
61  return G2_UNPACK_BAD_SEC;
+
62  }
+
63 
+
64  gbit(cgrib, ndpts, *iofst, 32); /* Get num of data points */
+
65  *iofst = *iofst + 32;
+
66  gbit(cgrib, idrsnum, *iofst, 16); /* Get Data Rep Template Num. */
+
67  *iofst = *iofst + 16;
+
68 
+
69  /* Gen Data Representation Template */
+
70  if (!(mapdrs = getdrstemplate(*idrsnum)))
+
71  {
+
72  *mapdrslen = 0;
+
73  return G2_UNPACK5_BAD_DRT;
+
74  }
+
75  *mapdrslen = mapdrs->maplen;
+
76  needext = mapdrs->needext;
+
77 
+
78  /* Unpack each value into array ipdstmpl from the appropriate
+
79  * number of octets, which are specified in corresponding
+
80  * entries in array mapdrs. */
+
81  if (*mapdrslen > 0)
+
82  lidrstmpl = calloc(*mapdrslen, sizeof(g2int));
+
83  if (!lidrstmpl)
+
84  {
+
85  *mapdrslen = 0;
+
86  *idrstmpl = NULL;
+
87  if (mapdrs)
+
88  free(mapdrs);
+
89  return G2_UNPACK_NO_MEM;
+
90  }
+
91  else
+
92  {
+
93  *idrstmpl = lidrstmpl;
+
94  }
+
95  for (i = 0; i < mapdrs->maplen; i++)
+
96  {
+
97  nbits = abs(mapdrs->map[i]) * 8;
+
98  if (mapdrs->map[i] >= 0)
+
99  {
+
100  gbit(cgrib, lidrstmpl + i, *iofst, nbits);
+
101  }
+
102  else
+
103  {
+
104  gbit(cgrib, &isign, *iofst, 1);
+
105  gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
+
106  if (isign == 1)
+
107  lidrstmpl[i] = -1 * lidrstmpl[i];
+
108  }
+
109  *iofst = *iofst + nbits;
+
110  }
+
111 
+
112  /* Check to see if the Data Representation Template needs to be
+
113  * extended. The number of values in a specific gtemplate may
+
114  * vary depending on data specified in the "static" part of the
+
115  * gtemplate. */
+
116  if (needext == 1)
+
117  {
+
118  free(mapdrs);
+
119  mapdrs = extdrstemplate(*idrsnum, lidrstmpl);
+
120  newlen = mapdrs->maplen + mapdrs->extlen;
+
121  lidrstmpl = realloc(lidrstmpl, newlen * sizeof(g2int));
+
122  *idrstmpl = lidrstmpl;
+
123 
+
124  /* Unpack the rest of the Data Representation Template */
+
125  j = 0;
+
126  for (i = *mapdrslen; i < newlen; i++)
+
127  {
+
128  nbits = abs(mapdrs->ext[j]) * 8;
+
129  if (mapdrs->ext[j] >= 0)
+
130  {
+
131  gbit(cgrib, lidrstmpl + i, *iofst, nbits);
+
132  }
+
133  else
+
134  {
+
135  gbit(cgrib, &isign, *iofst, 1);
+
136  gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
+
137  if (isign == 1)
+
138  lidrstmpl[i] = -1 * lidrstmpl[i];
+
139  }
+
140  *iofst = *iofst + nbits;
+
141  j++;
+
142  }
+
143  *mapdrslen = newlen;
+
144  }
+
145  if (mapdrs->ext)
+
146  free(mapdrs->ext);
+
147  if (mapdrs)
+
148  free(mapdrs);
+
149 
+
150  return G2_NO_ERROR;
+
151 }
+
+
+
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.
Definition: g2_unpack5.c:42
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
Definition: drstemplates.c:166
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
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,...
Definition: drstemplates.c:212
+
g2int maplen
Number of entries in the static part of the template.
Definition: grib2_int.h:39
+
#define G2_UNPACK5_BAD_DRT
In g2_unpack5(), undefined Data Representation Template.
Definition: grib2.h:305
+
g2int * map
Number of octets of each entry in the static part of the template.
Definition: grib2_int.h:43
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+
Struct for GRIB template.
Definition: grib2_int.h:28
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack6.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ g2_unpack6()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack6 (unsigned char * cgrib,
g2intiofst,
g2int ngpts,
g2intibmap,
g2int ** bmap 
)
+
+ +

This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.

+
Parameters
+ + + + + + +
cgribchar array containing Section 6 of the GRIB2 message.
iofstBit offset of the beginning of Section 6 in cgrib.
ngptsNumber of grid points specified in the bit-map
ibmapBitmap 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.
  • +
+
bmapPointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack6.c
+
+
+Go to the documentation of this file.
1 
+
5 #include <stdio.h>
+
6 #include <stdlib.h>
+
7 #include "grib2_int.h"
+
8 
+
32 g2int
+
33 g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap,
+
34  g2int **bmap)
+
35 {
+
36  g2int j, isecnum;
+
37  g2int *lbmap = 0;
+
38  g2int *intbmap;
+
39 
+
40  *bmap = NULL;
+
41 
+
42  *iofst = *iofst + 32; /* skip Length of Section */
+
43  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
44  *iofst = *iofst + 8;
+
45 
+
46  if (isecnum != 6)
+
47  {
+
48  fprintf(stderr, "g2_unpack6: Not Section 6 data.\n");
+
49  return G2_UNPACK_BAD_SEC;
+
50  }
+
51 
+
52  gbit(cgrib, ibmap, *iofst, 8); /* Get bit-map indicator */
+
53  *iofst = *iofst + 8;
+
54 
+
55  if (*ibmap == 0)
+
56  { /* Unpack bitmap */
+
57  if (ngpts > 0)
+
58  lbmap = calloc(ngpts, sizeof(g2int));
+
59  if (!lbmap)
+
60  return G2_UNPACK_NO_MEM;
+
61 
+
62  *bmap = lbmap;
+
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];
+
68  free(intbmap);
+
69  }
+
70 
+
71  return G2_NO_ERROR;
+
72 }
+
+
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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.
Definition: g2_unpack6.c:33
+
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...
Definition: gbits.c:57
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
g2_unpack7.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

Unpack Section 7 (Data Section) as defined in GRIB Edition 2.

+
Author
Stephen Gilbert
+
Date
2002-10-31
+ +

Definition in file g2_unpack7.c.

+

Function Documentation

+ +

◆ g2_unpack7()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_unpack7 (unsigned char * cgrib,
g2intiofst,
g2int igdsnum,
g2intigdstmpl,
g2int idrsnum,
g2intidrstmpl,
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
+ + + + + + + + + +
cgribchar array containing Section 7 of the GRIB2 message
iofstBit offset of the beginning of Section 7 in cgrib.
igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
igdstmplPointer 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).
idrsnumData Representation Template Number (see Code Table 5.0)
idrstmplPointer 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
ndptsNumber of data points unpacked and returned.
fldPointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
g2_unpack7.c
+
+
+Go to the documentation of this file.
1 
+
5 #include <stdio.h>
+
6 #include <stdlib.h>
+
7 #include <memory.h>
+
8 #include <string.h>
+
9 #include "grib2_int.h"
+
10 
+
54 g2int
+
55 g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl,
+
56  g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
+
57 {
+
58  g2int isecnum;
+
59  g2int ipos, lensec;
+
60  float *lfld;
+
61 
+
62  *fld = NULL;
+
63 
+
64  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
+
65  *iofst = *iofst + 32;
+
66  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
+
67  *iofst = *iofst + 8;
+
68 
+
69  if (isecnum != 7)
+
70  return G2_UNPACK_BAD_SEC;
+
71 
+
72  ipos = *iofst / 8;
+
73  if (!(lfld = calloc(ndpts ? ndpts : 1, sizeof(float))))
+
74  return G2_UNPACK_NO_MEM;
+
75 
+
76  *fld = lfld;
+
77 
+
78  if (idrsnum == 0)
+
79  simunpack(cgrib + ipos, idrstmpl, ndpts, lfld);
+
80  else if (idrsnum == 2 || idrsnum == 3)
+
81  {
+
82  if (comunpack(cgrib+ipos, lensec, idrsnum, idrstmpl, ndpts, lfld))
+ +
84  }
+
85  else if (idrsnum == 50)
+
86  { /* Spectral Simple */
+
87  simunpack(cgrib + ipos, idrstmpl, ndpts - 1, lfld + 1);
+
88  rdieee(idrstmpl + 4, lfld, 1);
+
89  }
+
90  else if (idrsnum == 51) /* Spectral complex */
+
91  {
+
92  if (igdsnum >= 50 && igdsnum <= 53)
+
93  specunpack(cgrib + ipos, idrstmpl, ndpts, igdstmpl[0], igdstmpl[2],
+
94  igdstmpl[2], lfld);
+
95  else
+
96  {
+
97  fprintf(stderr, "g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",
+
98  (int)igdsnum);
+
99  if (lfld)
+
100  free(lfld);
+
101  *fld = NULL;
+
102  return G2_UNPACK7_WRONG_GDT;
+
103  }
+
104  }
+
105 #if defined USE_JPEG2000 || defined USE_OPENJPEG
+
106  else if (idrsnum == 40 || idrsnum == 40000)
+
107  {
+
108  jpcunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
+
109  }
+
110 #endif /* USE_JPEG2000 */
+
111 #ifdef USE_PNG
+
112  else if (idrsnum == 41 || idrsnum == 40010)
+
113  {
+
114  pngunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
+
115  }
+
116 #endif /* USE_PNG */
+
117  else
+
118  {
+
119  fprintf(stderr, "g2_unpack7: Data Representation Template 5.%d not yet "
+
120  "implemented.\n", (int)idrsnum);
+
121  if (lfld)
+
122  free(lfld);
+
123  *fld = NULL;
+
124  return G2_UNPACK7_BAD_DRT;
+
125  }
+
126 
+
127  *iofst = *iofst + (8 * lensec);
+
128 
+
129  return G2_NO_ERROR;
+
130 }
+
+
+
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
Definition: grib2.h:302
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
#define G2_UNPACK7_CORRUPT_SEC
In g2_unpack7(), corrupt section 7.
Definition: grib2.h:307
+
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
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...
Definition: jpcunpack.c:108
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_UNPACK7_BAD_DRT
In g2_unpack7(), unrecognized Data Representation Template.
Definition: grib2.h:309
+
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...
Definition: pngunpack.c:105
+
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...
Definition: simunpack.c:26
+
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 ...
Definition: comunpack.c:42
+
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.
Definition: g2_unpack7.c:55
+
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
Definition: grib2.h:301
+
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...
Definition: specunpack.c:35
+
#define G2_UNPACK7_WRONG_GDT
In g2_unpack7(), need one of GDT 3.50 through 3.53 to decode DRT 5.51.
Definition: grib2.h:308
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
gbits.c File Reference
+
+
+ +

Functions to pack and unpack bits to/from a packed bit string. +More...

+
#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + +

+Functions

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...
 
+

Detailed Description

+

Functions to pack and unpack bits to/from a packed bit string.

+
Author
NOAA Programmer
+ +

Definition in file gbits.c.

+

Function Documentation

+ +

◆ gbit()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void gbit (unsigned char * in,
g2intiout,
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
+ + + + + +
inpointer to character array input.
ioutpointer to unpacked array output.
iskipinitial number of bits to skip.
nbitsnumber 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,
g2intiout,
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
+ + + + + + + +
inPointer to character array input.
ioutPointer to unpacked array output.
iskipInitial number of bits to skip.
nbitsNumber of bits to take.
nskipAdditional number of bits to skip on each iteration.
nNumber 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,
g2intin,
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
+ + + + + +
outPointer to packed array output. Must be allocated large enough to hold output.
inPointer to unpacked array input.
iskipInitial number of bits to skip.
nbitsNumber 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,
g2intin,
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
+ + + + + + + +
outPointer to packed array output. Must be allocated large enough to hold output.
inPointer to unpacked array input.
iskipInitial number of bits to skip.
nbitsNumber of bits to pack.
nskipAdditional number of bits to skip on each iteration.
nNumber 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gbits.c
+
+
+Go to the documentation of this file.
1 
+
6 #include "grib2_int.h"
+
7 
+
19 void
+
20 gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
+
21 {
+
22  gbits(in, iout, iskip, nbits, (g2int)0, (g2int)1);
+
23 }
+
24 
+
37 void
+
38 sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits)
+
39 {
+
40  sbits(out, in, iskip, nbits, (g2int)0, (g2int)1);
+
41 }
+
42 
+
56 void
+
57 gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits,
+
58  g2int nskip, g2int n)
+
59 {
+
60  g2int i, tbit, bitcnt, ibit, itmp;
+
61  g2int nbit, index;
+
62  static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
+
63 
+
64  /* nbit is the start position of the field in bits */
+
65  nbit = iskip;
+
66  for (i = 0; i < n; i++)
+
67  {
+
68  bitcnt = nbits;
+
69  index = nbit / 8;
+
70  ibit = nbit % 8;
+
71  nbit = nbit + nbits + nskip;
+
72 
+
73  /* first byte */
+
74  tbit = (bitcnt < (8 - ibit)) ? bitcnt : 8 - ibit; // find min
+
75  itmp = (int)*(in + index) & ones[7 - ibit];
+
76  if (tbit != 8 - ibit) itmp >>= (8 - ibit - tbit);
+
77  index++;
+
78  bitcnt = bitcnt - tbit;
+
79 
+
80  /* now transfer whole bytes */
+
81  while (bitcnt >= 8)
+
82  {
+
83  itmp = itmp << 8 | (int)*(in + index);
+
84  bitcnt = bitcnt - 8;
+
85  index++;
+
86  }
+
87 
+
88  /* get data from last byte */
+
89  if (bitcnt > 0)
+
90  {
+
91  itmp = ( itmp << bitcnt ) |
+
92  (((int)*(in + index) >> (8 - bitcnt)) & ones[bitcnt - 1]);
+
93  }
+
94 
+
95  *(iout + i) = itmp;
+
96  }
+
97 }
+
98 
+
113 void
+
114 sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits,
+
115  g2int nskip, g2int n)
+
116 {
+
117  g2int i, bitcnt, tbit, ibit, itmp, imask, itmp2, itmp3;
+
118  g2int nbit, index;
+
119  static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
+
120 
+
121  /* number bits from zero to ... nbit is the last bit of the field
+
122  * to be filled. */
+
123  nbit = iskip + nbits - 1;
+
124  for (i = 0; i < n; i++)
+
125  {
+
126  itmp = *(in + i);
+
127  bitcnt = nbits;
+
128  index = nbit / 8;
+
129  ibit = nbit % 8;
+
130  nbit = nbit + nbits + nskip;
+
131 
+
132  /* make byte aligned */
+
133  if (ibit != 7)
+
134  {
+
135  tbit = (bitcnt < (ibit+1)) ? bitcnt : ibit + 1; /* find min */
+
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;
+
141  itmp = itmp >> tbit;
+
142  index--;
+
143  }
+
144  /* now byte aligned */
+
145 
+
146  /* do by bytes */
+
147  while (bitcnt >= 8)
+
148  {
+
149  out[index] = (unsigned char)(itmp & 255);
+
150  itmp = itmp >> 8;
+
151  bitcnt = bitcnt - 8;
+
152  index--;
+
153  }
+
154 
+
155  /* do last byte */
+
156  if (bitcnt > 0)
+
157  {
+
158  itmp2 = itmp & ones[bitcnt - 1];
+
159  itmp3 = (int)*(out + index) & (255 - ones[bitcnt - 1]);
+
160  out[index] = (unsigned char)(itmp2 | itmp3);
+
161  }
+
162  }
+
163 
+
164 }
+
+
+
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 ...
Definition: gbits.c:114
+
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...
Definition: gbits.c:20
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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...
Definition: gbits.c:57
+
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 ...
Definition: gbits.c:38
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
getdim.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ getdim()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int getdim (unsigned char * csec3,
g2intwidth,
g2intheight,
g2intiscan 
)
+
+ +

This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.

+
Parameters
+ + + + + +
csec3Character array that contains the packed GRIB2 GDS.
widthx (or i) dimension of the grid. 0 if grid is not recognized.
heighty (or j) dimension of the grid. 0 if grid is not recognized.
iscanScanning 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
getdim.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
28 g2int
+
29 getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
+
30 {
+
31  g2int *igdstmpl = NULL, *list_opt = NULL;
+
32  g2int *igds = NULL;
+
33  g2int iofst, igdtlen, num_opt, jerr;
+
34 
+
35  iofst = 0; /* set offset to beginning of section */
+
36  if (!(jerr = g2_unpack3(csec3, &iofst, &igds, &igdstmpl, &igdtlen,
+
37  &list_opt, &num_opt)))
+
38  {
+
39  switch (igds[4]) /* Template number */
+
40  {
+
41  case 0: /* Lat/Lon */
+
42  case 1:
+
43  case 2:
+
44  case 3:
+
45  {
+
46  *width = igdstmpl[7];
+
47  *height = igdstmpl[8];
+
48  *iscan = igdstmpl[18];
+
49  break;
+
50  }
+
51  case 10: /* Mercator */
+
52  {
+
53  *width = igdstmpl[7];
+
54  *height = igdstmpl[8];
+
55  *iscan = igdstmpl[15];
+
56  break;
+
57  }
+
58  case 20: /* Polar Stereographic */
+
59  {
+
60  *width = igdstmpl[7];
+
61  *height = igdstmpl[8];
+
62  *iscan = igdstmpl[17];
+
63  break;
+
64  }
+
65  case 30: /* Lambert Conformal */
+
66  {
+
67  *width = igdstmpl[7];
+
68  *height = igdstmpl[8];
+
69  *iscan = igdstmpl[17];
+
70  break;
+
71  }
+
72  case 40: /* Gaussian */
+
73  case 41:
+
74  case 42:
+
75  case 43:
+
76  {
+
77  *width = igdstmpl[7];
+
78  *height = igdstmpl[8];
+
79  *iscan = igdstmpl[18];
+
80  break;
+
81  }
+
82  case 90: /* Space View/Orthographic */
+
83  {
+
84  *width = igdstmpl[7];
+
85  *height = igdstmpl[8];
+
86  *iscan = igdstmpl[16];
+
87  break;
+
88  }
+
89  case 110: /* Equatorial Azimuthal */
+
90  {
+
91  *width = igdstmpl[7];
+
92  *height = igdstmpl[8];
+
93  *iscan = igdstmpl[15];
+
94  break;
+
95  }
+
96  default:
+
97  {
+
98  *width = 0;
+
99  *height = 0;
+
100  *iscan = 0;
+
101  break;
+
102  }
+
103  } /* end switch */
+
104  }
+
105  else
+
106  {
+
107  *width = 0;
+
108  *height = 0;
+
109  }
+
110 
+
111  if (igds)
+
112  free(igds);
+
113  if (igdstmpl)
+
114  free(igdstmpl);
+
115  if (list_opt)
+
116  free(list_opt);
+
117 
+
118  return 0;
+
119 }
+
+
+
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...
Definition: getdim.c:29
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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.
Definition: g2_unpack3.c:57
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
getpoly.c File Reference
+
+
+ +

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.

+ + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ getpoly()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int getpoly (unsigned char * csec3,
g2intjj,
g2intkk,
g2intmm 
)
+
+ +

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
+ + + + + +
csec3Character array that contains the packed GRIB2 GDS.
jjJ pentagonal resolution parameter.
kkK pentagonal resolution parameter.
mmM 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
getpoly.c
+
+
+Go to the documentation of this file.
1 
+
7 #include <stdio.h>
+
8 #include <stdlib.h>
+
9 #include "grib2_int.h"
+
10 
+
39 g2int
+
40 getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
+
41 {
+
42 
+
43  g2int *igdstmpl, *list_opt;
+
44  g2int *igds;
+
45  g2int iofst, igdtlen, num_opt;
+
46 
+
47  iofst = 0; /* set offset to beginning of section */
+
48  if (!g2_unpack3(csec3, &iofst, &igds, &igdstmpl, &igdtlen,
+
49  &list_opt, &num_opt))
+
50  {
+
51  switch (igds[4]) /* Template number */
+
52  {
+
53  case 50: /* Spherical harmonic coefficients */
+
54  case 51:
+
55  case 52:
+
56  case 53:
+
57  {
+
58  *jj = igdstmpl[0];
+
59  *kk = igdstmpl[1];
+
60  *mm = igdstmpl[2];
+
61  break;
+
62  }
+
63  default:
+
64  {
+
65  *jj = 0;
+
66  *kk = 0;
+
67  *mm = 0;
+
68  break;
+
69  }
+
70  } /* end switch */
+
71  }
+
72  else
+
73  {
+
74  *jj = 0;
+
75  *kk = 0;
+
76  *mm = 0;
+
77  }
+
78 
+
79  if (igds)
+
80  free(igds);
+
81  if (igdstmpl)
+
82  free(igdstmpl);
+
83  if (list_opt)
+
84  free(list_opt);
+
85 
+
86  return 0;
+
87 }
+
+
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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...
Definition: getpoly.c:40
+
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.
Definition: g2_unpack3.c:57
+ + + + 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 -

+ + +

- 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
grib2.h File Reference
+
+
+ +

Header file for NCEPLIBS-g2c library. +More...

+
#include <stdio.h>
+#include <stdint.h>
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  gribfield
 Struct for GRIB field. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#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...
 
+ + + + + + + + + + + + + +

+Typedefs

typedef float g2float
 Float type. More...
 
typedef int64_t g2int
 Long integer type. More...
 
typedef uint64_t g2intu
 Unsigned long integer type. More...
 
typedef struct gribfield gribfield
 Struct for GRIB field. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Data Type Documentation

+ +

◆ gribfield

+ +
+
+ + + + +
struct 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).
+ +
+
+

Macro Definition Documentation

+ +

◆ 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
+
+ +

In g2_addfield() no bitmap in the GRIB message.

+ +

Definition at line 316 of file grib2.h.

+ +
+
+ +

◆ G2_ADDFIELD_BAD_DRT

+ +
+
+ + + + +
#define G2_ADDFIELD_BAD_DRT   -7
+
+ +

In g2_addfield() unsupported Data Representationi Template.

+ +

Definition at line 315 of file grib2.h.

+ +
+
+ +

◆ 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
+
+ +

In g2_addfield() error packing data field.

+ +

Definition at line 318 of file grib2.h.

+ +
+
+ +

◆ 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
+
+ +

Wrong GRIB version for g2_create(), must be 2.

+ +

Definition at line 276 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_END

+ +
+
+ + + + +
#define G2_GETFLD_BAD_END   7
+
+ +

g2_getfld() didn't find "7777" at end of message.

+ +

Definition at line 288 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC1

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC1   15
+
+ +

Error in g2_getfld() unpacking section 1.

+ +

Definition at line 291 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC2

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC2   16
+
+ +

Error in g2_getfld() unpacking section 2.

+ +

Definition at line 292 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC3

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC3   10
+
+ +

Error in g2_getfld() unpacking section 3.

+ +

Definition at line 293 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC4

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC4   11
+
+ +

Error in g2_getfld() unpacking section 4.

+ +

Definition at line 294 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC5

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC5   12
+
+ +

Error in g2_getfld() unpacking section 5.

+ +

Definition at line 295 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC6

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC6   13
+
+ +

Error in g2_getfld() unpacking section 6.

+ +

Definition at line 296 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_BAD_SEC7

+ +
+
+ + + + +
#define G2_GETFLD_BAD_SEC7   14
+
+ +

Error in g2_getfld() unpacking section 7.

+ +

Definition at line 297 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_GRIB_VERSION

+ +
+
+ + + + +
#define G2_GETFLD_GRIB_VERSION   2
+
+ +

Wrong GRIB version for g2_getfld(), must be 2.

+ +

Definition at line 284 of file grib2.h.

+ +
+
+ +

◆ 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() encountered unrecognized section.

+ +

Definition at line 289 of file grib2.h.

+ +
+
+ +

◆ 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() can't find beginning characters "GRIB".

+ +

Definition at line 283 of file grib2.h.

+ +
+
+ +

◆ G2_GETFLD_WRONG_END

+ +
+
+ + + + +
#define G2_GETFLD_WRONG_END   4
+
+ +

g2_info() found "7777" not where expected.

+ +

Definition at line 286 of file grib2.h.

+ +
+
+ +

◆ 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
+
+ +

In g2_gribend() GRIB message was not initialized - call g2_create() first.

+ +

Definition at line 299 of file grib2.h.

+ +
+
+ +

◆ 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
+
+ +

Wrong GRIB version for g2_info(), must be 2.

+ +

Definition at line 278 of file grib2.h.

+ +
+
+ +

◆ G2_INFO_INVAL_SEC

+ +
+
+ + + + +
#define G2_INFO_INVAL_SEC   6
+
+ +

g2_info() found invalid section number.

+ +

Definition at line 282 of file grib2.h.

+ +
+
+ +

◆ 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() can't find section 1.

+ +

Definition at line 279 of file grib2.h.

+ +
+
+ +

◆ G2_INFO_WRONG_END

+ +
+
+ + + + +
#define G2_INFO_WRONG_END   4
+
+ +

g2_info() found "7777" not where expected.

+ +

Definition at line 280 of file grib2.h.

+ +
+
+ +

◆ G2_JASPER_DECODE

+ +
+
+ + + + +
#define G2_JASPER_DECODE   -3
+
+ +

In dec_jpeg2000() error decoding image with jasper.

+ +

Definition at line 324 of file grib2.h.

+ +
+
+ +

◆ G2_JASPER_DECODE_COLOR

+ +
+
+ + + + +
#define G2_JASPER_DECODE_COLOR   -5
+
+ +

In dec_jpeg2000() decoded image had multiple color components.

+ +

Definition at line 325 of file grib2.h.

+ +
+
+ +

◆ G2_JASPER_ENCODE

+ +
+
+ + + + +
#define G2_JASPER_ENCODE   -3
+
+ +

In enc_jpeg2000() error encoding image with jasper.

+ +

Definition at line 323 of file grib2.h.

+ +
+
+ +

◆ G2_JASPER_INIT

+ +
+
+ + + + +
#define G2_JASPER_INIT   -2
+
+ +

In enc_jpeg2000()/dec_jpeg2000() error initializing jasper library.

+ +

Definition at line 322 of file grib2.h.

+ +
+
+ +

◆ 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
+
+ +

In specunpack() Can't handle 64 or 128 bit floats.

+ +

Definition at line 321 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK3_BAD_GDT

+ +
+
+ + + + +
#define G2_UNPACK3_BAD_GDT   5
+
+ +

In g2_unpack3(), undefined Grid Definition Template.

+ +

Definition at line 303 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK4_BAD_PDT

+ +
+
+ + + + +
#define G2_UNPACK4_BAD_PDT   5
+
+ +

In g2_unpack4(), undefined Product Definition Template.

+ +

Definition at line 304 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK5_BAD_DRT

+ +
+
+ + + + +
#define G2_UNPACK5_BAD_DRT   7
+
+ +

In g2_unpack5(), undefined Data Representation Template.

+ +

Definition at line 305 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK6_BAD_BITMAP

+ +
+
+ + + + +
#define G2_UNPACK6_BAD_BITMAP   4
+
+ +

In g2_unpack6(), unrecognized pre-defined bit-map.

+ +

Definition at line 306 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK7_BAD_DRT

+ +
+
+ + + + +
#define G2_UNPACK7_BAD_DRT   4
+
+ +

In g2_unpack7(), unrecognized Data Representation Template.

+ +

Definition at line 309 of file grib2.h.

+ +
+
+ +

◆ G2_UNPACK7_CORRUPT_SEC

+ +
+
+ + + + +
#define G2_UNPACK7_CORRUPT_SEC   7
+
+ +

In g2_unpack7(), corrupt section 7.

+ +

Definition at line 307 of file grib2.h.

+ +
+
+ +

◆ 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.

+ +
+
+

Typedef Documentation

+ +

◆ g2float

+ +
+
+ + + + +
typedef float 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

+ +
+
+ + + + +
typedef struct gribfield gribfield
+
+ +

Struct for GRIB field.

+ +

Definition at line 217 of file grib2.h.

+ +
+
+

Function Documentation

+ +

◆ g2_addfield()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int g2_addfield (unsigned char * cgrib,
g2int ipdsnum,
g2intipdstmpl,
float * coordlist,
g2int numcoord,
g2int idrsnum,
g2intidrstmpl,
float * fld,
g2int ngrdpts,
g2int ibmap,
g2intbmap 
)
+
+ +

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
+ + + + + + + + + + + + +
cgribChar 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.
ipdsnumProduct Definition Template Number (see Code Table 4.0).
ipdstmplContains the data values for the Product Definition Template specified by ipdsnum.
coordlistArray containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
numcoordnumber of values in array coordlist.
idrsnumData Representation Template Number (see Code Table 5.0).
idrstmplThe 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.
fldArray of data points to pack.
ngrdptsNumber of data points in grid. i.e. size of fld and bmap.
ibmapBitmap 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.
  • +
+
bmapInteger 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,
g2intigds,
g2intigdstmpl,
g2intideflist,
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
+ + + + + + +
cgribChar array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message.
igdsContains 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).
  • +
+
igdstmplContains 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
+ + + + +
cgribChar array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
csec2Character array containing information to be added in Section 2.
lcsec2Number 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,
g2intlistsec0,
g2intlistsec1 
)
+
+ +

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]cgribCharacter array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
[in]listsec0Contains 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]listsec1Contains 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 (gribfieldgfld)
+
+ +

This routine frees up memory that was allocated for struct gribfield.

+
Parameters
+ + +
gfldpointer 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
+ + + + + + +
cgribCharacter pointer to the GRIB2 message.
ifldnumSpecifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
unpackBoolean value indicating whether to unpack bitmap/data field.
    +
  • 1 unpack bitmap (if present) and data values.
  • +
  • 0 do not unpack bitmap and data values.
  • +
+
expandBoolean 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.
  • +
+
gfldpointer 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:

+
#include "grib2.h"
+
gribfield *gfld;
+
ret=g2_getfld(cgrib,1,1,1,&gfld);
+
...
+
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
+ + +
cgribChar array containing all the data sections added be previous calls to g2_create(), g2_addlocal(), g2_addgrid(), and g2_addfield(). After function is called, contains the finalized GRIB2 message.
+
+
+
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,
g2intlistsec0,
g2intlistsec1,
g2intnumfields,
g2intnumlocal 
)
+
+ +

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
+ + + + + + +
cgribCharacter pointer to the GRIB2 message.
listsec0pointer 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.
  • +
+
listsec1Pointer 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).
  • +
+
numfieldsThe number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
numlocalThe 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,
g2intiofst,
g2int ** ids,
g2intidslen 
)
+
+ +

This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

+
Parameters
+ + + + + +
cgribchar array containing Section 1 of the GRIB2 message.
iofstBit offset for the beginning of Section 1 in cgrib.
idsPointer 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).
  • +
+
idslenNumber 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,
g2intiofst,
g2intlencsec2,
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
+ + + + + +
cgribchar array containing Section 2 of the GRIB2 message.
iofstPointer that contains the bit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
lencsec2Length (in octets) of Local Use data.
csec2Pointer 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,
g2intiofst,
g2int ** igds,
g2int ** igdstmpl,
g2intmapgridlen,
g2int ** ideflist,
g2intidefnum 
)
+
+ +

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
+ + + + + + + + +
cgribChar array ontaining Section 3 of the GRIB2 message.
iofstBit offset for the beginning of Section 3 in cgrib.
igdsContains 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).
  • +
+
igdstmplPointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
mapgridlenNumber 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,
g2intiofst,
g2intipdsnum,
g2int ** ipdstmpl,
g2intmappdslen,
float ** coordlist,
g2intnumcoord 
)
+
+ +

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
+ + + + + + + + +
cgribArray containing Section 4 of the GRIB2 message.
iofstBit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
ipdsnumProduct Definition Template Number (see Table 4.0).
ipdstmplPointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
mappdslenNumber of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
coordlistPointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
numcoordnumber 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,
g2intiofst,
g2intndpts,
g2intidrsnum,
g2int ** idrstmpl,
g2intmapdrslen 
)
+
+ +

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
+ + + + + + + +
cgribchar array containing Section 5 of the GRIB2 message.
iofstBit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
ndptsNumber of data points unpacked and returned.
idrsnumData Representation Template Number (see Code Table 5.0).
idrstmplPointer 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,
g2intiofst,
g2int ngpts,
g2intibmap,
g2int ** bmap 
)
+
+ +

This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.

+
Parameters
+ + + + + + +
cgribchar array containing Section 6 of the GRIB2 message.
iofstBit offset of the beginning of Section 6 in cgrib.
ngptsNumber of grid points specified in the bit-map
ibmapBitmap 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.
  • +
+
bmapPointer 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,
g2intiofst,
g2int igdsnum,
g2intigdstmpl,
g2int idrsnum,
g2intidrstmpl,
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
+ + + + + + + + + +
cgribchar array containing Section 7 of the GRIB2 message
iofstBit offset of the beginning of Section 7 in cgrib.
igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
igdstmplPointer 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).
idrsnumData Representation Template Number (see Code Table 5.0)
idrstmplPointer 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
ndptsNumber of data points unpacked and returned.
fldPointer 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_levelThe 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to the float or double data values to pack.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to the float or double data values to pack.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to array of float that contains the data values to pack.
widthNumber of points in the x direction.
heightNumber of points in the y direction.
idrstmplContains 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.
  • +
+
cpackThe packed data field.
lcpacklength 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to array of double that contains the data values to pack.
widthNumber of points in the x direction.
heightNumber of points in the y direction.
idrstmplContains 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.
  • +
+
cpackThe packed data field.
lcpacklength 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data field (character*1 array).
lenlength of packed field cpack().
idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
ndptsThe number of data values to unpack.
fldContains 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data field (character*1 array).
lenlength of packed field cpack().
idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
ndptsThe number of data values to unpack.
fldContains 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,
g2intlskip,
g2intlgrib 
)
+
+ +

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
+ + + + + + +
lugbFILE pointer for the file to search. File must be opened before this routine is called.
iseeknumber of bytes in the file to skip before search.
mseeknumber of bytes to search at a time (must be at least 16).
lskipnumber of bytes to skip from the beggining of the file to where the GRIB message starts.
lgribnumber 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.
+
Struct for GRIB field.
Definition: grib2.h:41
+
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),...
Definition: g2_getfld.c:91
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
grib2.h
+
+
+Go to the documentation of this file.
1 
+
17 #ifndef _grib2_H
+
18 #define _grib2_H
+
19 #include <stdio.h>
+
20 #include <stdint.h>
+
21 
+
22 #define G2_VERSION "1.7.0"
+
24 #define G2_PNG_ENABLED 1
+
25 #define G2_JPEG2000_ENABLED 1
+
28 typedef int64_t g2int;
+
29 
+
32 typedef uint64_t g2intu;
+
33 
+
36 typedef float g2float;
+
37 
+
41 struct gribfield
+
42 {
+ +
45 
+ +
49 
+ +
97 
+ +
100 
+
103  unsigned char *local;
+
104 
+ +
107 
+ +
110 
+ +
117 
+ +
120 
+ +
125 
+ +
130 
+ +
136 
+ +
141 
+ +
145 
+ +
149 
+ +
153 
+ +
157 
+ +
161 
+ +
165 
+ +
168 
+
172  float *coord_list;
+
173 
+ +
176 
+ +
180 
+ +
183 
+ +
187 
+ +
191 
+ +
200 
+ +
208 
+ +
212 
+
214  float *fld;
+
215 };
+
216 
+
217 typedef struct gribfield gribfield;
+
219 /* Prototypes for unpacking sections API */
+
220 g2int g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen);
+
221 g2int g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2,
+
222  unsigned char **csec2);
+
223 g2int g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl,
+
224  g2int *mapgridlen, g2int **ideflist, g2int *idefnum);
+
225 g2int g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl,
+
226  g2int *mappdslen, float **coordlist, g2int *numcoord);
+
227 g2int g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum,
+
228  g2int **idrstmpl, g2int *mapdrslen);
+
229 g2int g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap,
+
230  g2int **bmap);
+
231 g2int g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl,
+
232  g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld);
+
233 
+
234 /* Prototypes for unpacking API */
+
235 void seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip,
+
236  g2int *lgrib);
+
237 g2int g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1,
+
238  g2int *numfields, g2int *numlocal);
+
239 g2int g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand,
+
240  gribfield **gfld);
+
241 void g2_free(gribfield *gfld);
+
242 
+
243 /* Prototypes for packing API */
+
244 g2int g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1);
+
245 g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2);
+
246 g2int g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist,
+
247  g2int idefnum);
+
248 g2int g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl,
+
249  float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl,
+
250  float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap);
+
251 g2int g2_gribend(unsigned char *cgrib);
+
252 
+
253 /* Compression. */
+
254 void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
+
255  unsigned char *cpack, g2int *lcpack);
+
256 g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
257  float *fld);
+
258 void pngpackd(double *fld, g2int width, g2int height, g2int *idrstmpl,
+
259  unsigned char *cpack, g2int *lcpack);
+
260 g2int pngunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
261  double *fld);
+
262 void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
+
263  unsigned char *cpack, g2int *lcpack);
+
264 g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
265  float *fld);
+
266 void jpcpackd(double *fld, g2int width, g2int height, g2int *idrstmpl,
+
267  unsigned char *cpack, g2int *lcpack);
+
268 g2int jpcunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
269  double *fld);
+
270 
+
271 /* Logging, for debugging purposes. */
+
272 int g2c_set_log_level(int new_level);
+
273 
+
274 /* Error codes for G2 API. */
+
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
+
327 /* These are the new error codes. */
+
328 #define G2C_NO_ERROR 0
+
329 #define G2C_NOT_GRIB -50
+
330 #define G2C_MSG_COMPLETE -51
+
332 #endif /* _grib2_H */
+
+
+
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.
Definition: g2_unpack1.c:55
+
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...
Definition: g2_create.c:68
+
g2int * igdtmpl
Contains the data values for the Grid Definition Template specified by igdtnum.
Definition: grib2.h:152
+
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...
Definition: pngunpack.c:105
+
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.
Definition: g2_unpack5.c:42
+
float g2float
Float type.
Definition: grib2.h:36
+
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.
Definition: jpcpack.c:294
+
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.
Definition: g2_unpack7.c:55
+
g2int ngrdpts
Number of grid points in the defined grid.
Definition: grib2.h:119
+
g2int unpacked
Logical value indicating whether the bitmap and data values were unpacked.
Definition: grib2.h:190
+
void g2_free(gribfield *gfld)
This routine frees up memory that was allocated for struct gribfield.
Definition: g2_free.c:24
+
g2int ifldnum
Field number within GRIB message.
Definition: grib2.h:109
+
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.
Definition: g2_addgrid.c:70
+
g2int idrtlen
Number of elements in idrtmpl.
Definition: grib2.h:182
+
g2int ibmap
Bitmap indicator (see Table 6.0).
Definition: grib2.h:207
+
g2int griddef
Source of grid definition (see Table 3.0).
Definition: grib2.h:116
+
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.
Definition: g2_unpack4.c:46
+
void seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
This subprogram searches a file for the next GRIB Message.
Definition: seekgb.c:39
+
g2int numoct_opt
Number of octets needed for each additional grid points definition.
Definition: grib2.h:124
+
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.
Definition: g2_addfield.c:98
+
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...
Definition: pngunpack.c:128
+
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...
Definition: g2_info.c:67
+
g2int * idsect
Contains the entries in the Identification Section (Section 1).
Definition: grib2.h:96
+
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.
Definition: g2_unpack6.c:33
+
int g2c_set_log_level(int new_level)
Use this to set the global log level.
Definition: util.c:124
+
g2int g2_gribend(unsigned char *cgrib)
This routine finalizes a GRIB2 message after all grids and fields have been added.
Definition: g2_gribend.c:37
+
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),...
Definition: g2_getfld.c:91
+
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.
Definition: pngpack.c:224
+
g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
Definition: grib2.h:186
+
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...
Definition: jpcunpack.c:108
+
g2int interp_opt
Interpretation of list for optional points definition.
Definition: grib2.h:129
+
g2int ipdtlen
Number of elements in ipdtmpl - i.e.
Definition: grib2.h:160
+
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.
Definition: g2_unpack2.c:38
+
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.
Definition: pngpack.c:259
+
g2int discipline
Message Discipline (see Table 0.0).
Definition: grib2.h:48
+
g2int num_opt
(Used if numoct_opt .ne.
Definition: grib2.h:135
+
float * coord_list
Array containing floating point values intended to document the vertical discretisation associated to...
Definition: grib2.h:172
+
g2int ipdtnum
Product Definition Template Number (see Table 4.0).
Definition: grib2.h:156
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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.
Definition: g2_unpack3.c:57
+
float * fld
Array of ndpts unpacked data points.
Definition: grib2.h:214
+
unsigned char * local
Pointer to character array containing contents of Local Section 2, if included.
Definition: grib2.h:103
+
g2int idrtnum
Data Representation Template Number (see Table 5.0).
Definition: grib2.h:179
+
g2int num_coord
Number of values in array coord_list.
Definition: grib2.h:167
+
g2int expanded
Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
Definition: grib2.h:199
+
Struct for GRIB field.
Definition: grib2.h:41
+
g2int version
GRIB edition number (2).
Definition: grib2.h:44
+
g2int locallen
Length of array local.
Definition: grib2.h:106
+
g2int ndpts
Number of data points unpacked and returned.
Definition: grib2.h:175
+
g2int igdtlen
Number of elements in igdtmpl - i.e.
Definition: grib2.h:148
+
g2int * list_opt
(Used if numoct_opt .ne.
Definition: grib2.h:140
+
g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
This routine adds a Local Use Section (Section 2) to a GRIB2 message.
Definition: g2_addlocal.c:40
+
g2int igdtnum
Grid Definition Template Number (See Table 3.1).
Definition: grib2.h:144
+
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.
Definition: jpcpack.c:253
+
g2int * bmap
Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
Definition: grib2.h:211
+
g2int * ipdtmpl
Contains the data values for the Product Definition Template specified by ipdtnum.
Definition: grib2.h:164
+
g2int idsectlen
Number of elements in idsect.
Definition: grib2.h:99
+
uint64_t g2intu
Unsigned long integer type.
Definition: grib2.h:32
+
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...
Definition: jpcunpack.c:135
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
grib2_int.h File Reference
+
+
+ +

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.

+ + + + + +

+Data Structures

struct  gtemplate
 Struct for GRIB template. More...
 
+ + + + + + + + + + +

+Macros

#define ALOG2   (0.69314718)
 ln(2.0) More...
 
#define G2C_JASPER_JPEG_FORMAT_NAME   "jpc"
 Name of JPEG codec in Jasper. More...
 
#define LOG(e)
 Ignore logging to stdout. More...
 
+ + + + +

+Typedefs

typedef struct gtemplate gtemplate
 Struct for GRIB template. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

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...
 
gtemplateextdrstemplate (g2int number, g2int *list)
 This subroutine generates the remaining octet map for a given Data Representation Template, if required. More...
 
gtemplateextgridtemplate (g2int number, g2int *list)
 This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More...
 
gtemplateextpdstemplate (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...
 
gtemplategetdrstemplate (g2int number)
 This subroutine returns DRS template information for a specified Data Representation Template. More...
 
gtemplategetgridtemplate (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...
 
gtemplategetpdstemplate (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...
 
+

Detailed Description

+

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.

+

Data Type Documentation

+ +

◆ gtemplate

+ +
+
+ + + + +
struct 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.

+
+ +
+
+

Macro Definition Documentation

+ +

◆ ALOG2

+ +
+
+ + + + +
#define ALOG2   (0.69314718)
+
+ +

ln(2.0)

+ +

Definition at line 21 of file grib2_int.h.

+ +
+
+ +

◆ 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.

+ +
+
+

Typedef Documentation

+ +

◆ gtemplate

+ +
+
+ + + + +
typedef struct gtemplate gtemplate
+
+ +

Struct for GRIB template.

+ +

Definition at line 56 of file grib2_int.h.

+ +
+
+

Function Documentation

+ +

◆ cmplxpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void cmplxpack (float * fld,
g2int ndpts,
g2int idrsnum,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldContains the data values to pack.
ndptsThe number of data values in array fld
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplContains 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 )
  • +
+
cpackThe packed data field.
lcpacklength 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldContains the data values to pack.
ndptsThe number of data values in array fld.
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplContains 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)
  • +
+
cpackThe packed data field.
lcpacklength 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,
g2intidrstmpl,
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
+ + + + + + + +
cpackpointer to the packed data field.
lenseclength of section 7 (used for error checking).
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplpointer to the array of values for Data Representation Template 5.2 or 5.3
ndptsThe number of data values to unpack
fldContains 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,
g2intoutfld 
)
+
+ +

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
+ + + + +
injpcInput JPEG2000 code stream.
bufsizeLength (in bytes) of the input JPEG2000 code stream.
outfldOutput 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,
g2intwidth,
g2intheight,
unsigned char * cout 
)
+
+ +

Decode PNG.

+
Parameters
+ + + + + +
pngbufPointer to PNG buffer.
widthPointer to width.
heightPointer to height.
coutOutput 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
+ + + + + + + + + + +
cinPacked matrix of Grayscale image values to encode.
widthwidth of image.
heightheight of image.
nbitsdepth (in bits) of image. i.e number of bits used to hold each data value.
ltypeindicator of lossless or lossy compression.
    +
  • 1, for lossy compression
  • +
  • != 1, for lossless compression
  • +
+
ratiotarget compression ratio. (ratio:1) Used only when ltype == 1.
retryIf 1 try increasing number of guard bits.
outjpcOutput encoded JPEG2000 code stream.
jpclenNumber 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
+ + + + + + +
datadata.
widthwidth.
heightheight.
nbitsnumber of bits.
pngbufPNG 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()

+ +
+
+ + + + + + + + + + + + + + + + + + +
gtemplate* extdrstemplate (g2int number,
g2intlist 
)
+
+ +

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
+ + + +
numberThe number of the Data Representation Template that is being requested.
listThe 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()

+ +
+
+ + + + + + + + + + + + + + + + + + +
gtemplate* extgridtemplate (g2int number,
g2intlist 
)
+
+ +

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
+ + + +
numberThe number of the Grid Definition Template that is being requested.
listThe 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()

+ +
+
+ + + + + + + + + + + + + + + + + + +
gtemplate* extpdstemplate (g2int number,
g2intlist 
)
+
+ +

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
+ + + +
numbernumber of the Product Definition Template 4.NN that is being requested.
listThe 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,
g2intlencurr,
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
+ + + + +
cgribBuffer that contains the GRIB message.
lencurrPointer that gets the length of the GRIB message.
verboseIf 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,
g2intiout,
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
+ + + + + +
inpointer to character array input.
ioutpointer to unpacked array output.
iskipinitial number of bits to skip.
nbitsnumber 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,
g2intiout,
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
+ + + + + + + +
inPointer to character array input.
ioutPointer to unpacked array output.
iskipInitial number of bits to skip.
nbitsNumber of bits to take.
nskipAdditional number of bits to skip on each iteration.
nNumber 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,
g2intwidth,
g2intheight,
g2intiscan 
)
+
+ +

This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.

+
Parameters
+ + + + + +
csec3Character array that contains the packed GRIB2 GDS.
widthx (or i) dimension of the grid. 0 if grid is not recognized.
heighty (or j) dimension of the grid. 0 if grid is not recognized.
iscanScanning 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()

+ +
+
+ + + + + + + + +
gtemplate* getdrstemplate (g2int number)
+
+ +

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
+ + +
numberThe 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()

+ +
+
+ + + + + + + + +
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).

+

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
+ + +
numberThe 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()

+ +
+
+ + + + + + + + +
gtemplate* getpdstemplate (g2int number)
+
+ +

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
+ + +
numberthe 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,
g2intjj,
g2intkk,
g2intmm 
)
+
+ +

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
+ + + + + +
csec3Character array that contains the packed GRIB2 GDS.
jjJ pentagonal resolution parameter.
kkK pentagonal resolution parameter.
mmM 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
+ + + +
xThe base value whose power is to be calculated.
yThe 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to the float or double data values to pack.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldContains the data values to pack
ndptsThe number of data values in array fld
idrsnumData Representation Template number. Must equal 2 or 3.
idrstmplContains 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).
  • +
+
cpackThe packed data field (character*1 array).
lcpacklength 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,
g2intrieee,
g2int num 
)
+
+ +

This subroutine stores a list of real values in 32-bit IEEE floating point format.

+
Parameters
+ + + + +
aInput array of floating point values.
numNumber of floating point values to convert.
rieeeOutput 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 (g2intkfildo,
g2intic,
g2intnxy,
g2intis523,
g2intminpk,
g2intinc,
g2intmissp,
g2intmisss,
g2intjmin,
g2intjmax,
g2intlbit,
g2intnov,
g2intndg,
g2intlx,
g2intibit,
g2intjbit,
g2intkbit,
g2intnovref,
g2intlbitref,
g2intier 
)
+
+ +

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
+ + + + + + + + + + + + + + + + + + + + + +
kfildounit number for output (print) file. (input)
icarray 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)
nxynumber of values in ic( ). also treated as its dimension. (input)
is523missing value management 0=data contains no missing values 1=data contains primary missing values 2=data contains primary and secondary missing values (input)
minpkthe minimum size of each group, except possibly the last one. (input)
incthe 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)
misspwhen 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)
missssecondary missing value indicator (see missp). (input)
jminthe minimum of each group (j=1,lx). (output)
jmaxthe 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)
lbitthe 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)
novthe number of values in each group (j=1,lx). (output)
ndgthe dimension of jmin, jmax, lbit, and nov. (input)
lxthe number of groups determined. (output)
ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (output)
jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (output)
kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. (output)
novrefreference value for nov( ). (output)
lbitrefreference value for lbit( ). (output)
ierError 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to array of float that contains the data values to pack.
widthNumber of points in the x direction.
heightNumber of points in the y direction.
idrstmplContains 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.
  • +
+
cpackThe packed data field.
lcpacklength 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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data field (character*1 array).
lenlength of packed field cpack().
idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
ndptsThe number of data values to unpack.
fldContains 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 (g2intrieee,
float * a,
g2int num 
)
+
+ +

This subroutine reads a list of real values in 32-bit IEEE floating point format.

+
Parameters
+ + + + +
rieeeg2int array of floating point values in 32-bit IEEE format.
numNumber of floating point values to convert.
afloat array of real values. a must be allocated with at least 4*num bytes of memory before calling this function.
+
+
+
Author
Stephen Gilbert
+
Date
2002-10-25
+ +

Definition at line 21 of file rdieee.c.

+ +

References int_power().

+ +

Referenced by comunpack(), g2_miss(), g2_unpack4(), g2_unpack7(), jpcunpack_int(), misspack(), pngunpack_int(), simunpack(), and specunpack().

+ +
+
+ +

◆ sbit()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void sbit (unsigned char * out,
g2intin,
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
+ + + + + +
outPointer to packed array output. Must be allocated large enough to hold output.
inPointer to unpacked array input.
iskipInitial number of bits to skip.
nbitsNumber 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,
g2intin,
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
+ + + + + + + +
outPointer to packed array output. Must be allocated large enough to hold output.
inPointer to unpacked array input.
iskipInitial number of bits to skip.
nbitsNumber of bits to pack.
nskipAdditional number of bits to skip on each iteration.
nNumber 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + +
fldContains the data values to pack.
ndptsThe number of data values in array fld.
idrstmplContains 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.
  • +
+
cpackThe packed data field
lcpacklength 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,
g2intidrstmpl,
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
+ + + + + +
cpackpointer to the packed data field.
idrstmplpointer to the array of values for Data Representation Template 5.0.
ndptsThe number of data values to unpack.
fldContains 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + + + +
fldContains the data values to be packed.
ndptsThe number of data values to pack.
JJJ - pentagonal resolution parameter.
KKK - pentagonal resolution parameter.
MMM - pentagonal resolution parameter.
idrstmplContains 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).
cpackPointer that gets the packed data field. Must be allocated by caller.
lcpacklength 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,
g2intidrstmpl,
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
+ + + + + + + + +
cpackpointer to the packed data field.
idrstmplpointer to the array of values for Data Representation Template 5.51.
ndptsThe number of data values to unpack (real and imaginary parts).
JJpentagonal resolution parameter.
KKpentagonal resolution parameter.
MMpentagonal resolution parameter.
fldContains 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
grib2_int.h
+
+
+Go to the documentation of this file.
1 
+
13 #ifndef _grib2_int_H
+
14 #define _grib2_int_H
+
15 
+
16 #include <stdio.h>
+
17 #include <stdint.h>
+
18 #include <assert.h>
+
19 #include "grib2.h"
+
20 
+
21 #define ALOG2 (0.69314718)
+
23 #define G2C_JASPER_JPEG_FORMAT_NAME "jpc"
+
28 struct gtemplate
+
29 {
+ +
35 
+ + +
40 
+ +
44 
+ +
47 
+ +
50 
+ +
54 };
+
55 
+
56 typedef struct gtemplate gtemplate;
+
58 /* Legacy support functions. */
+
59 double int_power(double x, g2int y);
+
60 void mkieee(float *a, g2int *rieee, g2int num);
+
61 void rdieee(g2int *rieee, float *a, g2int num);
+
62 
+
63 /* Get the various templates. */
+ +
65 gtemplate *extdrstemplate(g2int number, g2int *list);
+ +
67 gtemplate *extpdstemplate(g2int number, g2int *list);
+ +
69 gtemplate *extgridtemplate(g2int number, g2int *list);
+
70 
+
71 /* Packing and unpacking data. */
+
72 void simpack(float *fld, g2int ndpts, g2int *idrstmpl,
+
73  unsigned char *cpack, g2int *lcpack);
+
74 g2int simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts,
+
75  float *fld);
+
76 void compack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
+
77  unsigned char *cpack, g2int *lcpack);
+
78 int comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum,
+
79  g2int *idrstmpl, g2int ndpts, float *fld);
+
80 void misspack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
+
81  unsigned char *cpack, g2int *lcpack);
+
82 void cmplxpack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
+
83  unsigned char *cpack, g2int *lcpack);
+
84 g2int getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm);
+
85 void specpack(float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM,
+
86  g2int *idrstmpl, unsigned char *cpack, g2int *lcpack);
+
87 g2int specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ,
+
88  g2int KK, g2int MM, float *fld);
+
89 g2int getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan);
+
90 
+
91 int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits,
+
92  unsigned char *pngbuf);
+
93 int dec_png(unsigned char *pngbuf, g2int *width, g2int *height,
+
94  unsigned char *cout);
+
95 void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
+
96  unsigned char *cpack, g2int *lcpack);
+
97 g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
98  float *fld);
+
99 int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
+
100  g2int ltype, g2int ratio, g2int retry, char *outjpc,
+
101  g2int jpclen);
+
102 int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld);
+
103 void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
+
104  unsigned char *cpack, g2int *lcpack);
+
105 g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
106  float *fld);
+
107 
+
108 /* Packing and unpacking bits. */
+
109 void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits);
+
110 void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits);
+
111 void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits,
+
112  g2int nskip, g2int n);
+
113 void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits,
+
114  g2int nskip, g2int n);
+
115 
+
116 /* Deal with grib groups. */
+
117 int pack_gp(g2int *kfildo, g2int *ic, g2int *nxy,
+
118  g2int *is523, g2int *minpk, g2int *inc, g2int *missp, g2int *misss,
+
119  g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov,
+
120  g2int *ndg, g2int *lx, g2int *ibit, g2int *jbit, g2int *kbit,
+
121  g2int *novref, g2int *lbitref, g2int *ier);
+
122 
+
123 /* Check the message header and check for message termination. */
+
124 int g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose);
+
125 
+
126 /* Handle logging. */
+
127 #ifdef LOGGING
+
128 
+
129 /* To log something... */
+
130 void g2_log(int severity, const char *fmt, ...);
+
131 
+
133 #define LOG(e) g2_log e
+
134 
+
135 #else /* LOGGING */
+
136 
+
138 #define LOG(e)
+
139 
+
140 #endif /* LOGGING */
+
141 
+
142 #endif /* _grib2_int_H */
+
+
+
gtemplate * extpdstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Product Definition Template,...
Definition: pdstemplates.c:329
+
g2int * ext
Number of octets of each entry in the extension part of the template.
Definition: grib2_int.h:53
+
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 ...
Definition: comunpack.c:42
+
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 ...
Definition: gbits.c:114
+
gtemplate * getdrstemplate(g2int number)
This subroutine returns DRS template information for a specified Data Representation Template.
Definition: drstemplates.c:166
+
g2int type
The template type: 3 Grid Defintion Template.
Definition: grib2_int.h:34
+
gtemplate * extdrstemplate(g2int number, g2int *list)
This subroutine generates the remaining octet map for a given Data Representation Template,...
Definition: drstemplates.c:212
+
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
Decode PNG.
Definition: dec_png.c:61
+
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.
Definition: jpcpack.c:253
+
g2int needext
Indicates whether or not the template needs to be extended.
Definition: grib2_int.h:46
+
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 ...
Definition: gbits.c:38
+
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.
Definition: int_power.c:18
+
g2int maplen
Number of entries in the static part of the template.
Definition: grib2_int.h:39
+
int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
Encode PNG.
Definition: enc_png.c:75
+
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...
Definition: gbits.c:57
+
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...
Definition: jpcunpack.c:108
+
g2int * map
Number of octets of each entry in the static part of the template.
Definition: grib2_int.h:43
+
void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
Definition: mkieee.c:22
+
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...
Definition: compack.c:42
+
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 ...
Definition: pack_gp.c:255
+
gtemplate * getpdstemplate(g2int number)
This subroutine returns PDS template information for a specified Product Definition Template.
Definition: pdstemplates.c:281
+
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...
Definition: getdim.c:29
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
g2int num
The template number.
Definition: grib2_int.h:36
+
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...
Definition: specpack.c:33
+
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...
Definition: pngunpack.c:105
+
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...
Definition: simunpack.c:26
+
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...
Definition: gbits.c:20
+
g2int extlen
Number of entries in the template extension.
Definition: grib2_int.h:49
+
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...
Definition: simpack.c:34
+
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...
Definition: specunpack.c:35
+
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...
Definition: misspack.c:42
+
int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
Definition: dec_jpeg2000.c:38
+
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.
Definition: pngpack.c:224
+
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...
Definition: cmplxpack.c:36
+
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...
Definition: getpoly.c:40
+
Struct for GRIB template.
Definition: grib2_int.h:28
+
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...
Definition: util.c:26
+
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 ...
Definition: enc_jpeg2000.c:51
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
gridtemplates.c File Reference
+
+
+ +

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.

+ + + + + + + + +

+Macros

#define MAXGRIDMAPLEN   200
 Maximum template map length. More...
 
#define MAXGRIDTEMP   31
 Maximum number of templates. More...
 
+ + + + + + + + + + +

+Functions

gtemplateextgridtemplate (g2int number, g2int *list)
 This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More...
 
static g2int getgridindex (g2int number)
 This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml). More...
 
gtemplategetgridtemplate (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...
 
+ + + + +

+Variables

static const struct gridtemplate templatesgrid [MAXGRIDTEMP]
 Templates grid. More...
 
+

Detailed Description

+

Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).

+

Each Template has three parts:

    +
  1. The number of entries in the template (mapgridlen).
  2. +
  3. A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values.
  4. +
  5. A logical value (needext) that indicates whether the Template needs to be extended.
  6. +
+

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.

+

Macro Definition Documentation

+ +

◆ 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.

+ +
+
+

Function Documentation

+ +

◆ extgridtemplate()

+ +
+
+ + + + + + + + + + + + + + + + + + +
gtemplate* extgridtemplate (g2int number,
g2intlist 
)
+
+ +

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
+ + + +
numberThe number of the Grid Definition Template that is being requested.
listThe 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
+
+ +

This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml).

+
Parameters
+ + +
numberThe number of the Grid Definition Template being requested.
+
+
+
Returns
Index of the Grid Definition Template(GDT) in array templates, if template exists. -1, otherwise.
+
Author
Stephen Gilbert
+
Date
2001-06-28
+ +

Definition at line 142 of file gridtemplates.c.

+ +

References MAXGRIDTEMP, and templatesgrid.

+ +

Referenced by extgridtemplate(), and getgridtemplate().

+ +
+
+ +

◆ getgridtemplate()

+ +
+
+ + + + + + + + +
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).

+

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
+ + +
numberThe 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().

+ +
+
+

Variable Documentation

+ +

◆ templatesgrid

+ +
+
+ + + + + +
+ + + + +
const struct gridtemplate templatesgrid[MAXGRIDTEMP]
+
+static
+
+ +

Templates grid.

+ +

Definition at line 59 of file gridtemplates.c.

+ +

Referenced by getgridindex(), and getgridtemplate().

+ +
+
+
+
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gridtemplates.c
+
+
+Go to the documentation of this file.
1 
+
40 #include <stdlib.h>
+
41 #include "grib2_int.h"
+
42 #define MAXGRIDTEMP 31
+
43 #define MAXGRIDMAPLEN 200
+
48 struct gridtemplate
+
49 {
+
50  g2int template_num;
+
51  g2int mapgridlen;
+
52  g2int needext;
+
53  g2int mapgrid[MAXGRIDMAPLEN];
+
54 };
+
55 
+
59 static const struct gridtemplate templatesgrid[MAXGRIDTEMP] =
+
60 {
+
61  /* 3.0: Lat/Lon grid */
+
62  { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
63  /* 3.1: Rotated Lat/Lon grid */
+
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} },
+
65  /* 3.2: Stretched Lat/Lon grid */
+
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} },
+
67  /* 3.3: Stretched & Rotated Lat/Lon grid */
+
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} },
+
69  /* Added GDT 3.4,3.5 (08/05/2013) */
+
70  /* 3.4: Variable resolution Latitude/Longitude */
+
71  { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
+
72  /* 3.5: Variable resolution rotate Latitude/Longitude */
+
73  { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
+
74  /* 3.12: Transverse Mercator */
+
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} },
+
76  /* 3.101: General unstructured grid */
+
77  {101, 4, 0, {1,4,1,-4} },
+
78  /* 3.140: Lambert Azimuthal Equal Area Projection */
+
79  {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
+
80 
+
81  /* 3.10: Mercator */
+
82  {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+
83  /* 3.20: Polar Stereographic Projection */
+
84  {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+
85  /* 3.30: Lambert Conformal */
+
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} },
+
87  /* 3.31: Albers equal area */
+
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} },
+
89  /* 3.40: Guassian Lat/Lon */
+
90  {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
91  /* 3.41: Rotated Gaussian Lat/Lon */
+
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} },
+
93  /* 3.42: Stretched Gaussian Lat/Lon */
+
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} },
+
95  /* 3.43: Stretched and Rotated Gaussian Lat/Lon */
+
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} },
+
97  /* 3.50: Spherical Harmonic Coefficients */
+
98  {50, 5, 0, {4,4,4,1,1} },
+
99  /* 3.51: Rotated Spherical Harmonic Coefficients */
+
100  {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+
101  /* 3.52: Stretched Spherical Harmonic Coefficients */
+
102  {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+
103  /* 3.53: Stretched and Rotated Spherical Harmonic Coefficients */
+
104  {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+
105  /* 3.90: Space View Perspective or orthographic */
+
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} },
+
107  /* 3.100: Triangular grid based on an icosahedron */
+
108  {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+
109  /* 3.110: Equatorial Azimuthal equidistant */
+
110  {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+
111  /* 3.120: Azimuth-range projection */
+
112  {120, 7, 1, {4,4,-4,4,4,4,1} },
+
113  /* 3.204: Curvilinear Orthogonal Grid */
+
114  {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
115  /* 3.32768: Rot Lat/Lon E-grid (Arakawa) */
+
116  {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
117  /* 3.32769: Rot Lat/Lon Non-E Staggered grid (Arakawa) */
+
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} },
+
119  /* 3.1000: Cross Section Grid */
+
120  {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+
121  /* 3.1100: Hovmoller Diagram Grid */
+
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} },
+
123  /* 3.1200: Time Section Grid */
+
124  {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
125 } ;
+
126 
+
141 static g2int
+ +
143 {
+
144  g2int j, getgridindex = -1;
+
145 
+
146  for (j = 0; j < MAXGRIDTEMP; j++)
+
147  {
+
148  if (number == templatesgrid[j].template_num)
+
149  {
+
150  getgridindex = j;
+
151  return(getgridindex);
+
152  }
+
153  }
+
154 
+
155  return(getgridindex);
+
156 }
+
157 
+
179 gtemplate *
+ +
181 {
+
182  g2int index;
+
183  gtemplate *new;
+
184 
+
185  index = getgridindex(number);
+
186 
+
187  if (index != -1)
+
188  {
+
189  new = malloc(sizeof(gtemplate));
+
190  new->type = 3;
+
191  new->num = templatesgrid[index].template_num;
+
192  new->maplen = templatesgrid[index].mapgridlen;
+
193  new->needext = templatesgrid[index].needext;
+
194  new->map = (g2int *)templatesgrid[index].mapgrid;
+
195  new->extlen = 0;
+
196  new->ext = NULL;
+
197  return(new);
+
198  }
+
199  else
+
200  {
+
201  printf("getgridtemplate: GDT Template 3.%d not defined.\n", (int)number);
+
202  return(NULL);
+
203  }
+
204 
+
205  return(NULL);
+
206 }
+
207 
+
228 gtemplate *
+ +
230 {
+
231  gtemplate *new;
+
232  g2int index, i;
+
233 
+
234  index = getgridindex(number);
+
235  if (index == -1)
+
236  return(0);
+
237 
+
238  new = getgridtemplate(number);
+
239 
+
240  if (!new->needext)
+
241  return(new);
+
242 
+
243  if (number == 120)
+
244  {
+
245  new->extlen = list[1] * 2;
+
246  new->ext = malloc(sizeof(g2int) * new->extlen);
+
247  for (i = 0; i < new->extlen; i++)
+
248  {
+
249  if (i % 2 == 0)
+
250  new->ext[i] = 2;
+
251  else
+
252  new->ext[i] = -2;
+
253  }
+
254  }
+
255  else if (number == 4)
+
256  {
+
257  new->extlen = list[7];
+
258  new->ext = malloc(sizeof(g2int) * new->extlen);
+
259  for (i = 0; i < new->extlen; i++)
+
260  {
+
261  new->ext[i] = 4;
+
262  }
+
263  new->extlen = list[8];
+
264  new->ext = malloc(sizeof(g2int) * new->extlen);
+
265  for (i = 0; i < new->extlen; i++)
+
266  {
+
267  new->ext[i] = -4;
+
268  }
+
269  }
+
270  else if (number == 5)
+
271  {
+
272  new->extlen = list[7];
+
273  new->ext = malloc(sizeof(g2int) * new->extlen);
+
274  for (i = 0; i < new->extlen; i++)
+
275  {
+
276  new->ext[i] = 4;
+
277  }
+
278  new->extlen = list[8];
+
279  new->ext = malloc(sizeof(g2int) * new->extlen);
+
280  for (i = 0; i < new->extlen; i++)
+
281  {
+
282  new->ext[i] = -4;
+
283  }
+
284  }
+
285  else if (number == 1000)
+
286  {
+
287  new->extlen = list[19];
+
288  new->ext = malloc(sizeof(g2int) * new->extlen);
+
289  for (i = 0; i < new->extlen; i++)
+
290  {
+
291  new->ext[i] = 4;
+
292  }
+
293  }
+
294  else if (number == 1200)
+
295  {
+
296  new->extlen = list[15];
+
297  new->ext = malloc(sizeof(g2int) * new->extlen);
+
298  for (i = 0; i < new->extlen; i++)
+
299  {
+
300  new->ext[i] = 4;
+
301  }
+
302  }
+
303 
+
304  return(new);
+
305 }
+
+
+
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.
Definition: grib2_int.h:46
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
#define MAXGRIDMAPLEN
Maximum template map length.
Definition: gridtemplates.c:43
+
static const struct gridtemplate templatesgrid[MAXGRIDTEMP]
Templates grid.
Definition: gridtemplates.c:59
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define MAXGRIDTEMP
Maximum number of templates.
Definition: gridtemplates.c:42
+
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.
Definition: grib2_int.h:28
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
gridtemplates.h File Reference
+
+
+ +

This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS). +More...

+
#include "grib2.h"
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  gridtemplate
 Struct for grid template. More...
 
+ + + + + + + +

+Macros

#define MAXGRIDMAPLEN   200
 Maximum template map length. More...
 
#define MAXGRIDTEMP   31
 Maximum number of templates. More...
 
+ + + + +

+Variables

const struct gridtemplate templatesgrid [MAXGRIDTEMP]
 Templates grid. More...
 
+

Detailed Description

+

This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).

+

Each Template has three parts:

    +
  1. The number of entries in the template (mapgridlen).
  2. +
  3. A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values.
  4. +
  5. A logical value (needext) that indicates whether the Template needs to be extended.
  6. +
+

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.

+

Data Type Documentation

+ +

◆ 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.
+ +
+
+

Macro Definition Documentation

+ +

◆ 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.

+ +
+
+

Variable Documentation

+ +

◆ templatesgrid

+ +
+
+ + + + +
const struct gridtemplate templatesgrid[MAXGRIDTEMP]
+
+ +

Templates grid.

+ +

Definition at line 1 of file gridtemplates.h.

+ +

Referenced by getgridindex(), and getgridtemplate().

+ +
+
+
+
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gridtemplates.h
+
+
+Go to the documentation of this file.
1 
+
39 #ifndef _gridtemplates_H
+
40 #define _gridtemplates_H
+
41 #include "grib2.h"
+
42 
+
43 #define MAXGRIDTEMP 31
+
44 #define MAXGRIDMAPLEN 200
+ +
50 {
+ + + + +
55 };
+
56 
+ +
61 {
+
62  /* 3.0: Lat/Lon grid */
+
63  { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
64  /* 3.1: Rotated Lat/Lon grid */
+
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} },
+
66  /* 3.2: Stretched Lat/Lon grid */
+
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} },
+
68  /* 3.3: Stretched & Rotated Lat/Lon grid */
+
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} },
+
70  /* Added GDT 3.4,3.5 (08/05/2013) */
+
71  /* 3.4: Variable resolution Latitude/Longitude */
+
72  { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
+
73  /* 3.5: Variable resolution rotate Latitude/Longitude */
+
74  { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
+
75  /* 3.12: Transverse Mercator */
+
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} },
+
77  /* 3.101: General unstructured grid */
+
78  {101, 4, 0, {1,4,1,-4} },
+
79  /* 3.140: Lambert Azimuthal Equal Area Projection */
+
80  {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
+
81 
+
82  /* 3.10: Mercator */
+
83  {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+
84  /* 3.20: Polar Stereographic Projection */
+
85  {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+
86  /* 3.30: Lambert Conformal */
+
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} },
+
88  /* 3.31: Albers equal area */
+
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} },
+
90  /* 3.40: Guassian Lat/Lon */
+
91  {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
92  /* 3.41: Rotated Gaussian Lat/Lon */
+
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} },
+
94  /* 3.42: Stretched Gaussian Lat/Lon */
+
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} },
+
96  /* 3.43: Stretched and Rotated Gaussian Lat/Lon */
+
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} },
+
98  /* 3.50: Spherical Harmonic Coefficients */
+
99  {50, 5, 0, {4,4,4,1,1} },
+
100  /* 3.51: Rotated Spherical Harmonic Coefficients */
+
101  {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+
102  /* 3.52: Stretched Spherical Harmonic Coefficients */
+
103  {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+
104  /* 3.53: Stretched and Rotated Spherical Harmonic Coefficients */
+
105  {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+
106  /* 3.90: Space View Perspective or orthographic */
+
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} },
+
108  /* 3.100: Triangular grid based on an icosahedron */
+
109  {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+
110  /* 3.110: Equatorial Azimuthal equidistant */
+
111  {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+
112  /* 3.120: Azimuth-range projection */
+
113  {120, 7, 1, {4,4,-4,4,4,4,1} },
+
114  /* 3.204: Curvilinear Orthogonal Grid */
+
115  {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
116  /* 3.32768: Rot Lat/Lon E-grid (Arakawa) */
+
117  {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+
118  /* 3.32769: Rot Lat/Lon Non-E Staggered grid (Arakawa) */
+
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} },
+
120  /* 3.1000: Cross Section Grid */
+
121  {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+
122  /* 3.1100: Hovmoller Diagram Grid */
+
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} },
+
124  /* 3.1200: Time Section Grid */
+
125  {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
126 } ;
+
127 
+
128 #endif /* _gridtemplates_H */
+
Header file for NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:20
+
g2int template_num
Template number.
Definition: gridtemplates.h:51
+
#define MAXGRIDTEMP
Maximum number of templates.
Definition: gridtemplates.h:43
+
g2int needext
Does template need extension?
Definition: gridtemplates.h:53
+
g2int mapgridlen
The number of entries in the template.
Definition: gridtemplates.h:52
+
#define MAXGRIDMAPLEN
Maximum template map length.
Definition: gridtemplates.h:44
+
g2int mapgrid[MAXGRIDMAPLEN]
Number of bytes for each template value.
Definition: gridtemplates.h:54
+
const struct gridtemplate templatesgrid[MAXGRIDTEMP]
Templates grid.
Definition: gridtemplates.h:60
+
Struct for grid template.
Definition: gridtemplates.h:50
+
+
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
NCEPLIBS-g2c Documentation
+
+
+

+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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
int_power.c File Reference
+
+
+ +

Provide function similar to C pow() power function. +More...

+
#include "grib2_int.h"
+
+

Go to the source code of this file.

+ + + + + +

+Functions

double int_power (double x, g2int y)
 Function similar to C pow() power function. More...
 
+

Detailed Description

+

Provide function similar to C pow() power function.

+
Author
Wesley Ebisuzaki
+ +

Definition in file int_power.c.

+

Function Documentation

+ +

◆ int_power()

+ +
+
+ + + + + + + + + + + + + + + + + + +
double int_power (double x,
g2int y 
)
+
+ +

Function similar to C pow() power function.

+
Parameters
+ + + +
xThe base value whose power is to be calculated.
yThe 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
int_power.c
+
+
+Go to the documentation of this file.
1 
+
5 #include "grib2_int.h"
+
6 
+
17 double
+
18 int_power(double x, g2int y)
+
19 {
+
20  double value;
+
21 
+
22  if (y < 0)
+
23  {
+
24  y = -y;
+
25  x = 1.0 / x;
+
26  }
+
27  value = 1.0;
+
28 
+
29  while (y)
+
30  {
+
31  if (y & 1)
+
32  {
+
33  value *= x;
+
34  }
+
35  x = x * x;
+
36  y >>= 1;
+
37  }
+
38  return value;
+
39 }
+
+
+
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition: int_power.c:18
+
Header file with internal function prototypes NCEPLIBS-g2c library.
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
jpcpack.c File Reference
+
+
+ +

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.

+ + + + + + + + + + + +

+Functions

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...
 
+

Detailed Description

+

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.

+

Function Documentation

+ +

◆ jpcpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void jpcpack (float * fld,
g2int width,
g2int height,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to the float or double data values to pack.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+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
+ + + + + + + + +
fldPointer to the float or double data values to pack.
fld_is_doubleIf non-zero, then fld points to array of doubles, otherwise an array of floats.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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,
g2intidrstmpl,
unsigned char * cpack,
g2intlcpack 
)
+
+ +

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
+ + + + + + + +
fldPointer to the float or double data values to pack.
widthThe number of points in the x direction.
heightThe number of points in the y direction.
idrstmplContains 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.
  • +
+
cpackA pointer that will get the packed data field. Must be allocated before this function is called. Pass the allocated size in the lcpack parameter.
lcpackPointer 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
jpcpack.c
+
+
+Go to the documentation of this file.
1 
+
14 #include <stdlib.h>
+
15 #include <math.h>
+
16 #include "grib2_int.h"
+
17 
+
56 static void
+
57 jpcpack_int(void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl,
+
58  unsigned char *cpack, g2int *lcpack)
+
59 {
+
60  g2int *ifld = NULL;
+
61  static float alog2 = ALOG2; /* ln(2.0) */
+
62  g2int j, nbits, imin, imax, maxdif;
+
63  g2int ndpts, nbytes, nsize, retry;
+
64  float bscale, dscale, rmax, rmin, temp;
+
65  double rmaxd, rmind;
+
66  unsigned char *ctemp;
+
67  float *ffld = fld;
+
68  double *dfld = fld;
+
69 
+
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));
+
72 
+
73  ndpts = width * height;
+
74  bscale = int_power(2.0, -idrstmpl[1]);
+
75  dscale = int_power(10.0, idrstmpl[2]);
+
76  LOG((3, "ndpts %ld bscale %g dscale %g", ndpts, bscale, dscale));
+
77 
+
78  /* Find max and min values in the data. */
+
79  rmaxd = dfld[0];
+
80  rmind = dfld[0];
+
81  rmax = ffld[0];
+
82  rmin = ffld[0];
+
83  if (fld_is_double)
+
84  {
+
85  for (j = 1; j < ndpts; j++)
+
86  {
+
87  if (dfld[j] > rmaxd)
+
88  rmaxd = dfld[j];
+
89  if (dfld[j] < rmind)
+
90  rmind = dfld[j];
+
91  }
+
92  if (idrstmpl[1] == 0)
+
93  maxdif = (g2int)(rint(rmaxd * dscale) - rint(rmind * dscale));
+
94  else
+
95  maxdif = (g2int)rint((rmaxd - rmind) * dscale * bscale);
+
96  }
+
97  else
+
98  {
+
99  for (j = 1; j < ndpts; j++)
+
100  {
+
101  if (ffld[j] > rmax)
+
102  rmax = ffld[j];
+
103  if (ffld[j] < rmin)
+
104  rmin = ffld[j];
+
105  }
+
106  if (idrstmpl[1] == 0)
+
107  maxdif = (g2int)(rint(rmax * dscale) - rint(rmin * dscale));
+
108  else
+
109  maxdif = (g2int)rint((rmax - rmin) * dscale * bscale);
+
110  }
+
111  LOG((3, "rmax %g rmaxd %g rmin %g rmind %g", rmax, rmaxd, rmin, rmind));
+
112 
+
113  /* If max and min values are not equal, pack up field. If they are
+
114  * equal, we have a constant field, and the reference value (rmin)
+
115  * is the value for each point in the field and set nbits to 0. */
+
116  if (((fld_is_double && rmind != rmaxd) || (!fld_is_double && rmin != rmax)) && maxdif != 0)
+
117  {
+
118  ifld = malloc(ndpts * sizeof(g2int));
+
119 
+
120  /* Determine which algorithm to use based on user-supplied
+
121  * binary scale factor and number of bits. */
+
122  if (idrstmpl[1] == 0)
+
123  {
+
124  /* No binary scaling and calculate minumum number of bits
+
125  * in which the data will fit. */
+
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);
+
131  /* scale data */
+
132  if (fld_is_double)
+
133  {
+
134  rmind = (float)imin;
+
135  for(j = 0; j < ndpts; j++)
+
136  ifld[j] = (g2int)rint(dfld[j] * dscale) - imin;
+
137  }
+
138  else
+
139  {
+
140  rmin = (float)imin;
+
141  for(j = 0; j < ndpts; j++)
+
142  ifld[j] = (g2int)rint(ffld[j] * dscale) - imin;
+
143  }
+
144  }
+
145  else
+
146  {
+
147  /* Use binary scaling factor and calculate minumum number
+
148  * of bits in which the data will fit. */
+
149  if (fld_is_double)
+
150  {
+
151  rmind = rmind * dscale;
+
152  rmaxd = rmaxd * dscale;
+
153  maxdif = (g2int)rint((rmaxd - rmind) * bscale);
+
154  }
+
155  else
+
156  {
+
157  rmin = rmin * dscale;
+
158  rmax = rmax * dscale;
+
159  maxdif = (g2int)rint((rmax - rmin) * bscale);
+
160  }
+
161 
+
162  temp = log((double)(maxdif + 1)) / alog2;
+
163  nbits = (g2int)ceil(temp);
+
164  /* scale data */
+
165  if (fld_is_double)
+
166  {
+
167  for (j = 0; j < ndpts; j++)
+
168  ifld[j] = (g2int)rint(((dfld[j] * dscale) - rmind) * bscale);
+
169  }
+
170  else
+
171  {
+
172  for (j = 0; j < ndpts; j++)
+
173  ifld[j] = (g2int)rint(((ffld[j] * dscale) - rmin) * bscale);
+
174  }
+
175  }
+
176 
+
177  /* Pack data into full octets, then do JPEG 2000 encode and
+
178  * calculate the length of the packed data in bytes. */
+
179  retry = 0;
+
180  nbytes = (nbits + 7) / 8;
+
181  nsize = *lcpack; /* needed for input to enc_jpeg2000 */
+
182  ctemp = calloc(ndpts, nbytes);
+
183  sbits(ctemp, ifld, 0, nbytes * 8, 0, ndpts);
+
184  if ((*lcpack = (g2int)enc_jpeg2000(ctemp, width, height, nbits, idrstmpl[5],
+
185  idrstmpl[6], retry, (char *)cpack, nsize)) <= 0)
+
186  {
+
187  printf("jpcpack: ERROR Packing JPC = %d\n", (int)*lcpack);
+
188  if (*lcpack == -3)
+
189  {
+
190  retry = 1;
+
191  if ((*lcpack = (g2int)enc_jpeg2000(ctemp, width, height, nbits, idrstmpl[5],
+
192  idrstmpl[6], retry, (char *)cpack, nsize)) <= 0)
+
193  printf("jpcpack: Retry Failed.\n");
+
194  else
+
195  printf("jpcpack: Retry Successful.\n");
+
196  }
+
197  }
+
198  free(ctemp);
+
199  }
+
200  else
+
201  {
+
202  nbits = 0;
+
203  *lcpack = 0;
+
204  }
+
205 
+
206  /* Fill in ref value and number of bits in Template 5.0. */
+
207  if (fld_is_double)
+
208  rmin = (float)rmind;
+
209  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format. */
+
210  idrstmpl[3] = nbits;
+
211  idrstmpl[4] = 0; /* original data were reals */
+
212  if (idrstmpl[5] == 0)
+
213  idrstmpl[6] = 255; /* lossy not used */
+
214  if (ifld)
+
215  free(ifld);
+
216 }
+
217 
+
252 void
+
253 jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
+
254  unsigned char *cpack, g2int *lcpack)
+
255 {
+
256  jpcpack_int(fld, 0, width, height, idrstmpl, cpack, lcpack);
+
257 }
+
258 
+
293 void
+
294 jpcpackd(double *fld, g2int width, g2int height, g2int *idrstmpl,
+
295  unsigned char *cpack, g2int *lcpack)
+
296 {
+
297  jpcpack_int(fld, 1, width, height, idrstmpl, cpack, lcpack);
+
298 }
+
+
+
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.
Definition: jpcpack.c:57
+
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition: int_power.c:18
+
#define LOG(e)
Ignore logging to stdout.
Definition: grib2_int.h:138
+
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 ...
Definition: gbits.c:114
+
void mkieee(float *a, g2int *rieee, g2int num)
This subroutine stores a list of real values in 32-bit IEEE floating point format.
Definition: mkieee.c:22
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
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 ...
Definition: enc_jpeg2000.c:51
+
#define ALOG2
ln(2.0)
Definition: grib2_int.h:21
+
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.
Definition: jpcpack.c:294
+
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.
Definition: jpcpack.c:253
+ + + + 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
jpcunpack.c File Reference
+
+
+ +

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.

+ + + + + + + + + + + +

+Functions

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...
 
+

Detailed Description

+

Unpack a data field that was packed into a JPEG2000 code stream.

+
Author
Stephem Gilbert
+
Date
2003-08-27
+ +

Definition in file jpcunpack.c.

+

Function Documentation

+ +

◆ jpcunpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g2int jpcunpack (unsigned char * cpack,
g2int len,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA 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,
g2intidrstmpl,
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
+ + + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA pointer that gets the unpacked data values.
fld_is_doubleNon-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,
g2intidrstmpl,
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
+ + + + + + +
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA 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 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
jpcunpack.c
+
+
+Go to the documentation of this file.
1 
+
6 #include <stdio.h>
+
7 #include <stdlib.h>
+
8 #include "grib2_int.h"
+
9 
+
32 static g2int
+
33 jpcunpack_int(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
34  void *fld, int fld_is_double)
+
35 {
+
36  g2int *ifld;
+
37  g2int j, nbits;
+
38  float ref, bscale, dscale;
+
39  float *ffld = fld;
+
40  double *dfld = fld;
+
41 
+
42  rdieee(idrstmpl, &ref, 1);
+
43  bscale = int_power(2.0, idrstmpl[1]);
+
44  dscale = int_power(10.0, -idrstmpl[2]);
+
45  nbits = idrstmpl[3];
+
46 
+
47  /* If nbits equals 0, we have a constant field where the reference
+
48  * value is the data value at each gridpoint. */
+
49  if (nbits != 0)
+
50  {
+
51  if (!(ifld = calloc(ndpts, sizeof(g2int))))
+
52  {
+
53  fprintf(stderr, "Could not allocate space in jpcunpack.\n Data field NOT upacked.\n");
+
54  return G2_JPCUNPACK_MEM;
+
55  }
+
56  dec_jpeg2000((char *)cpack, len, ifld);
+
57  if (fld_is_double)
+
58  {
+
59  for (j = 0; j < ndpts; j++)
+
60  dfld[j] = (((float)ifld[j] * bscale) + ref) * dscale;
+
61  }
+
62  else
+
63  {
+
64  for (j = 0; j < ndpts; j++)
+
65  ffld[j] = (((float)ifld[j] * bscale) + ref) * dscale;
+
66  }
+
67  free(ifld);
+
68  }
+
69  else
+
70  {
+
71  if (fld_is_double)
+
72  {
+
73  for (j = 0; j < ndpts; j++)
+
74  dfld[j] = ref;
+
75  }
+
76  else
+
77  {
+
78  for (j = 0; j < ndpts; j++)
+
79  ffld[j] = ref;
+
80  }
+
81  }
+
82 
+
83  return G2_NO_ERROR;
+
84 }
+
85 
+
107 g2int
+
108 jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
109  float *fld)
+
110 {
+
111  return jpcunpack_int(cpack, len, idrstmpl, ndpts, fld, 0);
+
112 }
+
113 
+
134 g2int
+
135 jpcunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
+
136  double *fld)
+
137 {
+
138  return jpcunpack_int(cpack, len, idrstmpl, ndpts, fld, 1);
+
139 }
+
+
+
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...
Definition: jpcunpack.c:33
+
#define G2_NO_ERROR
Function succeeded.
Definition: grib2.h:275
+
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Definition: rdieee.c:21
+
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition: int_power.c:18
+
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...
Definition: jpcunpack.c:135
+
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....
Definition: dec_jpeg2000.c:38
+
int64_t g2int
Long integer type.
Definition: grib2.h:28
+
#define G2_JPCUNPACK_MEM
In jpcunpack() or other unpack function: out of memory.
Definition: grib2.h:320
+
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...
Definition: jpcunpack.c:108
+ + + + 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=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element +},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/ver-1.7.0/menu.js b/ver-1.7.0/menu.js new file mode 100644 index 00000000..433c15b8 --- /dev/null +++ b/ver-1.7.0/menu.js @@ -0,0 +1,50 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+=''; + } + return result; + } + + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchEnabled) { + if (serverSide) { + $('#main-menu').append('
  • '); + } else { + $('#main-menu').append('
  • '); + } + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/ver-1.7.0/menudata.js b/ver-1.7.0/menudata.js new file mode 100644 index 00000000..4bcf50e2 --- /dev/null +++ b/ver-1.7.0/menudata.js @@ -0,0 +1,97 @@ +/* +@licstart The following is the entire license notice for the +JavaScript code in this file. + +Copyright (C) 1997-2019 by Dimitri van Heesch + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as published by +the Free Software Foundation + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +@licend The above is the entire license notice +for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Data Types List",url:"annotated.html",children:[ +{text:"Data Types List",url:"annotated.html"}, +{text:"Data Fields",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"b",url:"functions.html#index_b"}, +{text:"c",url:"functions.html#index_c"}, +{text:"d",url:"functions.html#index_d"}, +{text:"e",url:"functions.html#index_e"}, +{text:"f",url:"functions.html#index_f"}, +{text:"g",url:"functions.html#index_g"}, +{text:"i",url:"functions.html#index_i"}, +{text:"l",url:"functions.html#index_l"}, +{text:"m",url:"functions.html#index_m"}, +{text:"n",url:"functions.html#index_n"}, +{text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}, +{text:"v",url:"functions.html#index_v"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"b",url:"functions_vars.html#index_b"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"d",url:"functions_vars.html#index_d"}, +{text:"e",url:"functions_vars.html#index_e"}, +{text:"f",url:"functions_vars.html#index_f"}, +{text:"g",url:"functions_vars.html#index_g"}, +{text:"i",url:"functions_vars.html#index_i"}, +{text:"l",url:"functions_vars.html#index_l"}, +{text:"m",url:"functions_vars.html#index_m"}, +{text:"n",url:"functions_vars.html#index_n"}, +{text:"t",url:"functions_vars.html#index_t"}, +{text:"u",url:"functions_vars.html#index_u"}, +{text:"v",url:"functions_vars.html#index_v"}]}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"Globals",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"a",url:"globals.html#index_a"}, +{text:"b",url:"globals_b.html#index_b"}, +{text:"c",url:"globals_c.html#index_c"}, +{text:"d",url:"globals_d.html#index_d"}, +{text:"e",url:"globals_e.html#index_e"}, +{text:"f",url:"globals_f.html#index_f"}, +{text:"g",url:"globals_g.html#index_g"}, +{text:"i",url:"globals_i.html#index_i"}, +{text:"j",url:"globals_j.html#index_j"}, +{text:"l",url:"globals_l.html#index_l"}, +{text:"m",url:"globals_m.html#index_m"}, +{text:"p",url:"globals_p.html#index_p"}, +{text:"r",url:"globals_r.html#index_r"}, +{text:"s",url:"globals_s.html#index_s"}, +{text:"t",url:"globals_t.html#index_t"}, +{text:"u",url:"globals_u.html#index_u"}]}, +{text:"Functions/Subroutines",url:"globals_func.html",children:[ +{text:"c",url:"globals_func.html#index_c"}, +{text:"d",url:"globals_func.html#index_d"}, +{text:"e",url:"globals_func.html#index_e"}, +{text:"g",url:"globals_func.html#index_g"}, +{text:"i",url:"globals_func.html#index_i"}, +{text:"j",url:"globals_func.html#index_j"}, +{text:"m",url:"globals_func.html#index_m"}, +{text:"p",url:"globals_func.html#index_p"}, +{text:"r",url:"globals_func.html#index_r"}, +{text:"s",url:"globals_func.html#index_s"}, +{text:"u",url:"globals_func.html#index_u"}]}, +{text:"Variables",url:"globals_vars.html"}, +{text:"Typedefs",url:"globals_type.html"}, +{text:"Macros",url:"globals_defs.html",children:[ +{text:"a",url:"globals_defs.html#index_a"}, +{text:"b",url:"globals_defs.html#index_b"}, +{text:"f",url:"globals_defs.html#index_f"}, +{text:"g",url:"globals_defs.html#index_g"}, +{text:"l",url:"globals_defs.html#index_l"}, +{text:"m",url:"globals_defs.html#index_m"}, +{text:"t",url:"globals_defs.html#index_t"}]}]}]}]} diff --git a/ver-1.7.0/misspack_8c.html b/ver-1.7.0/misspack_8c.html new file mode 100644 index 00000000..7d2f4650 --- /dev/null +++ b/ver-1.7.0/misspack_8c.html @@ -0,0 +1,209 @@ + + + + + + + +NCEPLIBS-g2c: misspack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    misspack.c File Reference
    +
    +
    + +

    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.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ misspack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void misspack (float * fld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldContains the data values to pack
    ndptsThe number of data values in array fld
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplContains 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).
    • +
    +
    cpackThe packed data field (character*1 array).
    lcpacklength 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/misspack_8c.js b/ver-1.7.0/misspack_8c.js new file mode 100644 index 00000000..c8e8244c --- /dev/null +++ b/ver-1.7.0/misspack_8c.js @@ -0,0 +1,4 @@ +var misspack_8c = +[ + [ "misspack", "misspack_8c.html#aaa78613e8bf42b3dbd6d3813371bc339", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/misspack_8c_source.html b/ver-1.7.0/misspack_8c_source.html new file mode 100644 index 00000000..be0ae839 --- /dev/null +++ b/ver-1.7.0/misspack_8c_source.html @@ -0,0 +1,626 @@ + + + + + + + +NCEPLIBS-g2c: misspack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    misspack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdlib.h>
    +
    8 #include <math.h>
    +
    9 #include "grib2_int.h"
    +
    10 
    +
    41 void
    +
    42 misspack(float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
    +
    43  unsigned char *cpack, g2int *lcpack)
    +
    44 {
    +
    45  g2int *ifld, *ifldmiss, *jfld;
    +
    46  g2int *jmin, *jmax, *lbit;
    +
    47  static g2int zero = 0;
    +
    48  g2int *gref, *gwidth, *glen;
    +
    49  g2int glength, grpwidth;
    +
    50  g2int i, n, iofst, imin, ival1, ival2, isd, minsd, nbitsd = 0;
    +
    51  g2int nbitsgref, left, iwmax, ngwidthref, nbitsgwidth, ilmax;
    +
    52  g2int nglenref, nglenlast, nbitsglen;
    +
    53  g2int j, missopt, nonmiss, itemp, maxorig, nbitorig, miss1, miss2;
    +
    54  g2int ngroups, ng, num0, num1, num2;
    +
    55  g2int imax, lg, mtemp, ier, igmax;
    +
    56  g2int kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
    +
    57  float rmissp, rmisss, bscale, dscale, rmin, temp;
    +
    58  static float alog2 = ALOG2; /* ln(2.0) */
    +
    59  static g2int one = 1;
    +
    60 
    +
    61  bscale = int_power(2.0, -idrstmpl[1]);
    +
    62  dscale = int_power(10.0, idrstmpl[2]);
    +
    63  missopt = idrstmpl[6];
    +
    64  if (missopt != 1 && missopt != 2)
    +
    65  {
    +
    66  printf("misspack: Unrecognized option.\n");
    +
    67  *lcpack = -1;
    +
    68  return;
    +
    69  }
    +
    70  else
    +
    71  { /* Get missing values */
    +
    72  rdieee(idrstmpl + 7, &rmissp, 1);
    +
    73  if (missopt == 2)
    +
    74  rdieee(idrstmpl + 8, &rmisss, 1);
    +
    75  }
    +
    76 
    +
    77  /* Find min value of non-missing values in the data, AND set up
    +
    78  * missing value mapping of the field. */
    +
    79  ifldmiss = calloc(ndpts, sizeof(g2int));
    +
    80  rmin = 1E+37;
    +
    81  if (missopt == 1)
    +
    82  { /* Primary missing value only */
    +
    83  for (j = 0; j < ndpts; j++)
    +
    84  {
    +
    85  if (fld[j] == rmissp)
    +
    86  {
    +
    87  ifldmiss[j] = 1;
    +
    88  }
    +
    89  else
    +
    90  {
    +
    91  ifldmiss[j] = 0;
    +
    92  if (fld[j] < rmin)
    +
    93  rmin = fld[j];
    +
    94  }
    +
    95  }
    +
    96  }
    +
    97  if (missopt == 2)
    +
    98  { /* Primary and secondary missing values */
    +
    99  for (j = 0; j < ndpts; j++)
    +
    100  {
    +
    101  if (fld[j] == rmissp)
    +
    102  {
    +
    103  ifldmiss[j] = 1;
    +
    104  }
    +
    105  else if (fld[j] == rmisss)
    +
    106  {
    +
    107  ifldmiss[j] = 2;
    +
    108  }
    +
    109  else
    +
    110  {
    +
    111  ifldmiss[j] = 0;
    +
    112  if (fld[j] < rmin)
    +
    113  rmin = fld[j];
    +
    114  }
    +
    115  }
    +
    116  }
    +
    117 
    +
    118  /* Allocate work arrays: Note: -ifldmiss[j],j = 0,ndpts-1 is a map
    +
    119  * of original field indicating which of the original data values
    +
    120  * are primary missing (1), sencondary missing (2) or non-missing
    +
    121  * (0). -jfld[j],j = 0,nonmiss-1 is a subarray of just the
    +
    122  * non-missing values from the original field. */
    +
    123  iofst = 0;
    +
    124  ifld = calloc(ndpts, sizeof(g2int));
    +
    125  jfld = calloc(ndpts, sizeof(g2int));
    +
    126  gref = calloc(ndpts, sizeof(g2int));
    +
    127  gwidth = calloc(ndpts, sizeof(g2int));
    +
    128  glen = calloc(ndpts, sizeof(g2int));
    +
    129 
    +
    130  /* Scale original data. */
    +
    131  nonmiss = 0;
    +
    132  if (idrstmpl[1] == 0)
    +
    133  { /* No binary scaling */
    +
    134  imin = (g2int)rint(rmin * dscale);
    +
    135  rmin = (float)imin;
    +
    136  for (j = 0; j < ndpts; j++)
    +
    137  {
    +
    138  if (ifldmiss[j] == 0)
    +
    139  {
    +
    140  jfld[nonmiss] = (g2int)rint(fld[j] * dscale) - imin;
    +
    141  nonmiss++;
    +
    142  }
    +
    143  }
    +
    144  }
    +
    145  else
    +
    146  { /* Use binary scaling factor */
    +
    147  rmin = rmin * dscale;
    +
    148  for (j = 0; j < ndpts; j++)
    +
    149  {
    +
    150  if (ifldmiss[j] == 0)
    +
    151  {
    +
    152  jfld[nonmiss] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    153  nonmiss++;
    +
    154  }
    +
    155  }
    +
    156  }
    +
    157 
    +
    158  /* Calculate Spatial differences, if using DRS Template 5.3. */
    +
    159  if (idrsnum == 3)
    +
    160  { /* spatial differences */
    +
    161  if (idrstmpl[16] != 1 && idrstmpl[16] != 2)
    +
    162  idrstmpl[16] = 2;
    +
    163  if (idrstmpl[16] == 1)
    +
    164  { /* first order */
    +
    165  ival1 = jfld[0];
    +
    166  for (j = nonmiss - 1; j > 0; j--)
    +
    167  jfld[j] = jfld[j] - jfld[j - 1];
    +
    168  jfld[0] = 0;
    +
    169  }
    +
    170  else if (idrstmpl[16] == 2)
    +
    171  { /* second order */
    +
    172  ival1 = jfld[0];
    +
    173  ival2 = jfld[1];
    +
    174  for (j = nonmiss - 1; j > 1; j--)
    +
    175  jfld[j] = jfld[j] - (2 * jfld[j - 1]) + jfld[j - 2];
    +
    176  jfld[0] = 0;
    +
    177  jfld[1] = 0;
    +
    178  }
    +
    179 
    +
    180  /* Subtract min value from spatial diff field. */
    +
    181  isd = idrstmpl[16];
    +
    182  minsd = jfld[isd];
    +
    183  for (j = isd; j < nonmiss; j++)
    +
    184  if (jfld[j] < minsd)
    +
    185  minsd = jfld[j];
    +
    186  for (j = isd; j < nonmiss; j++)
    +
    187  jfld[j] = jfld[j] - minsd;
    +
    188 
    +
    189  /* Find num of bits need to store minsd and add 1 extra bit to
    +
    190  * indicate sign. */
    +
    191  temp = log((double)(abs(minsd) + 1)) / alog2;
    +
    192  nbitsd = (g2int)ceil(temp) + 1;
    +
    193 
    +
    194  /* Find num of bits need to store ifld[0] (and ifld[1] if
    +
    195  * using 2nd order differencing). */
    +
    196  maxorig = ival1;
    +
    197  if (idrstmpl[16] == 2 && ival2 > ival1)
    +
    198  maxorig = ival2;
    +
    199  temp = log((double)(maxorig + 1)) / alog2;
    +
    200  nbitorig = (g2int)ceil(temp) + 1;
    +
    201  if (nbitorig > nbitsd)
    +
    202  nbitsd = nbitorig;
    +
    203 
    +
    204  /* increase number of bits to even multiple of 8 (octet) */
    +
    205  if (nbitsd % 8)
    +
    206  nbitsd = nbitsd + (8 - (nbitsd % 8));
    +
    207 
    +
    208  /* Store extra spatial differencing info into the packed data
    +
    209  * section. */
    +
    210  if (nbitsd != 0)
    +
    211  {
    +
    212  /* pack first original value */
    +
    213  if (ival1 >= 0) {
    +
    214  sbit(cpack, &ival1, iofst, nbitsd);
    +
    215  iofst = iofst + nbitsd;
    +
    216  }
    +
    217  else
    +
    218  {
    +
    219  sbit(cpack, &one, iofst, 1);
    +
    220  iofst = iofst + 1;
    +
    221  itemp = abs(ival1);
    +
    222  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    223  iofst = iofst + nbitsd - 1;
    +
    224  }
    +
    225  if (idrstmpl[16] == 2)
    +
    226  {
    +
    227  /* pack second original value */
    +
    228  if (ival2 >= 0)
    +
    229  {
    +
    230  sbit(cpack, &ival2, iofst, nbitsd);
    +
    231  iofst = iofst + nbitsd;
    +
    232  }
    +
    233  else
    +
    234  {
    +
    235  sbit(cpack, &one, iofst, 1);
    +
    236  iofst = iofst + 1;
    +
    237  itemp = abs(ival2);
    +
    238  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    239  iofst = iofst + nbitsd - 1;
    +
    240  }
    +
    241  }
    +
    242  /* pack overall min of spatial differences */
    +
    243  if (minsd >= 0)
    +
    244  {
    +
    245  sbit(cpack, &minsd, iofst, nbitsd);
    +
    246  iofst = iofst + nbitsd;
    +
    247  }
    +
    248  else
    +
    249  {
    +
    250  sbit(cpack, &one, iofst, 1);
    +
    251  iofst = iofst + 1;
    +
    252  itemp = abs(minsd);
    +
    253  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    254  iofst = iofst + nbitsd - 1;
    +
    255  }
    +
    256  }
    +
    257  } /* end of spatial diff section */
    +
    258 
    +
    259  /* Expand non-missing data values to original grid. */
    +
    260  miss1 = jfld[0];
    +
    261  for (j = 0; j < nonmiss; j++)
    +
    262  if (jfld[j] < miss1)
    +
    263  miss1 = jfld[j];
    +
    264  miss1--;
    +
    265  miss2 = miss1-1;
    +
    266  n = 0;
    +
    267  for (j = 0; j < ndpts; j++)
    +
    268  {
    +
    269  if (ifldmiss[j] == 0)
    +
    270  {
    +
    271  ifld[j] = jfld[n];
    +
    272  n++;
    +
    273  }
    +
    274  else if (ifldmiss[j] == 1)
    +
    275  {
    +
    276  ifld[j] = miss1;
    +
    277  }
    +
    278  else if (ifldmiss[j] == 2)
    +
    279  {
    +
    280  ifld[j] = miss2;
    +
    281  }
    +
    282  }
    +
    283 
    +
    284  /* Determine Groups to be used. Use Dr. Glahn's algorithm for
    +
    285  * determining grouping. */
    +
    286  kfildo = 6;
    +
    287  minpk = 10;
    +
    288  inc = 1;
    +
    289  maxgrps = (ndpts / minpk) + 1;
    +
    290  jmin = calloc(maxgrps, sizeof(g2int));
    +
    291  jmax = calloc(maxgrps, sizeof(g2int));
    +
    292  lbit = calloc(maxgrps, sizeof(g2int));
    +
    293  pack_gp(&kfildo, ifld, &ndpts, &missopt, &minpk, &inc, &miss1, &miss2,
    +
    294  jmin, jmax, lbit, glen, &maxgrps, &ngroups, &ibit, &jbit,
    +
    295  &kbit, &novref, &lbitref, &ier);
    +
    296  for (ng = 0; ng < ngroups; ng++)
    +
    297  glen[ng] = glen[ng] + novref;
    +
    298  free(jmin);
    +
    299  free(jmax);
    +
    300  free(lbit);
    +
    301 
    +
    302  /* For each group, find the group's reference value (min) and the
    +
    303  * number of bits needed to hold the remaining values. */
    +
    304  n = 0;
    +
    305  for (ng = 0; ng < ngroups; ng++)
    +
    306  {
    +
    307  /* how many of each type? */
    +
    308  num0 = num1 = num2 = 0;
    +
    309  for (j = n; j < n + glen[ng]; j++)
    +
    310  {
    +
    311  if (ifldmiss[j] == 0)
    +
    312  num0++;
    +
    313  if (ifldmiss[j] == 1)
    +
    314  num1++;
    +
    315  if (ifldmiss[j] == 2)
    +
    316  num2++;
    +
    317  }
    +
    318  if (num0 == 0)
    +
    319  { /* all missing values */
    +
    320  if (num1 == 0)
    +
    321  { /* all secondary missing */
    +
    322  gref[ng] = -2;
    +
    323  gwidth[ng] = 0;
    +
    324  }
    +
    325  else if (num2 == 0)
    +
    326  { /* all primary missing */
    +
    327  gref[ng] = -1;
    +
    328  gwidth[ng] = 0;
    +
    329  }
    +
    330  else
    +
    331  { /* both primary and secondary */
    +
    332  gref[ng] = 0;
    +
    333  gwidth[ng] = 1;
    +
    334  }
    +
    335  }
    +
    336  else
    +
    337  { /* contains some non-missing data */
    +
    338  /* find max and min values of group */
    +
    339  gref[ng] = 2147483647;
    +
    340  imax = -2147483647;
    +
    341  j = n;
    +
    342  for (lg = 0; lg < glen[ng]; lg++)
    +
    343  {
    +
    344  if (ifldmiss[j] == 0)
    +
    345  {
    +
    346  if (ifld[j] < gref[ng])
    +
    347  gref[ng] = ifld[j];
    +
    348  if (ifld[j] > imax)
    +
    349  imax = ifld[j];
    +
    350  }
    +
    351  j++;
    +
    352  }
    +
    353  if (missopt == 1)
    +
    354  imax = imax+1;
    +
    355  if (missopt == 2)
    +
    356  imax = imax+2;
    +
    357  /* calc num of bits needed to hold data */
    +
    358  if (gref[ng] != imax)
    +
    359  {
    +
    360  temp = log((double)(imax - gref[ng] + 1)) / alog2;
    +
    361  gwidth[ng] = (g2int)ceil(temp);
    +
    362  }
    +
    363  else
    +
    364  {
    +
    365  gwidth[ng] = 0;
    +
    366  }
    +
    367  }
    +
    368  /* Subtract min from data */
    +
    369  j = n;
    +
    370  mtemp = (g2int)int_power(2., gwidth[ng]);
    +
    371  for (lg = 0; lg < glen[ng]; lg++)
    +
    372  {
    +
    373  if (ifldmiss[j] == 0) /* non-missing */
    +
    374  ifld[j] = ifld[j] - gref[ng];
    +
    375  else if (ifldmiss[j] == 1) /* primary missing */
    +
    376  ifld[j] = mtemp - 1;
    +
    377  else if (ifldmiss[j] == 2) /* secondary missing */
    +
    378  ifld[j] = mtemp - 2;
    +
    379  j++;
    +
    380  }
    +
    381  /* increment fld array counter */
    +
    382  n = n + glen[ng];
    +
    383  }
    +
    384 
    +
    385  /* Find max of the group references and calc num of bits needed to
    +
    386  * pack each groups reference value, then pack up group reference
    +
    387  * values. */
    +
    388  igmax = gref[0];
    +
    389  for (j = 1; j < ngroups; j++)
    +
    390  if (gref[j] > igmax)
    +
    391  igmax = gref[j];
    +
    392  if (missopt == 1)
    +
    393  igmax = igmax + 1;
    +
    394  if (missopt == 2)
    +
    395  igmax = igmax + 2;
    +
    396  if (igmax != 0)
    +
    397  {
    +
    398  temp = log((double)(igmax + 1)) / alog2;
    +
    399  nbitsgref = (g2int)ceil(temp);
    +
    400  /* reset the ref values of any "missing only" groups. */
    +
    401  mtemp = (g2int)int_power(2., nbitsgref);
    +
    402  for (j = 0; j < ngroups; j++)
    +
    403  {
    +
    404  if (gref[j] == -1)
    +
    405  gref[j] = mtemp-1;
    +
    406  if (gref[j] == -2)
    +
    407  gref[j] = mtemp-2;
    +
    408  }
    +
    409  sbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
    +
    410  itemp = nbitsgref * ngroups;
    +
    411  iofst = iofst + itemp;
    +
    412  /* Pad last octet with Zeros, if necessary. */
    +
    413  if ((itemp % 8) != 0)
    +
    414  {
    +
    415  left = 8 - (itemp % 8);
    +
    416  sbit(cpack, &zero, iofst, left);
    +
    417  iofst = iofst + left;
    +
    418  }
    +
    419  }
    +
    420  else
    +
    421  {
    +
    422  nbitsgref = 0;
    +
    423  }
    +
    424 
    +
    425  /* Find max/min of the group widths and calc num of bits needed to
    +
    426  * pack each groups width value, then pack up group width
    +
    427  * values. */
    +
    428  iwmax = gwidth[0];
    +
    429  ngwidthref = gwidth[0];
    +
    430  for (j = 1; j < ngroups; j++)
    +
    431  {
    +
    432  if (gwidth[j] > iwmax)
    +
    433  iwmax = gwidth[j];
    +
    434  if (gwidth[j] < ngwidthref)
    +
    435  ngwidthref = gwidth[j];
    +
    436  }
    +
    437  if (iwmax != ngwidthref)
    +
    438  {
    +
    439  temp = log((double)(iwmax - ngwidthref + 1)) / alog2;
    +
    440  nbitsgwidth = (g2int)ceil(temp);
    +
    441  for (i = 0; i<ngroups; i++)
    +
    442  gwidth[i] = gwidth[i]-ngwidthref;
    +
    443  sbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
    +
    444  itemp = nbitsgwidth * ngroups;
    +
    445  iofst = iofst + itemp;
    +
    446  /* Pad last octet with Zeros, if necessary. */
    +
    447  if ((itemp %8) != 0)
    +
    448  {
    +
    449  left = 8 - (itemp % 8);
    +
    450  sbit(cpack, &zero, iofst, left);
    +
    451  iofst = iofst + left;
    +
    452  }
    +
    453  }
    +
    454  else
    +
    455  {
    +
    456  nbitsgwidth = 0;
    +
    457  for (i = 0; i < ngroups; i++)
    +
    458  gwidth[i] = 0;
    +
    459  }
    +
    460 
    +
    461  /* Find max/min of the group lengths and calc num of bits needed
    +
    462  * to pack each groups length value, then pack up group length
    +
    463  * values. */
    +
    464  ilmax = glen[0];
    +
    465  nglenref = glen[0];
    +
    466  for (j = 1; j < ngroups - 1; j++)
    +
    467  {
    +
    468  if (glen[j] > ilmax)
    +
    469  ilmax = glen[j];
    +
    470  if (glen[j] < nglenref)
    +
    471  nglenref = glen[j];
    +
    472  }
    +
    473  nglenlast = glen[ngroups - 1];
    +
    474  if (ilmax != nglenref)
    +
    475  {
    +
    476  temp = log((double)(ilmax - nglenref + 1)) / alog2;
    +
    477  nbitsglen = (g2int)ceil(temp);
    +
    478  for (i = 0; i < ngroups - 1; i++)
    +
    479  glen[i] = glen[i] - nglenref;
    +
    480  sbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
    +
    481  itemp = nbitsglen * ngroups;
    +
    482  iofst = iofst + itemp;
    +
    483  /* Pad last octet with Zeros, if necessary. */
    +
    484  if ((itemp % 8) != 0)
    +
    485  {
    +
    486  left = 8 - (itemp % 8);
    +
    487  sbit(cpack, &zero, iofst, left);
    +
    488  iofst = iofst + left;
    +
    489  }
    +
    490  }
    +
    491  else
    +
    492  {
    +
    493  nbitsglen = 0;
    +
    494  for (i = 0; i < ngroups; i++)
    +
    495  glen[i] = 0;
    +
    496  }
    +
    497 
    +
    498  /* For each group, pack data values. */
    +
    499  n = 0;
    +
    500  for (ng = 0; ng < ngroups; ng++)
    +
    501  {
    +
    502  glength = glen[ng] + nglenref;
    +
    503  if (ng == (ngroups - 1))
    +
    504  glength = nglenlast;
    +
    505  grpwidth = gwidth[ng] + ngwidthref;
    +
    506  if (grpwidth != 0)
    +
    507  {
    +
    508  sbits(cpack, ifld + n, iofst, grpwidth, 0, glength);
    +
    509  iofst = iofst + (grpwidth * glength);
    +
    510  }
    +
    511  n = n + glength;
    +
    512  }
    +
    513 
    +
    514  /* Pad last octet with Zeros, if necessary, */
    +
    515  if ((iofst % 8) != 0)
    +
    516  {
    +
    517  left = 8 - (iofst % 8);
    +
    518  sbit(cpack, &zero, iofst, left);
    +
    519  iofst = iofst + left;
    +
    520  }
    +
    521  *lcpack = iofst / 8;
    +
    522 
    +
    523  if (ifld)
    +
    524  free(ifld);
    +
    525  if (jfld)
    +
    526  free(jfld);
    +
    527  if (ifldmiss)
    +
    528  free(ifldmiss);
    +
    529  if (gref)
    +
    530  free(gref);
    +
    531  if (gwidth)
    +
    532  free(gwidth);
    +
    533  if (glen)
    +
    534  free(glen);
    +
    535 
    +
    536  /* Fill in ref value and number of bits in Template 5.2. */
    +
    537  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format */
    +
    538  idrstmpl[3] = nbitsgref;
    +
    539  idrstmpl[4] = 0; /* original data were reals */
    +
    540  idrstmpl[5] = 1; /* general group splitting */
    +
    541  idrstmpl[9] = ngroups; /* Number of groups */
    +
    542  idrstmpl[10] = ngwidthref; /* reference for group widths */
    +
    543  idrstmpl[11] = nbitsgwidth; /* num bits used for group widths */
    +
    544  idrstmpl[12] = nglenref; /* Reference for group lengths */
    +
    545  idrstmpl[13] = 1; /* length increment for group lengths */
    +
    546  idrstmpl[14] = nglenlast; /* True length of last group */
    +
    547  idrstmpl[15] = nbitsglen; /* num bits used for group lengths */
    +
    548  if (idrsnum == 3)
    +
    549  idrstmpl[17] = nbitsd / 8; /* num bits used for extra spatial differencing values */
    +
    550 }
    +
    +
    +
    void rdieee(g2int *rieee, float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:21
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    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 ...
    Definition: gbits.c:114
    +
    void mkieee(float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:22
    +
    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 ...
    Definition: pack_gp.c:255
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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...
    Definition: misspack.c:42
    +
    #define ALOG2
    ln(2.0)
    Definition: grib2_int.h:21
    +
    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 ...
    Definition: gbits.c:38
    + + + + diff --git a/ver-1.7.0/mkieee_8c.html b/ver-1.7.0/mkieee_8c.html new file mode 100644 index 00000000..e8dc0c93 --- /dev/null +++ b/ver-1.7.0/mkieee_8c.html @@ -0,0 +1,173 @@ + + + + + + + +NCEPLIBS-g2c: mkieee.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    mkieee.c File Reference
    +
    +
    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void mkieee (float *a, g2int *rieee, g2int num)
     This subroutine stores a list of real values in 32-bit IEEE floating point format. More...
     
    +

    Detailed Description

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file mkieee.c.

    +

    Function Documentation

    + +

    ◆ mkieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void mkieee (float * a,
    g2intrieee,
    g2int num 
    )
    +
    + +

    This subroutine stores a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    aInput array of floating point values.
    numNumber of floating point values to convert.
    rieeeOutput 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/mkieee_8c.js b/ver-1.7.0/mkieee_8c.js new file mode 100644 index 00000000..3ae38433 --- /dev/null +++ b/ver-1.7.0/mkieee_8c.js @@ -0,0 +1,4 @@ +var mkieee_8c = +[ + [ "mkieee", "mkieee_8c.html#a1594a8cc9a699a73a870b9ec4231fbd3", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/mkieee_8c_source.html b/ver-1.7.0/mkieee_8c_source.html new file mode 100644 index 00000000..39b63f7a --- /dev/null +++ b/ver-1.7.0/mkieee_8c_source.html @@ -0,0 +1,195 @@ + + + + + + + +NCEPLIBS-g2c: mkieee.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    mkieee.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdlib.h>
    +
    6 #include <math.h>
    +
    7 #include "grib2_int.h"
    +
    8 
    +
    21 void
    +
    22 mkieee(float *a, g2int *rieee, g2int num)
    +
    23 {
    +
    24  g2int j,n,ieee,iexp,imant;
    +
    25  double atemp;
    +
    26  static double two23, two126;
    +
    27  static g2int test = 0;
    +
    28 
    +
    29  if (test == 0)
    +
    30  {
    +
    31  two23 = (double)int_power(2.0, 23);
    +
    32  two126 = (double)int_power(2.0, 126);
    +
    33  test = 1;
    +
    34  }
    +
    35 
    +
    36  for (j = 0; j < num; j++)
    +
    37  {
    +
    38 
    +
    39  ieee=0;
    +
    40 
    +
    41  if (a[j] == 0.0)
    +
    42  {
    +
    43  rieee[j] = ieee;
    +
    44  continue;
    +
    45  }
    +
    46 
    +
    47  // Set Sign bit (bit 31 - leftmost bit).
    +
    48  if (a[j] < 0.0)
    +
    49  {
    +
    50  ieee= 1 << 31;
    +
    51  atemp=-1.0*a[j];
    +
    52  }
    +
    53  else
    +
    54  {
    +
    55  ieee= 0 << 31;
    +
    56  atemp=a[j];
    +
    57  }
    +
    58 
    +
    59  // Determine exponent n with base 2.
    +
    60  if (atemp >= 1.0)
    +
    61  {
    +
    62  n = 0;
    +
    63  while (int_power(2.0,n+1) <= atemp)
    +
    64  {
    +
    65  n++;
    +
    66  }
    +
    67  }
    +
    68  else
    +
    69  {
    +
    70  n = -1;
    +
    71  while (int_power(2.0,n) > atemp)
    +
    72  n--;
    +
    73  }
    +
    74  iexp = n + 127;
    +
    75  if (n > 127)
    +
    76  iexp = 255; // overflow
    +
    77  if (n < -127)
    +
    78  iexp = 0;
    +
    79 
    +
    80  // set exponent bits ( bits 30-23 )
    +
    81  ieee = ieee | ( iexp << 23 );
    +
    82 
    +
    83  // Determine Mantissa
    +
    84  if (iexp != 255)
    +
    85  {
    +
    86  if (iexp != 0)
    +
    87  atemp = (atemp / int_power(2.0, n)) - 1.0;
    +
    88  else
    +
    89  atemp = atemp * two126;
    +
    90  imant = (g2int)rint(atemp * two23);
    +
    91  }
    +
    92  else
    +
    93  {
    +
    94  imant = 0;
    +
    95  }
    +
    96 
    +
    97  // set mantissa bits ( bits 22-0 )
    +
    98  ieee = ieee | imant;
    +
    99 
    +
    100  // Transfer IEEE bit string to rieee array
    +
    101  rieee[j] = ieee;
    +
    102  }
    +
    103 
    +
    104  return;
    +
    105 }
    +
    +
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    void mkieee(float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:22
    + + + + diff --git a/ver-1.7.0/nav_f.png b/ver-1.7.0/nav_f.png new file mode 100644 index 00000000..72a58a52 Binary files /dev/null and b/ver-1.7.0/nav_f.png differ diff --git a/ver-1.7.0/nav_g.png b/ver-1.7.0/nav_g.png new file mode 100644 index 00000000..2093a237 Binary files /dev/null and b/ver-1.7.0/nav_g.png differ diff --git a/ver-1.7.0/nav_h.png b/ver-1.7.0/nav_h.png new file mode 100644 index 00000000..33389b10 Binary files /dev/null and b/ver-1.7.0/nav_h.png differ diff --git a/ver-1.7.0/navtree.css b/ver-1.7.0/navtree.css new file mode 100644 index 00000000..33341a67 --- /dev/null +++ b/ver-1.7.0/navtree.css @@ -0,0 +1,146 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:#fff; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + background-color: #FAFAFF; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: 250px; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:url("splitbar.png"); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/ver-1.7.0/navtree.js b/ver-1.7.0/navtree.js new file mode 100644 index 00000000..edc31efc --- /dev/null +++ b/ver-1.7.0/navtree.js @@ -0,0 +1,544 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2019 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func,show) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, false); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, showRoot) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, showRoot); + }, showRoot); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + $('#nav-sync').css('top','30px'); + } else { + $('#nav-sync').css('top','5px'); + } + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + },true); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + },true); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +NCEPLIBS-g2c: pack_gp.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pack_gp.c File Reference
    +
    +
    +
    #include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define FALSE_   (0)
     False. More...
     
    #define TRUE_   (1)
     True. More...
     
    + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +
    Author
    Glahn
    +
    Date
    february 1994
    + +

    Definition in file pack_gp.c.

    +

    Macro Definition Documentation

    + +

    ◆ FALSE_

    + +
    +
    + + + + +
    #define FALSE_   (0)
    +
    + +

    False.

    + +

    Definition at line 10 of file pack_gp.c.

    + +
    +
    + +

    ◆ TRUE_

    + +
    +
    + + + + +
    #define TRUE_   (1)
    +
    + +

    True.

    + +

    Definition at line 9 of file pack_gp.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ pack_gp()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int pack_gp (g2intkfildo,
    g2intic,
    g2intnxy,
    g2intis523,
    g2intminpk,
    g2intinc,
    g2intmissp,
    g2intmisss,
    g2intjmin,
    g2intjmax,
    g2intlbit,
    g2intnov,
    g2intndg,
    g2intlx,
    g2intibit,
    g2intjbit,
    g2intkbit,
    g2intnovref,
    g2intlbitref,
    g2intier 
    )
    +
    + +

    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
    + + + + + + + + + + + + + + + + + + + + + +
    kfildounit number for output (print) file. (input)
    icarray 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)
    nxynumber of values in ic( ). also treated as its dimension. (input)
    is523missing value management 0=data contains no missing values 1=data contains primary missing values 2=data contains primary and secondary missing values (input)
    minpkthe minimum size of each group, except possibly the last one. (input)
    incthe 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)
    misspwhen 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)
    missssecondary missing value indicator (see missp). (input)
    jminthe minimum of each group (j=1,lx). (output)
    jmaxthe 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)
    lbitthe 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)
    novthe number of values in each group (j=1,lx). (output)
    ndgthe dimension of jmin, jmax, lbit, and nov. (input)
    lxthe number of groups determined. (output)
    ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (output)
    jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (output)
    kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. (output)
    novrefreference value for nov( ). (output)
    lbitrefreference value for lbit( ). (output)
    ierError 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/pack__gp_8c.js b/ver-1.7.0/pack__gp_8c.js new file mode 100644 index 00000000..bf89c849 --- /dev/null +++ b/ver-1.7.0/pack__gp_8c.js @@ -0,0 +1,6 @@ +var pack__gp_8c = +[ + [ "FALSE_", "pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d", null ], + [ "TRUE_", "pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5", null ], + [ "pack_gp", "pack__gp_8c.html#ab5fbec07e58a9d872a0fa1c04d74a81b", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pack__gp_8c_source.html b/ver-1.7.0/pack__gp_8c_source.html new file mode 100644 index 00000000..b3c01c63 --- /dev/null +++ b/ver-1.7.0/pack__gp_8c_source.html @@ -0,0 +1,1263 @@ + + + + + + + +NCEPLIBS-g2c: pack_gp.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pack_gp.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 /*#include "f2c.h"*/
    +
    6 #include <stdlib.h>
    +
    7 #include "grib2_int.h"
    +
    8 
    +
    9 #define TRUE_ (1)
    +
    10 #define FALSE_ (0)
    +
    254 int
    +
    255 pack_gp(g2int *kfildo, g2int *ic, g2int *nxy,
    +
    256  g2int *is523, g2int *minpk, g2int *inc, g2int *missp, g2int *misss,
    +
    257  g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov,
    +
    258  g2int *ndg, g2int *lx, g2int *ibit, g2int *jbit, g2int *kbit,
    +
    259  g2int *novref, g2int *lbitref, g2int *ier)
    +
    260 {
    +
    261  /* Initialized data */
    +
    262 
    +
    263  const g2int mallow = 1073741825; /* MALLOW=2**30+1 */
    +
    264  static g2int ifeed = 12;
    +
    265  static g2int ifirst = 0;
    +
    266 
    +
    267  /* System generated locals */
    +
    268  g2int i__1, i__2, i__3;
    +
    269 
    +
    270  /* Local variables */
    +
    271  static g2int j, k, l;
    +
    272  static g2int adda;
    +
    273  static g2int ired, kinc, mina, maxa, minb, maxb, minc, maxc, ibxx2[31];
    +
    274  static char cfeed[1];
    +
    275  static g2int nenda, nendb, ibita, ibitb, minak, minbk, maxak, maxbk,
    +
    276  minck, maxck, nouta, lmiss, itest, nount;
    +
    277  extern /* Subroutine */ int reduce(g2int *, g2int *, g2int *,
    +
    278  g2int *, g2int *, g2int *, g2int *, g2int *, g2int *,
    +
    279  g2int *, g2int *, g2int *, g2int *);
    +
    280  static g2int ibitbs, mislla, misllb, misllc, iersav, lminpk, ktotal,
    +
    281  kounta, kountb, kstart, mstart, mintst, maxtst,
    +
    282  kounts, mintstk, maxtstk;
    +
    283  g2int *misslx;
    +
    284 
    +
    285 
    +
    286 
    +
    287 /* NON SYSTEM SUBROUTINES CALLED */
    +
    288 /* NONE */
    +
    289 
    +
    290 
    +
    291 
    +
    292 /* MISSLX( ) was AN AUTOMATIC ARRAY. */
    +
    293  misslx = (g2int *)calloc(*ndg,sizeof(g2int));
    +
    294 
    +
    295 
    +
    296  /* Parameter adjustments */
    +
    297  --ic;
    +
    298  --nov;
    +
    299  --lbit;
    +
    300  --jmax;
    +
    301  --jmin;
    +
    302 
    +
    303  /* Function Body */
    +
    304 
    +
    305  *ier = 0;
    +
    306  iersav = 0;
    +
    307 /* CALL TIMPR(KFILDO,KFILDO,'START PACK_GP ') */
    +
    308  *(unsigned char *)cfeed = (char) ifeed;
    +
    309 
    +
    310  ired = 0;
    +
    311 /* IRED IS A FLAG. WHEN ZERO, REDUCE WILL BE CALLED. */
    +
    312 /* IF REDUCE ABORTS, IRED = 1 AND IS NOT CALLED. IN */
    +
    313 /* THIS CASE PACK_GP EXECUTES AGAIN EXCEPT FOR REDUCE. */
    +
    314 
    +
    315  if (*inc <= 0) {
    +
    316  iersav = 717;
    +
    317 /* WRITE(KFILDO,101)INC */
    +
    318 /* 101 FORMAT(/' ****INC ='I8,' NOT CORRECT IN PACK_GP. 1 IS USED.') */
    +
    319  }
    +
    320 
    +
    321 /* THERE WILL BE A RESTART OF PACK_GP IF SUBROUTINE REDUCE */
    +
    322 /* ABORTS. THIS SHOULD NOT HAPPEN, BUT IF IT DOES, PACK_GP */
    +
    323 /* WILL COMPLETE WITHOUT SUBROUTINE REDUCE. A NON FATAL */
    +
    324 /* DIAGNOSTIC RETURN IS PROVIDED. */
    +
    325 
    +
    326 L102:
    +
    327  /*kinc = max(*inc,1);*/
    +
    328  kinc = (*inc > 1) ? *inc : 1;
    +
    329  lminpk = *minpk;
    +
    330 
    +
    331 /* CALCULATE THE POWERS OF 2 THE FIRST TIME ENTERED. */
    +
    332 
    +
    333  if (ifirst == 0) {
    +
    334  ifirst = 1;
    +
    335  ibxx2[0] = 1;
    +
    336 
    +
    337  for (j = 1; j <= 30; ++j) {
    +
    338  ibxx2[j] = ibxx2[j - 1] << 1;
    +
    339 /* L104: */
    +
    340  }
    +
    341 
    +
    342  }
    +
    343 
    +
    344 /* THERE WILL BE A RESTART AT 105 IS NDG IS NOT LARGE ENOUGH. */
    +
    345 /* A NON FATAL DIAGNOSTIC RETURN IS PROVIDED. */
    +
    346 
    +
    347 L105:
    +
    348  kstart = 1;
    +
    349  ktotal = 0;
    +
    350  *lx = 0;
    +
    351  adda = FALSE_;
    +
    352  lmiss = 0;
    +
    353  if (*is523 == 1) {
    +
    354  lmiss = 1;
    +
    355  }
    +
    356  if (*is523 == 2) {
    +
    357  lmiss = 2;
    +
    358  }
    +
    359 
    +
    360 /* ************************************* */
    +
    361 
    +
    362 /* THIS SECTION COMPUTES STATISTICS FOR GROUP A. GROUP A IS */
    +
    363 /* A GROUP OF SIZE LMINPK. */
    +
    364 
    +
    365 /* ************************************* */
    +
    366 
    +
    367  ibita = 0;
    +
    368  mina = mallow;
    +
    369  maxa = -mallow;
    +
    370  minak = mallow;
    +
    371  maxak = -mallow;
    +
    372 
    +
    373 /* FIND THE MIN AND MAX OF GROUP A. THIS WILL INITIALLY BE OF */
    +
    374 /* SIZE LMINPK (IF THERE ARE STILL LMINPK VALUES IN IC( )), BUT */
    +
    375 /* WILL INCREASE IN SIZE IN INCREMENTS OF INC UNTIL A NEW */
    +
    376 /* GROUP IS STARTED. THE DEFINITION OF GROUP A IS DONE HERE */
    +
    377 /* ONLY ONCE (UPON INITIAL ENTRY), BECAUSE A GROUP B CAN ALWAYS */
    +
    378 /* BECOME A NEW GROUP A AFTER A IS PACKED, EXCEPT IF LMINPK */
    +
    379 /* HAS TO BE INCREASED BECAUSE NDG IS TOO SMALL. THEREFORE, */
    +
    380 /* THE SEPARATE LOOPS FOR MISSING AND NON-MISSING HERE BUYS */
    +
    381 /* ALMOST NOTHING. */
    +
    382 
    +
    383 /* Computing MIN */
    +
    384  i__1 = kstart + lminpk - 1;
    +
    385  /*nenda = min(i__1,*nxy);*/
    +
    386  nenda = (i__1 < *nxy) ? i__1 : *nxy;
    +
    387  if (*nxy - nenda <= lminpk / 2) {
    +
    388  nenda = *nxy;
    +
    389  }
    +
    390 /* ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
    +
    391 /* MAKING THE ACTUAL GROUP LARGER. IF A PROVISION LIKE THIS IS */
    +
    392 /* NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
    +
    393 /* AT THE END. USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
    +
    394 /* VALUES FOR EFFICIENCY. */
    +
    395 
    +
    396 /* DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE */
    +
    397 /* UNLESS NENDA = NXY. THIS MAY ALLOW A LARGE GROUP A TO */
    +
    398 /* START WITH, AS WITH MISSING VALUES. SEPARATE LOOPS FOR */
    +
    399 /* MISSING OPTIONS. THIS SECTION IS ONLY EXECUTED ONCE, */
    +
    400 /* IN DETERMINING THE FIRST GROUP. IT HELPS FOR AN ARRAY */
    +
    401 /* OF MOSTLY MISSING VALUES OR OF ONE VALUE, SUCH AS */
    +
    402 /* RADAR OR PRECIP DATA. */
    +
    403 
    +
    404  if (nenda != *nxy && ic[kstart] == ic[kstart + 1]) {
    +
    405 /* NO NEED TO EXECUTE IF FIRST TWO VALUES ARE NOT EQUAL. */
    +
    406 
    +
    407  if (*is523 == 0) {
    +
    408 /* THIS LOOP IS FOR NO MISSING VALUES. */
    +
    409 
    +
    410  i__1 = *nxy;
    +
    411  for (k = kstart + 1; k <= i__1; ++k) {
    +
    412 
    +
    413  if (ic[k] != ic[kstart]) {
    +
    414 /* Computing MAX */
    +
    415  i__2 = nenda, i__3 = k - 1;
    +
    416  /*nenda = max(i__2,i__3);*/
    +
    417  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    418  goto L114;
    +
    419  }
    +
    420 
    +
    421 /* L111: */
    +
    422  }
    +
    423 
    +
    424  nenda = *nxy;
    +
    425 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    426 
    +
    427  } else if (*is523 == 1) {
    +
    428 /* THIS LOOP IS FOR PRIMARY MISSING VALUES ONLY. */
    +
    429 
    +
    430  i__1 = *nxy;
    +
    431  for (k = kstart + 1; k <= i__1; ++k) {
    +
    432 
    +
    433  if (ic[k] != *missp) {
    +
    434 
    +
    435  if (ic[k] != ic[kstart]) {
    +
    436 /* Computing MAX */
    +
    437  i__2 = nenda, i__3 = k - 1;
    +
    438  /*nenda = max(i__2,i__3);*/
    +
    439  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    440  goto L114;
    +
    441  }
    +
    442 
    +
    443  }
    +
    444 
    +
    445 /* L112: */
    +
    446  }
    +
    447 
    +
    448  nenda = *nxy;
    +
    449 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    450 
    +
    451  } else {
    +
    452 /* THIS LOOP IS FOR PRIMARY AND SECONDARY MISSING VALUES. */
    +
    453 
    +
    454  i__1 = *nxy;
    +
    455  for (k = kstart + 1; k <= i__1; ++k) {
    +
    456 
    +
    457  if (ic[k] != *missp && ic[k] != *misss) {
    +
    458 
    +
    459  if (ic[k] != ic[kstart]) {
    +
    460 /* Computing MAX */
    +
    461  i__2 = nenda, i__3 = k - 1;
    +
    462  /*nenda = max(i__2,i__3);*/
    +
    463  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    464  goto L114;
    +
    465  }
    +
    466 
    +
    467  }
    +
    468 
    +
    469 /* L113: */
    +
    470  }
    +
    471 
    +
    472  nenda = *nxy;
    +
    473 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    474  }
    +
    475 
    +
    476  }
    +
    477 
    +
    478 L114:
    +
    479  if (*is523 == 0) {
    +
    480 
    +
    481  i__1 = nenda;
    +
    482  for (k = kstart; k <= i__1; ++k) {
    +
    483  if (ic[k] < mina) {
    +
    484  mina = ic[k];
    +
    485  minak = k;
    +
    486  }
    +
    487  if (ic[k] > maxa) {
    +
    488  maxa = ic[k];
    +
    489  maxak = k;
    +
    490  }
    +
    491 /* L115: */
    +
    492  }
    +
    493 
    +
    494  } else if (*is523 == 1) {
    +
    495 
    +
    496  i__1 = nenda;
    +
    497  for (k = kstart; k <= i__1; ++k) {
    +
    498  if (ic[k] == *missp) {
    +
    499  goto L117;
    +
    500  }
    +
    501  if (ic[k] < mina) {
    +
    502  mina = ic[k];
    +
    503  minak = k;
    +
    504  }
    +
    505  if (ic[k] > maxa) {
    +
    506  maxa = ic[k];
    +
    507  maxak = k;
    +
    508  }
    +
    509  L117:
    +
    510  ;
    +
    511  }
    +
    512 
    +
    513  } else {
    +
    514 
    +
    515  i__1 = nenda;
    +
    516  for (k = kstart; k <= i__1; ++k) {
    +
    517  if (ic[k] == *missp || ic[k] == *misss) {
    +
    518  goto L120;
    +
    519  }
    +
    520  if (ic[k] < mina) {
    +
    521  mina = ic[k];
    +
    522  minak = k;
    +
    523  }
    +
    524  if (ic[k] > maxa) {
    +
    525  maxa = ic[k];
    +
    526  maxak = k;
    +
    527  }
    +
    528  L120:
    +
    529  ;
    +
    530  }
    +
    531 
    +
    532  }
    +
    533 
    +
    534  kounta = nenda - kstart + 1;
    +
    535 
    +
    536 /* INCREMENT KTOTAL AND FIND THE BITS NEEDED TO PACK THE A GROUP. */
    +
    537 
    +
    538  ktotal += kounta;
    +
    539  mislla = 0;
    +
    540  if (mina != mallow) {
    +
    541  goto L125;
    +
    542  }
    +
    543 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    544  mina = 0;
    +
    545  maxa = 0;
    +
    546  mislla = 1;
    +
    547  ibitb = 0;
    +
    548  if (*is523 != 2) {
    +
    549  goto L130;
    +
    550  }
    +
    551 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO */
    +
    552 /* SECONDARY MISSING VALUES, IBITA = 0. */
    +
    553 /* OTHERWISE, IBITA MUST BE CALCULATED. */
    +
    554 
    +
    555 L125:
    +
    556  itest = maxa - mina + lmiss;
    +
    557 
    +
    558  for (ibita = 0; ibita <= 30; ++ibita) {
    +
    559  if (itest < ibxx2[ibita]) {
    +
    560  goto L130;
    +
    561  }
    +
    562 /* *** THIS TEST IS THE SAME AS: */
    +
    563 /* *** IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 130 */
    +
    564 /* L126: */
    +
    565  }
    +
    566 
    +
    567 /* WRITE(KFILDO,127)MAXA,MINA */
    +
    568 /* 127 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    569 /* 1 ' MAXA ='I13,' MINA ='I13,'. ERROR AT 127.') */
    +
    570  *ier = 706;
    +
    571  goto L900;
    +
    572 
    +
    573 L130:
    +
    574 
    +
    575 /* ***D WRITE(KFILDO,131)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA */
    +
    576 /* ***D131 FORMAT(' AT 130, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    577 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3) */
    +
    578 
    +
    579 L133:
    +
    580  if (ktotal >= *nxy) {
    +
    581  goto L200;
    +
    582  }
    +
    583 
    +
    584 /* ************************************* */
    +
    585 
    +
    586 /* THIS SECTION COMPUTES STATISTICS FOR GROUP B. GROUP B IS A */
    +
    587 /* GROUP OF SIZE LMINPK IMMEDIATELY FOLLOWING GROUP A. */
    +
    588 
    +
    589 /* ************************************* */
    +
    590 
    +
    591 L140:
    +
    592  minb = mallow;
    +
    593  maxb = -mallow;
    +
    594  minbk = mallow;
    +
    595  maxbk = -mallow;
    +
    596  ibitbs = 0;
    +
    597  mstart = ktotal + 1;
    +
    598 
    +
    599 /* DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE. */
    +
    600 /* THIS WORKS WHEN THERE ARE NO MISSING VALUES. */
    +
    601 
    +
    602  nendb = 1;
    +
    603 
    +
    604  if (mstart < *nxy) {
    +
    605 
    +
    606  if (*is523 == 0) {
    +
    607 /* THIS LOOP IS FOR NO MISSING VALUES. */
    +
    608 
    +
    609  i__1 = *nxy;
    +
    610  for (k = mstart + 1; k <= i__1; ++k) {
    +
    611 
    +
    612  if (ic[k] != ic[mstart]) {
    +
    613  nendb = k - 1;
    +
    614  goto L150;
    +
    615  }
    +
    616 
    +
    617 /* L145: */
    +
    618  }
    +
    619 
    +
    620  nendb = *nxy;
    +
    621 /* FALL THROUGH THE LOOP MEANS ALL REMAINING VALUES */
    +
    622 /* ARE THE SAME. */
    +
    623  }
    +
    624 
    +
    625  }
    +
    626 
    +
    627 L150:
    +
    628 /* Computing MAX */
    +
    629 /* Computing MIN */
    +
    630  i__3 = ktotal + lminpk;
    +
    631  /*i__1 = nendb, i__2 = min(i__3,*nxy);*/
    +
    632  i__1 = nendb, i__2 = (i__3 < *nxy) ? i__3 : *nxy;
    +
    633  /*nendb = max(i__1,i__2);*/
    +
    634  nendb = (i__1 > i__2) ? i__1 : i__2;
    +
    635 /* **** 150 NENDB=MIN(KTOTAL+LMINPK,NXY) */
    +
    636 
    +
    637  if (*nxy - nendb <= lminpk / 2) {
    +
    638  nendb = *nxy;
    +
    639  }
    +
    640 /* ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
    +
    641 /* MAKING THE ACTUAL GROUP LARGER. IF A PROVISION LIKE THIS IS */
    +
    642 /* NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
    +
    643 /* AT THE END. USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
    +
    644 
    +
    645 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    646 /* FOR EFFICIENCY. */
    +
    647 
    +
    648  if (*is523 == 0) {
    +
    649 
    +
    650  i__1 = nendb;
    +
    651  for (k = mstart; k <= i__1; ++k) {
    +
    652  if (ic[k] <= minb) {
    +
    653  minb = ic[k];
    +
    654 /* NOTE LE, NOT LT. LT COULD BE USED BUT THEN A */
    +
    655 /* RECOMPUTE OVER THE WHOLE GROUP WOULD BE NEEDED */
    +
    656 /* MORE OFTEN. SAME REASONING FOR GE AND OTHER */
    +
    657 /* LOOPS BELOW. */
    +
    658  minbk = k;
    +
    659  }
    +
    660  if (ic[k] >= maxb) {
    +
    661  maxb = ic[k];
    +
    662  maxbk = k;
    +
    663  }
    +
    664 /* L155: */
    +
    665  }
    +
    666 
    +
    667  } else if (*is523 == 1) {
    +
    668 
    +
    669  i__1 = nendb;
    +
    670  for (k = mstart; k <= i__1; ++k) {
    +
    671  if (ic[k] == *missp) {
    +
    672  goto L157;
    +
    673  }
    +
    674  if (ic[k] <= minb) {
    +
    675  minb = ic[k];
    +
    676  minbk = k;
    +
    677  }
    +
    678  if (ic[k] >= maxb) {
    +
    679  maxb = ic[k];
    +
    680  maxbk = k;
    +
    681  }
    +
    682  L157:
    +
    683  ;
    +
    684  }
    +
    685 
    +
    686  } else {
    +
    687 
    +
    688  i__1 = nendb;
    +
    689  for (k = mstart; k <= i__1; ++k) {
    +
    690  if (ic[k] == *missp || ic[k] == *misss) {
    +
    691  goto L160;
    +
    692  }
    +
    693  if (ic[k] <= minb) {
    +
    694  minb = ic[k];
    +
    695  minbk = k;
    +
    696  }
    +
    697  if (ic[k] >= maxb) {
    +
    698  maxb = ic[k];
    +
    699  maxbk = k;
    +
    700  }
    +
    701  L160:
    +
    702  ;
    +
    703  }
    +
    704 
    +
    705  }
    +
    706 
    +
    707  kountb = nendb - ktotal;
    +
    708  misllb = 0;
    +
    709  if (minb != mallow) {
    +
    710  goto L165;
    +
    711  }
    +
    712 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    713  minb = 0;
    +
    714  maxb = 0;
    +
    715  misllb = 1;
    +
    716  ibitb = 0;
    +
    717 
    +
    718  if (*is523 != 2) {
    +
    719  goto L170;
    +
    720  }
    +
    721 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
    +
    722 /* MISSING VALUES, IBITB = 0. OTHERWISE, IBITB MUST BE */
    +
    723 /* CALCULATED. */
    +
    724 
    +
    725 L165:
    +
    726  for (ibitb = ibitbs; ibitb <= 30; ++ibitb) {
    +
    727  if (maxb - minb < ibxx2[ibitb] - lmiss) {
    +
    728  goto L170;
    +
    729  }
    +
    730 /* L166: */
    +
    731  }
    +
    732 
    +
    733 /* WRITE(KFILDO,167)MAXB,MINB */
    +
    734 /* 167 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    735 /* 1 ' MAXB ='I13,' MINB ='I13,'. ERROR AT 167.') */
    +
    736  *ier = 706;
    +
    737  goto L900;
    +
    738 
    +
    739 /* COMPARE THE BITS NEEDED TO PACK GROUP B WITH THOSE NEEDED */
    +
    740 /* TO PACK GROUP A. IF IBITB GE IBITA, TRY TO ADD TO GROUP A. */
    +
    741 /* IF NOT, TRY TO ADD A'S POINTS TO B, UNLESS ADDITION TO A */
    +
    742 /* HAS BEEN DONE. THIS LATTER IS CONTROLLED WITH ADDA. */
    +
    743 
    +
    744 L170:
    +
    745 
    +
    746 /* ***D WRITE(KFILDO,171)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
    +
    747 /* ***D 1 MINB,MAXB,IBITB,MISLLB */
    +
    748 /* ***D171 FORMAT(' AT 171, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    749 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3, */
    +
    750 /* ***D 2 ' MINB ='I8,' MAXB ='I8,' IBITB ='I3,' MISLLB ='I3) */
    +
    751 
    +
    752  if (ibitb >= ibita) {
    +
    753  goto L180;
    +
    754  }
    +
    755  if (adda) {
    +
    756  goto L200;
    +
    757  }
    +
    758 
    +
    759 /* ************************************* */
    +
    760 
    +
    761 /* GROUP B REQUIRES LESS BITS THAN GROUP A. PUT AS MANY OF A'S */
    +
    762 /* POINTS INTO B AS POSSIBLE WITHOUT EXCEEDING THE NUMBER OF */
    +
    763 /* BITS NECESSARY TO PACK GROUP B. */
    +
    764 
    +
    765 /* ************************************* */
    +
    766 
    +
    767  kounts = kounta;
    +
    768 /* KOUNTA REFERS TO THE PRESENT GROUP A. */
    +
    769  mintst = minb;
    +
    770  maxtst = maxb;
    +
    771  mintstk = minbk;
    +
    772  maxtstk = maxbk;
    +
    773 
    +
    774 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    775 /* FOR EFFICIENCY. */
    +
    776 
    +
    777  if (*is523 == 0) {
    +
    778 
    +
    779  i__1 = kstart;
    +
    780  for (k = ktotal; k >= i__1; --k) {
    +
    781 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    782  if (ic[k] < minb) {
    +
    783  mintst = ic[k];
    +
    784  mintstk = k;
    +
    785  } else if (ic[k] > maxb) {
    +
    786  maxtst = ic[k];
    +
    787  maxtstk = k;
    +
    788  }
    +
    789  if (maxtst - mintst >= ibxx2[ibitb]) {
    +
    790  goto L174;
    +
    791  }
    +
    792 /* NOTE THAT FOR THIS LOOP, LMISS = 0. */
    +
    793  minb = mintst;
    +
    794  maxb = maxtst;
    +
    795  minbk = mintstk;
    +
    796  maxbk = maxtstk;
    +
    797  --kounta;
    +
    798 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    799 /* L1715: */
    +
    800  }
    +
    801 
    +
    802  } else if (*is523 == 1) {
    +
    803 
    +
    804  i__1 = kstart;
    +
    805  for (k = ktotal; k >= i__1; --k) {
    +
    806 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    807  if (ic[k] == *missp) {
    +
    808  goto L1718;
    +
    809  }
    +
    810  if (ic[k] < minb) {
    +
    811  mintst = ic[k];
    +
    812  mintstk = k;
    +
    813  } else if (ic[k] > maxb) {
    +
    814  maxtst = ic[k];
    +
    815  maxtstk = k;
    +
    816  }
    +
    817  if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
    +
    818  goto L174;
    +
    819  }
    +
    820 /* FOR THIS LOOP, LMISS = 1. */
    +
    821  minb = mintst;
    +
    822  maxb = maxtst;
    +
    823  minbk = mintstk;
    +
    824  maxbk = maxtstk;
    +
    825  misllb = 0;
    +
    826 /* WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
    +
    827  L1718:
    +
    828  --kounta;
    +
    829 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    830 /* L1719: */
    +
    831  }
    +
    832 
    +
    833  } else {
    +
    834 
    +
    835  i__1 = kstart;
    +
    836  for (k = ktotal; k >= i__1; --k) {
    +
    837 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    838  if (ic[k] == *missp || ic[k] == *misss) {
    +
    839  goto L1729;
    +
    840  }
    +
    841  if (ic[k] < minb) {
    +
    842  mintst = ic[k];
    +
    843  mintstk = k;
    +
    844  } else if (ic[k] > maxb) {
    +
    845  maxtst = ic[k];
    +
    846  maxtstk = k;
    +
    847  }
    +
    848  if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
    +
    849  goto L174;
    +
    850  }
    +
    851 /* FOR THIS LOOP, LMISS = 2. */
    +
    852  minb = mintst;
    +
    853  maxb = maxtst;
    +
    854  minbk = mintstk;
    +
    855  maxbk = maxtstk;
    +
    856  misllb = 0;
    +
    857 /* WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
    +
    858  L1729:
    +
    859  --kounta;
    +
    860 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    861 /* L173: */
    +
    862  }
    +
    863 
    +
    864  }
    +
    865 
    +
    866 /* AT THIS POINT, KOUNTA CONTAINS THE NUMBER OF POINTS TO CLOSE */
    +
    867 /* OUT GROUP A WITH. GROUP B NOW STARTS WITH KSTART+KOUNTA AND */
    +
    868 /* ENDS WITH NENDB. MINB AND MAXB HAVE BEEN ADJUSTED AS */
    +
    869 /* NECESSARY TO REFLECT GROUP B (EVEN THOUGH THE NUMBER OF BITS */
    +
    870 /* NEEDED TO PACK GROUP B HAVE NOT INCREASED, THE END POINTS */
    +
    871 /* OF THE RANGE MAY HAVE). */
    +
    872 
    +
    873 L174:
    +
    874  if (kounta == kounts) {
    +
    875  goto L200;
    +
    876  }
    +
    877 /* ON TRANSFER, GROUP A WAS NOT CHANGED. CLOSE IT OUT. */
    +
    878 
    +
    879 /* ONE OR MORE POINTS WERE TAKEN OUT OF A. RANGE AND IBITA */
    +
    880 /* MAY HAVE TO BE RECOMPUTED; IBITA COULD BE LESS THAN */
    +
    881 /* ORIGINALLY COMPUTED. IN FACT, GROUP A CAN NOW CONTAIN */
    +
    882 /* ONLY ONE POINT AND BE PACKED WITH ZERO BITS */
    +
    883 /* (UNLESS MISSS NE 0). */
    +
    884 
    +
    885  nouta = kounts - kounta;
    +
    886  ktotal -= nouta;
    +
    887  kountb += nouta;
    +
    888  if (nenda - nouta > minak && nenda - nouta > maxak) {
    +
    889  goto L200;
    +
    890  }
    +
    891 /* WHEN THE ABOVE TEST IS MET, THE MIN AND MAX OF THE */
    +
    892 /* CURRENT GROUP A WERE WITHIN THE OLD GROUP A, SO THE */
    +
    893 /* RANGE AND IBITA DO NOT NEED TO BE RECOMPUTED. */
    +
    894 /* NOTE THAT MINAK AND MAXAK ARE NO LONGER NEEDED. */
    +
    895  ibita = 0;
    +
    896  mina = mallow;
    +
    897  maxa = -mallow;
    +
    898 
    +
    899 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    900 /* FOR EFFICIENCY. */
    +
    901 
    +
    902  if (*is523 == 0) {
    +
    903 
    +
    904  i__1 = nenda - nouta;
    +
    905  for (k = kstart; k <= i__1; ++k) {
    +
    906  if (ic[k] < mina) {
    +
    907  mina = ic[k];
    +
    908  }
    +
    909  if (ic[k] > maxa) {
    +
    910  maxa = ic[k];
    +
    911  }
    +
    912 /* L1742: */
    +
    913  }
    +
    914 
    +
    915  } else if (*is523 == 1) {
    +
    916 
    +
    917  i__1 = nenda - nouta;
    +
    918  for (k = kstart; k <= i__1; ++k) {
    +
    919  if (ic[k] == *missp) {
    +
    920  goto L1744;
    +
    921  }
    +
    922  if (ic[k] < mina) {
    +
    923  mina = ic[k];
    +
    924  }
    +
    925  if (ic[k] > maxa) {
    +
    926  maxa = ic[k];
    +
    927  }
    +
    928  L1744:
    +
    929  ;
    +
    930  }
    +
    931 
    +
    932  } else {
    +
    933 
    +
    934  i__1 = nenda - nouta;
    +
    935  for (k = kstart; k <= i__1; ++k) {
    +
    936  if (ic[k] == *missp || ic[k] == *misss) {
    +
    937  goto L175;
    +
    938  }
    +
    939  if (ic[k] < mina) {
    +
    940  mina = ic[k];
    +
    941  }
    +
    942  if (ic[k] > maxa) {
    +
    943  maxa = ic[k];
    +
    944  }
    +
    945  L175:
    +
    946  ;
    +
    947  }
    +
    948 
    +
    949  }
    +
    950 
    +
    951  mislla = 0;
    +
    952  if (mina != mallow) {
    +
    953  goto L1750;
    +
    954  }
    +
    955 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    956  mina = 0;
    +
    957  maxa = 0;
    +
    958  mislla = 1;
    +
    959  if (*is523 != 2) {
    +
    960  goto L177;
    +
    961  }
    +
    962 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
    +
    963 /* MISSING VALUES IBITA = 0 AS ORIGINALLY SET. OTHERWISE, */
    +
    964 /* IBITA MUST BE CALCULATED. */
    +
    965 
    +
    966 L1750:
    +
    967  itest = maxa - mina + lmiss;
    +
    968 
    +
    969  for (ibita = 0; ibita <= 30; ++ibita) {
    +
    970  if (itest < ibxx2[ibita]) {
    +
    971  goto L177;
    +
    972  }
    +
    973 /* *** THIS TEST IS THE SAME AS: */
    +
    974 /* *** IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 177 */
    +
    975 /* L176: */
    +
    976  }
    +
    977 
    +
    978 /* WRITE(KFILDO,1760)MAXA,MINA */
    +
    979 /* 1760 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    980 /* 1 ' MAXA ='I13,' MINA ='I13,'. ERROR AT 1760.') */
    +
    981  *ier = 706;
    +
    982  goto L900;
    +
    983 
    +
    984 L177:
    +
    985  goto L200;
    +
    986 
    +
    987 /* ************************************* */
    +
    988 
    +
    989 /* AT THIS POINT, GROUP B REQUIRES AS MANY BITS TO PACK AS GROUPA. */
    +
    990 /* THEREFORE, TRY TO ADD INC POINTS TO GROUP A WITHOUT INCREASING */
    +
    991 /* IBITA. THIS AUGMENTED GROUP IS CALLED GROUP C. */
    +
    992 
    +
    993 /* ************************************* */
    +
    994 
    +
    995 L180:
    +
    996  if (mislla == 1) {
    +
    997  minc = mallow;
    +
    998  minck = mallow;
    +
    999  maxc = -mallow;
    +
    1000  maxck = -mallow;
    +
    1001  } else {
    +
    1002  minc = mina;
    +
    1003  maxc = maxa;
    +
    1004  minck = minak;
    +
    1005  maxck = minak;
    +
    1006  }
    +
    1007 
    +
    1008  nount = 0;
    +
    1009  if (*nxy - (ktotal + kinc) <= lminpk / 2) {
    +
    1010  kinc = *nxy - ktotal;
    +
    1011  }
    +
    1012 /* ABOVE STATEMENT CONSTRAINS THE LAST GROUP TO BE NOT LESS THAN */
    +
    1013 /* LMINPK/2 IN SIZE. IF A PROVISION LIKE THIS IS NOT INCLUDED, */
    +
    1014 /* THERE WILL MANY TIMES BE A VERY SMALL GROUP AT THE END. */
    +
    1015 
    +
    1016 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    1017 /* FOR EFFICIENCY. SINCE KINC IS USUALLY 1, USING SEPARATE */
    +
    1018 /* LOOPS HERE DOESN'T BUY MUCH. A MISSING VALUE WILL ALWAYS */
    +
    1019 /* TRANSFER BACK TO GROUP A. */
    +
    1020 
    +
    1021  if (*is523 == 0) {
    +
    1022 
    +
    1023 /* Computing MIN */
    +
    1024  i__2 = ktotal + kinc;
    +
    1025  /*i__1 = min(i__2,*nxy);*/
    +
    1026  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1027  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1028  if (ic[k] < minc) {
    +
    1029  minc = ic[k];
    +
    1030  minck = k;
    +
    1031  }
    +
    1032  if (ic[k] > maxc) {
    +
    1033  maxc = ic[k];
    +
    1034  maxck = k;
    +
    1035  }
    +
    1036  ++nount;
    +
    1037 /* L185: */
    +
    1038  }
    +
    1039 
    +
    1040  } else if (*is523 == 1) {
    +
    1041 
    +
    1042 /* Computing MIN */
    +
    1043  i__2 = ktotal + kinc;
    +
    1044  /*i__1 = min(i__2,*nxy);*/
    +
    1045  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1046  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1047  if (ic[k] == *missp) {
    +
    1048  goto L186;
    +
    1049  }
    +
    1050  if (ic[k] < minc) {
    +
    1051  minc = ic[k];
    +
    1052  minck = k;
    +
    1053  }
    +
    1054  if (ic[k] > maxc) {
    +
    1055  maxc = ic[k];
    +
    1056  maxck = k;
    +
    1057  }
    +
    1058  L186:
    +
    1059  ++nount;
    +
    1060 /* L187: */
    +
    1061  }
    +
    1062 
    +
    1063  } else {
    +
    1064 
    +
    1065 /* Computing MIN */
    +
    1066  i__2 = ktotal + kinc;
    +
    1067  /*i__1 = min(i__2,*nxy);*/
    +
    1068  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1069  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1070  if (ic[k] == *missp || ic[k] == *misss) {
    +
    1071  goto L189;
    +
    1072  }
    +
    1073  if (ic[k] < minc) {
    +
    1074  minc = ic[k];
    +
    1075  minck = k;
    +
    1076  }
    +
    1077  if (ic[k] > maxc) {
    +
    1078  maxc = ic[k];
    +
    1079  maxck = k;
    +
    1080  }
    +
    1081  L189:
    +
    1082  ++nount;
    +
    1083 /* L190: */
    +
    1084  }
    +
    1085 
    +
    1086  }
    +
    1087 
    +
    1088 /* ***D WRITE(KFILDO,191)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
    +
    1089 /* ***D 1 MINC,MAXC,NOUNT,IC(KTOTAL),IC(KTOTAL+1) */
    +
    1090 /* ***D191 FORMAT(' AT 191, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    1091 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3, */
    +
    1092 /* ***D 2 ' MINC ='I8,' MAXC ='I8, */
    +
    1093 /* ***D 3 ' NOUNT ='I5,' IC(KTOTAL) ='I9,' IC(KTOTAL+1) =',I9) */
    +
    1094 
    +
    1095 /* IF THE NUMBER OF BITS NEEDED FOR GROUP C IS GT IBITA, */
    +
    1096 /* THEN THIS GROUP A IS A GROUP TO PACK. */
    +
    1097 
    +
    1098  if (minc == mallow) {
    +
    1099  minc = mina;
    +
    1100  maxc = maxa;
    +
    1101  minck = minak;
    +
    1102  maxck = maxak;
    +
    1103  misllc = 1;
    +
    1104  goto L195;
    +
    1105 /* WHEN THE NEW VALUE(S) ARE MISSING, THEY CAN ALWAYS */
    +
    1106 /* BE ADDED. */
    +
    1107 
    +
    1108  } else {
    +
    1109  misllc = 0;
    +
    1110  }
    +
    1111 
    +
    1112  if (maxc - minc >= ibxx2[ibita] - lmiss) {
    +
    1113  goto L200;
    +
    1114  }
    +
    1115 
    +
    1116 /* THE BITS NECESSARY FOR GROUP C HAS NOT INCREASED FROM THE */
    +
    1117 /* BITS NECESSARY FOR GROUP A. ADD THIS POINT(S) TO GROUP A. */
    +
    1118 /* COMPUTE THE NEXT GROUP B, ETC., UNLESS ALL POINTS HAVE BEEN */
    +
    1119 /* USED. */
    +
    1120 
    +
    1121 L195:
    +
    1122  ktotal += nount;
    +
    1123  kounta += nount;
    +
    1124  mina = minc;
    +
    1125  maxa = maxc;
    +
    1126  minak = minck;
    +
    1127  maxak = maxck;
    +
    1128  mislla = misllc;
    +
    1129  adda = TRUE_;
    +
    1130  if (ktotal >= *nxy) {
    +
    1131  goto L200;
    +
    1132  }
    +
    1133 
    +
    1134  if (minbk > ktotal && maxbk > ktotal) {
    +
    1135  mstart = nendb + 1;
    +
    1136 /* THE MAX AND MIN OF GROUP B WERE NOT FROM THE POINTS */
    +
    1137 /* REMOVED, SO THE WHOLE GROUP DOES NOT HAVE TO BE LOOKED */
    +
    1138 /* AT TO DETERMINE THE NEW MAX AND MIN. RATHER START */
    +
    1139 /* JUST BEYOND THE OLD NENDB. */
    +
    1140  ibitbs = ibitb;
    +
    1141  nendb = 1;
    +
    1142  goto L150;
    +
    1143  } else {
    +
    1144  goto L140;
    +
    1145  }
    +
    1146 
    +
    1147 /* ************************************* */
    +
    1148 
    +
    1149 /* GROUP A IS TO BE PACKED. STORE VALUES IN JMIN( ), JMAX( ), */
    +
    1150 /* LBIT( ), AND NOV( ). */
    +
    1151 
    +
    1152 /* ************************************* */
    +
    1153 
    +
    1154 L200:
    +
    1155  ++(*lx);
    +
    1156  if (*lx <= *ndg) {
    +
    1157  goto L205;
    +
    1158  }
    +
    1159  lminpk += lminpk / 2;
    +
    1160 /* WRITE(KFILDO,201)NDG,LMINPK,LX */
    +
    1161 /* 201 FORMAT(' ****NDG ='I5,' NOT LARGE ENOUGH.', */
    +
    1162 /* 1 ' LMINPK IS INCREASED TO 'I3,' FOR THIS FIELD.'/ */
    +
    1163 /* 2 ' LX = 'I10) */
    +
    1164  iersav = 716;
    +
    1165  goto L105;
    +
    1166 
    +
    1167 L205:
    +
    1168  jmin[*lx] = mina;
    +
    1169  jmax[*lx] = maxa;
    +
    1170  lbit[*lx] = ibita;
    +
    1171  nov[*lx] = kounta;
    +
    1172  kstart = ktotal + 1;
    +
    1173 
    +
    1174  if (mislla == 0) {
    +
    1175  misslx[*lx - 1] = mallow;
    +
    1176  } else {
    +
    1177  misslx[*lx - 1] = ic[ktotal];
    +
    1178 /* IC(KTOTAL) WAS THE LAST VALUE PROCESSED. IF MISLLA NE 0, */
    +
    1179 /* THIS MUST BE THE MISSING VALUE FOR THIS GROUP. */
    +
    1180  }
    +
    1181 
    +
    1182 /* ***D WRITE(KFILDO,206)MISLLA,IC(KTOTAL),KTOTAL,LX,JMIN(LX),JMAX(LX), */
    +
    1183 /* ***D 1 LBIT(LX),NOV(LX),MISSLX(LX) */
    +
    1184 /* ***D206 FORMAT(' AT 206, MISLLA ='I2,' IC(KTOTAL) ='I5,' KTOTAL ='I8, */
    +
    1185 /* ***D 1 ' LX ='I6,' JMIN(LX) ='I8,' JMAX(LX) ='I8, */
    +
    1186 /* ***D 2 ' LBIT(LX) ='I5,' NOV(LX) ='I8,' MISSLX(LX) =',I7) */
    +
    1187 
    +
    1188  if (ktotal >= *nxy) {
    +
    1189  goto L209;
    +
    1190  }
    +
    1191 
    +
    1192 /* THE NEW GROUP A WILL BE THE PREVIOUS GROUP B. SET LIMITS, ETC. */
    +
    1193 
    +
    1194  ibita = ibitb;
    +
    1195  mina = minb;
    +
    1196  maxa = maxb;
    +
    1197  minak = minbk;
    +
    1198  maxak = maxbk;
    +
    1199  mislla = misllb;
    +
    1200  nenda = nendb;
    +
    1201  kounta = kountb;
    +
    1202  ktotal += kounta;
    +
    1203  adda = FALSE_;
    +
    1204  goto L133;
    +
    1205 
    +
    1206 /* ************************************* */
    +
    1207 
    +
    1208 /* CALCULATE IBIT, THE NUMBER OF BITS NEEDED TO HOLD THE GROUP */
    +
    1209 /* MINIMUM VALUES. */
    +
    1210 
    +
    1211 /* ************************************* */
    +
    1212 
    +
    1213 L209:
    +
    1214  *ibit = 0;
    +
    1215 
    +
    1216  i__1 = *lx;
    +
    1217  for (l = 1; l <= i__1; ++l) {
    +
    1218  L210:
    +
    1219  if (jmin[l] < ibxx2[*ibit]) {
    +
    1220  goto L220;
    +
    1221  }
    +
    1222  ++(*ibit);
    +
    1223  goto L210;
    +
    1224  L220:
    +
    1225  ;
    +
    1226  }
    +
    1227 
    +
    1228 /* INSERT THE VALUE IN JMIN( ) TO BE USED FOR ALL MISSING */
    +
    1229 /* VALUES WHEN LBIT( ) = 0. WHEN SECONDARY MISSING */
    +
    1230 /* VALUES CAN BE PRESENT, LBIT(L) WILL NOT = 0. */
    +
    1231 
    +
    1232  if (*is523 == 1) {
    +
    1233 
    +
    1234  i__1 = *lx;
    +
    1235  for (l = 1; l <= i__1; ++l) {
    +
    1236 
    +
    1237  if (lbit[l] == 0) {
    +
    1238 
    +
    1239  if (misslx[l - 1] == *missp) {
    +
    1240  jmin[l] = ibxx2[*ibit] - 1;
    +
    1241  }
    +
    1242 
    +
    1243  }
    +
    1244 
    +
    1245 /* L226: */
    +
    1246  }
    +
    1247 
    +
    1248  }
    +
    1249 
    +
    1250 /* ************************************* */
    +
    1251 
    +
    1252 /* CALCULATE JBIT, THE NUMBER OF BITS NEEDED TO HOLD THE BITS */
    +
    1253 /* NEEDED TO PACK THE VALUES IN THE GROUPS. BUT FIND AND */
    +
    1254 /* REMOVE THE REFERENCE VALUE FIRST. */
    +
    1255 
    +
    1256 /* ************************************* */
    +
    1257 
    +
    1258 /* WRITE(KFILDO,228)CFEED,LX */
    +
    1259 /* 228 FORMAT(A1,/' *****************************************' */
    +
    1260 /* 1 /' THE GROUP WIDTHS LBIT( ) FOR ',I8,' GROUPS' */
    +
    1261 /* 2 /' *****************************************') */
    +
    1262 /* WRITE(KFILDO,229) (LBIT(J),J=1,MIN(LX,100)) */
    +
    1263 /* 229 FORMAT(/' '20I6) */
    +
    1264 
    +
    1265  *lbitref = lbit[1];
    +
    1266 
    +
    1267  i__1 = *lx;
    +
    1268  for (k = 1; k <= i__1; ++k) {
    +
    1269  if (lbit[k] < *lbitref) {
    +
    1270  *lbitref = lbit[k];
    +
    1271  }
    +
    1272 /* L230: */
    +
    1273  }
    +
    1274 
    +
    1275  if (*lbitref != 0) {
    +
    1276 
    +
    1277  i__1 = *lx;
    +
    1278  for (k = 1; k <= i__1; ++k) {
    +
    1279  lbit[k] -= *lbitref;
    +
    1280 /* L240: */
    +
    1281  }
    +
    1282 
    +
    1283  }
    +
    1284 
    +
    1285 /* WRITE(KFILDO,241)CFEED,LBITREF */
    +
    1286 /* 241 FORMAT(A1,/' *****************************************' */
    +
    1287 /* 1 /' THE GROUP WIDTHS LBIT( ) AFTER REMOVING REFERENCE ', */
    +
    1288 /* 2 I8, */
    +
    1289 /* 3 /' *****************************************') */
    +
    1290 /* WRITE(KFILDO,242) (LBIT(J),J=1,MIN(LX,100)) */
    +
    1291 /* 242 FORMAT(/' '20I6) */
    +
    1292 
    +
    1293  *jbit = 0;
    +
    1294 
    +
    1295  i__1 = *lx;
    +
    1296  for (k = 1; k <= i__1; ++k) {
    +
    1297  L310:
    +
    1298  if (lbit[k] < ibxx2[*jbit]) {
    +
    1299  goto L320;
    +
    1300  }
    +
    1301  ++(*jbit);
    +
    1302  goto L310;
    +
    1303  L320:
    +
    1304  ;
    +
    1305  }
    +
    1306 
    +
    1307 /* ************************************* */
    +
    1308 
    +
    1309 /* CALCULATE KBIT, THE NUMBER OF BITS NEEDED TO HOLD THE NUMBER */
    +
    1310 /* OF VALUES IN THE GROUPS. BUT FIND AND REMOVE THE */
    +
    1311 /* REFERENCE FIRST. */
    +
    1312 
    +
    1313 /* ************************************* */
    +
    1314 
    +
    1315 /* WRITE(KFILDO,321)CFEED,LX */
    +
    1316 /* 321 FORMAT(A1,/' *****************************************' */
    +
    1317 /* 1 /' THE GROUP SIZES NOV( ) FOR ',I8,' GROUPS' */
    +
    1318 /* 2 /' *****************************************') */
    +
    1319 /* WRITE(KFILDO,322) (NOV(J),J=1,MIN(LX,100)) */
    +
    1320 /* 322 FORMAT(/' '20I6) */
    +
    1321 
    +
    1322  *novref = nov[1];
    +
    1323 
    +
    1324  i__1 = *lx;
    +
    1325  for (k = 1; k <= i__1; ++k) {
    +
    1326  if (nov[k] < *novref) {
    +
    1327  *novref = nov[k];
    +
    1328  }
    +
    1329 /* L400: */
    +
    1330  }
    +
    1331 
    +
    1332  if (*novref > 0) {
    +
    1333 
    +
    1334  i__1 = *lx;
    +
    1335  for (k = 1; k <= i__1; ++k) {
    +
    1336  nov[k] -= *novref;
    +
    1337 /* L405: */
    +
    1338  }
    +
    1339 
    +
    1340  }
    +
    1341 
    +
    1342 /* WRITE(KFILDO,406)CFEED,NOVREF */
    +
    1343 /* 406 FORMAT(A1,/' *****************************************' */
    +
    1344 /* 1 /' THE GROUP SIZES NOV( ) AFTER REMOVING REFERENCE ',I8, */
    +
    1345 /* 2 /' *****************************************') */
    +
    1346 /* WRITE(KFILDO,407) (NOV(J),J=1,MIN(LX,100)) */
    +
    1347 /* 407 FORMAT(/' '20I6) */
    +
    1348 /* WRITE(KFILDO,408)CFEED */
    +
    1349 /* 408 FORMAT(A1,/' *****************************************' */
    +
    1350 /* 1 /' THE GROUP REFERENCES JMIN( )' */
    +
    1351 /* 2 /' *****************************************') */
    +
    1352 /* WRITE(KFILDO,409) (JMIN(J),J=1,MIN(LX,100)) */
    +
    1353 /* 409 FORMAT(/' '20I6) */
    +
    1354 
    +
    1355  *kbit = 0;
    +
    1356 
    +
    1357  i__1 = *lx;
    +
    1358  for (k = 1; k <= i__1; ++k) {
    +
    1359  L410:
    +
    1360  if (nov[k] < ibxx2[*kbit]) {
    +
    1361  goto L420;
    +
    1362  }
    +
    1363  ++(*kbit);
    +
    1364  goto L410;
    +
    1365  L420:
    +
    1366  ;
    +
    1367  }
    +
    1368 
    +
    1369 /* DETERMINE WHETHER THE GROUP SIZES SHOULD BE REDUCED */
    +
    1370 /* FOR SPACE EFFICIENCY. */
    +
    1371 
    +
    1372  if (ired == 0) {
    +
    1373  reduce(kfildo, &jmin[1], &jmax[1], &lbit[1], &nov[1], lx, ndg, ibit,
    +
    1374  jbit, kbit, novref, ibxx2, ier);
    +
    1375 
    +
    1376  if (*ier == 714 || *ier == 715) {
    +
    1377 /* REDUCE HAS ABORTED. REEXECUTE PACK_GP WITHOUT REDUCE. */
    +
    1378 /* PROVIDE FOR A NON FATAL RETURN FROM REDUCE. */
    +
    1379  iersav = *ier;
    +
    1380  ired = 1;
    +
    1381  *ier = 0;
    +
    1382  goto L102;
    +
    1383  }
    +
    1384 
    +
    1385  }
    +
    1386 
    +
    1387  if ( misslx != 0 ) {
    +
    1388  free(misslx);
    +
    1389  misslx=0;
    +
    1390  }
    +
    1391 /* CALL TIMPR(KFILDO,KFILDO,'END PACK_GP ') */
    +
    1392  if (iersav != 0) {
    +
    1393  *ier = iersav;
    +
    1394  return 0;
    +
    1395  }
    +
    1396 
    +
    1397 /* 900 IF(IER.NE.0)RETURN1 */
    +
    1398 
    +
    1399 L900:
    +
    1400  if ( misslx != 0 ) free(misslx);
    +
    1401  return 0;
    +
    1402 } /* 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 ...
    Definition: pack_gp.c:255
    +
    #define FALSE_
    False.
    Definition: pack_gp.c:10
    +
    int reduce(g2int *kfildo, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *lx, g2int *ndg, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *ibxx2, g2int *ier)
    Determines whether the number of groups should be increased in order to reduce the size of the large ...
    Definition: reduce.c:88
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    #define TRUE_
    True.
    Definition: pack_gp.c:9
    + + + + diff --git a/ver-1.7.0/pdstemplates_8c.html b/ver-1.7.0/pdstemplates_8c.html new file mode 100644 index 00000000..e79a890a --- /dev/null +++ b/ver-1.7.0/pdstemplates_8c.html @@ -0,0 +1,369 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pdstemplates.c File Reference
    +
    +
    + +

    Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS). +More...

    +
    #include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define MAXPDSMAPLEN   200
     Maximum template map length. More...
     
    #define MAXPDSTEMP   47
     Maximum number of templates. More...
     
    + + + + + + + + + + +

    +Functions

    gtemplateextpdstemplate (g2int number, g2int *list)
     This subroutine generates the remaining octet map for a given Product Definition Template, if required. More...
     
    static g2int getpdsindex (g2int number)
     This function returns the index of specified Product Definition Template in array templates. More...
     
    gtemplategetpdstemplate (g2int number)
     This subroutine returns PDS template information for a specified Product Definition Template. More...
     
    + + + + +

    +Variables

    static const struct pdstemplate templatespds [MAXPDSTEMP]
     Data for struct for PDS template. More...
     
    +

    Detailed Description

    +

    Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS).

    +

    Each Template has three parts:

      +
    1. The number of entries in the template (mappdslen).
    2. +
    3. A map of the template (mappds), which contains the number of octets in which to pack each of the template values.
    4. +
    5. 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 4.3 as an example).
    6. +
    +
    Note
    Array mappds contains the number of octets in which the corresponding template values will be stored. A negative value in mappds 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 mappds[] 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 mappds.
    +

    +Program History Log

    + + + + + + + + + + + + + + + + + + + +
    Date Programmer Comments
    2001-06-28 Gilbert Initial
    2009-01-14 Vuong Changed structure name template to gtemplate
    2009-12-15 Vuong Added Product Definition Templates 4.31, 4.15
    2010-08-03 Vuong Added Product Definition Template 4.42 and 4.43
    2010-12-08 Vuong Corrected Product Definition Template 4.42 and 4.43
    2012-03-29 Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50, 4.51,4.91,4.32 and 4.52
    2013-08-05 Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
    2015-10-07 Vuong Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition in file pdstemplates.c.

    +

    Macro Definition Documentation

    + +

    ◆ MAXPDSMAPLEN

    + +
    +
    + + + + +
    #define MAXPDSMAPLEN   200
    +
    + +

    Maximum template map length.

    + +

    Definition at line 45 of file pdstemplates.c.

    + +
    +
    + +

    ◆ MAXPDSTEMP

    + +
    +
    + + + + +
    #define MAXPDSTEMP   47
    +
    + +

    Maximum number of templates.

    + +

    Definition at line 44 of file pdstemplates.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ extpdstemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extpdstemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numbernumber of the Product Definition Template 4.NN that is being requested.
    listThe 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().

    + +
    +
    + +

    ◆ getpdsindex()

    + +
    +
    + + + + + +
    + + + + + + + + +
    static g2int getpdsindex (g2int number)
    +
    +static
    +
    + +

    This function returns the index of specified Product Definition Template in array templates.

    +
    Parameters
    + + +
    numberThe number of the Product Definition Template that is being requested.
    +
    +
    +
    Returns
    Index of PDT in array templates, if template exists. -1, otherwise.
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition at line 246 of file pdstemplates.c.

    + +

    References MAXPDSTEMP, and templatespds.

    + +

    Referenced by extpdstemplate(), and getpdstemplate().

    + +
    +
    + +

    ◆ getpdstemplate()

    + +
    +
    + + + + + + + + +
    gtemplate* getpdstemplate (g2int number)
    +
    + +

    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
    + + +
    numberthe 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().

    + +
    +
    +

    Variable Documentation

    + +

    ◆ templatespds

    + +
    +
    + + + + + +
    + + + + +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    +
    +static
    +
    + +

    Data for struct for PDS template.

    + +

    Definition at line 61 of file pdstemplates.c.

    + +

    Referenced by getpdsindex(), and getpdstemplate().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/pdstemplates_8c.js b/ver-1.7.0/pdstemplates_8c.js new file mode 100644 index 00000000..2dcf94dd --- /dev/null +++ b/ver-1.7.0/pdstemplates_8c.js @@ -0,0 +1,9 @@ +var pdstemplates_8c = +[ + [ "MAXPDSMAPLEN", "pdstemplates_8c.html#aa0bb590f8c48ad21d17f6cf7a72d8f53", null ], + [ "MAXPDSTEMP", "pdstemplates_8c.html#a11c588e7671155abba68b92678fc2071", null ], + [ "extpdstemplate", "pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb", null ], + [ "getpdsindex", "pdstemplates_8c.html#a59f2fe1fba0577301d154f21e0478e7f", null ], + [ "getpdstemplate", "pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520", null ], + [ "templatespds", "pdstemplates_8c.html#a87d5723cb60a9b598bc574cd31673a26", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pdstemplates_8c_source.html b/ver-1.7.0/pdstemplates_8c_source.html new file mode 100644 index 00000000..07a8fffa --- /dev/null +++ b/ver-1.7.0/pdstemplates_8c_source.html @@ -0,0 +1,623 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pdstemplates.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    41 #include <stdlib.h>
    +
    42 #include "grib2_int.h"
    +
    43 
    +
    44 #define MAXPDSTEMP 47
    +
    45 #define MAXPDSMAPLEN 200
    +
    50 struct pdstemplate
    +
    51 {
    +
    52  g2int template_num;
    +
    53  g2int mappdslen;
    +
    54  g2int needext;
    +
    55  g2int mappds[MAXPDSMAPLEN];
    +
    56 };
    +
    57 
    +
    61 static const struct pdstemplate templatespds[MAXPDSTEMP] =
    +
    62 {
    +
    65  {0,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    68  {1,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    71  {2,17,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1} },
    +
    74  {3,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4} },
    +
    77  {4,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4} },
    +
    80  {5,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4} },
    +
    83  {6,16,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    86  {7,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    89  {8,29,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    92  {9,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    95  {10,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    98  {11,32,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    101  {12,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    104  {13,45,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    107  {14,44,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    110  {15,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    112  {20,19,0, {1,1,1,1,1,-4,4,2,4,2,1,1,1,1,1,2,1,3,2} },
    +
    114  {30,5,1, {1,1,1,1,1} },
    +
    116  {31,5,1, {1,1,1,1,1} },
    +
    119  {40,16,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    122  {41,19,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    126  {42,30,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    130  {43,33,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    132  {254,3,0, {1,1,4} },
    +
    135  {1000,9,0, {1,1,1,1,1,2,1,1,-4} },
    +
    138  {1001,16,0, {1,1,1,1,1,2,1,1,4,4,1,1,1,4,1,4} },
    +
    141  {1002,15,0, {1,1,1,1,1,2,1,1,-4,1,1,1,4,4,2} },
    +
    144  {1100,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    147  {1101,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,4,1,1,1,4,1,4} },
    +
    149  {32,10,1, {1,1,1,1,1,2,1,1,-2,1} },
    +
    152  {44,21,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-2,1,-1,-4,1,-1,-4} },
    +
    156  {45,24,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    160  {46,35,1, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    164  {47,38,1, {1,1,1,2,1,-1,-4,-1,-4,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    168  {48,26,0, {1,1,2,1,-1,-4,-1,-4,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    169 
    +
    173  {50,21,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,4,4,4,4} },
    +
    174 
    +
    178  {52,15,0, {1,1,1,1,1,1,1,1,2,1,1,-4,1,-1,-4} },
    +
    179 
    +
    182  {51,16,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    183 
    +
    187  {91,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    192  {33,18,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1} },
    +
    197  {34,32,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    202  {53,19,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    207  {54,22,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    213  {57,7,1, {1,1,2,2,2,2,1} },
    +
    218  {60,24,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1} },
    +
    223  {61,38,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    229  {35,6,1, {1,1,1,1,1,1} }
    +
    230 
    +
    231 } ;
    +
    232 
    +
    245 static g2int
    + +
    247 {
    +
    248  g2int j, getpdsindex = -1;
    +
    249 
    +
    250  for (j = 0; j < MAXPDSTEMP; j++)
    +
    251  {
    +
    252  if (number == templatespds[j].template_num)
    +
    253  {
    +
    254  getpdsindex = j;
    +
    255  return getpdsindex;
    +
    256  }
    +
    257  }
    +
    258 
    +
    259  return getpdsindex;
    +
    260 }
    +
    261 
    +
    280 gtemplate *
    + +
    282 {
    +
    283  g2int index;
    +
    284  gtemplate *new;
    +
    285 
    +
    286  index = getpdsindex(number);
    +
    287 
    +
    288  if (index != -1)
    +
    289  {
    +
    290  new = malloc(sizeof(gtemplate));
    +
    291  new->type = 4;
    +
    292  new->num = templatespds[index].template_num;
    +
    293  new->maplen = templatespds[index].mappdslen;
    +
    294  new->needext = templatespds[index].needext;
    +
    295  new->map = (g2int *)templatespds[index].mappds;
    +
    296  new->extlen = 0;
    +
    297  new->ext = NULL;
    +
    298  return new;
    +
    299  }
    +
    300  else {
    +
    301  printf("getpdstemplate: PDS Template 4.%d not defined.\n", (int)number);
    +
    302  return NULL;
    +
    303  }
    +
    304 
    +
    305  return NULL;
    +
    306 }
    +
    307 
    +
    328 gtemplate *
    +
    329 extpdstemplate(g2int number, g2int *list)
    +
    330 {
    +
    331  gtemplate *new;
    +
    332  g2int index, i, j, k, l;
    +
    333 
    +
    334  index = getpdsindex(number);
    +
    335  if (index == -1)
    +
    336  return NULL;
    +
    337 
    +
    338  new = getpdstemplate(number);
    +
    339 
    +
    340  if (!new->needext)
    +
    341  return new;
    +
    342 
    +
    343  if (number == 3)
    +
    344  {
    +
    345  new->extlen = list[26];
    +
    346  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    347  for (i = 0; i < new->extlen; i++)
    +
    348  {
    +
    349  new->ext[i] = 1;
    +
    350  }
    +
    351  }
    +
    352  else if (number == 4)
    +
    353  {
    +
    354  new->extlen = list[25];
    +
    355  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    356  for (i = 0; i < new->extlen; i++)
    +
    357  {
    +
    358  new->ext[i] = 1;
    +
    359  }
    +
    360  }
    +
    361  else if (number == 8)
    +
    362  {
    +
    363  if (list[21] > 1)
    +
    364  {
    +
    365  new->extlen = (list[21] - 1) * 6;
    +
    366  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    367  for (j = 2; j <= list[21]; j++)
    +
    368  {
    +
    369  l = (j - 2) * 6;
    +
    370  for (k = 0; k < 6; k++)
    +
    371  {
    +
    372  new->ext[l+k] = new->map[23 + k];
    +
    373  }
    +
    374  }
    +
    375  }
    +
    376  }
    +
    377  else if (number == 9)
    +
    378  {
    +
    379  if (list[28] > 1)
    +
    380  {
    +
    381  new->extlen = (list[28] - 1) * 6;
    +
    382  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    383  for (j = 2; j <= list[28]; j++)
    +
    384  {
    +
    385  l = (j - 2) * 6;
    +
    386  for (k = 0; k < 6; k++)
    +
    387  {
    +
    388  new->ext[l + k] = new->map[30 + k];
    +
    389  }
    +
    390  }
    +
    391  }
    +
    392  }
    +
    393  else if (number == 10)
    +
    394  {
    +
    395  if (list[22] > 1)
    +
    396  {
    +
    397  new->extlen = (list[22] - 1) * 6;
    +
    398  new->ext = (g2int *)malloc(sizeof(g2int)*new->extlen);
    +
    399  for (j = 2; j <= list[22]; j++)
    +
    400  {
    +
    401  l = (j - 2) * 6;
    +
    402  for (k = 0; k < 6; k++)
    +
    403  {
    +
    404  new->ext[l + k] = new->map[24 + k];
    +
    405  }
    +
    406  }
    +
    407  }
    +
    408  }
    +
    409  else if (number == 11)
    +
    410  {
    +
    411  if (list[24] > 1)
    +
    412  {
    +
    413  new->extlen = (list[24] - 1) * 6;
    +
    414  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    415  for (j = 2; j <= list[24]; j++)
    +
    416  {
    +
    417  l = (j - 2) * 6;
    +
    418  for (k = 0; k < 6; k++)
    +
    419  {
    +
    420  new->ext[l + k] = new->map[26 + k];
    +
    421  }
    +
    422  }
    +
    423  }
    +
    424  }
    +
    425  else if (number == 12)
    +
    426  {
    +
    427  if (list[23] > 1)
    +
    428  {
    +
    429  new->extlen = (list[23] - 1) * 6;
    +
    430  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    431  for (j = 2; j <= list[23]; j++)
    +
    432  {
    +
    433  l = (j - 2) * 6;
    +
    434  for (k = 0; k < 6; k++)
    +
    435  {
    +
    436  new->ext[l + k] = new->map[25 + k];
    +
    437  }
    +
    438  }
    +
    439  }
    +
    440  }
    +
    441  else if (number == 13)
    +
    442  {
    +
    443  new->extlen = ((list[37] - 1) * 6) + list[26];
    +
    444  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    445  if (list[37] > 1)
    +
    446  {
    +
    447  for (j = 2; j <= list[37]; j++)
    +
    448  {
    +
    449  l = (j - 2) * 6;
    +
    450  for (k = 0; k < 6; k++)
    +
    451  {
    +
    452  new->ext[l + k] = new->map[39 + k];
    +
    453  }
    +
    454  }
    +
    455  }
    +
    456  l = (list[37] - 1) * 6;
    +
    457  if (l < 0)
    +
    458  l = 0;
    +
    459  for (i = 0; i < list[26]; i++)
    +
    460  {
    +
    461  new->ext[l+i] = 1;
    +
    462  }
    +
    463  }
    +
    464  else if (number == 14)
    +
    465  {
    +
    466  new->extlen = ((list[36] - 1) * 6) + list[25];
    +
    467  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    468  if (list[36] > 1)
    +
    469  {
    +
    470  for (j = 2; j <= list[36]; j++)
    +
    471  {
    +
    472  l = (j - 2) * 6;
    +
    473  for (k = 0; k < 6; k++)
    +
    474  {
    +
    475  new->ext[l + k] = new->map[38 + k];
    +
    476  }
    +
    477  }
    +
    478  }
    +
    479  l = (list[36] - 1) * 6;
    +
    480  if (l < 0)
    +
    481  l = 0;
    +
    482  for (i = 0; i < list[25]; i++)
    +
    483  {
    +
    484  new->ext[l + i] = 1;
    +
    485  }
    +
    486  }
    +
    487  else if (number == 30)
    +
    488  {
    +
    489  new->extlen = list[4] * 5;
    +
    490  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    491  for (i = 0;i < list[4]; i++)
    +
    492  {
    +
    493  l = i * 5;
    +
    494  new->ext[l] = 2;
    +
    495  new->ext[l + 1] = 2;
    +
    496  new->ext[l + 2] = 1;
    +
    497  new->ext[l + 3] = 1;
    +
    498  new->ext[l + 4] = 4;
    +
    499  }
    +
    500  }
    +
    501  else if (number == 31)
    +
    502  {
    +
    503  new->extlen = list[4] * 5;
    +
    504  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    505  for (i = 0; i < list[4]; i++)
    +
    506  {
    +
    507  l = i*5;
    +
    508  new->ext[l] = 2;
    +
    509  new->ext[l + 1] = 2;
    +
    510  new->ext[l + 2] = 2;
    +
    511  new->ext[l + 3] = 1;
    +
    512  new->ext[l + 4] = 4;
    +
    513  }
    +
    514  }
    +
    515  else if (number == 42)
    +
    516  {
    +
    517  if (list[22] > 1)
    +
    518  {
    +
    519  new->extlen = (list[22] - 1) * 6;
    +
    520  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    521  for (j = 2; j <= list[22]; j++)
    +
    522  {
    +
    523  l = (j - 2) * 6;
    +
    524  for (k = 0; k < 6; k++)
    +
    525  {
    +
    526  new->ext[l + k] = new->map[24 + k];
    +
    527  }
    +
    528  }
    +
    529  }
    +
    530  }
    +
    531  else if (number == 43)
    +
    532  {
    +
    533  if (list[25] > 1)
    +
    534  {
    +
    535  new->extlen = (list[25] - 1) * 6;
    +
    536  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    537  for (j = 2; j <= list[25]; j++)
    +
    538  {
    +
    539  l = (j - 2) * 6;
    +
    540  for (k = 0; k < 6; k++)
    +
    541  {
    +
    542  new->ext[l + k] = new->map[27 + k];
    +
    543  }
    +
    544  }
    +
    545  }
    +
    546  }
    +
    547  else if (number == 32)
    +
    548  {
    +
    549  new->extlen = list[9] * 10;
    +
    550  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    551  for (i = 0; i < list[9]; i++)
    +
    552  {
    +
    553  l = i * 5;
    +
    554  new->ext[l] = 2;
    +
    555  new->ext[l + 1] = 2;
    +
    556  new->ext[l + 2] = 2;
    +
    557  new->ext[l + 3] = -1;
    +
    558  new->ext[l + 4] = -4;
    +
    559  }
    +
    560  }
    +
    561  else if (number == 46)
    +
    562  {
    +
    563  if (list[27] > 1)
    +
    564  {
    +
    565  new->extlen = (list[27] - 1) * 6;
    +
    566  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    567  for (j = 2; j <= list[27]; j++)
    +
    568  {
    +
    569  l = (j - 2) * 6;
    +
    570  for (k = 0; k < 6; k++)
    +
    571  {
    +
    572  new->ext[l + k] = new->map[29 + k];
    +
    573  }
    +
    574  }
    +
    575  }
    +
    576  }
    +
    577  else if (number == 47)
    +
    578  {
    +
    579  if (list[30] > 1)
    +
    580  {
    +
    581  new->extlen = (list[30] - 1) * 6;
    +
    582  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    583  for (j = 2; j <= list[30]; j++)
    +
    584  {
    +
    585  l = (j - 2) * 6;
    +
    586  for (k = 0; k < 6; k++)
    +
    587  {
    +
    588  new->ext[l + k] = new->map[32 + k];
    +
    589  }
    +
    590  }
    +
    591  }
    +
    592  }
    +
    593  else if (number == 51)
    +
    594  {
    +
    595  new->extlen = list[15]*11;
    +
    596  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    597  for (i = 0; i < list[15]; i++)
    +
    598  {
    +
    599  l = i * 6;
    +
    600  new->ext[l] = 1;
    +
    601  new->ext[l+1] = 1;
    +
    602  new->ext[l+2] = -1;
    +
    603  new->ext[l+3] = -4;
    +
    604  new->ext[l+4] = -1;
    +
    605  new->ext[l+5] = -4;
    +
    606  }
    +
    607  }
    +
    608  else if (number == 33)
    +
    609  {
    +
    610  new->extlen = list[9];
    +
    611  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    612  for (i = 0; i < new->extlen; i++)
    +
    613  {
    +
    614  new->ext[i] = 1;
    +
    615  }
    +
    616  }
    +
    617  else if (number == 34)
    +
    618  {
    +
    619  new->extlen = ((list[24] - 1) * 6)+list[9];
    +
    620  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    621  if (list[24] > 1)
    +
    622  {
    +
    623  for (j = 2; j <= list[24]; j++)
    +
    624  {
    +
    625  l = (j - 2) * 6;
    +
    626  for (k = 0; k < 6; k++)
    +
    627  {
    +
    628  new->ext[l + k] = new->map[26 + k];
    +
    629  }
    +
    630  }
    +
    631  }
    +
    632  l = (list[24] - 1) * 6;
    +
    633  if (l < 0)
    +
    634  l = 0;
    +
    635  for (i = 0; i < list[9]; i++)
    +
    636  {
    +
    637  new->ext[l + i] = 1;
    +
    638  }
    +
    639  }
    +
    640  else if (number == 53)
    +
    641  {
    +
    642  new->extlen = list[3];
    +
    643  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    644  for (i = 0; i < new->extlen; i++)
    +
    645  {
    +
    646  new->ext[i] = 1;
    +
    647  }
    +
    648  }
    +
    649  else if (number == 54)
    +
    650  {
    +
    651  new->extlen = list[3];
    +
    652  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    653  for (i = 0;i<new->extlen;i++)
    +
    654  {
    +
    655  new->ext[i] = 1;
    +
    656  }
    +
    657  }
    +
    658  else if (number == 91)
    +
    659  {
    +
    660  new->extlen = ((list[28] - 1) * 6)+list[15];
    +
    661  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    662  if (list[28] > 1)
    +
    663  {
    +
    664  for (j = 2; j <= list[28]; j++)
    +
    665  {
    +
    666  l = (j - 2) * 6;
    +
    667  for (k = 0; k < 6; k++)
    +
    668  {
    +
    669  new->ext[l + k] = new->map[30 + k];
    +
    670  }
    +
    671  }
    +
    672  }
    +
    673  l = (list[29] - 1) * 6;
    +
    674  if (l < 0)
    +
    675  l = 0;
    +
    676  for (i = 0; i < list[15]; i++)
    +
    677  {
    +
    678  new->ext[l + i] = 1;
    +
    679  }
    +
    680  }
    +
    681  /* PDT 4.57 (10/07/2015) */
    +
    682  else if (number == 57)
    +
    683  {
    +
    684  new->extlen = list[6] * 15;
    +
    685  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    686  for (i = 0; i < list[6]; i++)
    +
    687  {
    +
    688  l = i*15;
    +
    689  new->ext[l] = 1;
    +
    690  new->ext[l+1] = -4;
    +
    691  new->ext[l+2] = 1;
    +
    692  new->ext[l+3] = 1;
    +
    693  new->ext[l+4] = 1;
    +
    694  new->ext[l+5] = 2;
    +
    695  new->ext[l+6] = 1;
    +
    696  new->ext[l+7] = 1;
    +
    697  new->ext[l+8] = -4;
    +
    698  new->ext[l+9] = 1;
    +
    699  new->ext[l+10] = -1;
    +
    700  new->ext[l+11] = -4;
    +
    701  new->ext[l+12] = 1;
    +
    702  new->ext[l+13] = -1;
    +
    703  new->ext[l+14] = -4;
    +
    704  }
    +
    705  }
    +
    706  /* PDT 4.61 (10/07/2015) */
    +
    707  else if (number == 61)
    +
    708  {
    +
    709  if (list[30] > 1)
    +
    710  {
    +
    711  new->extlen = (list[30] - 1) * 6;
    +
    712  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    713  for (j = 2; j <= list[30]; j++)
    +
    714  {
    +
    715  l = (j - 2) * 6;
    +
    716  for (k = 0; k < 6; k++)
    +
    717  {
    +
    718  new->ext[l + k] = new->map[32 + k];
    +
    719  }
    +
    720  }
    +
    721  }
    +
    722  }
    +
    723 
    +
    724  return new;
    +
    725 }
    +
    +
    +
    gtemplate * getpdstemplate(g2int number)
    This subroutine returns PDS template information for a specified Product Definition Template.
    Definition: pdstemplates.c:281
    +
    static const struct pdstemplate templatespds[MAXPDSTEMP]
    Data for struct for PDS template.
    Definition: pdstemplates.c:61
    +
    #define MAXPDSMAPLEN
    Maximum template map length.
    Definition: pdstemplates.c:45
    +
    static g2int getpdsindex(g2int number)
    This function returns the index of specified Product Definition Template in array templates.
    Definition: pdstemplates.c:246
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    gtemplate * extpdstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Product Definition Template,...
    Definition: pdstemplates.c:329
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    Struct for GRIB template.
    Definition: grib2_int.h:28
    +
    #define MAXPDSTEMP
    Maximum number of templates.
    Definition: pdstemplates.c:44
    + + + + diff --git a/ver-1.7.0/pdstemplates_8h.html b/ver-1.7.0/pdstemplates_8h.html new file mode 100644 index 00000000..3337bcd7 --- /dev/null +++ b/ver-1.7.0/pdstemplates_8h.html @@ -0,0 +1,268 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.h File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pdstemplates.h File Reference
    +
    +
    + +

    This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml). +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Data Structures

    struct  pdstemplate
     Struct for PDS template. More...
     
    + + + + + + + +

    +Macros

    #define MAXPDSMAPLEN   200
     Maximum template map length. More...
     
    #define MAXPDSTEMP   47
     Maximum number of templates. More...
     
    + + + + +

    +Variables

    const struct pdstemplate templatespds [MAXPDSTEMP]
     Date for struct for PDS template. More...
     
    +

    Detailed Description

    +

    This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml).

    +

    Each Template has three parts:

      +
    1. The number of entries in the template (mappdslen).
    2. +
    3. A map of the template (mappds), which contains the number of octets in which to pack each of the template values.
    4. +
    5. 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 4.3 as an example).
    6. +
    +
    Note
    Array mappds contains the number of octets in which the corresponding template values will be stored. A negative value in mappds 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 mappds[] 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 mappds.
    +

    +Program History Log

    + + + + + + + + + + + + + + + + + + + +
    Date Programmer Comments
    2005-12-08 Gilbert Allow negative scale factors, limits for 4.5 and 4.9
    2009-12-15 Vuong Added Product Definition Templates 4.31, 4.15
    2010-08-03 Vuong Added Product Definition Template 4.40,4.41,4.42,4.43
    2010-12-08 Vuong Corrected Definition Template 4.42,4.43
    2010-12-08 Vuong Corrected Definition Template 4.42,4.43
    2012-03-29 Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,4.51,4.91,4.32 and 4.52
    2013-08-05 Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
    2015-10-07 Vuong Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative
    +
    Author
    Stephen Gilbert
    +
    Date
    2005-12-08
    + +

    Definition in file pdstemplates.h.

    +

    Data Type Documentation

    + +

    ◆ pdstemplate

    + +
    +
    + + + + +
    struct pdstemplate
    +
    +

    Struct for PDS template.

    + +

    Definition at line 53 of file pdstemplates.h.

    +
    + + + + + + + + + + + + + +
    Data Fields
    +g2int +mappds[MAXPDSMAPLEN] +Number of bytes for each template value.
    +g2int +mappdslen +The number of entries in the template.
    +g2int +needext +Does template need extension?
    +g2int +template_num +Template number.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ MAXPDSMAPLEN

    + +
    +
    + + + + +
    #define MAXPDSMAPLEN   200
    +
    + +

    Maximum template map length.

    + +

    Definition at line 48 of file pdstemplates.h.

    + +
    +
    + +

    ◆ MAXPDSTEMP

    + +
    +
    + + + + +
    #define MAXPDSTEMP   47
    +
    + +

    Maximum number of templates.

    + +

    Definition at line 47 of file pdstemplates.h.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ templatespds

    + +
    +
    + + + + +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    +
    + +

    Date for struct for PDS template.

    + +

    Definition at line 1 of file pdstemplates.h.

    + +

    Referenced by getpdsindex(), and getpdstemplate().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/pdstemplates_8h.js b/ver-1.7.0/pdstemplates_8h.js new file mode 100644 index 00000000..6797a29e --- /dev/null +++ b/ver-1.7.0/pdstemplates_8h.js @@ -0,0 +1,12 @@ +var pdstemplates_8h = +[ + [ "pdstemplate", "pdstemplates_8h.html#structpdstemplate", [ + [ "mappds", "pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b", null ], + [ "mappdslen", "pdstemplates_8h.html#ad086e08141828302359fbd2584e15931", null ], + [ "needext", "pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4", null ], + [ "template_num", "pdstemplates_8h.html#aa220825f05131b888bc234444067d22d", null ] + ] ], + [ "MAXPDSMAPLEN", "pdstemplates_8h.html#aa0bb590f8c48ad21d17f6cf7a72d8f53", null ], + [ "MAXPDSTEMP", "pdstemplates_8h.html#a11c588e7671155abba68b92678fc2071", null ], + [ "templatespds", "pdstemplates_8h.html#a87d5723cb60a9b598bc574cd31673a26", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pdstemplates_8h_source.html b/ver-1.7.0/pdstemplates_8h_source.html new file mode 100644 index 00000000..d964fae2 --- /dev/null +++ b/ver-1.7.0/pdstemplates_8h_source.html @@ -0,0 +1,181 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.h Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pdstemplates.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    43 #ifndef _pdstemplates_H
    +
    44 #define _pdstemplates_H
    +
    45 #include "grib2.h"
    +
    46 
    +
    47 #define MAXPDSTEMP 47
    +
    48 #define MAXPDSMAPLEN 200
    + +
    54 {
    + + + + +
    59 };
    +
    60 
    +
    64 const struct pdstemplate templatespds[MAXPDSTEMP] =
    +
    65 {
    +
    68  {0,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    71  {1,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    74  {2,17,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1} },
    +
    77  {3,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4} },
    +
    80  {4,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4} },
    +
    83  {5,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4} },
    +
    86  {6,16,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    89  {7,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    92  {8,29,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    95  {9,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    98  {10,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    101  {11,32,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    104  {12,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    107  {13,45,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    110  {14,44,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    113  {15,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    115  {20,19,0, {1,1,1,1,1,-4,4,2,4,2,1,1,1,1,1,2,1,3,2} },
    +
    117  {30,5,1, {1,1,1,1,1} },
    +
    119  {31,5,1, {1,1,1,1,1} },
    +
    122  {40,16,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    125  {41,19,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    129  {42,30,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    133  {43,33,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    135  {254,3,0, {1,1,4} },
    +
    138  {1000,9,0, {1,1,1,1,1,2,1,1,-4} },
    +
    141  {1001,16,0, {1,1,1,1,1,2,1,1,4,4,1,1,1,4,1,4} },
    +
    144  {1002,15,0, {1,1,1,1,1,2,1,1,-4,1,1,1,4,4,2} },
    +
    147  {1100,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    150  {1101,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,4,1,1,1,4,1,4} },
    +
    152  {32,10,1, {1,1,1,1,1,2,1,1,-2,1} },
    +
    155  {44,21,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-2,1,-1,-4,1,-1,-4} },
    +
    159  {45,24,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    163  {46,35,1, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    167  {47,38,1, {1,1,1,2,1,-1,-4,-1,-4,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    171  {48,26,0, {1,1,2,1,-1,-4,-1,-4,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    172 
    +
    176  {50,21,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,4,4,4,4} },
    +
    177 
    +
    181  {52,15,0, {1,1,1,1,1,1,1,1,2,1,1,-4,1,-1,-4} },
    +
    182 
    +
    185  {51,16,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    186 
    +
    190  {91,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    195  {33,18,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1} },
    +
    200  {34,32,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    205  {53,19,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    210  {54,22,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    216  {57,7,1, {1,1,2,2,2,2,1} },
    +
    221  {60,24,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1} },
    +
    226  {61,38,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    232  {35,6,1, {1,1,1,1,1,1} }
    +
    233 
    +
    234 } ;
    +
    235 
    +
    236 #endif /* _pdstemplates_H */
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    #define MAXPDSTEMP
    Maximum number of templates.
    Definition: pdstemplates.h:47
    +
    g2int mappds[MAXPDSMAPLEN]
    Number of bytes for each template value.
    Definition: pdstemplates.h:58
    +
    g2int needext
    Does template need extension?
    Definition: pdstemplates.h:57
    +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    Date for struct for PDS template.
    Definition: pdstemplates.h:64
    +
    #define MAXPDSMAPLEN
    Maximum template map length.
    Definition: pdstemplates.h:48
    +
    g2int template_num
    Template number.
    Definition: pdstemplates.h:55
    +
    g2int mappdslen
    The number of entries in the template.
    Definition: pdstemplates.h:56
    +
    Struct for PDS template.
    Definition: pdstemplates.h:54
    +
    +
    + + + + diff --git a/ver-1.7.0/pdstemplates_8h_structpdstemplate.js b/ver-1.7.0/pdstemplates_8h_structpdstemplate.js new file mode 100644 index 00000000..9d3866b7 --- /dev/null +++ b/ver-1.7.0/pdstemplates_8h_structpdstemplate.js @@ -0,0 +1,7 @@ +var pdstemplates_8h_structpdstemplate = +[ + [ "mappds", "pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b", null ], + [ "mappdslen", "pdstemplates_8h.html#ad086e08141828302359fbd2584e15931", null ], + [ "needext", "pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4", null ], + [ "template_num", "pdstemplates_8h.html#aa220825f05131b888bc234444067d22d", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pngpack_8c.html b/ver-1.7.0/pngpack_8c.html new file mode 100644 index 00000000..50445cfb --- /dev/null +++ b/ver-1.7.0/pngpack_8c.html @@ -0,0 +1,390 @@ + + + + + + + +NCEPLIBS-g2c: pngpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pngpack.c File Reference
    +
    +
    + +

    Function to pack data with PNG compression. +More...

    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    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...
     
    static void pngpack_int (void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
     This internal function packs up float or double data 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...
     
    +

    Detailed Description

    +

    Function to pack data with PNG compression.

    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition in file pngpack.c.

    +

    Function Documentation

    + +

    ◆ pngpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void pngpack (float * fld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldPointer to array of float that contains the data values to pack.
    widthNumber of points in the x direction.
    heightNumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpacklength 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().

    + +

    Referenced by g2_addfield().

    + +
    +
    + +

    ◆ pngpack_int()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static void pngpack_int (void * fld,
    int fld_is_double,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    +static
    +
    + +

    This internal function packs up float or double data into PNG image format.

    +

    This is called by pngpack() and pngpackd().

    +

    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
    + + + + + + + + +
    fldPointer to array of float or double that contains the data values to pack.
    fld_is_doubleIf non-zero, then fld is double, otherwise float.
    widthNumber of points in the x direction.
    heightNumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Returns
    void
    +
    Author
    Ed Hartnett
    +
    Date
    Aug 8, 2022
    + +

    Definition at line 41 of file pngpack.c.

    + +

    References ALOG2, enc_png(), int_power(), LOG, mkieee(), and sbits().

    + +

    Referenced by pngpack(), and pngpackd().

    + +
    +
    + +

    ◆ pngpackd()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void pngpackd (double * fld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldPointer to array of double that contains the data values to pack.
    widthNumber of points in the x direction.
    heightNumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Ed Hartnett
    +
    Date
    Aug 8, 2022
    + +

    Definition at line 259 of file pngpack.c.

    + +

    References pngpack_int().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/pngpack_8c.js b/ver-1.7.0/pngpack_8c.js new file mode 100644 index 00000000..2fc19085 --- /dev/null +++ b/ver-1.7.0/pngpack_8c.js @@ -0,0 +1,6 @@ +var pngpack_8c = +[ + [ "pngpack", "pngpack_8c.html#a1353956d6cc706acd63e87ce21c69fd2", null ], + [ "pngpack_int", "pngpack_8c.html#a425894461009149774943fa50667c5ee", null ], + [ "pngpackd", "pngpack_8c.html#ac449247d0b5e9f7a297a154f3791a41d", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pngpack_8c_source.html b/ver-1.7.0/pngpack_8c_source.html new file mode 100644 index 00000000..420276f2 --- /dev/null +++ b/ver-1.7.0/pngpack_8c_source.html @@ -0,0 +1,285 @@ + + + + + + + +NCEPLIBS-g2c: pngpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pngpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdlib.h>
    +
    6 #include <math.h>
    +
    7 #include "grib2_int.h"
    +
    8 
    +
    40 static void
    +
    41 pngpack_int(void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl,
    +
    42  unsigned char *cpack, g2int *lcpack)
    +
    43 {
    +
    44  g2int *ifld = NULL;
    +
    45  static float alog2 = ALOG2; /* ln(2.0) */
    +
    46  g2int j, nbits, imin, imax, maxdif;
    +
    47  g2int ndpts, nbytes;
    +
    48  float bscale, dscale, rmax, rmin, temp;
    +
    49  double rmaxd, rmind;
    +
    50  unsigned char *ctemp;
    +
    51  float *ffld = fld;
    +
    52  double *dfld = fld;
    +
    53 
    +
    54  LOG((2, "pngpack_int fld_is_double %d width %ld height %ld idrstmpl[1] %d",
    +
    55  fld_is_double, width, height, idrstmpl[1]));
    +
    56 
    +
    57  ndpts = width * height;
    +
    58  bscale = int_power(2.0, -idrstmpl[1]);
    +
    59  dscale = int_power(10.0, idrstmpl[2]);
    +
    60  LOG((3, "ndpts %d bscale %g dscale %g", ndpts, bscale, dscale));
    +
    61 
    +
    62  /* Find max and min values in the data. Either rmax and rmin will
    +
    63  * be used (if fld_is_double is not true), or rmaxd and rmind will
    +
    64  * be used (if fld_is_double is true). */
    +
    65  rmaxd = dfld[0];
    +
    66  rmind = dfld[0];
    +
    67  rmax = ffld[0];
    +
    68  rmin = ffld[0];
    +
    69  if (fld_is_double)
    +
    70  {
    +
    71  for (j = 1; j < ndpts; j++)
    +
    72  {
    +
    73  if (dfld[j] > rmaxd)
    +
    74  rmaxd = dfld[j];
    +
    75  if (dfld[j] < rmind)
    +
    76  rmind = dfld[j];
    +
    77  }
    +
    78  maxdif = (g2int)rint((rmaxd - rmind) * dscale * bscale);
    +
    79  }
    +
    80  else
    +
    81  {
    +
    82  for (j = 1; j < ndpts; j++)
    +
    83  {
    +
    84  if (ffld[j] > rmax)
    +
    85  rmax = ffld[j];
    +
    86  if (ffld[j] < rmin)
    +
    87  rmin = ffld[j];
    +
    88  }
    +
    89  maxdif = (g2int)rint((rmax - rmin) * dscale * bscale);
    +
    90  }
    +
    91  LOG((3, "rmax %g rmaxd %g rmin %g rmind %g", rmax, rmaxd, rmin, rmind));
    +
    92 
    +
    93  /* If max and min values are not equal, pack up field. If they are
    +
    94  * equal, we have a constant field, and the reference value (rmin)
    +
    95  * is the value for each point in the field and set nbits to 0. */
    +
    96  if (((fld_is_double && rmind != rmaxd) || (!fld_is_double && rmin != rmax)) && maxdif != 0)
    +
    97  {
    +
    98  ifld = malloc(ndpts * sizeof(g2int));
    +
    99 
    +
    100  /* Determine which algorithm to use based on user-supplied
    +
    101  * binary scale factor and number of bits. */
    +
    102  if (idrstmpl[1] == 0)
    +
    103  {
    +
    104  /* No binary scaling and calculate minumum number of bits
    +
    105  * in which the data will fit. */
    +
    106  imin = (g2int)rint((fld_is_double ? rmind : rmin) * dscale);
    +
    107  imax = (g2int)rint((fld_is_double ? rmaxd : rmax) * dscale);
    +
    108  maxdif = imax - imin;
    +
    109  temp = log((double)(maxdif + 1)) / alog2;
    +
    110  nbits = (g2int)ceil(temp);
    +
    111  /* scale data */
    +
    112  if (fld_is_double)
    +
    113  {
    +
    114  rmind = (float)imin;
    +
    115  for(j = 0; j < ndpts; j++)
    +
    116  ifld[j] = (g2int)rint(dfld[j] * dscale) - imin;
    +
    117  }
    +
    118  else
    +
    119  {
    +
    120  rmin = (float)imin;
    +
    121  for(j = 0; j < ndpts; j++)
    +
    122  ifld[j] = (g2int)rint(ffld[j] * dscale) - imin;
    +
    123  }
    +
    124  }
    +
    125  else
    +
    126  {
    +
    127  /* Use binary scaling factor and calculate minumum number
    +
    128  * of bits in which the data will fit. */
    +
    129  if (fld_is_double)
    +
    130  {
    +
    131  rmind = rmind * dscale;
    +
    132  rmaxd = rmaxd * dscale;
    +
    133  maxdif = (g2int)rint((rmaxd - rmind) * bscale);
    +
    134  }
    +
    135  else
    +
    136  {
    +
    137  rmin = rmin * dscale;
    +
    138  rmax = rmax * dscale;
    +
    139  maxdif = (g2int)rint((rmax - rmin) * bscale);
    +
    140  }
    +
    141  temp = log((double)(maxdif + 1)) / alog2;
    +
    142  nbits = (g2int)ceil(temp);
    +
    143  /* scale data */
    +
    144  if (fld_is_double)
    +
    145  {
    +
    146  for (j = 0; j < ndpts; j++)
    +
    147  ifld[j] = (g2int)rint(((dfld[j] * dscale) - rmind) * bscale);
    +
    148  }
    +
    149  else
    +
    150  {
    +
    151  for (j = 0; j < ndpts; j++)
    +
    152  ifld[j] = (g2int)rint(((ffld[j] * dscale) - rmin) * bscale);
    +
    153  }
    +
    154  }
    +
    155 
    +
    156  /* Pack data into full octets, then do PNG encode and
    +
    157  * calculate the length of the packed data in bytes. */
    +
    158  if (nbits <= 8)
    +
    159  nbits = 8;
    +
    160  else if (nbits <= 16)
    +
    161  nbits = 16;
    +
    162  else if (nbits <= 24)
    +
    163  nbits = 24;
    +
    164  else
    +
    165  nbits = 32;
    +
    166 
    +
    167  nbytes = (nbits / 8) * ndpts;
    +
    168  ctemp = calloc(nbytes, 1);
    +
    169  sbits(ctemp, ifld, 0, nbits, 0, ndpts);
    +
    170 
    +
    171  /* Encode data into PNG Format. */
    +
    172  if ((*lcpack = (g2int)enc_png(ctemp, width, height, nbits, cpack)) <= 0)
    +
    173  printf("pngpack: ERROR Packing PNG = %d\n", (int)*lcpack);
    +
    174 
    +
    175  free(ctemp);
    +
    176  }
    +
    177  else
    +
    178  {
    +
    179  nbits = 0;
    +
    180  *lcpack = 0;
    +
    181  }
    +
    182 
    +
    183  /* Fill in ref value and number of bits in Template 5.0. */
    +
    184  if (fld_is_double)
    +
    185  rmin = (float)rmind;
    +
    186  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format */
    +
    187  idrstmpl[3] = nbits;
    +
    188  idrstmpl[4] = 0; /* original data were reals */
    +
    189 
    +
    190  if (ifld)
    +
    191  free(ifld);
    +
    192 }
    +
    193 
    +
    223 void
    +
    224 pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
    +
    225  unsigned char *cpack, g2int *lcpack)
    +
    226 {
    +
    227  pngpack_int(fld, 0, width, height, idrstmpl, cpack, lcpack);
    +
    228 }
    +
    229 
    +
    258 void
    +
    259 pngpackd(double *fld, g2int width, g2int height, g2int *idrstmpl,
    +
    260  unsigned char *cpack, g2int *lcpack)
    +
    261 {
    +
    262  pngpack_int(fld, 1, width, height, idrstmpl, cpack, lcpack);
    +
    263 }
    +
    264 
    +
    +
    +
    int enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
    Encode PNG.
    Definition: enc_png.c:75
    +
    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.
    Definition: pngpack.c:259
    +
    static void pngpack_int(void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
    This internal function packs up float or double data into PNG image format.
    Definition: pngpack.c:41
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    #define LOG(e)
    Ignore logging to stdout.
    Definition: grib2_int.h:138
    +
    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 ...
    Definition: gbits.c:114
    +
    void mkieee(float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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.
    Definition: pngpack.c:224
    +
    #define ALOG2
    ln(2.0)
    Definition: grib2_int.h:21
    + + + + diff --git a/ver-1.7.0/pngunpack_8c.html b/ver-1.7.0/pngunpack_8c.html new file mode 100644 index 00000000..412aac95 --- /dev/null +++ b/ver-1.7.0/pngunpack_8c.html @@ -0,0 +1,346 @@ + + + + + + + +NCEPLIBS-g2c: pngunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pngunpack.c File Reference
    +
    +
    + +

    Contains a function to unpack data packed with PNG compression. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    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...
     
    static g2int pngunpack_int (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
     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...
     
    +

    Detailed Description

    +

    Contains a function to unpack data packed with PNG compression.

    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition in file pngunpack.c.

    +

    Function Documentation

    + +

    ◆ pngunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int pngunpack (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    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
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack().
    idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
    ndptsThe number of data values to unpack.
    fldContains 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().

    + +

    Referenced by g2_unpack7().

    + +
    +
    + +

    ◆ pngunpack_int()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static g2int pngunpack_int (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    g2int ndpts,
    void * fld,
    int fld_is_double 
    )
    +
    +static
    +
    + +

    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
    + + + + + + + +
    cpackThe packed data field (character*1 array).
    lenThe length of packed field cpack().
    idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
    ndptsThe number of data values to unpack.
    fldPointer that will get the unpacked data values.
    fld_is_doubleIf non-zero, then fld will get data as double, otherwise float.
    +
    +
    +
    Returns
    0 for success, 1 for memory allocation error.
    +
    Author
    Stephen Gilbert, Ed Hartnett
    +
    Date
    Aug 8, 2022
    + +

    Definition at line 32 of file pngunpack.c.

    + +

    References dec_png(), G2_JPCUNPACK_MEM, gbits(), int_power(), LOG, and rdieee().

    + +

    Referenced by pngunpack(), and pngunpackd().

    + +
    +
    + +

    ◆ pngunpackd()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int pngunpackd (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    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
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack().
    idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
    ndptsThe number of data values to unpack.
    fldContains 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/pngunpack_8c.js b/ver-1.7.0/pngunpack_8c.js new file mode 100644 index 00000000..cbec606a --- /dev/null +++ b/ver-1.7.0/pngunpack_8c.js @@ -0,0 +1,6 @@ +var pngunpack_8c = +[ + [ "pngunpack", "pngunpack_8c.html#a25efad18886998fd8f7172ddccaa9076", null ], + [ "pngunpack_int", "pngunpack_8c.html#ae194e51085dbb56e1c59cb8578eb2722", null ], + [ "pngunpackd", "pngunpack_8c.html#a0e15cdfb0f46d45f44eca76bf13bc7c8", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/pngunpack_8c_source.html b/ver-1.7.0/pngunpack_8c_source.html new file mode 100644 index 00000000..61d1f623 --- /dev/null +++ b/ver-1.7.0/pngunpack_8c_source.html @@ -0,0 +1,186 @@ + + + + + + + +NCEPLIBS-g2c: pngunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pngunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2_int.h"
    +
    10 
    +
    31 static g2int
    +
    32 pngunpack_int(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
    +
    33  void *fld, int fld_is_double)
    +
    34 {
    +
    35  g2int *ifld;
    +
    36  g2int j, nbits, width, height;
    +
    37  float ref, bscale, dscale;
    +
    38  unsigned char *ctemp;
    +
    39  float *ffld = fld;
    +
    40  double *dfld = fld;
    +
    41 
    +
    42  LOG((2, "pngunpack_int len %ld ndpts %ld fld_is_double %d", len, ndpts, fld_is_double));
    +
    43 
    +
    44  rdieee(idrstmpl, &ref, 1);
    +
    45  bscale = int_power(2.0, idrstmpl[1]);
    +
    46  dscale = int_power(10.0, -idrstmpl[2]);
    +
    47  nbits = idrstmpl[3];
    +
    48  LOG((2, "bscale %g dscale %g nbits %ld", bscale, dscale, nbits));
    +
    49 
    +
    50  /* If nbits equals 0, we have a constant field where the reference
    +
    51  * value is the data value at each gridpoint. */
    +
    52  if (nbits != 0)
    +
    53  {
    +
    54  ifld = calloc(ndpts, sizeof(g2int));
    +
    55  ctemp = calloc(ndpts * 4, 1);
    +
    56  if (!ifld || !ctemp)
    +
    57  {
    +
    58  fprintf(stderr,"Could not allocate space in jpcunpack.\n Data field NOT upacked.\n");
    +
    59  return G2_JPCUNPACK_MEM;
    +
    60  }
    +
    61  dec_png(cpack, &width, &height, ctemp);
    +
    62  gbits(ctemp, ifld, 0, nbits, 0, ndpts);
    +
    63  for (j = 0; j < ndpts; j++)
    +
    64  {
    +
    65  if (fld_is_double)
    +
    66  dfld[j] = (((double)ifld[j] * bscale) + ref) * dscale;
    +
    67  else
    +
    68  ffld[j] = (((float)ifld[j] * bscale) + ref) * dscale;
    +
    69  }
    +
    70  free(ctemp);
    +
    71  free(ifld);
    +
    72  }
    +
    73  else
    +
    74  {
    +
    75  for (j = 0; j < ndpts; j++)
    +
    76  {
    +
    77  if (fld_is_double)
    +
    78  dfld[j] = ref;
    +
    79  else
    +
    80  ffld[j] = ref;
    +
    81  }
    +
    82  }
    +
    83 
    +
    84  return 0;
    +
    85 }
    +
    86 
    +
    104 g2int
    +
    105 pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
    +
    106  float *fld)
    +
    107 {
    +
    108  return pngunpack_int(cpack, len, idrstmpl, ndpts, fld, 0);
    +
    109 }
    +
    110 
    +
    127 g2int
    +
    128 pngunpackd(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
    +
    129  double *fld)
    +
    130 {
    +
    131  return pngunpack_int(cpack, len, idrstmpl, ndpts, fld, 1);
    +
    132 }
    +
    +
    +
    int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
    Decode PNG.
    Definition: dec_png.c:61
    +
    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...
    Definition: pngunpack.c:128
    +
    void rdieee(g2int *rieee, float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:21
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    #define LOG(e)
    Ignore logging to stdout.
    Definition: grib2_int.h:138
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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...
    Definition: gbits.c:57
    +
    #define G2_JPCUNPACK_MEM
    In jpcunpack() or other unpack function: out of memory.
    Definition: grib2.h:320
    +
    static g2int pngunpack_int(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
    This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
    Definition: pngunpack.c:32
    +
    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...
    Definition: pngunpack.c:105
    + + + + diff --git a/ver-1.7.0/rdieee_8c.html b/ver-1.7.0/rdieee_8c.html new file mode 100644 index 00000000..2c57d179 --- /dev/null +++ b/ver-1.7.0/rdieee_8c.html @@ -0,0 +1,175 @@ + + + + + + + +NCEPLIBS-g2c: rdieee.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    rdieee.c File Reference
    +
    +
    + +

    Read a list of real values in 32-bit IEEE floating point format. +More...

    +
    #include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void rdieee (g2int *rieee, float *a, g2int num)
     This subroutine reads a list of real values in 32-bit IEEE floating point format. More...
     
    +

    Detailed Description

    +

    Read a list of real values in 32-bit IEEE floating point format.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition in file rdieee.c.

    +

    Function Documentation

    + +

    ◆ rdieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void rdieee (g2intrieee,
    float * a,
    g2int num 
    )
    +
    + +

    This subroutine reads a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    rieeeg2int array of floating point values in 32-bit IEEE format.
    numNumber of floating point values to convert.
    afloat array of real values. a must be allocated with at least 4*num bytes of memory before calling this function.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition at line 21 of file rdieee.c.

    + +

    References int_power().

    + +

    Referenced by comunpack(), g2_miss(), g2_unpack4(), g2_unpack7(), jpcunpack_int(), misspack(), pngunpack_int(), simunpack(), and specunpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/rdieee_8c.js b/ver-1.7.0/rdieee_8c.js new file mode 100644 index 00000000..2460e582 --- /dev/null +++ b/ver-1.7.0/rdieee_8c.js @@ -0,0 +1,4 @@ +var rdieee_8c = +[ + [ "rdieee", "rdieee_8c.html#af4e2650852f7bbbfb531c977fcbd42ca", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/rdieee_8c_source.html b/ver-1.7.0/rdieee_8c_source.html new file mode 100644 index 00000000..923369d5 --- /dev/null +++ b/ver-1.7.0/rdieee_8c_source.html @@ -0,0 +1,158 @@ + + + + + + + +NCEPLIBS-g2c: rdieee.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    rdieee.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include "grib2_int.h"
    +
    7 
    +
    20 void
    +
    21 rdieee(g2int *rieee, float *a, g2int num)
    +
    22 {
    +
    23 
    +
    24  g2int j;
    +
    25  g2int isign,iexp,imant;
    +
    26 
    +
    27  float sign,temp;
    +
    28  static float two23,two126;
    +
    29  static g2int test=0;
    +
    30  uint64_t msk1=0x80000000; // 10000000000000000000000000000000 binary
    +
    31  g2int msk2=0x7F800000; // 01111111100000000000000000000000 binary
    +
    32  g2int msk3=0x007FFFFF; // 00000000011111111111111111111111 binary
    +
    33 
    +
    34  if ( test == 0 ) {
    +
    35  two23=(float)int_power(2.0,-23);
    +
    36  two126=(float)int_power(2.0,-126);
    +
    37  test=1;
    +
    38  }
    +
    39 
    +
    40  for (j=0;j<num;j++) {
    +
    41 //
    +
    42 // Extract sign bit, exponent, and mantissa
    +
    43 //
    +
    44  isign=(rieee[j]&msk1)>>31;
    +
    45  iexp=(rieee[j]&msk2)>>23;
    +
    46  imant=(rieee[j]&msk3);
    +
    47  //printf("SAGieee= %ld %ld %ld\n",isign,iexp,imant);
    +
    48 
    +
    49  sign=1.0;
    +
    50  if (isign == 1) sign=-1.0;
    +
    51 
    +
    52  if ( (iexp > 0) && (iexp < 255) ) {
    +
    53  temp=(float)int_power(2.0,(iexp-127));
    +
    54  a[j]=sign*temp*(1.0+(two23*(float)imant));
    +
    55  }
    +
    56  else if ( iexp == 0 ) {
    +
    57  if ( imant != 0 )
    +
    58  a[j]=sign*two126*two23*(float)imant;
    +
    59  else
    +
    60  a[j]=sign*0.0;
    +
    61 
    +
    62  }
    +
    63  else if ( iexp == 255 )
    +
    64  a[j]=sign*(1E+37);
    +
    65 
    +
    66 
    +
    67  }
    +
    68 
    +
    69 }
    +
    +
    +
    void rdieee(g2int *rieee, float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:21
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    + + + + diff --git a/ver-1.7.0/reduce_8c.html b/ver-1.7.0/reduce_8c.html new file mode 100644 index 00000000..c02a4ab0 --- /dev/null +++ b/ver-1.7.0/reduce_8c.html @@ -0,0 +1,277 @@ + + + + + + + +NCEPLIBS-g2c: reduce.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    reduce.c File Reference
    +
    +
    + +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment. +More...

    +
    #include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    int reduce (g2int *kfildo, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *lx, g2int *ndg, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *ibxx2, g2int *ier)
     Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment. More...
     
    +

    Detailed Description

    +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.

    +
    Author
    Harry Glahn, The Meteorological Development Lab (MDL)
    +
    Date
    November 2001
    + +

    Definition in file reduce.c.

    +

    Function Documentation

    + +

    ◆ reduce()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int reduce (g2intkfildo,
    g2intjmin,
    g2intjmax,
    g2intlbit,
    g2intnov,
    g2intlx,
    g2intndg,
    g2intibit,
    g2intjbit,
    g2intkbit,
    g2intnovref,
    g2intibxx2,
    g2intier 
    )
    +
    + +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.

    +

    By reducing the size of the large groups, less bits may be necessary for packing the group sizes and all the information about the groups.

    +

    The reference for nov was removed in the calling routine so that kbit could be determined. This furnishes a starting point for the iterations in reduce. However, the reference must be considered.

    +

    PROGRAM HISTORY LOG

      +
    • November 2001 Harry Glahn, The Meteorological Development Lab (MDL) tdl grib2
    • +
    • March 2002 Harry Glahn, The Meteorological Development Lab (MDL) comment ier = 715
    • +
    • March 2002 Harry Glahn, The Meteorological Development Lab (MDL) modified to accommodate lx=1 on entry
    • +
    +

    DATA SET USE

      +
    • kfildo - unit number for output (print) file. (output)
    • +
    +
    Parameters
    + + + + + + + + + + + + + + +
    kfildounit number for output (print) file. (input)
    jminthe minimum of each group (j=1,lx). it is possible after splitting the groups, jmin() will not be the minimum of the new group. this doesn't matter; jmin() is really the group reference and doesn't have to be the smallest value. (input/output)
    jmaxthe maximum of each group (j=1,lx). (input/output)
    lbitthe number of bits necessary to pack each group (j=1,lx). (input/output)
    novthe number of values in each group (j=1,lx). (input/output)
    lxthe number of groups. this will be increased if groups are split. (input/output)
    ndgthe dimension of jmin(), jmax(), lbit(), and nov( ). (input)
    ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (input)
    jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (input)
    kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. if the groups are split, kbit is reduced. (input/output)
    novrefreference value for nov(). (input)
    ibxx22**j (j=0,30). (input)
    iererror return. (output)
      +
    • 0 = good return.
    • +
    • 714 = problem in algorithm. reduce aborted.
    • +
    • 715 = ngp not large enough. reduce aborted.
    • +
    +
    +
    +
    +
    Returns
    always returns 0, see parameter ier for error code.
    +
    + ntotbt(j) = the total bits used for the packing bits j
    +                       (j=1,30). (internal)
    +  nboxj(j) = new boxes needed for the packing bits j
    +                       (j=1,30). (internal)
    +           newbox(l) = number of new boxes (groups) for each original
    +                       group (l=1,lx) for the current j. (automatic)
    +                       (internal)
    +          newboxp(l) = same as newbox() but for the previous j.
    +                       this eliminates recomputation. (automatic)
    +                       (internal)
    +               cfeed = contains the character representation
    +                       of a printer form feed. (character) (internal)
    +               ifeed = contains the g2int value of a printer
    +                       form feed. (internal)
    +              iorigb = the original number of bits necessary
    +                       for the group values. (internal)
    + 
    Author
    Harry Glahn, The Meteorological Development Lab (MDL)
    +
    Date
    November 2001
    + +

    Definition at line 88 of file reduce.c.

    + +

    Referenced by pack_gp().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/reduce_8c.js b/ver-1.7.0/reduce_8c.js new file mode 100644 index 00000000..674d4e8c --- /dev/null +++ b/ver-1.7.0/reduce_8c.js @@ -0,0 +1,4 @@ +var reduce_8c = +[ + [ "reduce", "reduce_8c.html#a6bb0dafca9ef2de9d433cb4c72f34b2d", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/reduce_8c_source.html b/ver-1.7.0/reduce_8c_source.html new file mode 100644 index 00000000..3aef449a --- /dev/null +++ b/ver-1.7.0/reduce_8c_source.html @@ -0,0 +1,429 @@ + + + + + + + +NCEPLIBS-g2c: reduce.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    reduce.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    11 #include <stdlib.h>
    +
    12 #include "grib2_int.h"
    +
    13 
    +
    87 int
    +
    88 reduce(g2int *kfildo, g2int *jmin, g2int *jmax,
    +
    89  g2int *lbit, g2int *nov, g2int *lx, g2int *ndg, g2int *ibit,
    +
    90  g2int *jbit, g2int *kbit, g2int *novref, g2int *ibxx2,
    +
    91  g2int *ier)
    +
    92 {
    +
    93  /* Initialized data */
    +
    94 
    +
    95  static g2int ifeed = 12;
    +
    96 
    +
    97  /* System generated locals */
    +
    98  g2int i__1, i__2;
    +
    99 
    +
    100  /* Local variables */
    +
    101  static g2int newboxtp, j, l, m, jj, lxn, left;
    +
    102  static float pimp;
    +
    103  static g2int move, novl;
    +
    104  static char cfeed[1];
    +
    105  /* static g2int nboxj[31]; */
    +
    106  static g2int lxnkp, iorigb, ibxx2m1, movmin,
    +
    107  ntotbt[31], ntotpr, newboxt;
    +
    108  g2int *newbox, *newboxp;
    +
    109 
    +
    110 /* NEWBOX() AND NEWBOXP() were AUTOMATIC ARRAYS. */
    +
    111  newbox = (g2int *)calloc(*ndg,sizeof(g2int));
    +
    112  newboxp = (g2int *)calloc(*ndg,sizeof(g2int));
    +
    113 
    +
    114  /* Parameter adjustments */
    +
    115  --nov;
    +
    116  --lbit;
    +
    117  --jmax;
    +
    118  --jmin;
    +
    119 
    +
    120  /* Function Body */
    +
    121 
    +
    122  *ier = 0;
    +
    123  if (*lx == 1) {
    +
    124  goto L410;
    +
    125  }
    +
    126 /* IF THERE IS ONLY ONE GROUP, RETURN. */
    +
    127 
    +
    128  *(unsigned char *)cfeed = (char) ifeed;
    +
    129 
    +
    130 /* INITIALIZE NUMBER OF NEW BOXES PER GROUP TO ZERO. */
    +
    131 
    +
    132  i__1 = *lx;
    +
    133  for (l = 1; l <= i__1; ++l) {
    +
    134  newbox[l - 1] = 0;
    +
    135 /* L110: */
    +
    136  }
    +
    137 
    +
    138 /* INITIALIZE NUMBER OF TOTAL NEW BOXES PER J TO ZERO. */
    +
    139 
    +
    140  for (j = 1; j <= 31; ++j) {
    +
    141  ntotbt[j - 1] = 999999999;
    +
    142  /* nboxj[j - 1] = 0; */
    +
    143 /* L112: */
    +
    144  }
    +
    145 
    +
    146  iorigb = (*ibit + *jbit + *kbit) * *lx;
    +
    147 /* IBIT = BITS TO PACK THE JMIN(). */
    +
    148 /* JBIT = BITS TO PACK THE LBIT(). */
    +
    149 /* KBIT = BITS TO PACK THE NOV(). */
    +
    150 /* LX = NUMBER OF GROUPS. */
    +
    151  ntotbt[*kbit - 1] = iorigb;
    +
    152 /* THIS IS THE VALUE OF TOTAL BITS FOR THE ORIGINAL LX */
    +
    153 /* GROUPS, WHICH REQUIRES KBITS TO PACK THE GROUP */
    +
    154 /* LENGHTS. SETTING THIS HERE MAKES ONE LESS LOOPS */
    +
    155 /* NECESSARY BELOW. */
    +
    156 
    +
    157 /* COMPUTE BITS NOW USED FOR THE PARAMETERS DEFINED. */
    +
    158 
    +
    159 /* DETERMINE OTHER POSSIBILITES BY INCREASING LX AND DECREASING */
    +
    160 /* NOV() WITH VALUES GREATER THAN THRESHOLDS. ASSUME A GROUP IS */
    +
    161 /* SPLIT INTO 2 OR MORE GROUPS SO THAT KBIT IS REDUCED WITHOUT */
    +
    162 /* CHANGING IBIT OR JBIT. */
    +
    163 
    +
    164  jj = 0;
    +
    165 
    +
    166 /* Computing MIN */
    +
    167  i__1 = 30, i__2 = *kbit - 1;
    +
    168  /*for (j = min(i__1,i__2); j >= 2; --j) {*/
    +
    169  for (j = (i__1 < i__2) ? i__1 : i__2; j >= 2; --j) {
    +
    170 /* VALUES GE KBIT WILL NOT REQUIRE SPLITS. ONCE THE TOTAL */
    +
    171 /* BITS START INCREASING WITH DECREASING J, STOP. ALSO, THE */
    +
    172 /* NUMBER OF BITS REQUIRED IS KNOWN FOR KBITS = NTOTBT(KBIT). */
    +
    173 
    +
    174  newboxt = 0;
    +
    175 
    +
    176  i__1 = *lx;
    +
    177  for (l = 1; l <= i__1; ++l) {
    +
    178 
    +
    179  if (nov[l] < ibxx2[j]) {
    +
    180  newbox[l - 1] = 0;
    +
    181 /* NO SPLITS OR NEW BOXES. */
    +
    182  goto L190;
    +
    183  } else {
    +
    184  novl = nov[l];
    +
    185 
    +
    186  m = (nov[l] - 1) / (ibxx2[j] - 1) + 1;
    +
    187 /* M IS FOUND BY SOLVING THE EQUATION BELOW FOR M: */
    +
    188 /* (NOV(L)+M-1)/M LT IBXX2(J) */
    +
    189 /* M GT (NOV(L)-1)/(IBXX2(J)-1) */
    +
    190 /* SET M = (NOV(L)-1)/(IBXX2(J)-1)+1 */
    +
    191  L130:
    +
    192  novl = (nov[l] + m - 1) / m;
    +
    193 /* THE +M-1 IS NECESSARY. FOR INSTANCE, 15 WILL FIT */
    +
    194 /* INTO A BOX 4 BITS WIDE, BUT WON'T DIVIDE INTO */
    +
    195 /* TWO BOXES 3 BITS WIDE EACH. */
    +
    196 
    +
    197  if (novl < ibxx2[j]) {
    +
    198  goto L185;
    +
    199  } else {
    +
    200  ++m;
    +
    201 /* *** WRITE(KFILDO,135)L,NOV(L),NOVL,M,J,IBXX2(J) */
    +
    202 /* *** 135 FORMAT(/' AT 135--L,NOV(L),NOVL,M,J,IBXX2(J)',6I10) */
    +
    203  goto L130;
    +
    204  }
    +
    205 
    +
    206 /* THE ABOVE DO LOOP WILL NEVER COMPLETE. */
    +
    207  }
    +
    208 
    +
    209  L185:
    +
    210  newbox[l - 1] = m - 1;
    +
    211  newboxt = newboxt + m - 1;
    +
    212  L190:
    +
    213  ;
    +
    214  }
    +
    215 
    +
    216  /* nboxj[j - 1] = newboxt; */
    +
    217  ntotpr = ntotbt[j];
    +
    218  ntotbt[j - 1] = (*ibit + *jbit) * (*lx + newboxt) + j * (*lx +
    +
    219  newboxt);
    +
    220 
    +
    221  if (ntotbt[j - 1] >= ntotpr) {
    +
    222  jj = j + 1;
    +
    223 /* THE PLUS IS USED BECAUSE J DECREASES PER ITERATION. */
    +
    224  goto L250;
    +
    225  } else {
    +
    226 
    +
    227 /* SAVE THE TOTAL NEW BOXES AND NEWBOX() IN CASE THIS */
    +
    228 /* IS THE J TO USE. */
    +
    229 
    +
    230  newboxtp = newboxt;
    +
    231 
    +
    232  i__1 = *lx;
    +
    233  for (l = 1; l <= i__1; ++l) {
    +
    234  newboxp[l - 1] = newbox[l - 1];
    +
    235 /* L195: */
    +
    236  }
    +
    237 
    +
    238 /* WRITE(KFILDO,197)NEWBOXT,IBXX2(J) */
    +
    239 /* 197 FORMAT(/' *****************************************' */
    +
    240 /* 1 /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
    +
    241 /* 2 I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
    +
    242 /* 3 /' *****************************************') */
    +
    243 /* WRITE(KFILDO,198) (NEWBOX(L),L=1,LX) */
    +
    244 /* 198 FORMAT(/' '20I6/(' '20I6)) */
    +
    245  }
    +
    246 
    +
    247 /* 205 WRITE(KFILDO,209)KBIT,IORIGB */
    +
    248 /* 209 FORMAT(/' ORIGINAL BITS WITH KBIT OF',I5,' =',I10) */
    +
    249 /* WRITE(KFILDO,210)(N,N=2,10),(IBXX2(N),N=2,10), */
    +
    250 /* 1 (NTOTBT(N),N=2,10),(NBOXJ(N),N=2,10), */
    +
    251 /* 2 (N,N=11,20),(IBXX2(N),N=11,20), */
    +
    252 /* 3 (NTOTBT(N),N=11,20),(NBOXJ(N),N=11,20), */
    +
    253 /* 4 (N,N=21,30),(IBXX2(N),N=11,20), */
    +
    254 /* 5 (NTOTBT(N),N=21,30),(NBOXJ(N),N=21,30) */
    +
    255 /* 210 FORMAT(/' THE TOTAL BYTES FOR MAXIMUM GROUP LENGTHS BY ROW'// */
    +
    256 /* 1 ' J = THE NUMBER OF BITS PER GROUP LENGTH'/ */
    +
    257 /* 2 ' IBXX2(J) = THE MAXIMUM GROUP LENGTH PLUS 1 FOR THIS J'/ */
    +
    258 /* 3 ' NTOTBT(J) = THE TOTAL BITS FOR THIS J'/ */
    +
    259 /* 4 ' NBOXJ(J) = THE NEW GROUPS FOR THIS J'/ */
    +
    260 /* 5 4(/10X,9I10)/4(/10I10)/4(/10I10)) */
    +
    261 
    +
    262 /* L200: */
    +
    263  }
    +
    264 
    +
    265 L250:
    +
    266  pimp = (iorigb - ntotbt[jj - 1]) / (float) iorigb * 100.f;
    +
    267 /* WRITE(KFILDO,252)PIMP,KBIT,JJ */
    +
    268 /* 252 FORMAT(/' PERCENT IMPROVEMENT =',F6.1, */
    +
    269 /* 1 ' BY DECREASING GROUP LENGTHS FROM',I4,' TO',I4,' BITS') */
    +
    270  if (pimp >= 2.f) {
    +
    271 
    +
    272 /* WRITE(KFILDO,255)CFEED,NEWBOXTP,IBXX2(JJ) */
    +
    273 /* 255 FORMAT(A1,/' *****************************************' */
    +
    274 /* 1 /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
    +
    275 /* 2 I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
    +
    276 /* 2 /' *****************************************') */
    +
    277 /* WRITE(KFILDO,256) (NEWBOXP(L),L=1,LX) */
    +
    278 /* 256 FORMAT(/' '20I6) */
    +
    279 
    +
    280 /* ADJUST GROUP LENGTHS FOR MAXIMUM LENGTH OF JJ BITS. */
    +
    281 /* THE MIN PER GROUP AND THE NUMBER OF BITS REQUIRED */
    +
    282 /* PER GROUP ARE NOT CHANGED. THIS MAY MEAN THAT A */
    +
    283 /* GROUP HAS A MIN (OR REFERENCE) THAT IS NOT ZERO. */
    +
    284 /* THIS SHOULD NOT MATTER TO THE UNPACKER. */
    +
    285 
    +
    286  lxnkp = *lx + newboxtp;
    +
    287 /* LXNKP = THE NEW NUMBER OF BOXES */
    +
    288 
    +
    289  if (lxnkp > *ndg) {
    +
    290 /* DIMENSIONS NOT LARGE ENOUGH. PROBABLY AN ERROR */
    +
    291 /* OF SOME SORT. ABORT. */
    +
    292 /* WRITE(KFILDO,257)NDG,LXNPK */
    +
    293 /* 1 2 3 4 5 6 7 X */
    +
    294 /* 257 FORMAT(/' DIMENSIONS OF JMIN, ETC. IN REDUCE =',I8, */
    +
    295 /* 1 ' NOT LARGE ENOUGH FOR THE EXPANDED NUMBER OF', */
    +
    296 /* 2 ' GROUPS =',I8,'. ABORT REDUCE.') */
    +
    297  *ier = 715;
    +
    298  goto L410;
    +
    299 /* AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
    +
    300 /* WITHOUT CALLING REDUCE. */
    +
    301  }
    +
    302 
    +
    303  lxn = lxnkp;
    +
    304 /* LXN IS THE NUMBER OF THE BOX IN THE NEW SERIES BEING */
    +
    305 /* FILLED. IT DECREASES PER ITERATION. */
    +
    306  ibxx2m1 = ibxx2[jj] - 1;
    +
    307 /* IBXX2M1 IS THE MAXIMUM NUMBER OF VALUES PER GROUP. */
    +
    308 
    +
    309  for (l = *lx; l >= 1; --l) {
    +
    310 
    +
    311 /* THE VALUES IS NOV() REPRESENT THOSE VALUES + NOVREF. */
    +
    312 /* WHEN VALUES ARE MOVED TO ANOTHER BOX, EACH VALUE */
    +
    313 /* MOVED TO A NEW BOX REPRESENTS THAT VALUE + NOVREF. */
    +
    314 /* THIS HAS TO BE CONSIDERED IN MOVING VALUES. */
    +
    315 
    +
    316  if (newboxp[l - 1] * (ibxx2m1 + *novref) + *novref > nov[l] + *
    +
    317  novref) {
    +
    318 /* IF THE ABOVE TEST IS MET, THEN MOVING IBXX2M1 VALUES */
    +
    319 /* FOR ALL NEW BOXES WILL LEAVE A NEGATIVE NUMBER FOR */
    +
    320 /* THE LAST BOX. NOT A TOLERABLE SITUATION. */
    +
    321  movmin = (nov[l] - newboxp[l - 1] * *novref) / newboxp[l - 1];
    +
    322  left = nov[l];
    +
    323 /* LEFT = THE NUMBER OF VALUES TO MOVE FROM THE ORIGINAL */
    +
    324 /* BOX TO EACH NEW BOX EXCEPT THE LAST. LEFT IS THE */
    +
    325 /* NUMBER LEFT TO MOVE. */
    +
    326  } else {
    +
    327  movmin = ibxx2m1;
    +
    328 /* MOVMIN VALUES CAN BE MOVED FOR EACH NEW BOX. */
    +
    329  left = nov[l];
    +
    330 /* LEFT IS THE NUMBER OF VALUES LEFT TO MOVE. */
    +
    331  }
    +
    332 
    +
    333  if (newboxp[l - 1] > 0) {
    +
    334  if ((movmin + *novref) * newboxp[l - 1] + *novref <= nov[l] +
    +
    335  *novref && (movmin + *novref) * (newboxp[l - 1] + 1)
    +
    336  >= nov[l] + *novref) {
    +
    337  goto L288;
    +
    338  } else {
    +
    339 /* ***D WRITE(KFILDO,287)L,MOVMIN,NOVREF,NEWBOXP(L),NOV(L) */
    +
    340 /* ***D287 FORMAT(/' AT 287 IN REDUCE--L,MOVMIN,NOVREF,', */
    +
    341 /* ***D 1 'NEWBOXP(L),NOV(L)',5I12 */
    +
    342 /* ***D 2 ' REDUCE ABORTED.') */
    +
    343 /* WRITE(KFILDO,2870) */
    +
    344 /* 2870 FORMAT(/' AN ERROR IN REDUCE ALGORITHM. ABORT REDUCE.') */
    +
    345  *ier = 714;
    +
    346  goto L410;
    +
    347 /* AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
    +
    348 /* WITHOUT CALLING REDUCE. */
    +
    349  }
    +
    350 
    +
    351  }
    +
    352 
    +
    353  L288:
    +
    354  i__1 = newboxp[l - 1] + 1;
    +
    355  for (j = 1; j <= i__1; ++j) {
    +
    356  /*move = min(movmin,left);*/
    +
    357  move = (movmin < left) ? movmin : left;
    +
    358  jmin[lxn] = jmin[l];
    +
    359  jmax[lxn] = jmax[l];
    +
    360  lbit[lxn] = lbit[l];
    +
    361  nov[lxn] = move;
    +
    362  --lxn;
    +
    363  left -= move + *novref;
    +
    364 /* THE MOVE OF MOVE VALUES REALLY REPRESENTS A MOVE OF */
    +
    365 /* MOVE + NOVREF VALUES. */
    +
    366 /* L290: */
    +
    367  }
    +
    368 
    +
    369  if (left != -(*novref)) {
    +
    370 /* *** WRITE(KFILDO,292)L,LXN,MOVE,LXNKP,IBXX2(JJ),LEFT,NOV(L), */
    +
    371 /* *** 1 MOVMIN */
    +
    372 /* *** 292 FORMAT(' AT 292 IN REDUCE--L,LXN,MOVE,LXNKP,', */
    +
    373 /* *** 1 'IBXX2(JJ),LEFT,NOV(L),MOVMIN'/8I12) */
    +
    374  }
    +
    375 
    +
    376 /* L300: */
    +
    377  }
    +
    378 
    +
    379  *lx = lxnkp;
    +
    380 /* LX IS NOW THE NEW NUMBER OF GROUPS. */
    +
    381  *kbit = jj;
    +
    382 /* KBIT IS NOW THE NEW NUMBER OF BITS REQUIRED FOR PACKING */
    +
    383 /* GROUP LENGHTS. */
    +
    384  }
    +
    385 
    +
    386 /* WRITE(KFILDO,406)CFEED,LX */
    +
    387 /* 406 FORMAT(A1,/' *****************************************' */
    +
    388 /* 1 /' THE GROUP SIZES NOV() AFTER REDUCTION IN SIZE', */
    +
    389 /* 2 ' FOR'I10,' GROUPS', */
    +
    390 /* 3 /' *****************************************') */
    +
    391 /* WRITE(KFILDO,407) (NOV(J),J=1,LX) */
    +
    392 /* 407 FORMAT(/' '20I6) */
    +
    393 /* WRITE(KFILDO,408)CFEED,LX */
    +
    394 /* 408 FORMAT(A1,/' *****************************************' */
    +
    395 /* 1 /' THE GROUP MINIMA JMIN() AFTER REDUCTION IN SIZE', */
    +
    396 /* 2 ' FOR'I10,' GROUPS', */
    +
    397 /* 3 /' *****************************************') */
    +
    398 /* WRITE(KFILDO,409) (JMIN(J),J=1,LX) */
    +
    399 /* 409 FORMAT(/' '20I6) */
    +
    400 
    +
    401 L410:
    +
    402  if (newbox)
    +
    403  free(newbox);
    +
    404  if (newboxp)
    +
    405  free(newboxp);
    +
    406  return 0;
    +
    407 } /* reduce_ */
    +
    +
    +
    int reduce(g2int *kfildo, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *lx, g2int *ndg, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *ibxx2, g2int *ier)
    Determines whether the number of groups should be increased in order to reduce the size of the large ...
    Definition: reduce.c:88
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    + + + + diff --git a/ver-1.7.0/resize.js b/ver-1.7.0/resize.js new file mode 100644 index 00000000..a0bb5f45 --- /dev/null +++ b/ver-1.7.0/resize.js @@ -0,0 +1,137 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function initResizable() +{ + var cookie_namespace = 'doxygen'; + var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight; + + function readCookie(cookie) + { + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) { + var index = document.cookie.indexOf(myCookie); + if (index != -1) { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + return 0; + } + + function writeCookie(cookie, val, expiration) + { + if (val==undefined) return; + if (expiration == null) { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + } + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; + } + + function resizeWidth() + { + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + writeCookie('width',sidenavWidth-barWidth, null); + } + + function restoreWidth(navWidth) + { + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight() + { + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + content.css({height:windowHeight + "px"}); + navtree.css({height:windowHeight + "px"}); + sidenav.css({height:windowHeight + "px"}); + var width=$(window).width(); + if (width!=collapsedWidth) { + if (width=desktop_vp) { + if (!collapsed) { + collapseExpand(); + } + } else if (width>desktop_vp && collapsedWidth0) { + restoreWidth(0); + collapsed=true; + } + else { + var width = readCookie('width'); + if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } + collapsed=false; + } + } + + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + $(window).resize(function() { resizeHeight(); }); + var device = navigator.userAgent.toLowerCase(); + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + var width = readCookie('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/ver-1.7.0/search/all_0.html b/ver-1.7.0/search/all_0.html new file mode 100644 index 00000000..1ec5b2d5 --- /dev/null +++ b/ver-1.7.0/search/all_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_0.js b/ver-1.7.0/search/all_0.js new file mode 100644 index 00000000..6d4ddb82 --- /dev/null +++ b/ver-1.7.0/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['alog2_0',['ALOG2',['../grib2__int_8h.html#aca7ef7356b1550ae26423a6d8012f5fd',1,'grib2_int.h']]] +]; diff --git a/ver-1.7.0/search/all_1.html b/ver-1.7.0/search/all_1.html new file mode 100644 index 00000000..9f80e904 --- /dev/null +++ b/ver-1.7.0/search/all_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_1.js b/ver-1.7.0/search/all_1.js new file mode 100644 index 00000000..f180b597 --- /dev/null +++ b/ver-1.7.0/search/all_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['bits_5fper_5fbyte_1',['BITS_PER_BYTE',['../seekgb_8c.html#a369ecd38b3ab077fc235f892354bb46f',1,'seekgb.c']]], + ['bmap_2',['bmap',['../grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_10.html b/ver-1.7.0/search/all_10.html new file mode 100644 index 00000000..3bf11961 --- /dev/null +++ b/ver-1.7.0/search/all_10.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_10.js b/ver-1.7.0/search/all_10.js new file mode 100644 index 00000000..a4850ce8 --- /dev/null +++ b/ver-1.7.0/search/all_10.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['unpacked_211',['unpacked',['../grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47',1,'gribfield']]], + ['user_5fflush_5fdata_212',['user_flush_data',['../enc__png_8c.html#a97f27ca60f363a8a91319d3adee16b0e',1,'enc_png.c']]], + ['user_5fread_5fdata_213',['user_read_data',['../dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7',1,'dec_png.c']]], + ['user_5fwrite_5fdata_214',['user_write_data',['../enc__png_8c.html#ac84301dcabbe4c2893799955c50c38a5',1,'enc_png.c']]], + ['util_2ec_215',['util.c',['../util_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_11.html b/ver-1.7.0/search/all_11.html new file mode 100644 index 00000000..c9f79d28 --- /dev/null +++ b/ver-1.7.0/search/all_11.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_11.js b/ver-1.7.0/search/all_11.js new file mode 100644 index 00000000..ee3f9812 --- /dev/null +++ b/ver-1.7.0/search/all_11.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['version_216',['version',['../grib2_8h.html#ac1a18226d7790431bad8b065f85befa5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_2.html b/ver-1.7.0/search/all_2.html new file mode 100644 index 00000000..02cfffc2 --- /dev/null +++ b/ver-1.7.0/search/all_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_2.js b/ver-1.7.0/search/all_2.js new file mode 100644 index 00000000..38ed51b5 --- /dev/null +++ b/ver-1.7.0/search/all_2.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['cmplxpack_3',['cmplxpack',['../cmplxpack_8c.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c'],['../grib2__int_8h.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c']]], + ['cmplxpack_2ec_4',['cmplxpack.c',['../cmplxpack_8c.html',1,'']]], + ['compack_5',['compack',['../compack_8c.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c'],['../grib2__int_8h.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c']]], + ['compack_2ec_6',['compack.c',['../compack_8c.html',1,'']]], + ['comunpack_7',['comunpack',['../comunpack_8c.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c'],['../grib2__int_8h.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c']]], + ['comunpack_2ec_8',['comunpack.c',['../comunpack_8c.html',1,'']]], + ['coord_5flist_9',['coord_list',['../grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_3.html b/ver-1.7.0/search/all_3.html new file mode 100644 index 00000000..39767b85 --- /dev/null +++ b/ver-1.7.0/search/all_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_3.js b/ver-1.7.0/search/all_3.js new file mode 100644 index 00000000..f5b7454a --- /dev/null +++ b/ver-1.7.0/search/all_3.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['dec_5fjpeg2000_10',['dec_jpeg2000',['../dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c'],['../grib2__int_8h.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c']]], + ['dec_5fjpeg2000_2ec_11',['dec_jpeg2000.c',['../dec__jpeg2000_8c.html',1,'']]], + ['dec_5fpng_12',['dec_png',['../dec__png_8c.html#a4c7dfb37dbbca9143143db5aeb2f6005',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout): dec_png.c'],['../grib2__int_8h.html#a4c7dfb37dbbca9143143db5aeb2f6005',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout): dec_png.c']]], + ['dec_5fpng_2ec_13',['dec_png.c',['../dec__png_8c.html',1,'']]], + ['decenc_5fopenjpeg_2ec_14',['decenc_openjpeg.c',['../decenc__openjpeg_8c.html',1,'']]], + ['discipline_15',['discipline',['../grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574',1,'gribfield']]], + ['drstemplates_2ec_16',['drstemplates.c',['../drstemplates_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_4.html b/ver-1.7.0/search/all_4.html new file mode 100644 index 00000000..fc40463c --- /dev/null +++ b/ver-1.7.0/search/all_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_4.js b/ver-1.7.0/search/all_4.js new file mode 100644 index 00000000..da1c1963 --- /dev/null +++ b/ver-1.7.0/search/all_4.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['enc_5fjpeg2000_17',['enc_jpeg2000',['../enc__jpeg2000_8c.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c'],['../grib2__int_8h.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c']]], + ['enc_5fjpeg2000_2ec_18',['enc_jpeg2000.c',['../enc__jpeg2000_8c.html',1,'']]], + ['enc_5fpng_19',['enc_png',['../enc__png_8c.html#a0b304f2dca88e94a76c1182fbc1f5938',1,'enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf): enc_png.c'],['../grib2__int_8h.html#a0b304f2dca88e94a76c1182fbc1f5938',1,'enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf): enc_png.c']]], + ['enc_5fpng_2ec_20',['enc_png.c',['../enc__png_8c.html',1,'']]], + ['expanded_21',['expanded',['../grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20',1,'gribfield']]], + ['ext_22',['ext',['../grib2__int_8h.html#a312a417c8e6f68bea7bfe86268c16594',1,'gtemplate']]], + ['extdrstemplate_23',['extdrstemplate',['../drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c'],['../grib2__int_8h.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c']]], + ['extgridtemplate_24',['extgridtemplate',['../grib2__int_8h.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c'],['../gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c']]], + ['extlen_25',['extlen',['../grib2__int_8h.html#a743151a1bde2a21603926e1541baa5de',1,'gtemplate']]], + ['extpdstemplate_26',['extpdstemplate',['../grib2__int_8h.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c'],['../pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c']]] +]; diff --git a/ver-1.7.0/search/all_5.html b/ver-1.7.0/search/all_5.html new file mode 100644 index 00000000..9dd9344b --- /dev/null +++ b/ver-1.7.0/search/all_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_5.js b/ver-1.7.0/search/all_5.js new file mode 100644 index 00000000..567be8ed --- /dev/null +++ b/ver-1.7.0/search/all_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['false_5f_27',['FALSE_',['../pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d',1,'pack_gp.c']]], + ['fld_28',['fld',['../grib2_8h.html#ade69d8c093b2aa18c720c833def6198f',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_6.html b/ver-1.7.0/search/all_6.html new file mode 100644 index 00000000..f1e516d7 --- /dev/null +++ b/ver-1.7.0/search/all_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_6.js b/ver-1.7.0/search/all_6.js new file mode 100644 index 00000000..18ab07c3 --- /dev/null +++ b/ver-1.7.0/search/all_6.js @@ -0,0 +1,111 @@ +var searchData= +[ + ['g2_5fadd_5fmsg_5fcomplete_29',['G2_ADD_MSG_COMPLETE',['../grib2_8h.html#a5aaef5008fd9be5c044b207231cf767f',1,'grib2.h']]], + ['g2_5fadd_5fmsg_5finit_30',['G2_ADD_MSG_INIT',['../grib2_8h.html#a9627c88b7c7dd863cb3af9fb3e10011b',1,'grib2.h']]], + ['g2_5faddfield_31',['g2_addfield',['../g2__addfield_8c.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c'],['../grib2_8h.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c']]], + ['g2_5faddfield_2ec_32',['g2_addfield.c',['../g2__addfield_8c.html',1,'']]], + ['g2_5faddfield_5fbad_5fbitmap_33',['G2_ADDFIELD_BAD_BITMAP',['../grib2_8h.html#a496eb9c096d0ecdc712ebea3ffd3a37d',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fdrt_34',['G2_ADDFIELD_BAD_DRT',['../grib2_8h.html#a5a92ce5b0b8da884e2924dba7f1e1a95',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fgds_35',['G2_ADDFIELD_BAD_GDS',['../grib2_8h.html#a28e1af8be9f9c34241c0c8ce780c2707',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fgdt_36',['G2_ADDFIELD_BAD_GDT',['../grib2_8h.html#aaead77879d197777943ee9c53e0672ef',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fpdt_37',['G2_ADDFIELD_BAD_PDT',['../grib2_8h.html#a7661683648959dad5ea1d2def2cb766d',1,'grib2.h']]], + ['g2_5faddfield_5ferr_38',['G2_ADDFIELD_ERR',['../grib2_8h.html#ad37ad5e44291e1b229321755b4838c3a',1,'grib2.h']]], + ['g2_5faddgrid_39',['g2_addgrid',['../g2__addgrid_8c.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c'],['../grib2_8h.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c']]], + ['g2_5faddgrid_2ec_40',['g2_addgrid.c',['../g2__addgrid_8c.html',1,'']]], + ['g2_5faddgrid_5fbad_5fgdt_41',['G2_ADDGRID_BAD_GDT',['../grib2_8h.html#a3687ada1cdabe6b44b62620a3e4e612b',1,'grib2.h']]], + ['g2_5faddlocal_42',['g2_addlocal',['../grib2_8h.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c'],['../g2__addlocal_8c.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c']]], + ['g2_5faddlocal_2ec_43',['g2_addlocal.c',['../g2__addlocal_8c.html',1,'']]], + ['g2_5fbad_5fsec_44',['G2_BAD_SEC',['../grib2_8h.html#a362f4c8ddcb007058bccba7eab1ff8e0',1,'grib2.h']]], + ['g2_5fbad_5fsec_5fcounts_45',['G2_BAD_SEC_COUNTS',['../grib2_8h.html#a06d37843d3f4b3f46cb240206ce430b0',1,'grib2.h']]], + ['g2_5fcreate_46',['g2_create',['../g2__create_8c.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c'],['../grib2_8h.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c']]], + ['g2_5fcreate_2ec_47',['g2_create.c',['../g2__create_8c.html',1,'']]], + ['g2_5fcreate_5fgrib_5fversion_48',['G2_CREATE_GRIB_VERSION',['../grib2_8h.html#ae740c66315236fc68d4f337558587505',1,'grib2.h']]], + ['g2_5ffree_49',['g2_free',['../g2__free_8c.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c'],['../grib2_8h.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c']]], + ['g2_5ffree_2ec_50',['g2_free.c',['../g2__free_8c.html',1,'']]], + ['g2_5fgetfld_51',['g2_getfld',['../g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c'],['../grib2_8h.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c']]], + ['g2_5fgetfld_2ec_52',['g2_getfld.c',['../g2__getfld_8c.html',1,'']]], + ['g2_5fgetfld_5fbad_5fend_53',['G2_GETFLD_BAD_END',['../grib2_8h.html#ae5716ebe302534d9fc24cf328bade4df',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec1_54',['G2_GETFLD_BAD_SEC1',['../grib2_8h.html#a57517913da70932f0c56f076207ea90b',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec2_55',['G2_GETFLD_BAD_SEC2',['../grib2_8h.html#a4f8b8ce8eb11ed2de38710863323f41a',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec3_56',['G2_GETFLD_BAD_SEC3',['../grib2_8h.html#ad101a194bd4c5c6c0a0dd9aaa6fb9905',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec4_57',['G2_GETFLD_BAD_SEC4',['../grib2_8h.html#a94364236b4274588b2b4b6b851555e15',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec5_58',['G2_GETFLD_BAD_SEC5',['../grib2_8h.html#a6065be2bee7e56c7eb0d3673a70be727',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec6_59',['G2_GETFLD_BAD_SEC6',['../grib2_8h.html#ab2d294bedc5fda5e67800bef91b6de44',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec7_60',['G2_GETFLD_BAD_SEC7',['../grib2_8h.html#a115c0b1461732602197d7129cb783938',1,'grib2.h']]], + ['g2_5fgetfld_5fgrib_5fversion_61',['G2_GETFLD_GRIB_VERSION',['../grib2_8h.html#a3c94f1f792106e97d1e4cc2fe674e9ef',1,'grib2.h']]], + ['g2_5fgetfld_5finval_62',['G2_GETFLD_INVAL',['../grib2_8h.html#a2915a7e9bd01c1b2bd33a6e362c88acc',1,'grib2.h']]], + ['g2_5fgetfld_5finval_5fsec_63',['G2_GETFLD_INVAL_SEC',['../grib2_8h.html#afeef0a49033cd2735140f87dfe0fe49f',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fbitmap_64',['G2_GETFLD_NO_BITMAP',['../grib2_8h.html#aee39ba22e9351cf0b7f2813bd1b5dd7e',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fdrt_65',['G2_GETFLD_NO_DRT',['../grib2_8h.html#ac2734aa4f2d3f10a642b3d7919563dcc',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fgrib_66',['G2_GETFLD_NO_GRIB',['../grib2_8h.html#a9600b70ed48d9ee91c366c3d2aaaebb3',1,'grib2.h']]], + ['g2_5fgetfld_5fwrong_5fend_67',['G2_GETFLD_WRONG_END',['../grib2_8h.html#a8ebd7f4cdc757b37d8cf344c17329936',1,'grib2.h']]], + ['g2_5fgetfld_5fwrong_5fnflds_68',['G2_GETFLD_WRONG_NFLDS',['../grib2_8h.html#a49e78acc21d879a88d3fb21866878ef6',1,'grib2.h']]], + ['g2_5fgribend_69',['g2_gribend',['../g2__gribend_8c.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c'],['../grib2_8h.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c']]], + ['g2_5fgribend_2ec_70',['g2_gribend.c',['../g2__gribend_8c.html',1,'']]], + ['g2_5fgribend_5fmsg_5finit_71',['G2_GRIBEND_MSG_INIT',['../grib2_8h.html#a07313bd28e479d86f64ff744b10a2b78',1,'grib2.h']]], + ['g2_5finfo_72',['g2_info',['../g2__info_8c.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c'],['../grib2_8h.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c']]], + ['g2_5finfo_2ec_73',['g2_info.c',['../g2__info_8c.html',1,'']]], + ['g2_5finfo_5fbad_5fend_74',['G2_INFO_BAD_END',['../grib2_8h.html#ae174af0c4aa67c5d6217688d45aad4c5',1,'grib2.h']]], + ['g2_5finfo_5fgrib_5fversion_75',['G2_INFO_GRIB_VERSION',['../grib2_8h.html#a55b6bf7ad57b4c202827f3326ad2c4df',1,'grib2.h']]], + ['g2_5finfo_5finval_5fsec_76',['G2_INFO_INVAL_SEC',['../grib2_8h.html#a436d91157da728072516d50f5c349507',1,'grib2.h']]], + ['g2_5finfo_5fno_5fgrib_77',['G2_INFO_NO_GRIB',['../grib2_8h.html#af26cc0775753191aabf4720876452b48',1,'grib2.h']]], + ['g2_5finfo_5fno_5fsec1_78',['G2_INFO_NO_SEC1',['../grib2_8h.html#a14417ca1b452ff2e6681ebd4f00c2dee',1,'grib2.h']]], + ['g2_5finfo_5fwrong_5fend_79',['G2_INFO_WRONG_END',['../grib2_8h.html#af935bef94850a5b24e554393ce0a8eef',1,'grib2.h']]], + ['g2_5fjpcunpack_5fmem_80',['G2_JPCUNPACK_MEM',['../grib2_8h.html#ade01e29b36d4a7b1de09c84c39786fbd',1,'grib2.h']]], + ['g2_5fjpeg2000_5fenabled_81',['G2_JPEG2000_ENABLED',['../grib2_8h.html#a0a07a1092a64ae871ab45b147de85318',1,'grib2.h']]], + ['g2_5fmiss_82',['g2_miss',['../g2__miss_8c.html#a5ededd2735de5cd446ee17c2415592e6',1,'g2_miss.c']]], + ['g2_5fmiss_2ec_83',['g2_miss.c',['../g2__miss_8c.html',1,'']]], + ['g2_5fno_5ferror_84',['G2_NO_ERROR',['../grib2_8h.html#a94af4623709fa1c08f8035b98e7ca56b',1,'grib2.h']]], + ['g2_5fpng_5fenabled_85',['G2_PNG_ENABLED',['../grib2_8h.html#acaa1f7159ddd54e667beca9658c797a0',1,'grib2.h']]], + ['g2_5fspecunpack_5ftype_86',['G2_SPECUNPACK_TYPE',['../grib2_8h.html#ac046d29b8feb2f0333e7a5c8803aba4d',1,'grib2.h']]], + ['g2_5funpack1_87',['g2_unpack1',['../g2__unpack1_8c.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c'],['../grib2_8h.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c']]], + ['g2_5funpack1_2ec_88',['g2_unpack1.c',['../g2__unpack1_8c.html',1,'']]], + ['g2_5funpack2_89',['g2_unpack2',['../g2__unpack2_8c.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c'],['../grib2_8h.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c']]], + ['g2_5funpack2_2ec_90',['g2_unpack2.c',['../g2__unpack2_8c.html',1,'']]], + ['g2_5funpack3_91',['g2_unpack3',['../g2__unpack3_8c.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c'],['../grib2_8h.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c']]], + ['g2_5funpack3_2ec_92',['g2_unpack3.c',['../g2__unpack3_8c.html',1,'']]], + ['g2_5funpack3_5fbad_5fgdt_93',['G2_UNPACK3_BAD_GDT',['../grib2_8h.html#a97570f9ca7b7f018cad85d5f8e5be4e3',1,'grib2.h']]], + ['g2_5funpack4_94',['g2_unpack4',['../g2__unpack4_8c.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c'],['../grib2_8h.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c']]], + ['g2_5funpack4_2ec_95',['g2_unpack4.c',['../g2__unpack4_8c.html',1,'']]], + ['g2_5funpack4_5fbad_5fpdt_96',['G2_UNPACK4_BAD_PDT',['../grib2_8h.html#a6441abadc54f311dbef926fdbd7a6e5a',1,'grib2.h']]], + ['g2_5funpack5_97',['g2_unpack5',['../g2__unpack5_8c.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c'],['../grib2_8h.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c']]], + ['g2_5funpack5_2ec_98',['g2_unpack5.c',['../g2__unpack5_8c.html',1,'']]], + ['g2_5funpack5_5fbad_5fdrt_99',['G2_UNPACK5_BAD_DRT',['../grib2_8h.html#a073c8c6c97479d96e86cdaf1bed26f41',1,'grib2.h']]], + ['g2_5funpack6_100',['g2_unpack6',['../g2__unpack6_8c.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c'],['../grib2_8h.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c']]], + ['g2_5funpack6_2ec_101',['g2_unpack6.c',['../g2__unpack6_8c.html',1,'']]], + ['g2_5funpack6_5fbad_5fbitmap_102',['G2_UNPACK6_BAD_BITMAP',['../grib2_8h.html#a2f05416b54c82d3ec6aa050c2dd033a4',1,'grib2.h']]], + ['g2_5funpack7_103',['g2_unpack7',['../g2__unpack7_8c.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c'],['../grib2_8h.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c']]], + ['g2_5funpack7_2ec_104',['g2_unpack7.c',['../g2__unpack7_8c.html',1,'']]], + ['g2_5funpack7_5fbad_5fdrt_105',['G2_UNPACK7_BAD_DRT',['../grib2_8h.html#a01fe4ac54380851cc28581d59dfa9bf4',1,'grib2.h']]], + ['g2_5funpack7_5fcorrupt_5fsec_106',['G2_UNPACK7_CORRUPT_SEC',['../grib2_8h.html#a3b6b5bd21386f9f7d49f1f628a9c895c',1,'grib2.h']]], + ['g2_5funpack7_5fwrong_5fgdt_107',['G2_UNPACK7_WRONG_GDT',['../grib2_8h.html#a9485e54be066c97916f22b4d6046cd1b',1,'grib2.h']]], + ['g2_5funpack_5fbad_5fsec_108',['G2_UNPACK_BAD_SEC',['../grib2_8h.html#a1eb0a21681ad4d1a9af3e357f59dc08b',1,'grib2.h']]], + ['g2_5funpack_5fno_5fmem_109',['G2_UNPACK_NO_MEM',['../grib2_8h.html#a76dad0fdc4926df76a417a2992b81d66',1,'grib2.h']]], + ['g2_5fversion_110',['G2_VERSION',['../grib2_8h.html#abdcadc6336632657f0b90b4cff01709f',1,'grib2.h']]], + ['g2c_5fcheck_5fmsg_111',['g2c_check_msg',['../grib2__int_8h.html#a3acf35e5653f0dab59b3e6fd130f2d62',1,'g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose): util.c'],['../util_8c.html#a3acf35e5653f0dab59b3e6fd130f2d62',1,'g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose): util.c']]], + ['g2c_5fmsg_5fcomplete_112',['G2C_MSG_COMPLETE',['../grib2_8h.html#a575d0594c327da0f6001abd1ae17128a',1,'grib2.h']]], + ['g2c_5fno_5ferror_113',['G2C_NO_ERROR',['../grib2_8h.html#a9ea0feeb2757a4caa81858e6957ea3d7',1,'grib2.h']]], + ['g2c_5fnot_5fgrib_114',['G2C_NOT_GRIB',['../grib2_8h.html#abda58c1fda90dc4b6d105e8d9853819e',1,'grib2.h']]], + ['g2float_115',['g2float',['../grib2_8h.html#a2e615ee29fc8d17a681017e4384847c2',1,'grib2.h']]], + ['g2int_116',['g2int',['../grib2_8h.html#af0b63b0e0f41f07f562a4367e2a60838',1,'grib2.h']]], + ['g2intu_117',['g2intu',['../grib2_8h.html#a95bb698b6bd148aae1b3b841fb0da83b',1,'grib2.h']]], + ['gbit_118',['gbit',['../gbits_8c.html#a1efb9739e947d94010aeba6daf62eca3',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits): gbits.c'],['../grib2__int_8h.html#a1efb9739e947d94010aeba6daf62eca3',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits): gbits.c']]], + ['gbits_119',['gbits',['../gbits_8c.html#a31ebdbbf262b7478d6a7cc4326f76ade',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c'],['../grib2__int_8h.html#a31ebdbbf262b7478d6a7cc4326f76ade',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c']]], + ['gbits_2ec_120',['gbits.c',['../gbits_8c.html',1,'']]], + ['getdim_121',['getdim',['../getdim_8c.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c'],['../grib2__int_8h.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c']]], + ['getdim_2ec_122',['getdim.c',['../getdim_8c.html',1,'']]], + ['getdrsindex_123',['getdrsindex',['../drstemplates_8c.html#a307a8ced5bd81dd2bf110596fc9e6532',1,'drstemplates.c']]], + ['getdrstemplate_124',['getdrstemplate',['../drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c'],['../grib2__int_8h.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c']]], + ['getgridindex_125',['getgridindex',['../gridtemplates_8c.html#addbeca29a7de77dc30f65a08b6b38941',1,'gridtemplates.c']]], + ['getgridtemplate_126',['getgridtemplate',['../grib2__int_8h.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c'],['../gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c']]], + ['getpdsindex_127',['getpdsindex',['../pdstemplates_8c.html#a59f2fe1fba0577301d154f21e0478e7f',1,'pdstemplates.c']]], + ['getpdstemplate_128',['getpdstemplate',['../grib2__int_8h.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c'],['../pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c']]], + ['getpoly_129',['getpoly',['../getpoly_8c.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c'],['../grib2__int_8h.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c']]], + ['getpoly_2ec_130',['getpoly.c',['../getpoly_8c.html',1,'']]], + ['grib2_2eh_131',['grib2.h',['../grib2_8h.html',1,'']]], + ['grib2_5fint_2eh_132',['grib2_int.h',['../grib2__int_8h.html',1,'']]], + ['gribfield_133',['gribfield',['../grib2_8h.html#afd3ef3eb9f8b9a64a7b749a892de46c5',1,'gribfield(): grib2.h'],['../grib2_8h.html#structgribfield',1,'gribfield']]], + ['griddef_134',['griddef',['../grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138',1,'gribfield']]], + ['gridtemplates_2ec_135',['gridtemplates.c',['../gridtemplates_8c.html',1,'']]], + ['gtemplate_136',['gtemplate',['../grib2__int_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63',1,'gtemplate(): grib2_int.h'],['../grib2__int_8h.html#structgtemplate',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/search/all_7.html b/ver-1.7.0/search/all_7.html new file mode 100644 index 00000000..8ddbf6c8 --- /dev/null +++ b/ver-1.7.0/search/all_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_7.js b/ver-1.7.0/search/all_7.js new file mode 100644 index 00000000..4e0ac966 --- /dev/null +++ b/ver-1.7.0/search/all_7.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['ibmap_137',['ibmap',['../grib2_8h.html#a10a46b6a25d615784dced13e914d0726',1,'gribfield']]], + ['idrtlen_138',['idrtlen',['../grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc',1,'gribfield']]], + ['idrtmpl_139',['idrtmpl',['../grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457',1,'gribfield']]], + ['idrtnum_140',['idrtnum',['../grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f',1,'gribfield']]], + ['idsect_141',['idsect',['../grib2_8h.html#ad81615f4a659f2454762301e0e810793',1,'gribfield']]], + ['idsectlen_142',['idsectlen',['../grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826',1,'gribfield']]], + ['ifldnum_143',['ifldnum',['../grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454',1,'gribfield']]], + ['igdtlen_144',['igdtlen',['../grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e',1,'gribfield']]], + ['igdtmpl_145',['igdtmpl',['../grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53',1,'gribfield']]], + ['igdtnum_146',['igdtnum',['../grib2_8h.html#a065d206f38d552c49af642e3cf6056b3',1,'gribfield']]], + ['int_5fpower_147',['int_power',['../grib2__int_8h.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c'],['../int__power_8c.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c']]], + ['int_5fpower_2ec_148',['int_power.c',['../int__power_8c.html',1,'']]], + ['interp_5fopt_149',['interp_opt',['../grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940',1,'gribfield']]], + ['ipdtlen_150',['ipdtlen',['../grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e',1,'gribfield']]], + ['ipdtmpl_151',['ipdtmpl',['../grib2_8h.html#a49b9e8c090596e02abc193b1974b8022',1,'gribfield']]], + ['ipdtnum_152',['ipdtnum',['../grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_8.html b/ver-1.7.0/search/all_8.html new file mode 100644 index 00000000..83c55ae2 --- /dev/null +++ b/ver-1.7.0/search/all_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_8.js b/ver-1.7.0/search/all_8.js new file mode 100644 index 00000000..24cd733a --- /dev/null +++ b/ver-1.7.0/search/all_8.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['jpcpack_153',['jpcpack',['../g2__addfield_8c.html#ae9c19967000623138e0d9218f6c949ab',1,'jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): jpcpack.c'],['../grib2__int_8h.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c'],['../jpcpack_8c.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c']]], + ['jpcpack_2ec_154',['jpcpack.c',['../jpcpack_8c.html',1,'']]], + ['jpcunpack_155',['jpcunpack',['../grib2__int_8h.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c'],['../jpcunpack_8c.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c']]], + ['jpcunpack_2ec_156',['jpcunpack.c',['../jpcunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_9.html b/ver-1.7.0/search/all_9.html new file mode 100644 index 00000000..1e263c13 --- /dev/null +++ b/ver-1.7.0/search/all_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_9.js b/ver-1.7.0/search/all_9.js new file mode 100644 index 00000000..37995078 --- /dev/null +++ b/ver-1.7.0/search/all_9.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['lensec0_157',['LENSEC0',['../g2__create_8c.html#a509c8614b4771ae9b3d2a96a6f3bdc15',1,'g2_create.c']]], + ['list_5fopt_158',['list_opt',['../grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d',1,'gribfield']]], + ['local_159',['local',['../grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1',1,'gribfield']]], + ['locallen_160',['locallen',['../grib2_8h.html#a0e2cadad47b161868b97e60f00409982',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_a.html b/ver-1.7.0/search/all_a.html new file mode 100644 index 00000000..3a6cac10 --- /dev/null +++ b/ver-1.7.0/search/all_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_a.js b/ver-1.7.0/search/all_a.js new file mode 100644 index 00000000..f7c03745 --- /dev/null +++ b/ver-1.7.0/search/all_a.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['map_161',['map',['../grib2__int_8h.html#a88e12020d460546cafcef9c445c3df20',1,'gtemplate']]], + ['maplen_162',['maplen',['../grib2__int_8h.html#aea3cb225770444c7e40855ee401a5b29',1,'gtemplate']]], + ['mapsec1len_163',['MAPSEC1LEN',['../g2__create_8c.html#a7ea6e1ded57657a0b75c46636e6dbb89',1,'g2_create.c']]], + ['maxdrsmaplen_164',['MAXDRSMAPLEN',['../drstemplates_8c.html#ade593949cef71416060205db106c2828',1,'drstemplates.c']]], + ['maxdrstemp_165',['MAXDRSTEMP',['../drstemplates_8c.html#a94872ea1f11e8ea068177a6506e0a3e4',1,'drstemplates.c']]], + ['maxgridmaplen_166',['MAXGRIDMAPLEN',['../gridtemplates_8c.html#ab19500a13d07a421b89afd9d011ae058',1,'gridtemplates.c']]], + ['maxgridtemp_167',['MAXGRIDTEMP',['../gridtemplates_8c.html#a4d1ba1f89b11d332fb06d9624d5156c9',1,'gridtemplates.c']]], + ['maxoptssize_168',['MAXOPTSSIZE',['../enc__jpeg2000_8c.html#a9855b4e8c40619aab0092ba284943a67',1,'enc_jpeg2000.c']]], + ['maxpdsmaplen_169',['MAXPDSMAPLEN',['../pdstemplates_8c.html#aa0bb590f8c48ad21d17f6cf7a72d8f53',1,'pdstemplates.c']]], + ['maxpdstemp_170',['MAXPDSTEMP',['../pdstemplates_8c.html#a11c588e7671155abba68b92678fc2071',1,'pdstemplates.c']]], + ['misspack_171',['misspack',['../grib2__int_8h.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c'],['../misspack_8c.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c']]], + ['misspack_2ec_172',['misspack.c',['../misspack_8c.html',1,'']]], + ['mkieee_173',['mkieee',['../grib2__int_8h.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c'],['../mkieee_8c.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c']]], + ['mkieee_2ec_174',['mkieee.c',['../mkieee_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_b.html b/ver-1.7.0/search/all_b.html new file mode 100644 index 00000000..130deb4e --- /dev/null +++ b/ver-1.7.0/search/all_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_b.js b/ver-1.7.0/search/all_b.js new file mode 100644 index 00000000..5c7949f0 --- /dev/null +++ b/ver-1.7.0/search/all_b.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['ndpts_175',['ndpts',['../grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c',1,'gribfield']]], + ['needext_176',['needext',['../grib2__int_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf',1,'gtemplate']]], + ['ngrdpts_177',['ngrdpts',['../grib2_8h.html#a1fd25a21842b45215676696fcddb2a09',1,'gribfield']]], + ['num_178',['num',['../grib2__int_8h.html#a973b6764b40aed427d419046b63d75b3',1,'gtemplate']]], + ['num_5fcoord_179',['num_coord',['../grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce',1,'gribfield']]], + ['num_5fopt_180',['num_opt',['../grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b',1,'gribfield']]], + ['numoct_5fopt_181',['numoct_opt',['../grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/all_c.html b/ver-1.7.0/search/all_c.html new file mode 100644 index 00000000..3dd5af06 --- /dev/null +++ b/ver-1.7.0/search/all_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_c.js b/ver-1.7.0/search/all_c.js new file mode 100644 index 00000000..60688094 --- /dev/null +++ b/ver-1.7.0/search/all_c.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['pack_5fgp_182',['pack_gp',['../grib2__int_8h.html#ab5fbec07e58a9d872a0fa1c04d74a81b',1,'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): pack_gp.c'],['../pack__gp_8c.html#ab5fbec07e58a9d872a0fa1c04d74a81b',1,'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): pack_gp.c']]], + ['pack_5fgp_2ec_183',['pack_gp.c',['../pack__gp_8c.html',1,'']]], + ['pdstemplates_2ec_184',['pdstemplates.c',['../pdstemplates_8c.html',1,'']]], + ['png_5fstream_185',['png_stream',['../dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): dec_png.c'],['../enc__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): enc_png.c']]], + ['pngpack_186',['pngpack',['../g2__addfield_8c.html#aa19673a03d5b0df2730903c39b9e5002',1,'pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): pngpack.c'],['../grib2__int_8h.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c'],['../pngpack_8c.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c']]], + ['pngpack_2ec_187',['pngpack.c',['../pngpack_8c.html',1,'']]], + ['pngunpack_188',['pngunpack',['../grib2__int_8h.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c'],['../pngunpack_8c.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c']]], + ['pngunpack_2ec_189',['pngunpack.c',['../pngunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_d.html b/ver-1.7.0/search/all_d.html new file mode 100644 index 00000000..af7f2f0f --- /dev/null +++ b/ver-1.7.0/search/all_d.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_d.js b/ver-1.7.0/search/all_d.js new file mode 100644 index 00000000..b3c8e09b --- /dev/null +++ b/ver-1.7.0/search/all_d.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['rdieee_190',['rdieee',['../grib2__int_8h.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c'],['../rdieee_8c.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c']]], + ['rdieee_2ec_191',['rdieee.c',['../rdieee_8c.html',1,'']]], + ['reduce_192',['reduce',['../reduce_8c.html#a6bb0dafca9ef2de9d433cb4c72f34b2d',1,'reduce.c']]], + ['reduce_2ec_193',['reduce.c',['../reduce_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_e.html b/ver-1.7.0/search/all_e.html new file mode 100644 index 00000000..e25df423 --- /dev/null +++ b/ver-1.7.0/search/all_e.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_e.js b/ver-1.7.0/search/all_e.js new file mode 100644 index 00000000..260f1f44 --- /dev/null +++ b/ver-1.7.0/search/all_e.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['sbit_194',['sbit',['../gbits_8c.html#af9e044ba7da32a5415e351ed647ef676',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits): gbits.c'],['../grib2__int_8h.html#af9e044ba7da32a5415e351ed647ef676',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits): gbits.c']]], + ['sbits_195',['sbits',['../gbits_8c.html#a92b32e56ff8941c5026d460f4fe2aec3',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c'],['../grib2__int_8h.html#a92b32e56ff8941c5026d460f4fe2aec3',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c']]], + ['seekgb_196',['seekgb',['../grib2_8h.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c'],['../seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c']]], + ['seekgb_2ec_197',['seekgb.c',['../seekgb_8c.html',1,'']]], + ['simpack_198',['simpack',['../simpack_8c.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c'],['../grib2__int_8h.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c']]], + ['simpack_2ec_199',['simpack.c',['../simpack_8c.html',1,'']]], + ['simunpack_200',['simunpack',['../grib2__int_8h.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c'],['../simunpack_8c.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c']]], + ['simunpack_2ec_201',['simunpack.c',['../simunpack_8c.html',1,'']]], + ['specpack_202',['specpack',['../grib2__int_8h.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c'],['../specpack_8c.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c']]], + ['specpack_2ec_203',['specpack.c',['../specpack_8c.html',1,'']]], + ['specunpack_204',['specunpack',['../grib2__int_8h.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c'],['../specunpack_8c.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c']]], + ['specunpack_2ec_205',['specunpack.c',['../specunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/all_f.html b/ver-1.7.0/search/all_f.html new file mode 100644 index 00000000..b23da6ce --- /dev/null +++ b/ver-1.7.0/search/all_f.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/all_f.js b/ver-1.7.0/search/all_f.js new file mode 100644 index 00000000..799a3b59 --- /dev/null +++ b/ver-1.7.0/search/all_f.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['templatesdrs_206',['templatesdrs',['../drstemplates_8c.html#a08f7c019317d1e6235a863ee8ce6e9e2',1,'drstemplates.c']]], + ['templatesgrid_207',['templatesgrid',['../gridtemplates_8c.html#af8316127b8fcf96fb4d3ab2c5411cde9',1,'gridtemplates.c']]], + ['templatespds_208',['templatespds',['../pdstemplates_8c.html#a87d5723cb60a9b598bc574cd31673a26',1,'pdstemplates.c']]], + ['true_5f_209',['TRUE_',['../pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5',1,'pack_gp.c']]], + ['type_210',['type',['../grib2__int_8h.html#ad28b4af0030473208605c2cf2c5e3f36',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/search/classes_0.html b/ver-1.7.0/search/classes_0.html new file mode 100644 index 00000000..af8159ee --- /dev/null +++ b/ver-1.7.0/search/classes_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/classes_0.js b/ver-1.7.0/search/classes_0.js new file mode 100644 index 00000000..64287294 --- /dev/null +++ b/ver-1.7.0/search/classes_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['gribfield_217',['gribfield',['../grib2_8h.html#structgribfield',1,'']]], + ['gtemplate_218',['gtemplate',['../grib2__int_8h.html#structgtemplate',1,'']]] +]; diff --git a/ver-1.7.0/search/close.svg b/ver-1.7.0/search/close.svg new file mode 100644 index 00000000..a933eea1 --- /dev/null +++ b/ver-1.7.0/search/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/ver-1.7.0/search/defines_0.html b/ver-1.7.0/search/defines_0.html new file mode 100644 index 00000000..15cc3de3 --- /dev/null +++ b/ver-1.7.0/search/defines_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_0.js b/ver-1.7.0/search/defines_0.js new file mode 100644 index 00000000..ba7d3385 --- /dev/null +++ b/ver-1.7.0/search/defines_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['alog2_370',['ALOG2',['../grib2__int_8h.html#aca7ef7356b1550ae26423a6d8012f5fd',1,'grib2_int.h']]] +]; diff --git a/ver-1.7.0/search/defines_1.html b/ver-1.7.0/search/defines_1.html new file mode 100644 index 00000000..c49009c7 --- /dev/null +++ b/ver-1.7.0/search/defines_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_1.js b/ver-1.7.0/search/defines_1.js new file mode 100644 index 00000000..ecb06d42 --- /dev/null +++ b/ver-1.7.0/search/defines_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bits_5fper_5fbyte_371',['BITS_PER_BYTE',['../seekgb_8c.html#a369ecd38b3ab077fc235f892354bb46f',1,'seekgb.c']]] +]; diff --git a/ver-1.7.0/search/defines_2.html b/ver-1.7.0/search/defines_2.html new file mode 100644 index 00000000..c5510111 --- /dev/null +++ b/ver-1.7.0/search/defines_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_2.js b/ver-1.7.0/search/defines_2.js new file mode 100644 index 00000000..67bf4d14 --- /dev/null +++ b/ver-1.7.0/search/defines_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['false_5f_372',['FALSE_',['../pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/search/defines_3.html b/ver-1.7.0/search/defines_3.html new file mode 100644 index 00000000..8c6d2153 --- /dev/null +++ b/ver-1.7.0/search/defines_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_3.js b/ver-1.7.0/search/defines_3.js new file mode 100644 index 00000000..821c1a82 --- /dev/null +++ b/ver-1.7.0/search/defines_3.js @@ -0,0 +1,56 @@ +var searchData= +[ + ['g2_5fadd_5fmsg_5fcomplete_373',['G2_ADD_MSG_COMPLETE',['../grib2_8h.html#a5aaef5008fd9be5c044b207231cf767f',1,'grib2.h']]], + ['g2_5fadd_5fmsg_5finit_374',['G2_ADD_MSG_INIT',['../grib2_8h.html#a9627c88b7c7dd863cb3af9fb3e10011b',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fbitmap_375',['G2_ADDFIELD_BAD_BITMAP',['../grib2_8h.html#a496eb9c096d0ecdc712ebea3ffd3a37d',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fdrt_376',['G2_ADDFIELD_BAD_DRT',['../grib2_8h.html#a5a92ce5b0b8da884e2924dba7f1e1a95',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fgds_377',['G2_ADDFIELD_BAD_GDS',['../grib2_8h.html#a28e1af8be9f9c34241c0c8ce780c2707',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fgdt_378',['G2_ADDFIELD_BAD_GDT',['../grib2_8h.html#aaead77879d197777943ee9c53e0672ef',1,'grib2.h']]], + ['g2_5faddfield_5fbad_5fpdt_379',['G2_ADDFIELD_BAD_PDT',['../grib2_8h.html#a7661683648959dad5ea1d2def2cb766d',1,'grib2.h']]], + ['g2_5faddfield_5ferr_380',['G2_ADDFIELD_ERR',['../grib2_8h.html#ad37ad5e44291e1b229321755b4838c3a',1,'grib2.h']]], + ['g2_5faddgrid_5fbad_5fgdt_381',['G2_ADDGRID_BAD_GDT',['../grib2_8h.html#a3687ada1cdabe6b44b62620a3e4e612b',1,'grib2.h']]], + ['g2_5fbad_5fsec_382',['G2_BAD_SEC',['../grib2_8h.html#a362f4c8ddcb007058bccba7eab1ff8e0',1,'grib2.h']]], + ['g2_5fbad_5fsec_5fcounts_383',['G2_BAD_SEC_COUNTS',['../grib2_8h.html#a06d37843d3f4b3f46cb240206ce430b0',1,'grib2.h']]], + ['g2_5fcreate_5fgrib_5fversion_384',['G2_CREATE_GRIB_VERSION',['../grib2_8h.html#ae740c66315236fc68d4f337558587505',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fend_385',['G2_GETFLD_BAD_END',['../grib2_8h.html#ae5716ebe302534d9fc24cf328bade4df',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec1_386',['G2_GETFLD_BAD_SEC1',['../grib2_8h.html#a57517913da70932f0c56f076207ea90b',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec2_387',['G2_GETFLD_BAD_SEC2',['../grib2_8h.html#a4f8b8ce8eb11ed2de38710863323f41a',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec3_388',['G2_GETFLD_BAD_SEC3',['../grib2_8h.html#ad101a194bd4c5c6c0a0dd9aaa6fb9905',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec4_389',['G2_GETFLD_BAD_SEC4',['../grib2_8h.html#a94364236b4274588b2b4b6b851555e15',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec5_390',['G2_GETFLD_BAD_SEC5',['../grib2_8h.html#a6065be2bee7e56c7eb0d3673a70be727',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec6_391',['G2_GETFLD_BAD_SEC6',['../grib2_8h.html#ab2d294bedc5fda5e67800bef91b6de44',1,'grib2.h']]], + ['g2_5fgetfld_5fbad_5fsec7_392',['G2_GETFLD_BAD_SEC7',['../grib2_8h.html#a115c0b1461732602197d7129cb783938',1,'grib2.h']]], + ['g2_5fgetfld_5fgrib_5fversion_393',['G2_GETFLD_GRIB_VERSION',['../grib2_8h.html#a3c94f1f792106e97d1e4cc2fe674e9ef',1,'grib2.h']]], + ['g2_5fgetfld_5finval_394',['G2_GETFLD_INVAL',['../grib2_8h.html#a2915a7e9bd01c1b2bd33a6e362c88acc',1,'grib2.h']]], + ['g2_5fgetfld_5finval_5fsec_395',['G2_GETFLD_INVAL_SEC',['../grib2_8h.html#afeef0a49033cd2735140f87dfe0fe49f',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fbitmap_396',['G2_GETFLD_NO_BITMAP',['../grib2_8h.html#aee39ba22e9351cf0b7f2813bd1b5dd7e',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fdrt_397',['G2_GETFLD_NO_DRT',['../grib2_8h.html#ac2734aa4f2d3f10a642b3d7919563dcc',1,'grib2.h']]], + ['g2_5fgetfld_5fno_5fgrib_398',['G2_GETFLD_NO_GRIB',['../grib2_8h.html#a9600b70ed48d9ee91c366c3d2aaaebb3',1,'grib2.h']]], + ['g2_5fgetfld_5fwrong_5fend_399',['G2_GETFLD_WRONG_END',['../grib2_8h.html#a8ebd7f4cdc757b37d8cf344c17329936',1,'grib2.h']]], + ['g2_5fgetfld_5fwrong_5fnflds_400',['G2_GETFLD_WRONG_NFLDS',['../grib2_8h.html#a49e78acc21d879a88d3fb21866878ef6',1,'grib2.h']]], + ['g2_5fgribend_5fmsg_5finit_401',['G2_GRIBEND_MSG_INIT',['../grib2_8h.html#a07313bd28e479d86f64ff744b10a2b78',1,'grib2.h']]], + ['g2_5finfo_5fbad_5fend_402',['G2_INFO_BAD_END',['../grib2_8h.html#ae174af0c4aa67c5d6217688d45aad4c5',1,'grib2.h']]], + ['g2_5finfo_5fgrib_5fversion_403',['G2_INFO_GRIB_VERSION',['../grib2_8h.html#a55b6bf7ad57b4c202827f3326ad2c4df',1,'grib2.h']]], + ['g2_5finfo_5finval_5fsec_404',['G2_INFO_INVAL_SEC',['../grib2_8h.html#a436d91157da728072516d50f5c349507',1,'grib2.h']]], + ['g2_5finfo_5fno_5fgrib_405',['G2_INFO_NO_GRIB',['../grib2_8h.html#af26cc0775753191aabf4720876452b48',1,'grib2.h']]], + ['g2_5finfo_5fno_5fsec1_406',['G2_INFO_NO_SEC1',['../grib2_8h.html#a14417ca1b452ff2e6681ebd4f00c2dee',1,'grib2.h']]], + ['g2_5finfo_5fwrong_5fend_407',['G2_INFO_WRONG_END',['../grib2_8h.html#af935bef94850a5b24e554393ce0a8eef',1,'grib2.h']]], + ['g2_5fjpcunpack_5fmem_408',['G2_JPCUNPACK_MEM',['../grib2_8h.html#ade01e29b36d4a7b1de09c84c39786fbd',1,'grib2.h']]], + ['g2_5fjpeg2000_5fenabled_409',['G2_JPEG2000_ENABLED',['../grib2_8h.html#a0a07a1092a64ae871ab45b147de85318',1,'grib2.h']]], + ['g2_5fno_5ferror_410',['G2_NO_ERROR',['../grib2_8h.html#a94af4623709fa1c08f8035b98e7ca56b',1,'grib2.h']]], + ['g2_5fpng_5fenabled_411',['G2_PNG_ENABLED',['../grib2_8h.html#acaa1f7159ddd54e667beca9658c797a0',1,'grib2.h']]], + ['g2_5fspecunpack_5ftype_412',['G2_SPECUNPACK_TYPE',['../grib2_8h.html#ac046d29b8feb2f0333e7a5c8803aba4d',1,'grib2.h']]], + ['g2_5funpack3_5fbad_5fgdt_413',['G2_UNPACK3_BAD_GDT',['../grib2_8h.html#a97570f9ca7b7f018cad85d5f8e5be4e3',1,'grib2.h']]], + ['g2_5funpack4_5fbad_5fpdt_414',['G2_UNPACK4_BAD_PDT',['../grib2_8h.html#a6441abadc54f311dbef926fdbd7a6e5a',1,'grib2.h']]], + ['g2_5funpack5_5fbad_5fdrt_415',['G2_UNPACK5_BAD_DRT',['../grib2_8h.html#a073c8c6c97479d96e86cdaf1bed26f41',1,'grib2.h']]], + ['g2_5funpack6_5fbad_5fbitmap_416',['G2_UNPACK6_BAD_BITMAP',['../grib2_8h.html#a2f05416b54c82d3ec6aa050c2dd033a4',1,'grib2.h']]], + ['g2_5funpack7_5fbad_5fdrt_417',['G2_UNPACK7_BAD_DRT',['../grib2_8h.html#a01fe4ac54380851cc28581d59dfa9bf4',1,'grib2.h']]], + ['g2_5funpack7_5fcorrupt_5fsec_418',['G2_UNPACK7_CORRUPT_SEC',['../grib2_8h.html#a3b6b5bd21386f9f7d49f1f628a9c895c',1,'grib2.h']]], + ['g2_5funpack7_5fwrong_5fgdt_419',['G2_UNPACK7_WRONG_GDT',['../grib2_8h.html#a9485e54be066c97916f22b4d6046cd1b',1,'grib2.h']]], + ['g2_5funpack_5fbad_5fsec_420',['G2_UNPACK_BAD_SEC',['../grib2_8h.html#a1eb0a21681ad4d1a9af3e357f59dc08b',1,'grib2.h']]], + ['g2_5funpack_5fno_5fmem_421',['G2_UNPACK_NO_MEM',['../grib2_8h.html#a76dad0fdc4926df76a417a2992b81d66',1,'grib2.h']]], + ['g2_5fversion_422',['G2_VERSION',['../grib2_8h.html#abdcadc6336632657f0b90b4cff01709f',1,'grib2.h']]], + ['g2c_5fmsg_5fcomplete_423',['G2C_MSG_COMPLETE',['../grib2_8h.html#a575d0594c327da0f6001abd1ae17128a',1,'grib2.h']]], + ['g2c_5fno_5ferror_424',['G2C_NO_ERROR',['../grib2_8h.html#a9ea0feeb2757a4caa81858e6957ea3d7',1,'grib2.h']]], + ['g2c_5fnot_5fgrib_425',['G2C_NOT_GRIB',['../grib2_8h.html#abda58c1fda90dc4b6d105e8d9853819e',1,'grib2.h']]] +]; diff --git a/ver-1.7.0/search/defines_4.html b/ver-1.7.0/search/defines_4.html new file mode 100644 index 00000000..f4afac12 --- /dev/null +++ b/ver-1.7.0/search/defines_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_4.js b/ver-1.7.0/search/defines_4.js new file mode 100644 index 00000000..e8c58367 --- /dev/null +++ b/ver-1.7.0/search/defines_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['lensec0_426',['LENSEC0',['../g2__create_8c.html#a509c8614b4771ae9b3d2a96a6f3bdc15',1,'g2_create.c']]] +]; diff --git a/ver-1.7.0/search/defines_5.html b/ver-1.7.0/search/defines_5.html new file mode 100644 index 00000000..8c40d123 --- /dev/null +++ b/ver-1.7.0/search/defines_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_5.js b/ver-1.7.0/search/defines_5.js new file mode 100644 index 00000000..f058a436 --- /dev/null +++ b/ver-1.7.0/search/defines_5.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['mapsec1len_427',['MAPSEC1LEN',['../g2__create_8c.html#a7ea6e1ded57657a0b75c46636e6dbb89',1,'g2_create.c']]], + ['maxdrsmaplen_428',['MAXDRSMAPLEN',['../drstemplates_8c.html#ade593949cef71416060205db106c2828',1,'drstemplates.c']]], + ['maxdrstemp_429',['MAXDRSTEMP',['../drstemplates_8c.html#a94872ea1f11e8ea068177a6506e0a3e4',1,'drstemplates.c']]], + ['maxgridmaplen_430',['MAXGRIDMAPLEN',['../gridtemplates_8c.html#ab19500a13d07a421b89afd9d011ae058',1,'gridtemplates.c']]], + ['maxgridtemp_431',['MAXGRIDTEMP',['../gridtemplates_8c.html#a4d1ba1f89b11d332fb06d9624d5156c9',1,'gridtemplates.c']]], + ['maxoptssize_432',['MAXOPTSSIZE',['../enc__jpeg2000_8c.html#a9855b4e8c40619aab0092ba284943a67',1,'enc_jpeg2000.c']]], + ['maxpdsmaplen_433',['MAXPDSMAPLEN',['../pdstemplates_8c.html#aa0bb590f8c48ad21d17f6cf7a72d8f53',1,'pdstemplates.c']]], + ['maxpdstemp_434',['MAXPDSTEMP',['../pdstemplates_8c.html#a11c588e7671155abba68b92678fc2071',1,'pdstemplates.c']]] +]; diff --git a/ver-1.7.0/search/defines_6.html b/ver-1.7.0/search/defines_6.html new file mode 100644 index 00000000..c6c0f489 --- /dev/null +++ b/ver-1.7.0/search/defines_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/defines_6.js b/ver-1.7.0/search/defines_6.js new file mode 100644 index 00000000..c531f5fd --- /dev/null +++ b/ver-1.7.0/search/defines_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['true_5f_435',['TRUE_',['../pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/search/files_0.html b/ver-1.7.0/search/files_0.html new file mode 100644 index 00000000..9498842a --- /dev/null +++ b/ver-1.7.0/search/files_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_0.js b/ver-1.7.0/search/files_0.js new file mode 100644 index 00000000..6b0ad10b --- /dev/null +++ b/ver-1.7.0/search/files_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['cmplxpack_2ec_219',['cmplxpack.c',['../cmplxpack_8c.html',1,'']]], + ['compack_2ec_220',['compack.c',['../compack_8c.html',1,'']]], + ['comunpack_2ec_221',['comunpack.c',['../comunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_1.html b/ver-1.7.0/search/files_1.html new file mode 100644 index 00000000..7050ef48 --- /dev/null +++ b/ver-1.7.0/search/files_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_1.js b/ver-1.7.0/search/files_1.js new file mode 100644 index 00000000..c32247f7 --- /dev/null +++ b/ver-1.7.0/search/files_1.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['dec_5fjpeg2000_2ec_222',['dec_jpeg2000.c',['../dec__jpeg2000_8c.html',1,'']]], + ['dec_5fpng_2ec_223',['dec_png.c',['../dec__png_8c.html',1,'']]], + ['decenc_5fopenjpeg_2ec_224',['decenc_openjpeg.c',['../decenc__openjpeg_8c.html',1,'']]], + ['drstemplates_2ec_225',['drstemplates.c',['../drstemplates_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_2.html b/ver-1.7.0/search/files_2.html new file mode 100644 index 00000000..497cdf5c --- /dev/null +++ b/ver-1.7.0/search/files_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_2.js b/ver-1.7.0/search/files_2.js new file mode 100644 index 00000000..a5cfef5f --- /dev/null +++ b/ver-1.7.0/search/files_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['enc_5fjpeg2000_2ec_226',['enc_jpeg2000.c',['../enc__jpeg2000_8c.html',1,'']]], + ['enc_5fpng_2ec_227',['enc_png.c',['../enc__png_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_3.html b/ver-1.7.0/search/files_3.html new file mode 100644 index 00000000..1ba106b2 --- /dev/null +++ b/ver-1.7.0/search/files_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_3.js b/ver-1.7.0/search/files_3.js new file mode 100644 index 00000000..c4f62cf3 --- /dev/null +++ b/ver-1.7.0/search/files_3.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['g2_5faddfield_2ec_228',['g2_addfield.c',['../g2__addfield_8c.html',1,'']]], + ['g2_5faddgrid_2ec_229',['g2_addgrid.c',['../g2__addgrid_8c.html',1,'']]], + ['g2_5faddlocal_2ec_230',['g2_addlocal.c',['../g2__addlocal_8c.html',1,'']]], + ['g2_5fcreate_2ec_231',['g2_create.c',['../g2__create_8c.html',1,'']]], + ['g2_5ffree_2ec_232',['g2_free.c',['../g2__free_8c.html',1,'']]], + ['g2_5fgetfld_2ec_233',['g2_getfld.c',['../g2__getfld_8c.html',1,'']]], + ['g2_5fgribend_2ec_234',['g2_gribend.c',['../g2__gribend_8c.html',1,'']]], + ['g2_5finfo_2ec_235',['g2_info.c',['../g2__info_8c.html',1,'']]], + ['g2_5fmiss_2ec_236',['g2_miss.c',['../g2__miss_8c.html',1,'']]], + ['g2_5funpack1_2ec_237',['g2_unpack1.c',['../g2__unpack1_8c.html',1,'']]], + ['g2_5funpack2_2ec_238',['g2_unpack2.c',['../g2__unpack2_8c.html',1,'']]], + ['g2_5funpack3_2ec_239',['g2_unpack3.c',['../g2__unpack3_8c.html',1,'']]], + ['g2_5funpack4_2ec_240',['g2_unpack4.c',['../g2__unpack4_8c.html',1,'']]], + ['g2_5funpack5_2ec_241',['g2_unpack5.c',['../g2__unpack5_8c.html',1,'']]], + ['g2_5funpack6_2ec_242',['g2_unpack6.c',['../g2__unpack6_8c.html',1,'']]], + ['g2_5funpack7_2ec_243',['g2_unpack7.c',['../g2__unpack7_8c.html',1,'']]], + ['gbits_2ec_244',['gbits.c',['../gbits_8c.html',1,'']]], + ['getdim_2ec_245',['getdim.c',['../getdim_8c.html',1,'']]], + ['getpoly_2ec_246',['getpoly.c',['../getpoly_8c.html',1,'']]], + ['grib2_2eh_247',['grib2.h',['../grib2_8h.html',1,'']]], + ['grib2_5fint_2eh_248',['grib2_int.h',['../grib2__int_8h.html',1,'']]], + ['gridtemplates_2ec_249',['gridtemplates.c',['../gridtemplates_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_4.html b/ver-1.7.0/search/files_4.html new file mode 100644 index 00000000..753b7b10 --- /dev/null +++ b/ver-1.7.0/search/files_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_4.js b/ver-1.7.0/search/files_4.js new file mode 100644 index 00000000..98c03c5d --- /dev/null +++ b/ver-1.7.0/search/files_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['int_5fpower_2ec_250',['int_power.c',['../int__power_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_5.html b/ver-1.7.0/search/files_5.html new file mode 100644 index 00000000..7b6affd7 --- /dev/null +++ b/ver-1.7.0/search/files_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_5.js b/ver-1.7.0/search/files_5.js new file mode 100644 index 00000000..4ad32bac --- /dev/null +++ b/ver-1.7.0/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['jpcpack_2ec_251',['jpcpack.c',['../jpcpack_8c.html',1,'']]], + ['jpcunpack_2ec_252',['jpcunpack.c',['../jpcunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_6.html b/ver-1.7.0/search/files_6.html new file mode 100644 index 00000000..802ebf71 --- /dev/null +++ b/ver-1.7.0/search/files_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_6.js b/ver-1.7.0/search/files_6.js new file mode 100644 index 00000000..b424e605 --- /dev/null +++ b/ver-1.7.0/search/files_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['misspack_2ec_253',['misspack.c',['../misspack_8c.html',1,'']]], + ['mkieee_2ec_254',['mkieee.c',['../mkieee_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_7.html b/ver-1.7.0/search/files_7.html new file mode 100644 index 00000000..365e6484 --- /dev/null +++ b/ver-1.7.0/search/files_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_7.js b/ver-1.7.0/search/files_7.js new file mode 100644 index 00000000..c1b5053d --- /dev/null +++ b/ver-1.7.0/search/files_7.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['pack_5fgp_2ec_255',['pack_gp.c',['../pack__gp_8c.html',1,'']]], + ['pdstemplates_2ec_256',['pdstemplates.c',['../pdstemplates_8c.html',1,'']]], + ['pngpack_2ec_257',['pngpack.c',['../pngpack_8c.html',1,'']]], + ['pngunpack_2ec_258',['pngunpack.c',['../pngunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_8.html b/ver-1.7.0/search/files_8.html new file mode 100644 index 00000000..3df0f2fa --- /dev/null +++ b/ver-1.7.0/search/files_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_8.js b/ver-1.7.0/search/files_8.js new file mode 100644 index 00000000..89e8c362 --- /dev/null +++ b/ver-1.7.0/search/files_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['rdieee_2ec_259',['rdieee.c',['../rdieee_8c.html',1,'']]], + ['reduce_2ec_260',['reduce.c',['../reduce_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_9.html b/ver-1.7.0/search/files_9.html new file mode 100644 index 00000000..52f8b6c0 --- /dev/null +++ b/ver-1.7.0/search/files_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_9.js b/ver-1.7.0/search/files_9.js new file mode 100644 index 00000000..82adca37 --- /dev/null +++ b/ver-1.7.0/search/files_9.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['seekgb_2ec_261',['seekgb.c',['../seekgb_8c.html',1,'']]], + ['simpack_2ec_262',['simpack.c',['../simpack_8c.html',1,'']]], + ['simunpack_2ec_263',['simunpack.c',['../simunpack_8c.html',1,'']]], + ['specpack_2ec_264',['specpack.c',['../specpack_8c.html',1,'']]], + ['specunpack_2ec_265',['specunpack.c',['../specunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/files_a.html b/ver-1.7.0/search/files_a.html new file mode 100644 index 00000000..11d4c117 --- /dev/null +++ b/ver-1.7.0/search/files_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/files_a.js b/ver-1.7.0/search/files_a.js new file mode 100644 index 00000000..ccc3030b --- /dev/null +++ b/ver-1.7.0/search/files_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['util_2ec_266',['util.c',['../util_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/search/functions_0.html b/ver-1.7.0/search/functions_0.html new file mode 100644 index 00000000..eb4c5014 --- /dev/null +++ b/ver-1.7.0/search/functions_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_0.js b/ver-1.7.0/search/functions_0.js new file mode 100644 index 00000000..bd595b6f --- /dev/null +++ b/ver-1.7.0/search/functions_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['cmplxpack_267',['cmplxpack',['../cmplxpack_8c.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c'],['../grib2__int_8h.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c']]], + ['compack_268',['compack',['../compack_8c.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c'],['../grib2__int_8h.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c']]], + ['comunpack_269',['comunpack',['../comunpack_8c.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c'],['../grib2__int_8h.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c']]] +]; diff --git a/ver-1.7.0/search/functions_1.html b/ver-1.7.0/search/functions_1.html new file mode 100644 index 00000000..ef4088b8 --- /dev/null +++ b/ver-1.7.0/search/functions_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_1.js b/ver-1.7.0/search/functions_1.js new file mode 100644 index 00000000..667215b0 --- /dev/null +++ b/ver-1.7.0/search/functions_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dec_5fjpeg2000_270',['dec_jpeg2000',['../dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c'],['../grib2__int_8h.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c']]], + ['dec_5fpng_271',['dec_png',['../dec__png_8c.html#a4c7dfb37dbbca9143143db5aeb2f6005',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout): dec_png.c'],['../grib2__int_8h.html#a4c7dfb37dbbca9143143db5aeb2f6005',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout): dec_png.c']]] +]; diff --git a/ver-1.7.0/search/functions_2.html b/ver-1.7.0/search/functions_2.html new file mode 100644 index 00000000..ca5aa10e --- /dev/null +++ b/ver-1.7.0/search/functions_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_2.js b/ver-1.7.0/search/functions_2.js new file mode 100644 index 00000000..a8c4d905 --- /dev/null +++ b/ver-1.7.0/search/functions_2.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['enc_5fjpeg2000_272',['enc_jpeg2000',['../enc__jpeg2000_8c.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c'],['../grib2__int_8h.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c']]], + ['enc_5fpng_273',['enc_png',['../enc__png_8c.html#a0b304f2dca88e94a76c1182fbc1f5938',1,'enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf): enc_png.c'],['../grib2__int_8h.html#a0b304f2dca88e94a76c1182fbc1f5938',1,'enc_png(unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf): enc_png.c']]], + ['extdrstemplate_274',['extdrstemplate',['../drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c'],['../grib2__int_8h.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c']]], + ['extgridtemplate_275',['extgridtemplate',['../grib2__int_8h.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c'],['../gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c']]], + ['extpdstemplate_276',['extpdstemplate',['../grib2__int_8h.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c'],['../pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c']]] +]; diff --git a/ver-1.7.0/search/functions_3.html b/ver-1.7.0/search/functions_3.html new file mode 100644 index 00000000..d79f55b8 --- /dev/null +++ b/ver-1.7.0/search/functions_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_3.js b/ver-1.7.0/search/functions_3.js new file mode 100644 index 00000000..630dd885 --- /dev/null +++ b/ver-1.7.0/search/functions_3.js @@ -0,0 +1,30 @@ +var searchData= +[ + ['g2_5faddfield_277',['g2_addfield',['../grib2_8h.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c'],['../g2__addfield_8c.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c']]], + ['g2_5faddgrid_278',['g2_addgrid',['../grib2_8h.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c'],['../g2__addgrid_8c.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c']]], + ['g2_5faddlocal_279',['g2_addlocal',['../g2__addlocal_8c.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c'],['../grib2_8h.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c']]], + ['g2_5fcreate_280',['g2_create',['../g2__create_8c.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c'],['../grib2_8h.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c']]], + ['g2_5ffree_281',['g2_free',['../g2__free_8c.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c'],['../grib2_8h.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c']]], + ['g2_5fgetfld_282',['g2_getfld',['../g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c'],['../grib2_8h.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c']]], + ['g2_5fgribend_283',['g2_gribend',['../g2__gribend_8c.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c'],['../grib2_8h.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c']]], + ['g2_5finfo_284',['g2_info',['../g2__info_8c.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c'],['../grib2_8h.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c']]], + ['g2_5fmiss_285',['g2_miss',['../g2__miss_8c.html#a5ededd2735de5cd446ee17c2415592e6',1,'g2_miss.c']]], + ['g2_5funpack1_286',['g2_unpack1',['../g2__unpack1_8c.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c'],['../grib2_8h.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c']]], + ['g2_5funpack2_287',['g2_unpack2',['../g2__unpack2_8c.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c'],['../grib2_8h.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c']]], + ['g2_5funpack3_288',['g2_unpack3',['../g2__unpack3_8c.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c'],['../grib2_8h.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c']]], + ['g2_5funpack4_289',['g2_unpack4',['../g2__unpack4_8c.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c'],['../grib2_8h.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c']]], + ['g2_5funpack5_290',['g2_unpack5',['../g2__unpack5_8c.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c'],['../grib2_8h.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c']]], + ['g2_5funpack6_291',['g2_unpack6',['../g2__unpack6_8c.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c'],['../grib2_8h.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c']]], + ['g2_5funpack7_292',['g2_unpack7',['../g2__unpack7_8c.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c'],['../grib2_8h.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c']]], + ['g2c_5fcheck_5fmsg_293',['g2c_check_msg',['../grib2__int_8h.html#a3acf35e5653f0dab59b3e6fd130f2d62',1,'g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose): util.c'],['../util_8c.html#a3acf35e5653f0dab59b3e6fd130f2d62',1,'g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose): util.c']]], + ['gbit_294',['gbit',['../gbits_8c.html#a1efb9739e947d94010aeba6daf62eca3',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits): gbits.c'],['../grib2__int_8h.html#a1efb9739e947d94010aeba6daf62eca3',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits): gbits.c']]], + ['gbits_295',['gbits',['../gbits_8c.html#a31ebdbbf262b7478d6a7cc4326f76ade',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c'],['../grib2__int_8h.html#a31ebdbbf262b7478d6a7cc4326f76ade',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c']]], + ['getdim_296',['getdim',['../grib2__int_8h.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c'],['../getdim_8c.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c']]], + ['getdrsindex_297',['getdrsindex',['../drstemplates_8c.html#a307a8ced5bd81dd2bf110596fc9e6532',1,'drstemplates.c']]], + ['getdrstemplate_298',['getdrstemplate',['../drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c'],['../grib2__int_8h.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c']]], + ['getgridindex_299',['getgridindex',['../gridtemplates_8c.html#addbeca29a7de77dc30f65a08b6b38941',1,'gridtemplates.c']]], + ['getgridtemplate_300',['getgridtemplate',['../grib2__int_8h.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c'],['../gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c']]], + ['getpdsindex_301',['getpdsindex',['../pdstemplates_8c.html#a59f2fe1fba0577301d154f21e0478e7f',1,'pdstemplates.c']]], + ['getpdstemplate_302',['getpdstemplate',['../grib2__int_8h.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c'],['../pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c']]], + ['getpoly_303',['getpoly',['../getpoly_8c.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c'],['../grib2__int_8h.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c']]] +]; diff --git a/ver-1.7.0/search/functions_4.html b/ver-1.7.0/search/functions_4.html new file mode 100644 index 00000000..1657cad0 --- /dev/null +++ b/ver-1.7.0/search/functions_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_4.js b/ver-1.7.0/search/functions_4.js new file mode 100644 index 00000000..d5725cf6 --- /dev/null +++ b/ver-1.7.0/search/functions_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['int_5fpower_304',['int_power',['../grib2__int_8h.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c'],['../int__power_8c.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c']]] +]; diff --git a/ver-1.7.0/search/functions_5.html b/ver-1.7.0/search/functions_5.html new file mode 100644 index 00000000..9301d6b9 --- /dev/null +++ b/ver-1.7.0/search/functions_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_5.js b/ver-1.7.0/search/functions_5.js new file mode 100644 index 00000000..8d594145 --- /dev/null +++ b/ver-1.7.0/search/functions_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['jpcpack_305',['jpcpack',['../g2__addfield_8c.html#ae9c19967000623138e0d9218f6c949ab',1,'jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): jpcpack.c'],['../grib2__int_8h.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c'],['../jpcpack_8c.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c']]], + ['jpcunpack_306',['jpcunpack',['../grib2__int_8h.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c'],['../jpcunpack_8c.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c']]] +]; diff --git a/ver-1.7.0/search/functions_6.html b/ver-1.7.0/search/functions_6.html new file mode 100644 index 00000000..9c4f5fc6 --- /dev/null +++ b/ver-1.7.0/search/functions_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_6.js b/ver-1.7.0/search/functions_6.js new file mode 100644 index 00000000..92c20e8c --- /dev/null +++ b/ver-1.7.0/search/functions_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['misspack_307',['misspack',['../grib2__int_8h.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c'],['../misspack_8c.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c']]], + ['mkieee_308',['mkieee',['../grib2__int_8h.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c'],['../mkieee_8c.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c']]] +]; diff --git a/ver-1.7.0/search/functions_7.html b/ver-1.7.0/search/functions_7.html new file mode 100644 index 00000000..46b5c0f6 --- /dev/null +++ b/ver-1.7.0/search/functions_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_7.js b/ver-1.7.0/search/functions_7.js new file mode 100644 index 00000000..014f2a03 --- /dev/null +++ b/ver-1.7.0/search/functions_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['pack_5fgp_309',['pack_gp',['../grib2__int_8h.html#ab5fbec07e58a9d872a0fa1c04d74a81b',1,'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): pack_gp.c'],['../pack__gp_8c.html#ab5fbec07e58a9d872a0fa1c04d74a81b',1,'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): pack_gp.c']]], + ['pngpack_310',['pngpack',['../g2__addfield_8c.html#aa19673a03d5b0df2730903c39b9e5002',1,'pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): pngpack.c'],['../grib2__int_8h.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c'],['../pngpack_8c.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c']]], + ['pngunpack_311',['pngunpack',['../grib2__int_8h.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c'],['../pngunpack_8c.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c']]] +]; diff --git a/ver-1.7.0/search/functions_8.html b/ver-1.7.0/search/functions_8.html new file mode 100644 index 00000000..31a1d950 --- /dev/null +++ b/ver-1.7.0/search/functions_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_8.js b/ver-1.7.0/search/functions_8.js new file mode 100644 index 00000000..a7780bb2 --- /dev/null +++ b/ver-1.7.0/search/functions_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['rdieee_312',['rdieee',['../grib2__int_8h.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c'],['../rdieee_8c.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c']]], + ['reduce_313',['reduce',['../reduce_8c.html#a6bb0dafca9ef2de9d433cb4c72f34b2d',1,'reduce.c']]] +]; diff --git a/ver-1.7.0/search/functions_9.html b/ver-1.7.0/search/functions_9.html new file mode 100644 index 00000000..9a8e4290 --- /dev/null +++ b/ver-1.7.0/search/functions_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_9.js b/ver-1.7.0/search/functions_9.js new file mode 100644 index 00000000..f219ccbe --- /dev/null +++ b/ver-1.7.0/search/functions_9.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['sbit_314',['sbit',['../gbits_8c.html#af9e044ba7da32a5415e351ed647ef676',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits): gbits.c'],['../grib2__int_8h.html#af9e044ba7da32a5415e351ed647ef676',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbits): gbits.c']]], + ['sbits_315',['sbits',['../gbits_8c.html#a92b32e56ff8941c5026d460f4fe2aec3',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c'],['../grib2__int_8h.html#a92b32e56ff8941c5026d460f4fe2aec3',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbits, g2int nskip, g2int n): gbits.c']]], + ['seekgb_316',['seekgb',['../seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c'],['../grib2_8h.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c']]], + ['simpack_317',['simpack',['../grib2__int_8h.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c'],['../simpack_8c.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c']]], + ['simunpack_318',['simunpack',['../grib2__int_8h.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c'],['../simunpack_8c.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c']]], + ['specpack_319',['specpack',['../grib2__int_8h.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c'],['../specpack_8c.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c']]], + ['specunpack_320',['specunpack',['../grib2__int_8h.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c'],['../specunpack_8c.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c']]] +]; diff --git a/ver-1.7.0/search/functions_a.html b/ver-1.7.0/search/functions_a.html new file mode 100644 index 00000000..5ecc152c --- /dev/null +++ b/ver-1.7.0/search/functions_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/functions_a.js b/ver-1.7.0/search/functions_a.js new file mode 100644 index 00000000..b539d663 --- /dev/null +++ b/ver-1.7.0/search/functions_a.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['user_5fflush_5fdata_321',['user_flush_data',['../enc__png_8c.html#a97f27ca60f363a8a91319d3adee16b0e',1,'enc_png.c']]], + ['user_5fread_5fdata_322',['user_read_data',['../dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7',1,'dec_png.c']]], + ['user_5fwrite_5fdata_323',['user_write_data',['../enc__png_8c.html#ac84301dcabbe4c2893799955c50c38a5',1,'enc_png.c']]] +]; diff --git a/ver-1.7.0/search/mag_sel.svg b/ver-1.7.0/search/mag_sel.svg new file mode 100644 index 00000000..03626f64 --- /dev/null +++ b/ver-1.7.0/search/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/ver-1.7.0/search/nomatches.html b/ver-1.7.0/search/nomatches.html new file mode 100644 index 00000000..2b9360b6 --- /dev/null +++ b/ver-1.7.0/search/nomatches.html @@ -0,0 +1,13 @@ + + + + + + + + +
    +
    No Matches
    +
    + + diff --git a/ver-1.7.0/search/search.css b/ver-1.7.0/search/search.css new file mode 100644 index 00000000..9074198f --- /dev/null +++ b/ver-1.7.0/search/search.css @@ -0,0 +1,257 @@ +/*---------------- Search Box */ + +#MSearchBox { + white-space : nowrap; + background: white; + border-radius: 0.65em; + box-shadow: inset 0.5px 0.5px 3px 0px #555; + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + height: 1.4em; + padding: 0 0 0 0.3em; + margin: 0; +} + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 1.1em; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: #909090; + outline: none; + font-family: Arial, Verdana, sans-serif; + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + height: 1.4em; + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; + z-index:10000; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: Arial, Verdana, sans-serif; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: Arial, Verdana, sans-serif; +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/ver-1.7.0/search/search.js b/ver-1.7.0/search/search.js new file mode 100644 index 00000000..fb226f73 --- /dev/null +++ b/ver-1.7.0/search/search.js @@ -0,0 +1,816 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + this.extension; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches' + this.extension; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline-block'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/typedefs_0.js b/ver-1.7.0/search/typedefs_0.js new file mode 100644 index 00000000..e7ad3a1f --- /dev/null +++ b/ver-1.7.0/search/typedefs_0.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['g2float_364',['g2float',['../grib2_8h.html#a2e615ee29fc8d17a681017e4384847c2',1,'grib2.h']]], + ['g2int_365',['g2int',['../grib2_8h.html#af0b63b0e0f41f07f562a4367e2a60838',1,'grib2.h']]], + ['g2intu_366',['g2intu',['../grib2_8h.html#a95bb698b6bd148aae1b3b841fb0da83b',1,'grib2.h']]], + ['gribfield_367',['gribfield',['../grib2_8h.html#afd3ef3eb9f8b9a64a7b749a892de46c5',1,'grib2.h']]], + ['gtemplate_368',['gtemplate',['../grib2__int_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63',1,'grib2_int.h']]] +]; diff --git a/ver-1.7.0/search/typedefs_1.html b/ver-1.7.0/search/typedefs_1.html new file mode 100644 index 00000000..46cf01e6 --- /dev/null +++ b/ver-1.7.0/search/typedefs_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/typedefs_1.js b/ver-1.7.0/search/typedefs_1.js new file mode 100644 index 00000000..e3709187 --- /dev/null +++ b/ver-1.7.0/search/typedefs_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['png_5fstream_369',['png_stream',['../dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): dec_png.c'],['../enc__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): enc_png.c']]] +]; diff --git a/ver-1.7.0/search/variables_0.html b/ver-1.7.0/search/variables_0.html new file mode 100644 index 00000000..1e477c08 --- /dev/null +++ b/ver-1.7.0/search/variables_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_0.js b/ver-1.7.0/search/variables_0.js new file mode 100644 index 00000000..2d687990 --- /dev/null +++ b/ver-1.7.0/search/variables_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bmap_324',['bmap',['../grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_1.html b/ver-1.7.0/search/variables_1.html new file mode 100644 index 00000000..ea73d9a4 --- /dev/null +++ b/ver-1.7.0/search/variables_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_1.js b/ver-1.7.0/search/variables_1.js new file mode 100644 index 00000000..639611b9 --- /dev/null +++ b/ver-1.7.0/search/variables_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['coord_5flist_325',['coord_list',['../grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_2.html b/ver-1.7.0/search/variables_2.html new file mode 100644 index 00000000..0580462e --- /dev/null +++ b/ver-1.7.0/search/variables_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_2.js b/ver-1.7.0/search/variables_2.js new file mode 100644 index 00000000..81fb2858 --- /dev/null +++ b/ver-1.7.0/search/variables_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['discipline_326',['discipline',['../grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_3.html b/ver-1.7.0/search/variables_3.html new file mode 100644 index 00000000..0d69e761 --- /dev/null +++ b/ver-1.7.0/search/variables_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_3.js b/ver-1.7.0/search/variables_3.js new file mode 100644 index 00000000..9d642c1b --- /dev/null +++ b/ver-1.7.0/search/variables_3.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['expanded_327',['expanded',['../grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20',1,'gribfield']]], + ['ext_328',['ext',['../grib2__int_8h.html#a312a417c8e6f68bea7bfe86268c16594',1,'gtemplate']]], + ['extlen_329',['extlen',['../grib2__int_8h.html#a743151a1bde2a21603926e1541baa5de',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/search/variables_4.html b/ver-1.7.0/search/variables_4.html new file mode 100644 index 00000000..a4b6506b --- /dev/null +++ b/ver-1.7.0/search/variables_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_4.js b/ver-1.7.0/search/variables_4.js new file mode 100644 index 00000000..c9dad677 --- /dev/null +++ b/ver-1.7.0/search/variables_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['fld_330',['fld',['../grib2_8h.html#ade69d8c093b2aa18c720c833def6198f',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_5.html b/ver-1.7.0/search/variables_5.html new file mode 100644 index 00000000..7e345d16 --- /dev/null +++ b/ver-1.7.0/search/variables_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_5.js b/ver-1.7.0/search/variables_5.js new file mode 100644 index 00000000..a90393f8 --- /dev/null +++ b/ver-1.7.0/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['griddef_331',['griddef',['../grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_6.html b/ver-1.7.0/search/variables_6.html new file mode 100644 index 00000000..7d48e75e --- /dev/null +++ b/ver-1.7.0/search/variables_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_6.js b/ver-1.7.0/search/variables_6.js new file mode 100644 index 00000000..f23b9fb1 --- /dev/null +++ b/ver-1.7.0/search/variables_6.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['ibmap_332',['ibmap',['../grib2_8h.html#a10a46b6a25d615784dced13e914d0726',1,'gribfield']]], + ['idrtlen_333',['idrtlen',['../grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc',1,'gribfield']]], + ['idrtmpl_334',['idrtmpl',['../grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457',1,'gribfield']]], + ['idrtnum_335',['idrtnum',['../grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f',1,'gribfield']]], + ['idsect_336',['idsect',['../grib2_8h.html#ad81615f4a659f2454762301e0e810793',1,'gribfield']]], + ['idsectlen_337',['idsectlen',['../grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826',1,'gribfield']]], + ['ifldnum_338',['ifldnum',['../grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454',1,'gribfield']]], + ['igdtlen_339',['igdtlen',['../grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e',1,'gribfield']]], + ['igdtmpl_340',['igdtmpl',['../grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53',1,'gribfield']]], + ['igdtnum_341',['igdtnum',['../grib2_8h.html#a065d206f38d552c49af642e3cf6056b3',1,'gribfield']]], + ['interp_5fopt_342',['interp_opt',['../grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940',1,'gribfield']]], + ['ipdtlen_343',['ipdtlen',['../grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e',1,'gribfield']]], + ['ipdtmpl_344',['ipdtmpl',['../grib2_8h.html#a49b9e8c090596e02abc193b1974b8022',1,'gribfield']]], + ['ipdtnum_345',['ipdtnum',['../grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_7.html b/ver-1.7.0/search/variables_7.html new file mode 100644 index 00000000..5c263409 --- /dev/null +++ b/ver-1.7.0/search/variables_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_7.js b/ver-1.7.0/search/variables_7.js new file mode 100644 index 00000000..ca5adda8 --- /dev/null +++ b/ver-1.7.0/search/variables_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['list_5fopt_346',['list_opt',['../grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d',1,'gribfield']]], + ['local_347',['local',['../grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1',1,'gribfield']]], + ['locallen_348',['locallen',['../grib2_8h.html#a0e2cadad47b161868b97e60f00409982',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_8.html b/ver-1.7.0/search/variables_8.html new file mode 100644 index 00000000..dc9ec54a --- /dev/null +++ b/ver-1.7.0/search/variables_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_8.js b/ver-1.7.0/search/variables_8.js new file mode 100644 index 00000000..5ec9fa94 --- /dev/null +++ b/ver-1.7.0/search/variables_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['map_349',['map',['../grib2__int_8h.html#a88e12020d460546cafcef9c445c3df20',1,'gtemplate']]], + ['maplen_350',['maplen',['../grib2__int_8h.html#aea3cb225770444c7e40855ee401a5b29',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/search/variables_9.html b/ver-1.7.0/search/variables_9.html new file mode 100644 index 00000000..7b014750 --- /dev/null +++ b/ver-1.7.0/search/variables_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_9.js b/ver-1.7.0/search/variables_9.js new file mode 100644 index 00000000..143b27a7 --- /dev/null +++ b/ver-1.7.0/search/variables_9.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['ndpts_351',['ndpts',['../grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c',1,'gribfield']]], + ['needext_352',['needext',['../grib2__int_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf',1,'gtemplate']]], + ['ngrdpts_353',['ngrdpts',['../grib2_8h.html#a1fd25a21842b45215676696fcddb2a09',1,'gribfield']]], + ['num_354',['num',['../grib2__int_8h.html#a973b6764b40aed427d419046b63d75b3',1,'gtemplate']]], + ['num_5fcoord_355',['num_coord',['../grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce',1,'gribfield']]], + ['num_5fopt_356',['num_opt',['../grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b',1,'gribfield']]], + ['numoct_5fopt_357',['numoct_opt',['../grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_a.html b/ver-1.7.0/search/variables_a.html new file mode 100644 index 00000000..52a724d1 --- /dev/null +++ b/ver-1.7.0/search/variables_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_a.js b/ver-1.7.0/search/variables_a.js new file mode 100644 index 00000000..65971db5 --- /dev/null +++ b/ver-1.7.0/search/variables_a.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['templatesdrs_358',['templatesdrs',['../drstemplates_8c.html#a08f7c019317d1e6235a863ee8ce6e9e2',1,'drstemplates.c']]], + ['templatesgrid_359',['templatesgrid',['../gridtemplates_8c.html#af8316127b8fcf96fb4d3ab2c5411cde9',1,'gridtemplates.c']]], + ['templatespds_360',['templatespds',['../pdstemplates_8c.html#a87d5723cb60a9b598bc574cd31673a26',1,'pdstemplates.c']]], + ['type_361',['type',['../grib2__int_8h.html#ad28b4af0030473208605c2cf2c5e3f36',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/search/variables_b.html b/ver-1.7.0/search/variables_b.html new file mode 100644 index 00000000..f376b27a --- /dev/null +++ b/ver-1.7.0/search/variables_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_b.js b/ver-1.7.0/search/variables_b.js new file mode 100644 index 00000000..e1a12f3d --- /dev/null +++ b/ver-1.7.0/search/variables_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['unpacked_362',['unpacked',['../grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47',1,'gribfield']]] +]; diff --git a/ver-1.7.0/search/variables_c.html b/ver-1.7.0/search/variables_c.html new file mode 100644 index 00000000..6019eba9 --- /dev/null +++ b/ver-1.7.0/search/variables_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/search/variables_c.js b/ver-1.7.0/search/variables_c.js new file mode 100644 index 00000000..5dde2cb0 --- /dev/null +++ b/ver-1.7.0/search/variables_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['version_363',['version',['../grib2_8h.html#ac1a18226d7790431bad8b065f85befa5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/seekgb_8c.html b/ver-1.7.0/seekgb_8c.html new file mode 100644 index 00000000..193dab14 --- /dev/null +++ b/ver-1.7.0/seekgb_8c.html @@ -0,0 +1,226 @@ + + + + + + + +NCEPLIBS-g2c: seekgb.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    seekgb.c File Reference
    +
    +
    + +

    Searches a file for the next GRIB message. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Macros

    #define BITS_PER_BYTE   8
     8 bits per byte. More...
     
    + + + + +

    +Functions

    void seekgb (FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
     This subprogram searches a file for the next GRIB Message. More...
     
    +

    Detailed Description

    +

    Searches a file for the next GRIB message.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-28
    + +

    Definition in file seekgb.c.

    +

    Macro Definition Documentation

    + +

    ◆ BITS_PER_BYTE

    + +
    +
    + + + + +
    #define BITS_PER_BYTE   8
    +
    + +

    8 bits per byte.

    + +

    Definition at line 10 of file seekgb.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ seekgb()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void seekgb (FILE * lugb,
    g2int iseek,
    g2int mseek,
    g2intlskip,
    g2intlgrib 
    )
    +
    + +

    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
    + + + + + + +
    lugbFILE pointer for the file to search. File must be opened before this routine is called.
    iseeknumber of bytes in the file to skip before search.
    mseeknumber of bytes to search at a time (must be at least 16).
    lskipnumber of bytes to skip from the beggining of the file to where the GRIB message starts.
    lgribnumber 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/seekgb_8c.js b/ver-1.7.0/seekgb_8c.js new file mode 100644 index 00000000..c37438d8 --- /dev/null +++ b/ver-1.7.0/seekgb_8c.js @@ -0,0 +1,5 @@ +var seekgb_8c = +[ + [ "BITS_PER_BYTE", "seekgb_8c.html#a369ecd38b3ab077fc235f892354bb46f", null ], + [ "seekgb", "seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/seekgb_8c_source.html b/ver-1.7.0/seekgb_8c_source.html new file mode 100644 index 00000000..95973d8a --- /dev/null +++ b/ver-1.7.0/seekgb_8c_source.html @@ -0,0 +1,171 @@ + + + + + + + +NCEPLIBS-g2c: seekgb.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    seekgb.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdio.h>
    +
    6 #include <stdlib.h>
    +
    7 #include "grib2_int.h"
    +
    8 
    +
    10 #define BITS_PER_BYTE 8
    +
    11 
    +
    38 void
    +
    39 seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
    +
    40 {
    +
    41  g2int k, k4, ipos, nread, lim, start, vers, lengrib;
    +
    42  int end;
    +
    43  unsigned char *cbuf;
    +
    44 
    +
    45  *lgrib = 0;
    +
    46  cbuf = (unsigned char *)malloc(mseek);
    +
    47  nread = mseek;
    +
    48  ipos = iseek;
    +
    49 
    +
    50  /* Loop until grib message is found. */
    +
    51  while (*lgrib == 0 && nread == mseek)
    +
    52  {
    +
    53  /* Read partial section. */
    +
    54  fseek(lugb, ipos, SEEK_SET);
    +
    55  nread = fread(cbuf, sizeof(unsigned char), mseek, lugb);
    +
    56  lim = nread - 8;
    +
    57 
    +
    58  /* Look for 'grib...' in partial section. */
    +
    59  for (k = 0; k < lim; k++)
    +
    60  {
    +
    61  /* Look at the first 4 bytes - should be 'GRIB'. */
    +
    62  gbit(cbuf, &start, k * BITS_PER_BYTE, 4 * BITS_PER_BYTE);
    +
    63 
    +
    64  /* Look at the 8th byte, it has the GRIB version. */
    +
    65  gbit(cbuf, &vers, (k + 7) * BITS_PER_BYTE, 1 * BITS_PER_BYTE);
    +
    66 
    +
    67  /* If the message starts with 'GRIB', and is version 1 or
    +
    68  * 2, then this is a GRIB message. */
    +
    69  if (start == 1196575042 && (vers == 1 || vers == 2))
    +
    70  {
    +
    71  /* Find the length of the message. */
    +
    72  if (vers == 1)
    +
    73  gbit(cbuf, &lengrib, (k + 4) * BITS_PER_BYTE, 3 * BITS_PER_BYTE);
    +
    74  if (vers == 2)
    +
    75  gbit(cbuf, &lengrib, (k + 12) * BITS_PER_BYTE, 4 * BITS_PER_BYTE);
    +
    76 
    +
    77  /* Read the last 4 bytesof the message. */
    +
    78  fseek(lugb, ipos + k + lengrib - 4, SEEK_SET);
    +
    79  k4 = fread(&end, 4, 1, lugb);
    +
    80 
    +
    81  /* Look for '7777' at end of grib message. */
    +
    82  if (k4 == 1 && end == 926365495)
    +
    83  {
    +
    84  /* GRIB message found. */
    +
    85  *lskip = ipos + k;
    +
    86  *lgrib = lengrib;
    +
    87  break;
    +
    88  }
    +
    89  }
    +
    90  }
    +
    91  ipos = ipos + lim;
    +
    92  }
    +
    93 
    +
    94  free(cbuf);
    +
    95 }
    +
    +
    +
    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...
    Definition: gbits.c:20
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    void seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
    This subprogram searches a file for the next GRIB Message.
    Definition: seekgb.c:39
    +
    #define BITS_PER_BYTE
    8 bits per byte.
    Definition: seekgb.c:10
    + + + + diff --git a/ver-1.7.0/simpack_8c.html b/ver-1.7.0/simpack_8c.html new file mode 100644 index 00000000..5531a749 --- /dev/null +++ b/ver-1.7.0/simpack_8c.html @@ -0,0 +1,199 @@ + + + + + + + +NCEPLIBS-g2c: simpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    simpack.c File Reference
    +
    +
    + +

    Pack up a data field using the simple packing algorithm. +More...

    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    Pack up a data field using the simple packing algorithm.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-06
    + +

    Definition in file simpack.c.

    +

    Function Documentation

    + +

    ◆ simpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void simpack (float * fld,
    g2int ndpts,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field
    lcpacklength 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/simpack_8c.js b/ver-1.7.0/simpack_8c.js new file mode 100644 index 00000000..c2c098f6 --- /dev/null +++ b/ver-1.7.0/simpack_8c.js @@ -0,0 +1,4 @@ +var simpack_8c = +[ + [ "simpack", "simpack_8c.html#ac0b7f3dd51c470b9fb883bc93d82ab49", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/simpack_8c_source.html b/ver-1.7.0/simpack_8c_source.html new file mode 100644 index 00000000..33516446 --- /dev/null +++ b/ver-1.7.0/simpack_8c_source.html @@ -0,0 +1,227 @@ + + + + + + + +NCEPLIBS-g2c: simpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    simpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdlib.h>
    +
    7 #include <math.h>
    +
    8 #include "grib2_int.h"
    +
    9 
    +
    33 void
    +
    34 simpack(float *fld, g2int ndpts, g2int *idrstmpl,
    +
    35  unsigned char *cpack, g2int *lcpack)
    +
    36 {
    +
    37  static g2int zero = 0;
    +
    38  g2int *ifld;
    +
    39  g2int j, nbits, imin, imax, maxdif, nbittot, left;
    +
    40  float bscale, dscale, rmax, rmin, temp;
    +
    41  double maxnum;
    +
    42  static float alog2 = ALOG2; /* ln(2.0) */
    +
    43 
    +
    44  bscale = int_power(2.0, -idrstmpl[1]);
    +
    45  dscale = int_power(10.0, idrstmpl[2]);
    +
    46  if (idrstmpl[3] <= 0 || idrstmpl[3] > 31)
    +
    47  nbits = 0;
    +
    48  else
    +
    49  nbits = idrstmpl[3];
    +
    50 
    +
    51  /* Find max and min values in the data. */
    +
    52  rmax = fld[0];
    +
    53  rmin = fld[0];
    +
    54  for (j = 1; j < ndpts; j++) {
    +
    55  if (fld[j] > rmax)
    +
    56  rmax = fld[j];
    +
    57  if (fld[j] < rmin)
    +
    58  rmin = fld[j];
    +
    59  }
    +
    60 
    +
    61  ifld = calloc(ndpts, sizeof(g2int));
    +
    62 
    +
    63  /* If max and min values are not equal, pack up field. If they are
    +
    64  * equal, we have a constant field, and the reference value (rmin)
    +
    65  * is the value for each point in the field and set nbits to 0. */
    +
    66  if (rmin != rmax) {
    +
    67 
    +
    68  /* Determine which algorithm to use based on user-supplied
    +
    69  * binary scale factor and number of bits. */
    +
    70  if (nbits == 0 && idrstmpl[1] == 0) {
    +
    71 
    +
    72  /* No binary scaling and calculate minumum number of bits
    +
    73  * in which the data will fit. */
    +
    74  imin = (g2int)rint(rmin * dscale);
    +
    75  imax = (g2int)rint(rmax * dscale);
    +
    76  maxdif = imax - imin;
    +
    77  temp = log((double)(maxdif + 1)) / alog2;
    +
    78  nbits = (g2int)ceil(temp);
    +
    79  rmin = (float)imin;
    +
    80  /* scale data */
    +
    81  for(j = 0; j < ndpts; j++)
    +
    82  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
    +
    83  }
    +
    84  else if (nbits != 0 && idrstmpl[1] == 0) {
    +
    85 
    +
    86  /* Use minimum number of bits specified by user and adjust
    +
    87  * binary scaling factor to accomodate data. */
    +
    88  rmin = rmin * dscale;
    +
    89  rmax = rmax * dscale;
    +
    90  maxnum = int_power(2.0, nbits) - 1;
    +
    91  temp = log(maxnum / (rmax - rmin)) / alog2;
    +
    92  idrstmpl[1] = (g2int)ceil(-1.0 * temp);
    +
    93  bscale = int_power(2.0, -idrstmpl[1]);
    +
    94  /* scale data */
    +
    95  for (j = 0; j < ndpts; j++)
    +
    96  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    97  }
    +
    98  else if (nbits == 0 && idrstmpl[1] != 0) {
    +
    99 
    +
    100  /* Use binary scaling factor and calculate minumum number
    +
    101  * of bits in which the data will fit. */
    +
    102  rmin = rmin * dscale;
    +
    103  rmax = rmax * dscale;
    +
    104  maxdif = (g2int)rint((rmax - rmin) * bscale);
    +
    105  temp = log((double)(maxdif + 1)) / alog2;
    +
    106  nbits = (g2int)ceil(temp);
    +
    107  /* scale data */
    +
    108  for (j = 0; j < ndpts; j++)
    +
    109  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    110  }
    +
    111  else if (nbits != 0 && idrstmpl[1] != 0) {
    +
    112 
    +
    113  /* Use binary scaling factor and use minumum number of
    +
    114  * bits specified by user. Dangerous - may loose
    +
    115  * information if binary scale factor and nbits not set
    +
    116  * properly by user. */
    +
    117  rmin = rmin * dscale;
    +
    118  /* scale data */
    +
    119  for (j = 0; j < ndpts; j++)
    +
    120  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    121  }
    +
    122 
    +
    123  /* Pack data, Pad last octet with Zeros, if necessary, and
    +
    124  * calculate the length of the packed data in bytes. */
    +
    125  sbits(cpack, ifld, 0, nbits, 0, ndpts);
    +
    126  nbittot = nbits * ndpts;
    +
    127  left = 8 - (nbittot % 8);
    +
    128  if (left != 8) {
    +
    129  sbit(cpack, &zero, nbittot, left); /* Pad with zeros to fill Octet. */
    +
    130  nbittot = nbittot + left;
    +
    131  }
    +
    132  *lcpack = nbittot / 8;
    +
    133  }
    +
    134  else {
    +
    135  nbits = 0;
    +
    136  *lcpack = 0;
    +
    137  }
    +
    138 
    +
    139  /* Fill in ref value and number of bits in Template 5.0. */
    +
    140  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format. */
    +
    141  idrstmpl[3] = nbits;
    +
    142  idrstmpl[4] = 0; /* original data were reals. */
    +
    143 
    +
    144  free(ifld);
    +
    145 }
    +
    +
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    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 ...
    Definition: gbits.c:114
    +
    void mkieee(float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:22
    +
    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...
    Definition: simpack.c:34
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    #define ALOG2
    ln(2.0)
    Definition: grib2_int.h:21
    +
    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 ...
    Definition: gbits.c:38
    + + + + diff --git a/ver-1.7.0/simunpack_8c.html b/ver-1.7.0/simunpack_8c.html new file mode 100644 index 00000000..72fc7d27 --- /dev/null +++ b/ver-1.7.0/simunpack_8c.html @@ -0,0 +1,181 @@ + + + + + + + +NCEPLIBS-g2c: simunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    simunpack.c File Reference
    +
    +
    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file simunpack.c.

    +

    Function Documentation

    + +

    ◆ simunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int simunpack (unsigned char * cpack,
    g2intidrstmpl,
    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
    + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.0.
    ndptsThe number of data values to unpack.
    fldContains 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/simunpack_8c.js b/ver-1.7.0/simunpack_8c.js new file mode 100644 index 00000000..023de3bf --- /dev/null +++ b/ver-1.7.0/simunpack_8c.js @@ -0,0 +1,4 @@ +var simunpack_8c = +[ + [ "simunpack", "simunpack_8c.html#af1de6ae0957904b78ff8cfd7eeb908fa", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/simunpack_8c_source.html b/ver-1.7.0/simunpack_8c_source.html new file mode 100644 index 00000000..777294cc --- /dev/null +++ b/ver-1.7.0/simunpack_8c_source.html @@ -0,0 +1,151 @@ + + + + + + + +NCEPLIBS-g2c: simunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    simunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    4 #include <stdio.h>
    +
    5 #include <stdlib.h>
    +
    6 #include "grib2_int.h"
    +
    7 
    +
    25 g2int
    +
    26 simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts,
    +
    27  float *fld)
    +
    28 {
    +
    29  g2int *ifld;
    +
    30  g2int j, nbits;
    +
    31  float ref, bscale, dscale;
    +
    32 
    +
    33  rdieee(idrstmpl, &ref, 1);
    +
    34  bscale = int_power(2.0, idrstmpl[1]);
    +
    35  dscale = int_power(10.0, -idrstmpl[2]);
    +
    36  nbits = idrstmpl[3];
    +
    37 
    +
    38  if (!(ifld = calloc(ndpts, sizeof(g2int))))
    +
    39  {
    +
    40  fprintf(stderr, "Could not allocate space in simunpack.\n "
    +
    41  "Data field NOT upacked.\n");
    +
    42  return G2_JPCUNPACK_MEM;
    +
    43  }
    +
    44 
    +
    45  /* If nbits equals 0, we have a constant field where the reference
    +
    46  * value is the data value at each gridpoint. */
    +
    47  if (nbits != 0)
    +
    48  {
    +
    49  gbits(cpack, ifld, 0, nbits, 0, ndpts);
    +
    50  for (j = 0; j < ndpts; j++)
    +
    51  fld[j] = (((float)ifld[j] * bscale) + ref) * dscale;
    +
    52  }
    +
    53  else
    +
    54  {
    +
    55  for (j = 0; j < ndpts; j++)
    +
    56  fld[j] = ref;
    +
    57  }
    +
    58 
    +
    59  free(ifld);
    +
    60  return G2_NO_ERROR;
    +
    61 }
    +
    +
    +
    #define G2_NO_ERROR
    Function succeeded.
    Definition: grib2.h:275
    +
    void rdieee(g2int *rieee, float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:21
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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...
    Definition: simunpack.c:26
    +
    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...
    Definition: gbits.c:57
    +
    #define G2_JPCUNPACK_MEM
    In jpcunpack() or other unpack function: out of memory.
    Definition: grib2.h:320
    + + + + diff --git a/ver-1.7.0/specpack_8c.html b/ver-1.7.0/specpack_8c.html new file mode 100644 index 00000000..f2e23a5f --- /dev/null +++ b/ver-1.7.0/specpack_8c.html @@ -0,0 +1,213 @@ + + + + + + + +NCEPLIBS-g2c: specpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    specpack.c File Reference
    +
    +
    + +

    Pack a spectral data field using the complex packing algorithm for spherical harmonic data. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <math.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    Pack a spectral data field using the complex packing algorithm for spherical harmonic data.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-19
    + +

    Definition in file specpack.c.

    +

    Function Documentation

    + +

    ◆ specpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void specpack (float * fld,
    g2int ndpts,
    g2int JJ,
    g2int KK,
    g2int MM,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + + + +
    fldContains the data values to be packed.
    ndptsThe number of data values to pack.
    JJJ - pentagonal resolution parameter.
    KKK - pentagonal resolution parameter.
    MMM - pentagonal resolution parameter.
    idrstmplContains 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).
    cpackPointer that gets the packed data field. Must be allocated by caller.
    lcpacklength 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/specpack_8c.js b/ver-1.7.0/specpack_8c.js new file mode 100644 index 00000000..7d889464 --- /dev/null +++ b/ver-1.7.0/specpack_8c.js @@ -0,0 +1,4 @@ +var specpack_8c = +[ + [ "specpack", "specpack_8c.html#ab712ca4ca13ff72a2a4f3738e9ef66ce", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/specpack_8c_source.html b/ver-1.7.0/specpack_8c_source.html new file mode 100644 index 00000000..988d1bc0 --- /dev/null +++ b/ver-1.7.0/specpack_8c_source.html @@ -0,0 +1,200 @@ + + + + + + + +NCEPLIBS-g2c: specpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    specpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include <math.h>
    +
    10 #include "grib2_int.h"
    +
    11 
    +
    32 void
    +
    33 specpack(float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM,
    +
    34  g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
    +
    35 {
    +
    36 
    +
    37  g2int *ifld, tmplsim[5];
    +
    38  float *unpk, *tfld;
    +
    39  float *pscale, tscale;
    +
    40  g2int Js, Ks, Ms, Ts, Ns, inc, incu, incp, n, Nm, m, ipos;
    +
    41 
    +
    42  Js = idrstmpl[5];
    +
    43  Ks = idrstmpl[6];
    +
    44  Ms = idrstmpl[7];
    +
    45  Ts = idrstmpl[8];
    +
    46 
    +
    47  /* Calculate Laplacian scaling factors for each possible wave
    +
    48  * number. */
    +
    49  pscale = malloc((JJ + MM + 1) * sizeof(float));
    +
    50  tscale = (float)idrstmpl[4] * 1E-6;
    +
    51  for (n = Js; n <= JJ + MM; n++)
    +
    52  pscale[n] = pow((float)(n * (n + 1)), tscale);
    +
    53 
    +
    54  /* Separate spectral coeffs into two lists; one to contain
    +
    55  * unpacked values within the sub-spectrum Js, Ks, Ms, and the
    +
    56  * other with values outside of the sub-spectrum to be packed. */
    +
    57  tfld = malloc(ndpts * sizeof(float));
    +
    58  unpk = malloc(ndpts * sizeof(float));
    +
    59  ifld = malloc(ndpts * sizeof(g2int));
    +
    60  inc = 0;
    +
    61  incu = 0;
    +
    62  incp = 0;
    +
    63  for (m = 0; m <= MM; m++)
    +
    64  {
    +
    65  Nm = JJ; /* triangular or trapezoidal */
    +
    66  if (KK == JJ + MM)
    +
    67  Nm = JJ + m; /* rhombodial */
    +
    68  Ns = Js; /* triangular or trapezoidal */
    +
    69  if (Ks == Js + Ms)
    +
    70  Ns = Js + m; /* rhombodial */
    +
    71  for (n = m; n <= Nm; n++)
    +
    72  {
    +
    73  if (n <= Ns && m <= Ms)
    +
    74  { /* save unpacked value */
    +
    75  unpk[incu++] = fld[inc++]; /* real part */
    +
    76  unpk[incu++] = fld[inc++]; /* imaginary part */
    +
    77  }
    +
    78  else
    +
    79  { /* Save value to be packed and scale Laplacian scale factor. */
    +
    80  tfld[incp++] = fld[inc++] * pscale[n]; /* real part */
    +
    81  tfld[incp++] = fld[inc++] * pscale[n]; /* imaginary part */
    +
    82  }
    +
    83  }
    +
    84  }
    +
    85  free(pscale);
    +
    86 
    +
    87  if (incu != Ts)
    +
    88  {
    +
    89  printf("specpack: Incorrect number of unpacked values %d given:\n", (int)Ts);
    +
    90  printf("specpack: Resetting idrstmpl[8] to %d\n", (int)incu);
    +
    91  Ts = incu;
    +
    92  }
    +
    93 
    +
    94  /* Add unpacked values to the packed data array in 32-bit IEEE
    +
    95  * format. */
    +
    96  mkieee(unpk, (g2int *)cpack, Ts);
    +
    97  ipos = 4 * Ts;
    +
    98 
    +
    99  /* Scale and pack the rest of the coefficients. */
    +
    100  tmplsim[1] = idrstmpl[1];
    +
    101  tmplsim[2] = idrstmpl[2];
    +
    102  tmplsim[3] = idrstmpl[3];
    +
    103  simpack(tfld, ndpts - Ts, tmplsim, cpack + ipos, lcpack);
    +
    104  *lcpack = (*lcpack) + ipos;
    +
    105 
    +
    106  /* Fill in Template 5.51. */
    +
    107  idrstmpl[0] = tmplsim[0];
    +
    108  idrstmpl[1] = tmplsim[1];
    +
    109  idrstmpl[2] = tmplsim[2];
    +
    110  idrstmpl[3] = tmplsim[3];
    +
    111  idrstmpl[8] = Ts;
    +
    112  idrstmpl[9] = 1; /* Unpacked spectral data is 32-bit IEEE */
    +
    113 
    +
    114  free(tfld);
    +
    115  free(unpk);
    +
    116  free(ifld);
    +
    117 
    +
    118  return;
    +
    119 }
    +
    +
    +
    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...
    Definition: specpack.c:33
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    void mkieee(float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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...
    Definition: simpack.c:34
    + + + + diff --git a/ver-1.7.0/specunpack_8c.html b/ver-1.7.0/specunpack_8c.html new file mode 100644 index 00000000..47db3d96 --- /dev/null +++ b/ver-1.7.0/specunpack_8c.html @@ -0,0 +1,207 @@ + + + + + + + +NCEPLIBS-g2c: specunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    specunpack.c File Reference
    +
    +
    + +

    Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <math.h>
    +#include "grib2_int.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data.

    +
    Author
    Stephen Gilbert
    +
    Date
    2000-06-21
    + +

    Definition in file specunpack.c.

    +

    Function Documentation

    + +

    ◆ specunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int specunpack (unsigned char * cpack,
    g2intidrstmpl,
    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
    + + + + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.51.
    ndptsThe number of data values to unpack (real and imaginary parts).
    JJpentagonal resolution parameter.
    KKpentagonal resolution parameter.
    MMpentagonal resolution parameter.
    fldContains 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/specunpack_8c.js b/ver-1.7.0/specunpack_8c.js new file mode 100644 index 00000000..647adfab --- /dev/null +++ b/ver-1.7.0/specunpack_8c.js @@ -0,0 +1,4 @@ +var specunpack_8c = +[ + [ "specunpack", "specunpack_8c.html#accf1040682acbd7ef03f54ca5250d683", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/specunpack_8c_source.html b/ver-1.7.0/specunpack_8c_source.html new file mode 100644 index 00000000..25147585 --- /dev/null +++ b/ver-1.7.0/specunpack_8c_source.html @@ -0,0 +1,195 @@ + + + + + + + +NCEPLIBS-g2c: specunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    specunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include <math.h>
    +
    9 #include "grib2_int.h"
    +
    10 
    +
    34 g2int
    +
    35 specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ,
    +
    36  g2int KK, g2int MM, float *fld)
    +
    37 {
    +
    38  g2int *ifld, j, iofst, nbits;
    +
    39  float ref, bscale, dscale, *unpk;
    +
    40  float *pscale, tscale;
    +
    41  g2int Js, Ks, Ms, Ts, Ns, Nm, n, m;
    +
    42  g2int inc, incu, incp;
    +
    43 
    +
    44  rdieee(idrstmpl+0, &ref, 1);
    +
    45  bscale = int_power(2.0, idrstmpl[1]);
    +
    46  dscale = int_power(10.0, -idrstmpl[2]);
    +
    47  nbits = idrstmpl[3];
    +
    48  Js = idrstmpl[5];
    +
    49  Ks = idrstmpl[6];
    +
    50  Ms = idrstmpl[7];
    +
    51  Ts = idrstmpl[8];
    +
    52 
    +
    53  if (idrstmpl[9] == 1)
    +
    54  { /* unpacked floats are 32-bit IEEE */
    +
    55 
    +
    56  unpk = malloc(ndpts * sizeof(float));
    +
    57  ifld = malloc(ndpts * sizeof(g2int));
    +
    58 
    +
    59  gbits(cpack, ifld, 0, 32, 0, Ts);
    +
    60  iofst = 32 * Ts;
    +
    61  rdieee(ifld, unpk, Ts); /* read IEEE unpacked floats */
    +
    62  gbits(cpack, ifld, iofst, nbits, 0, ndpts - Ts); /* unpack scaled data */
    +
    63 
    +
    64  /* Calculate Laplacian scaling factors for each possible wave
    +
    65  * number. */
    +
    66  pscale = malloc((JJ + MM + 1) * sizeof(float));
    +
    67  tscale = idrstmpl[4] * 1E-6;
    +
    68  for (n = Js; n <= JJ + MM; n++)
    +
    69  pscale[n] = pow((float)(n * (n+1)), -tscale);
    +
    70 
    +
    71  /* Assemble spectral coeffs back to original order. */
    +
    72  inc = 0;
    +
    73  incu = 0;
    +
    74  incp = 0;
    +
    75  for (m = 0; m <= MM; m++)
    +
    76  {
    +
    77  Nm = JJ; /* triangular or trapezoidal */
    +
    78  if (KK == JJ+MM)
    +
    79  Nm = JJ + m; /* rhombodial */
    +
    80  Ns = Js; /* triangular or trapezoidal */
    +
    81  if (Ks == Js + Ms)
    +
    82  Ns = Js + m; /* rhombodial */
    +
    83  for (n = m; n <= Nm; n++)
    +
    84  {
    +
    85  if (n <= Ns && m <= Ms)
    +
    86  { /* grab unpacked value */
    +
    87  fld[inc++] = unpk[incu++]; /* real part */
    +
    88  fld[inc++] = unpk[incu++]; /* imaginary part */
    +
    89  }
    +
    90  else
    +
    91  { /* Calc coeff from packed value */
    +
    92  fld[inc++] = (((float)ifld[incp++] * bscale) + ref) *
    +
    93  dscale * pscale[n]; /* real part */
    +
    94  fld[inc++] = (((float)ifld[incp++] * bscale) + ref) *
    +
    95  dscale * pscale[n]; /* imaginary part */
    +
    96  }
    +
    97  }
    +
    98  }
    +
    99 
    +
    100  free(pscale);
    +
    101  free(unpk);
    +
    102  free(ifld);
    +
    103  }
    +
    104  else
    +
    105  {
    +
    106  printf("specunpack: Cannot handle 64 or 128-bit floats.\n");
    +
    107  for (j = 0; j < ndpts; j++)
    +
    108  fld[j] = 0.0;
    +
    109  return G2_SPECUNPACK_TYPE;
    +
    110  }
    +
    111 
    +
    112  return G2_NO_ERROR;
    +
    113 }
    +
    +
    +
    #define G2_NO_ERROR
    Function succeeded.
    Definition: grib2.h:275
    +
    void rdieee(g2int *rieee, float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:21
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:18
    +
    Header file with internal function prototypes NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    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...
    Definition: gbits.c:57
    +
    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...
    Definition: specunpack.c:35
    +
    #define G2_SPECUNPACK_TYPE
    In specunpack() Can't handle 64 or 128 bit floats.
    Definition: grib2.h:321
    + + + + diff --git a/ver-1.7.0/splitbar.png b/ver-1.7.0/splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/ver-1.7.0/splitbar.png differ diff --git a/ver-1.7.0/sync_off.png b/ver-1.7.0/sync_off.png new file mode 100644 index 00000000..3b443fc6 Binary files /dev/null and b/ver-1.7.0/sync_off.png differ diff --git a/ver-1.7.0/sync_on.png b/ver-1.7.0/sync_on.png new file mode 100644 index 00000000..e08320fb Binary files /dev/null and b/ver-1.7.0/sync_on.png differ diff --git a/ver-1.7.0/tab_a.png b/ver-1.7.0/tab_a.png new file mode 100644 index 00000000..3b725c41 Binary files /dev/null and b/ver-1.7.0/tab_a.png differ diff --git a/ver-1.7.0/tab_b.png b/ver-1.7.0/tab_b.png new file mode 100644 index 00000000..e2b4a863 Binary files /dev/null and b/ver-1.7.0/tab_b.png differ diff --git a/ver-1.7.0/tab_h.png b/ver-1.7.0/tab_h.png new file mode 100644 index 00000000..fd5cb705 Binary files /dev/null and b/ver-1.7.0/tab_h.png differ diff --git a/ver-1.7.0/tab_s.png b/ver-1.7.0/tab_s.png new file mode 100644 index 00000000..ab478c95 Binary files /dev/null and b/ver-1.7.0/tab_s.png differ diff --git a/ver-1.7.0/tabs.css b/ver-1.7.0/tabs.css new file mode 100644 index 00000000..7d45d36c --- /dev/null +++ b/ver-1.7.0/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} diff --git a/ver-1.7.0/util_8c.html b/ver-1.7.0/util_8c.html new file mode 100644 index 00000000..09194f1b --- /dev/null +++ b/ver-1.7.0/util_8c.html @@ -0,0 +1,218 @@ + + + + + + + +NCEPLIBS-g2c: util.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    util.c File Reference
    +
    +
    + +

    Internal utility functions for the g2c library. +More...

    +
    #include "grib2_int.h"
    +#include <stdarg.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    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...
     
    int g2c_set_log_level (int new_level)
     Use this to set the global log level. More...
     
    +

    Detailed Description

    +

    Internal utility functions for the g2c library.

    +
    Author
    Ed Hartnett
    +
    Date
    Nov 11, 2021
    + +

    Definition in file util.c.

    +

    Function Documentation

    + +

    ◆ g2c_check_msg()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int g2c_check_msg (unsigned char * cgrib,
    g2intlencurr,
    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
    + + + + +
    cgribBuffer that contains the GRIB message.
    lencurrPointer that gets the length of the GRIB message.
    verboseIf 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().

    + +
    +
    + +

    ◆ 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_levelThe 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.

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/util_8c.js b/ver-1.7.0/util_8c.js new file mode 100644 index 00000000..6a8e8979 --- /dev/null +++ b/ver-1.7.0/util_8c.js @@ -0,0 +1,5 @@ +var util_8c = +[ + [ "g2c_check_msg", "util_8c.html#a3acf35e5653f0dab59b3e6fd130f2d62", null ], + [ "g2c_set_log_level", "util_8c.html#a9a2353e67d13207769db5bd68e343abe", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/util_8c_source.html b/ver-1.7.0/util_8c_source.html new file mode 100644 index 00000000..44f741db --- /dev/null +++ b/ver-1.7.0/util_8c_source.html @@ -0,0 +1,210 @@ + + + + + + + +NCEPLIBS-g2c: util.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.7.0 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    util.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include "grib2_int.h"
    +
    8 #include <stdarg.h>
    +
    9 
    +
    25 int
    +
    26 g2c_check_msg(unsigned char *cgrib, g2int *lencurr, int verbose)
    +
    27 {
    +
    28  unsigned char G = 0x47; /* 'G' */
    +
    29  unsigned char R = 0x52; /* 'R' */
    +
    30  unsigned char I = 0x49; /* 'I' */
    +
    31  unsigned char B = 0x42; /* 'B' */
    +
    32  unsigned char seven = 0x37; /* '7' */
    +
    33 
    +
    34  assert(cgrib && lencurr);
    +
    35 
    +
    36  /* Check to see if beginning of GRIB message exists. */
    +
    37  if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B)
    +
    38  {
    +
    39  if (verbose)
    +
    40  printf("GRIB not found in given message. A call to routine g2_create() "
    +
    41  "is required to to initialize GRIB messge.\n");
    +
    42  return G2C_NOT_GRIB;
    +
    43  }
    +
    44 
    +
    45  /* Get current length of GRIB message. */
    +
    46  gbit(cgrib, lencurr, 96, 32);
    +
    47 
    +
    48  /* Check to see if GRIB message is already complete. */
    +
    49  if (cgrib[*lencurr - 4] == seven && cgrib[*lencurr - 3] == seven &&
    +
    50  cgrib[*lencurr - 2] == seven && cgrib[*lencurr - 1] == seven)
    +
    51  {
    +
    52  if (verbose)
    +
    53  printf("GRIB message already complete. Cannot add new section.\n");
    +
    54  return G2C_MSG_COMPLETE;
    +
    55  }
    +
    56 
    +
    57  return G2C_NO_ERROR;
    +
    58 }
    +
    59 
    +
    60 #ifdef LOGGING
    +
    61 /* This is the severity level of messages which will be logged. Use
    +
    62  severity 0 for errors, 1 for important log messages, 2 for less
    +
    63  important, etc. */
    +
    64 int g2_log_level = -1;
    +
    65 
    +
    66 /* This function prints out a message, if the severity of
    +
    67  * the message is lower than the global g2_log_level. To use it, do
    +
    68  * something like this:
    +
    69  *
    +
    70  * g2_log(0, "this computer will explode in %d seconds", i);
    +
    71  *
    +
    72  * After the first arg (the severity), use the rest like a normal
    +
    73  * printf statement. Output will appear on stderr.
    +
    74  *
    +
    75  * This function is not included in the build unless NCEPLIBS-g2c was
    +
    76  * built with -DLOGGING.
    +
    77  *
    +
    78  * Ed Hartnett
    +
    79  */
    +
    80 void
    +
    81 g2_log(int severity, const char *fmt, ...)
    +
    82 {
    +
    83  va_list argp;
    +
    84  int t;
    +
    85  FILE *f = stderr;
    +
    86 
    +
    87  /* If the severity is greater than the log level, we don't print
    +
    88  * this message. */
    +
    89  if (severity > g2_log_level)
    +
    90  return;
    +
    91 
    +
    92  /* If the severity is zero, this is an error. Otherwise insert that
    +
    93  many tabs before the message. */
    +
    94  if (!severity)
    +
    95  fprintf(f, "ERROR: ");
    +
    96  for (t = 0; t < severity; t++)
    +
    97  fprintf(f, "\t");
    +
    98 
    +
    99  /* Print out the variable list of args with vprintf. */
    +
    100  va_start(argp, fmt);
    +
    101  vfprintf(f, fmt, argp);
    +
    102  va_end(argp);
    +
    103 
    +
    104  /* Put on a final linefeed. */
    +
    105  fprintf(f, "\n");
    +
    106  fflush(f);
    +
    107 }
    +
    108 #endif /* LOGGING */
    +
    109 
    +
    123 int
    +
    124 g2c_set_log_level(int new_level)
    +
    125 {
    +
    126 #ifdef LOGGING
    +
    127  /* Remember the new level. */
    +
    128  g2_log_level = new_level;
    +
    129 
    +
    130  LOG((1, "log_level changed to %d", g2_log_level));
    +
    131 #endif
    +
    132  return G2C_NO_ERROR;
    +
    133 }
    +
    +
    +
    int g2c_set_log_level(int new_level)
    Use this to set the global log level.
    Definition: util.c:124
    +
    #define G2C_NO_ERROR
    No error.
    Definition: grib2.h:328
    +
    #define LOG(e)
    Ignore logging to stdout.
    Definition: grib2_int.h:138
    +
    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...
    Definition: gbits.c:20
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:28
    +
    #define G2C_MSG_COMPLETE
    GRIB message already complete.
    Definition: grib2.h:330
    +
    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...
    Definition: util.c:26
    +
    #define G2C_NOT_GRIB
    GRIB header not found.
    Definition: grib2.h:329
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/annotated.html b/ver-1.7.0/ver-1.6.4/annotated.html new file mode 100644 index 00000000..1b6b6cb2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/annotated.html @@ -0,0 +1,107 @@ + + + + + + + +NCEPLIBS-g2c: Data Types List + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    Data Types List
    +
    +
    +
    Here are the data types with brief descriptions:
    + + + + + + +
     CdrstemplateStuct for GRIB2 Data Representation Section (DRS) template
     CgribfieldStruct for GRIB field
     CgridtemplateStruct for grid template
     CgtemplateStruct for GRIB template
     CpdstemplateStruct for PDS template
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/annotated_dup.js b/ver-1.7.0/ver-1.6.4/annotated_dup.js new file mode 100644 index 00000000..c86f9c8a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/annotated_dup.js @@ -0,0 +1,8 @@ +var annotated_dup = +[ + [ "drstemplate", "drstemplates_8h.html#structdrstemplate", "drstemplates_8h_structdrstemplate" ], + [ "gribfield", "grib2_8h.html#structgribfield", "grib2_8h_structgribfield" ], + [ "gridtemplate", "gridtemplates_8h.html#structgridtemplate", "gridtemplates_8h_structgridtemplate" ], + [ "gtemplate", "grib2_8h.html#structgtemplate", "grib2_8h_structgtemplate" ], + [ "pdstemplate", "pdstemplates_8h.html#structpdstemplate", "pdstemplates_8h_structpdstemplate" ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/bc_s.png b/ver-1.7.0/ver-1.6.4/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/bc_s.png differ diff --git a/ver-1.7.0/ver-1.6.4/bdwn.png b/ver-1.7.0/ver-1.6.4/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/bdwn.png differ diff --git a/ver-1.7.0/ver-1.6.4/classes.html b/ver-1.7.0/ver-1.6.4/classes.html new file mode 100644 index 00000000..076b7436 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/classes.html @@ -0,0 +1,110 @@ + + + + + + + +NCEPLIBS-g2c: Data Types + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    Data Types
    +
    + +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/closed.png b/ver-1.7.0/ver-1.6.4/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/closed.png differ diff --git a/ver-1.7.0/ver-1.6.4/cmplxpack_8c.html b/ver-1.7.0/ver-1.6.4/cmplxpack_8c.html new file mode 100644 index 00000000..62f45605 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/cmplxpack_8c.html @@ -0,0 +1,204 @@ + + + + + + + +NCEPLIBS-g2c: cmplxpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    cmplxpack.c File Reference
    +
    +
    + +

    Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention. +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void cmplxpack (g2float *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...
     
    +

    Detailed Description

    +

    Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.

    +
    Author
    Stephen Gilbert
    +
    Date
    2004-08-27
    + +

    Definition in file cmplxpack.c.

    +

    Function Documentation

    + +

    ◆ cmplxpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmplxpack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplContains 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 )
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2004-08-27
    + +

    Definition at line 35 of file cmplxpack.c.

    + +

    References compack(), and misspack().

    + +

    Referenced by g2_addfield().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/cmplxpack_8c.js b/ver-1.7.0/ver-1.6.4/cmplxpack_8c.js new file mode 100644 index 00000000..1968758d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/cmplxpack_8c.js @@ -0,0 +1,4 @@ +var cmplxpack_8c = +[ + [ "cmplxpack", "cmplxpack_8c.html#a1866293a23a4f417804e829d30817054", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/cmplxpack_8c_source.html b/ver-1.7.0/ver-1.6.4/cmplxpack_8c_source.html new file mode 100644 index 00000000..c5ed2725 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/cmplxpack_8c_source.html @@ -0,0 +1,123 @@ + + + + + + + +NCEPLIBS-g2c: cmplxpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    cmplxpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include "grib2.h"
    +
    8 
    +
    34 void
    +
    35 cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
    +
    36  unsigned char *cpack, g2int *lcpack)
    +
    37 {
    +
    38  if (idrstmpl[6] == 0) /* No internal missing values */
    +
    39  compack(fld, ndpts, idrsnum, idrstmpl, cpack, lcpack);
    +
    40  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
    +
    41  misspack(fld, ndpts, idrsnum, idrstmpl, cpack, lcpack);
    +
    42  else
    +
    43  {
    +
    44  printf("cmplxpack: Don:t recognize Missing value option.");
    +
    45  *lcpack = -1;
    +
    46  }
    +
    47 
    +
    48 }
    +
    void cmplxpack(g2float *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...
    Definition: cmplxpack.c:35
    +
    void compack(g2float *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...
    Definition: compack.c:42
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    void misspack(g2float *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...
    Definition: misspack.c:43
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/compack_8c.html b/ver-1.7.0/ver-1.6.4/compack_8c.html new file mode 100644 index 00000000..58deb840 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/compack_8c.html @@ -0,0 +1,206 @@ + + + + + + + +NCEPLIBS-g2c: compack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    compack.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void compack (g2float *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...
     
    +

    Detailed Description

    +

    Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-07
    + +

    Definition in file compack.c.

    +

    Function Documentation

    + +

    ◆ compack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void compack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplContains 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)
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-07
    + +

    Definition at line 42 of file compack.c.

    + +

    References int_power(), mkieee(), pack_gp(), sbit(), and sbits().

    + +

    Referenced by cmplxpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/compack_8c.js b/ver-1.7.0/ver-1.6.4/compack_8c.js new file mode 100644 index 00000000..bc3956cd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/compack_8c.js @@ -0,0 +1,4 @@ +var compack_8c = +[ + [ "compack", "compack_8c.html#a1e3bc6eb03df58e192ded1b429f172e0", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/compack_8c_source.html b/ver-1.7.0/ver-1.6.4/compack_8c_source.html new file mode 100644 index 00000000..d5bf8e04 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/compack_8c_source.html @@ -0,0 +1,511 @@ + + + + + + + +NCEPLIBS-g2c: compack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    compack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    8 #include <stdlib.h>
    +
    9 #include <math.h>
    +
    10 #include "grib2.h"
    +
    11 
    +
    41 void
    +
    42 compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
    +
    43  unsigned char *cpack, g2int *lcpack)
    +
    44 {
    +
    45 
    +
    46  static g2int zero = 0;
    +
    47  g2int *ifld, *gref, *glen, *gwidth;
    +
    48  g2int *jmin, *jmax, *lbit;
    +
    49  g2int i, j, n, imin, imax, left;
    +
    50  g2int isd, itemp, ilmax, ngwidthref = 0, nbitsgwidth = 0;
    +
    51  g2int nglenref = 0, nglenlast = 0, iofst, ival1, ival2;
    +
    52  g2int minsd, nbitsd = 0, maxorig, nbitorig, ngroups;
    +
    53  g2int lg, ng, igmax, iwmax, nbitsgref;
    +
    54  g2int glength, grpwidth, nbitsglen = 0;
    +
    55  g2int kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
    +
    56  g2int missopt, miss1, miss2, ier;
    +
    57  g2float bscale, dscale, rmax, rmin, temp;
    +
    58  static g2int simple_alg = 0;
    +
    59  static g2float alog2 = 0.69314718; /* ln(2.0) */
    +
    60  static g2int one = 1;
    +
    61 
    +
    62  bscale = int_power(2.0, -idrstmpl[1]);
    +
    63  dscale = int_power(10.0, idrstmpl[2]);
    +
    64 
    +
    65  /* Find max and min values in the data. */
    +
    66  rmax = fld[0];
    +
    67  rmin = fld[0];
    +
    68  for (j = 1; j < ndpts; j++)
    +
    69  {
    +
    70  if (fld[j] > rmax) rmax = fld[j];
    +
    71  if (fld[j] < rmin) rmin = fld[j];
    +
    72  }
    +
    73 
    +
    74  /* If max and min values are not equal, pack up field. If they are
    +
    75  * equal, we have a constant field, and the reference value (rmin)
    +
    76  * is the value for each point in the field and set nbits to 0. */
    +
    77  if (rmin != rmax)
    +
    78  {
    +
    79  iofst = 0;
    +
    80  ifld = calloc(ndpts, sizeof(g2int));
    +
    81  gref = calloc(ndpts, sizeof(g2int));
    +
    82  gwidth = calloc(ndpts, sizeof(g2int));
    +
    83  glen = calloc(ndpts, sizeof(g2int));
    +
    84 
    +
    85  /* Scale original data. */
    +
    86  if (idrstmpl[1] == 0)
    +
    87  { /* No binary scaling. */
    +
    88  imin = (g2int)rint(rmin*dscale);
    +
    89  /*imax = (g2int)rint(rmax*dscale); */
    +
    90  rmin = (g2float)imin;
    +
    91  for (j = 0; j < ndpts; j++)
    +
    92  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
    +
    93  }
    +
    94  else
    +
    95  { /* Use binary scaling factor */
    +
    96  rmin = rmin * dscale;
    +
    97  /*rmax = rmax*dscale; */
    +
    98  for (j = 0; j < ndpts; j++)
    +
    99  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    100  }
    +
    101 
    +
    102  /* Calculate Spatial differences, if using DRS Template
    +
    103  * 5.3. */
    +
    104  if (idrsnum == 3)
    +
    105  { /* spatial differences */
    +
    106  if (idrstmpl[16] !=1 && idrstmpl[16] != 2)
    +
    107  idrstmpl[16] = 1;
    +
    108  if (idrstmpl[16] == 1)
    +
    109  { /* first order */
    +
    110  ival1 = ifld[0];
    +
    111  for (j = ndpts-1; j > 0; j--)
    +
    112  ifld[j] = ifld[j] - ifld[j - 1];
    +
    113  ifld[0] = 0;
    +
    114  }
    +
    115  else if (idrstmpl[16] == 2)
    +
    116  { /* second order */
    +
    117  ival1 = ifld[0];
    +
    118  ival2 = ifld[1];
    +
    119  for (j = ndpts - 1; j > 1; j--)
    +
    120  ifld[j] = ifld[j] - (2 * ifld[j - 1]) + ifld[j - 2];
    +
    121  ifld[0] = 0;
    +
    122  ifld[1] = 0;
    +
    123  }
    +
    124 
    +
    125  /* Subtract min value from spatial diff field. */
    +
    126  isd = idrstmpl[16];
    +
    127  minsd = ifld[isd];
    +
    128  for (j = isd; j < ndpts; j++)
    +
    129  if (ifld[j] < minsd)
    +
    130  minsd = ifld[j];
    +
    131  for (j = isd; j < ndpts; j++)
    +
    132  ifld[j] = ifld[j] - minsd;
    +
    133 
    +
    134  /* Find num of bits need to store minsd and add 1 extra bit to indicate sign. */
    +
    135  temp = log((double)(abs(minsd) + 1)) / alog2;
    +
    136  nbitsd = (g2int)ceil(temp) + 1;
    +
    137 
    +
    138  /* Find num of bits need to store ifld[0] (and ifld[1] if
    +
    139  * using 2nd order differencing). */
    +
    140  maxorig = ival1;
    +
    141  if (idrstmpl[16] == 2 && ival2 > ival1)
    +
    142  maxorig = ival2;
    +
    143  temp = log((double)(maxorig + 1)) / alog2;
    +
    144  nbitorig = (g2int)ceil(temp) + 1;
    +
    145  if (nbitorig > nbitsd)
    +
    146  nbitsd = nbitorig;
    +
    147 
    +
    148  /* Increase number of bits to even multiple of 8 (octet). */
    +
    149  if ((nbitsd % 8) != 0)
    +
    150  nbitsd = nbitsd+(8-(nbitsd%8));
    +
    151 
    +
    152  /* Store extra spatial differencing info into the packed
    +
    153  * data section. */
    +
    154  if (nbitsd != 0)
    +
    155  {
    +
    156  /* pack first original value */
    +
    157  if (ival1 >= 0)
    +
    158  {
    +
    159  sbit(cpack, &ival1, iofst, nbitsd);
    +
    160  iofst = iofst+nbitsd;
    +
    161  }
    +
    162  else
    +
    163  {
    +
    164  sbit(cpack, &one, iofst, 1);
    +
    165  iofst = iofst + 1;
    +
    166  itemp = abs(ival1);
    +
    167  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    168  iofst = iofst + nbitsd - 1;
    +
    169  }
    +
    170  if (idrstmpl[16] == 2)
    +
    171  {
    +
    172  /* pack second original value */
    +
    173  if (ival2 >= 0)
    +
    174  {
    +
    175  sbit(cpack, &ival2, iofst, nbitsd);
    +
    176  iofst = iofst + nbitsd;
    +
    177  }
    +
    178  else
    +
    179  {
    +
    180  sbit(cpack, &one, iofst, 1);
    +
    181  iofst = iofst + 1;
    +
    182  itemp = abs(ival2);
    +
    183  sbit(cpack, &itemp, iofst, nbitsd - 1);
    +
    184  iofst = iofst + nbitsd - 1;
    +
    185  }
    +
    186  }
    +
    187 
    +
    188  /* pack overall min of spatial differences */
    +
    189  if (minsd >= 0)
    +
    190  {
    +
    191  sbit(cpack, &minsd, iofst, nbitsd);
    +
    192  iofst = iofst + nbitsd;
    +
    193  }
    +
    194  else
    +
    195  {
    +
    196  sbit(cpack, &one, iofst, 1);
    +
    197  iofst = iofst + 1;
    +
    198  itemp = abs(minsd);
    +
    199  sbit(cpack, &itemp, iofst, nbitsd - 1);
    +
    200  iofst = iofst + nbitsd - 1;
    +
    201  }
    +
    202  }
    +
    203  } /* end of spatial diff section */
    +
    204 
    +
    205  /* Determine Groups to be used. */
    +
    206  if (simple_alg == 1)
    +
    207  {
    +
    208  /* Set group length to 10; calculate number of groups and
    +
    209  * length of last group. */
    +
    210  ngroups = ndpts / 10;
    +
    211  for (j = 0; j < ngroups; j++)
    +
    212  glen[j] = 10;
    +
    213  itemp = ndpts % 10;
    +
    214  if (itemp != 0)
    +
    215  {
    +
    216  ngroups = ngroups + 1;
    +
    217  glen[ngroups - 1] = itemp;
    +
    218  }
    +
    219  }
    +
    220  else
    +
    221  {
    +
    222  /* Use Dr. Glahn's algorithm for determining grouping. */
    +
    223  kfildo = 6;
    +
    224  minpk = 10;
    +
    225  inc = 1;
    +
    226  maxgrps = (ndpts / minpk) + 1;
    +
    227  jmin = calloc(maxgrps, sizeof(g2int));
    +
    228  jmax = calloc(maxgrps, sizeof(g2int));
    +
    229  lbit = calloc(maxgrps, sizeof(g2int));
    +
    230  missopt = 0;
    +
    231  pack_gp(&kfildo, ifld, &ndpts, &missopt, &minpk, &inc, &miss1, &miss2,
    +
    232  jmin, jmax, lbit, glen, &maxgrps, &ngroups, &ibit, &jbit,
    +
    233  &kbit, &novref, &lbitref, &ier);
    +
    234  for (ng = 0; ng<ngroups; ng++)
    +
    235  glen[ng] = glen[ng] + novref;
    +
    236  free(jmin);
    +
    237  free(jmax);
    +
    238  free(lbit);
    +
    239  }
    +
    240 
    +
    241  /* For each group, find the group's reference value and the
    +
    242  * number of bits needed to hold the remaining values. */
    +
    243  n = 0;
    +
    244  for (ng = 0; ng < ngroups; ng++)
    +
    245  {
    +
    246  /* find max and min values of group */
    +
    247  gref[ng] = ifld[n];
    +
    248  imax = ifld[n];
    +
    249  j = n + 1;
    +
    250  for (lg = 1; lg < glen[ng]; lg++)
    +
    251  {
    +
    252  if (ifld[j] < gref[ng])
    +
    253  gref[ng] = ifld[j];
    +
    254  if (ifld[j] > imax)
    +
    255  imax = ifld[j];
    +
    256  j++;
    +
    257  }
    +
    258 
    +
    259  /* calc num of bits needed to hold data */
    +
    260  if (gref[ng] != imax)
    +
    261  {
    +
    262  temp = log((double)(imax - gref[ng] + 1))/alog2;
    +
    263  gwidth[ng] = (g2int)ceil(temp);
    +
    264  }
    +
    265  else
    +
    266  gwidth[ng] = 0;
    +
    267  /* Subtract min from data */
    +
    268  j = n;
    +
    269  for (lg = 0; lg < glen[ng]; lg++)
    +
    270  {
    +
    271  ifld[j] = ifld[j] - gref[ng];
    +
    272  j++;
    +
    273  }
    +
    274  /* increment fld array counter */
    +
    275  n = n + glen[ng];
    +
    276  }
    +
    277 
    +
    278  /* Find max of the group references and calc num of bits
    +
    279  * needed to pack each groups reference value, then pack up
    +
    280  * group reference values. */
    +
    281  igmax = gref[0];
    +
    282  for (j = 1; j < ngroups; j++)
    +
    283  if (gref[j] > igmax)
    +
    284  igmax = gref[j];
    +
    285  if (igmax != 0)
    +
    286  {
    +
    287  temp = log((double)(igmax + 1)) / alog2;
    +
    288  nbitsgref = (g2int)ceil(temp);
    +
    289  sbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
    +
    290  itemp = nbitsgref * ngroups;
    +
    291  iofst = iofst + itemp;
    +
    292  /* Pad last octet with Zeros, if necessary. */
    +
    293  if ((itemp % 8) != 0)
    +
    294  {
    +
    295  left = 8 - (itemp % 8);
    +
    296  sbit(cpack, &zero, iofst, left);
    +
    297  iofst = iofst + left;
    +
    298  }
    +
    299  }
    +
    300  else
    +
    301  nbitsgref = 0;
    +
    302 
    +
    303  /* Find max/min of the group widths and calc num of bits
    +
    304  * needed to pack each groups width value, then pack up group
    +
    305  * width values. */
    +
    306  iwmax = gwidth[0];
    +
    307  ngwidthref = gwidth[0];
    +
    308  for (j = 1; j < ngroups; j++)
    +
    309  {
    +
    310  if (gwidth[j] > iwmax)
    +
    311  iwmax = gwidth[j];
    +
    312  if (gwidth[j] < ngwidthref)
    +
    313  ngwidthref = gwidth[j];
    +
    314  }
    +
    315  if (iwmax != ngwidthref)
    +
    316  {
    +
    317  temp = log((double)(iwmax - ngwidthref +1)) / alog2;
    +
    318  nbitsgwidth = (g2int)ceil(temp);
    +
    319  for (i = 0; i < ngroups; i++)
    +
    320  gwidth[i] = gwidth[i] - ngwidthref;
    +
    321  sbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
    +
    322  itemp = nbitsgwidth * ngroups;
    +
    323  iofst = iofst + itemp;
    +
    324  /* Pad last octet with Zeros, if necessary. */
    +
    325  if ((itemp % 8) != 0)
    +
    326  {
    +
    327  left = 8 - (itemp % 8);
    +
    328  sbit(cpack, &zero, iofst, left);
    +
    329  iofst = iofst + left;
    +
    330  }
    +
    331  }
    +
    332  else
    +
    333  {
    +
    334  nbitsgwidth = 0;
    +
    335  for (i = 0; i < ngroups; i++)
    +
    336  gwidth[i] = 0;
    +
    337  }
    +
    338 
    +
    339  /* Find max/min of the group lengths and calc num of bits
    +
    340  * needed to pack each groups length value, then pack up group
    +
    341  * length values. */
    +
    342  ilmax = glen[0];
    +
    343  nglenref = glen[0];
    +
    344  for (j = 1; j < ngroups - 1; j++)
    +
    345  {
    +
    346  if (glen[j] > ilmax)
    +
    347  ilmax = glen[j];
    +
    348  if (glen[j] < nglenref)
    +
    349  nglenref = glen[j];
    +
    350  }
    +
    351  nglenlast = glen[ngroups - 1];
    +
    352  if (ilmax != nglenref)
    +
    353  {
    +
    354  temp = log((double)(ilmax - nglenref + 1)) / alog2;
    +
    355  nbitsglen = (g2int)ceil(temp);
    +
    356  for (i = 0; i < ngroups - 1; i++)
    +
    357  glen[i] = glen[i] - nglenref;
    +
    358  sbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
    +
    359  itemp = nbitsglen * ngroups;
    +
    360  iofst = iofst + itemp;
    +
    361  /* Pad last octet with Zeros, if necessary, */
    +
    362  if ((itemp % 8) != 0)
    +
    363  {
    +
    364  left = 8 - (itemp % 8);
    +
    365  sbit(cpack, &zero, iofst, left);
    +
    366  iofst = iofst + left;
    +
    367  }
    +
    368  }
    +
    369  else
    +
    370  {
    +
    371  nbitsglen = 0;
    +
    372  for (i = 0; i < ngroups; i++)
    +
    373  glen[i] = 0;
    +
    374  }
    +
    375 
    +
    376  /* For each group, pack data values. */
    +
    377  n = 0;
    +
    378  for (ng = 0; ng < ngroups; ng++)
    +
    379  {
    +
    380  glength = glen[ng] + nglenref;
    +
    381  if (ng == (ngroups - 1))
    +
    382  glength = nglenlast;
    +
    383  grpwidth = gwidth[ng] + ngwidthref;
    +
    384  if (grpwidth != 0)
    +
    385  {
    +
    386  sbits(cpack, ifld + n, iofst, grpwidth, 0, glength);
    +
    387  iofst = iofst + (grpwidth * glength);
    +
    388  }
    +
    389  n = n + glength;
    +
    390  }
    +
    391  /* Pad last octet with Zeros, if necessary. */
    +
    392  if ((iofst % 8) != 0)
    +
    393  {
    +
    394  left = 8 - (iofst % 8);
    +
    395  sbit(cpack, &zero, iofst, left);
    +
    396  iofst = iofst + left;
    +
    397  }
    +
    398  *lcpack = iofst / 8;
    +
    399 
    +
    400  if (ifld)
    +
    401  free(ifld);
    +
    402  if (gref)
    +
    403  free(gref);
    +
    404  if (gwidth)
    +
    405  free(gwidth);
    +
    406  if (glen)
    +
    407  free(glen);
    +
    408  }
    +
    409  else
    +
    410  { /* Constant field (max = min) */
    +
    411  *lcpack = 0;
    +
    412  nbitsgref = 0;
    +
    413  ngroups = 0;
    +
    414  }
    +
    415 
    +
    416  /* Fill in ref value and number of bits in Template 5.2. */
    +
    417 
    +
    418  /* Ensure reference value is IEEE format. */
    +
    419  mkieee(&rmin, idrstmpl, 1);
    +
    420  idrstmpl[3] = nbitsgref;
    +
    421  idrstmpl[4] = 0; /* original data were reals */
    +
    422  idrstmpl[5] = 1; /* general group splitting */
    +
    423  idrstmpl[6] = 0; /* No internal missing values */
    +
    424  idrstmpl[7] = 0; /* Primary missing value */
    +
    425  idrstmpl[8] = 0; /* secondary missing value */
    +
    426  idrstmpl[9] = ngroups; /* Number of groups */
    +
    427  idrstmpl[10] = ngwidthref; /* reference for group widths */
    +
    428  idrstmpl[11] = nbitsgwidth; /* num bits used for group widths */
    +
    429  idrstmpl[12] = nglenref; /* Reference for group lengths */
    +
    430  idrstmpl[13] = 1; /* length increment for group lengths */
    +
    431  idrstmpl[14] = nglenlast; /* True length of last group */
    +
    432  idrstmpl[15] = nbitsglen; /* num bits used for group lengths */
    +
    433  if (idrsnum == 3)
    +
    434  {
    +
    435  idrstmpl[17] = nbitsd / 8; /* num bits used for extra spatial */
    +
    436  /* differencing values */
    +
    437  }
    +
    438 }
    +
    void compack(g2float *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...
    Definition: compack.c:42
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    int pack_gp(integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *ier)
    Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
    Definition: pack_gp.c:256
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/comunpack_8c.html b/ver-1.7.0/ver-1.6.4/comunpack_8c.html new file mode 100644 index 00000000..c3334972 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/comunpack_8c.html @@ -0,0 +1,208 @@ + + + + + + + +NCEPLIBS-g2c: comunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    comunpack.c File Reference
    +
    +
    + +

    Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    int comunpack (unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *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...
     
    +

    Detailed Description

    +

    Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file comunpack.c.

    +

    Function Documentation

    + +

    ◆ comunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int comunpack (unsigned char * cpack,
    g2int lensec,
    g2int idrsnum,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + + +
    cpackpointer to the packed data field.
    lenseclength of section 7 (used for error checking).
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplpointer to the array of values for Data Representation Template 5.2 or 5.3
    ndptsThe number of data values to unpack
    fldContains the unpacked data values. Must be allocated with at least ndpts * sizeof(g2float) 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/comunpack_8c.js b/ver-1.7.0/ver-1.6.4/comunpack_8c.js new file mode 100644 index 00000000..db5f8b06 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/comunpack_8c.js @@ -0,0 +1,4 @@ +var comunpack_8c = +[ + [ "comunpack", "comunpack_8c.html#a7c04fe1475985ae33214a65398cd1d94", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/comunpack_8c_source.html b/ver-1.7.0/ver-1.6.4/comunpack_8c_source.html new file mode 100644 index 00000000..99c979c2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/comunpack_8c_source.html @@ -0,0 +1,413 @@ + + + + + + + +NCEPLIBS-g2c: comunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    comunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    41 int
    +
    42 comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum,
    +
    43  g2int *idrstmpl, g2int ndpts, g2float *fld)
    +
    44 {
    +
    45  g2int nbitsd=0, isign;
    +
    46  g2int j, iofst, ival1, ival2, minsd, itemp, l, k, n, non=0;
    +
    47  g2int *ifld, *ifldmiss=0;
    +
    48  g2int *gref, *gwidth, *glen;
    +
    49  g2int itype, ngroups, nbitsgref, nbitsgwidth, nbitsglen;
    +
    50  g2int msng1, msng2;
    +
    51  g2float ref, bscale, dscale, rmiss1, rmiss2;
    +
    52  g2int totBit, totLen;
    +
    53 
    +
    54  rdieee(idrstmpl, &ref, 1);
    +
    55  bscale = (g2float)int_power(2.0, idrstmpl[1]);
    +
    56  dscale = (g2float)int_power(10.0, -idrstmpl[2]);
    +
    57  nbitsgref = idrstmpl[3];
    +
    58  itype = idrstmpl[4];
    +
    59  ngroups = idrstmpl[9];
    +
    60  nbitsgwidth = idrstmpl[11];
    +
    61  nbitsglen = idrstmpl[15];
    +
    62  if (idrsnum == 3)
    +
    63  nbitsd=idrstmpl[17] * 8;
    +
    64 
    +
    65  /* Constant field */
    +
    66  if (ngroups == 0)
    +
    67  {
    +
    68  for (j = 0; j < ndpts; j++)
    +
    69  fld[j] = ref;
    +
    70  return(0);
    +
    71  }
    +
    72 
    +
    73  iofst = 0;
    +
    74  ifld = (g2int *)calloc(ndpts, sizeof(g2int));
    +
    75  gref = (g2int *)calloc(ngroups, sizeof(g2int));
    +
    76  gwidth = (g2int *)calloc(ngroups, sizeof(g2int));
    +
    77 
    +
    78  /* Get missing values, if supplied */
    +
    79  if (idrstmpl[6] == 1)
    +
    80  {
    +
    81  if (itype == 0)
    +
    82  rdieee(idrstmpl+7,&rmiss1,1);
    +
    83  else
    +
    84  rmiss1 = (g2float)idrstmpl[7];
    +
    85  }
    +
    86  if (idrstmpl[6] == 2)
    +
    87  {
    +
    88  if (itype == 0)
    +
    89  {
    +
    90  rdieee(idrstmpl+7,&rmiss1,1);
    +
    91  rdieee(idrstmpl+8,&rmiss2,1);
    +
    92  }
    +
    93  else {
    +
    94  rmiss1 = (g2float)idrstmpl[7];
    +
    95  rmiss2 = (g2float)idrstmpl[8];
    +
    96  }
    +
    97  }
    +
    98 
    +
    99  /* Extract Spatial differencing values, if using DRS Template 5.3 */
    +
    100  if (idrsnum == 3)
    +
    101  {
    +
    102  if (nbitsd != 0)
    +
    103  {
    +
    104  /* wne mistake here shoujld be unsigned int */
    +
    105  gbit(cpack, &ival1, iofst, nbitsd);
    +
    106  iofst = iofst + nbitsd;
    +
    107  if (idrstmpl[16] == 2)
    +
    108  {
    +
    109  /* wne mistake here shoujld be unsigned int */
    +
    110  gbit(cpack, &ival2, iofst, nbitsd);
    +
    111  iofst = iofst + nbitsd;
    +
    112  }
    +
    113  gbit(cpack, &isign, iofst, 1);
    +
    114  iofst = iofst + 1;
    +
    115  gbit(cpack, &minsd, iofst, nbitsd - 1);
    +
    116  iofst = iofst + nbitsd - 1;
    +
    117  if (isign == 1)
    +
    118  minsd = -minsd;
    +
    119  }
    +
    120  else {
    +
    121  ival1 = 0;
    +
    122  ival2 = 0;
    +
    123  minsd = 0;
    +
    124  }
    +
    125  }
    +
    126 
    +
    127  /* Extract Each Group's reference value */
    +
    128  if (nbitsgref != 0)
    +
    129  {
    +
    130  gbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
    +
    131  itemp = nbitsgref * ngroups;
    +
    132  iofst = iofst + itemp;
    +
    133  if (itemp % 8 != 0)
    +
    134  iofst = iofst + (8 - (itemp % 8));
    +
    135  }
    +
    136  else
    +
    137  {
    +
    138  for (j = 0; j < ngroups; j++)
    +
    139  gref[j] = 0;
    +
    140  }
    +
    141 
    +
    142  /* Extract Each Group's bit width */
    +
    143  if (nbitsgwidth != 0) {
    +
    144  gbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
    +
    145  itemp = nbitsgwidth * ngroups;
    +
    146  iofst = iofst + itemp;
    +
    147  if (itemp % 8 != 0)
    +
    148  iofst = iofst + (8 - (itemp % 8));
    +
    149  }
    +
    150  else {
    +
    151  for (j = 0; j < ngroups; j++)
    +
    152  gwidth[j] = 0;
    +
    153  }
    +
    154 
    +
    155  for (j = 0; j < ngroups; j++)
    +
    156  gwidth[j] = gwidth[j] + idrstmpl[10];
    +
    157 
    +
    158  /* Extract Each Group's length (number of values in each group) */
    +
    159  glen = calloc(ngroups, sizeof(g2int));
    +
    160  if (nbitsglen != 0)
    +
    161  {
    +
    162  gbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
    +
    163  itemp = nbitsglen * ngroups;
    +
    164  iofst = iofst + itemp;
    +
    165  if (itemp % 8 != 0)
    +
    166  iofst = iofst + (8 - (itemp % 8));
    +
    167  }
    +
    168  else
    +
    169  {
    +
    170  for (j = 0; j < ngroups; j++)
    +
    171  glen[j] = 0;
    +
    172  }
    +
    173  for (j = 0;j<ngroups;j++)
    +
    174  glen[j] = (glen[j]*idrstmpl[13])+idrstmpl[12];
    +
    175  glen[ngroups-1] = idrstmpl[14];
    +
    176 
    +
    177  /* Test to see if the group widths and lengths are consistent
    +
    178  * with number of values, and length of section 7. */
    +
    179  totBit = 0;
    +
    180  totLen = 0;
    +
    181  for (j = 0; j < ngroups; j++)
    +
    182  {
    +
    183  totBit += (gwidth[j] * glen[j]);
    +
    184  totLen += glen[j];
    +
    185  }
    +
    186  if (totLen != ndpts)
    +
    187  return 1;
    +
    188  if (totBit / 8. > lensec)
    +
    189  return 1;
    +
    190 
    +
    191  /* For each group, unpack data values */
    +
    192  if (idrstmpl[6] == 0)
    +
    193  { /* no missing values */
    +
    194  n = 0;
    +
    195  for (j = 0; j < ngroups; j++)
    +
    196  {
    +
    197  if (gwidth[j] != 0)
    +
    198  {
    +
    199  gbits(cpack, ifld + n, iofst, gwidth[j], 0, glen[j]);
    +
    200  for (k = 0; k < glen[j]; k++)
    +
    201  {
    +
    202  ifld[n] = ifld[n] + gref[j];
    +
    203  n = n + 1;
    +
    204  }
    +
    205  }
    +
    206  else
    +
    207  {
    +
    208  for (l = n; l < n + glen[j]; l++)
    +
    209  ifld[l] = gref[j];
    +
    210  n = n + glen[j];
    +
    211  }
    +
    212  iofst = iofst + (gwidth[j] * glen[j]);
    +
    213  }
    +
    214  }
    +
    215  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
    +
    216  {
    +
    217  /* missing values included */
    +
    218  ifldmiss = malloc(ndpts * sizeof(g2int));
    +
    219  for (j = 0; j < ndpts; j++)
    +
    220  ifldmiss[j] = 0;
    +
    221  n = 0;
    +
    222  non = 0;
    +
    223  for (j = 0; j < ngroups; j++)
    +
    224  {
    +
    225  if (gwidth[j] != 0)
    +
    226  {
    +
    227  msng1 = (g2int)int_power(2.0, gwidth[j]) - 1;
    +
    228  msng2 = msng1 - 1;
    +
    229  gbits(cpack, ifld + n, iofst, gwidth[j], 0, glen[j]);
    +
    230  iofst = iofst + (gwidth[j] * glen[j]);
    +
    231  for (k = 0; k < glen[j]; k++)
    +
    232  {
    +
    233  if (ifld[n] == msng1)
    +
    234  ifldmiss[n] = 1;
    +
    235  else if (idrstmpl[6] == 2 && ifld[n] == msng2)
    +
    236  ifldmiss[n] = 2;
    +
    237  else {
    +
    238  ifldmiss[n] = 0;
    +
    239  ifld[non++] = ifld[n] + gref[j];
    +
    240  }
    +
    241  n++;
    +
    242  }
    +
    243  }
    +
    244  else
    +
    245  {
    +
    246  msng1 = (g2int)int_power(2.0, nbitsgref) -1;
    +
    247  msng2 = msng1 - 1;
    +
    248  if (gref[j] == msng1)
    +
    249  {
    +
    250  for (l = n; l < n + glen[j]; l++)
    +
    251  ifldmiss[l] = 1;
    +
    252  }
    +
    253  else if (idrstmpl[6] == 2 && gref[j] == msng2)
    +
    254  {
    +
    255  for (l = n; l < n + glen[j]; l++)
    +
    256  ifldmiss[l] = 2;
    +
    257  }
    +
    258  else
    +
    259  {
    +
    260  for (l = n; l < n + glen[j]; l++)
    +
    261  ifldmiss[l] = 0;
    +
    262  for (l = non; l < non + glen[j]; l++)
    +
    263  ifld[l] = gref[j];
    +
    264  non += glen[j];
    +
    265  }
    +
    266  n = n + glen[j];
    +
    267  }
    +
    268  }
    +
    269  }
    +
    270 
    +
    271  if (gref)
    +
    272  free(gref);
    +
    273  if (gwidth)
    +
    274  free(gwidth);
    +
    275  if (glen)
    +
    276  free(glen);
    +
    277 
    +
    278  /* If using spatial differences, add overall min value, and sum up recursively */
    +
    279  if (idrsnum == 3)
    +
    280  { /* spatial differencing */
    +
    281  if (idrstmpl[16] == 1)
    +
    282  { /* first order */
    +
    283  ifld[0] = ival1;
    +
    284  if (idrstmpl[6] == 0)
    +
    285  itemp = ndpts; /* no missing values */
    +
    286  else
    +
    287  itemp = non;
    +
    288  for (n = 1; n < itemp; n++)
    +
    289  {
    +
    290  ifld[n] = ifld[n] + minsd;
    +
    291  ifld[n] = ifld[n] + ifld[n - 1];
    +
    292  }
    +
    293  }
    +
    294  else if (idrstmpl[16] == 2)
    +
    295  { /* second order */
    +
    296  ifld[0] = ival1;
    +
    297  ifld[1] = ival2;
    +
    298  if (idrstmpl[6] == 0)
    +
    299  itemp = ndpts; /* no missing values */
    +
    300  else
    +
    301  itemp = non;
    +
    302  for (n = 2; n < itemp; n++)
    +
    303  {
    +
    304  ifld[n] = ifld[n] + minsd;
    +
    305  ifld[n] = ifld[n] + (2 * ifld[n - 1]) - ifld[n - 2];
    +
    306  }
    +
    307  }
    +
    308  }
    +
    309 
    +
    310  /* Scale data back to original form */
    +
    311  if (idrstmpl[6] == 0)
    +
    312  { /* no missing values */
    +
    313  for (n = 0; n <ndpts; n++)
    +
    314  {
    +
    315  fld[n] = (((g2float)ifld[n] * bscale) + ref) * dscale;
    +
    316  }
    +
    317  }
    +
    318  else if (idrstmpl[6] == 1 || idrstmpl[6] == 2)
    +
    319  {
    +
    320  /* missing values included */
    +
    321  non = 0;
    +
    322  for (n = 0; n < ndpts; n++)
    +
    323  {
    +
    324  if (ifldmiss[n] == 0)
    +
    325  {
    +
    326  fld[n] = (((g2float)ifld[non++] * bscale) + ref) * dscale;
    +
    327  }
    +
    328  else if (ifldmiss[n] == 1)
    +
    329  fld[n] = rmiss1;
    +
    330  else if (ifldmiss[n] == 2)
    +
    331  fld[n] = rmiss2;
    +
    332  }
    +
    333  if (ifldmiss)
    +
    334  free(ifldmiss);
    +
    335  }
    +
    336 
    +
    337  if (ifld)
    +
    338  free(ifld);
    +
    339 
    +
    340  return 0;
    +
    341 }
    +
    int comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld)
    This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in ...
    Definition: comunpack.c:42
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.html b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.html new file mode 100644 index 00000000..1d54807f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.html @@ -0,0 +1,183 @@ + + + + + + + +NCEPLIBS-g2c: dec_jpeg2000.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    dec_jpeg2000.c File Reference
    +
    +
    + +

    Decodes JPEG2000 code stream. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include "grib2.h"
    +#include "jasper/jasper.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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 written by the University of British Columbia and Image Power Inc, and others. More...
     
    +

    Detailed Description

    +

    Decodes JPEG2000 code stream.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition in file dec_jpeg2000.c.

    +

    Function Documentation

    + +

    ◆ dec_jpeg2000()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dec_jpeg2000 (char * injpc,
    g2int bufsize,
    g2intoutfld 
    )
    +
    + +

    This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software written by the University of British Columbia and Image Power Inc, and others.

    +

    JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.

    +
    Parameters
    + + + + +
    injpcInput JPEG2000 code stream.
    bufsizeLength (in bytes) of the input JPEG2000 code stream.
    outfldOutput matrix of grayscale image values.
    +
    +
    +
    Returns
      +
    • 0 Successful decode
    • +
    • -3 Error decode jpeg2000 code stream.
    • +
    • -5 decoded image had multiple color components. Only grayscale is expected.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition at line 42 of file dec_jpeg2000.c.

    + +

    Referenced by jpcunpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.js b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.js new file mode 100644 index 00000000..f55c036e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c.js @@ -0,0 +1,5 @@ +var dec__jpeg2000_8c = +[ + [ "JAS_1_700_2", "dec__jpeg2000_8c.html#a61429602b0de9ba46b443e66a2c1d8cb", null ], + [ "dec_jpeg2000", "dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c_source.html b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c_source.html new file mode 100644 index 00000000..5dea5208 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__jpeg2000_8c_source.html @@ -0,0 +1,193 @@ + + + + + + + +NCEPLIBS-g2c: dec_jpeg2000.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    dec_jpeg2000.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #ifndef USE_JPEG2000
    +
    12 void dummy(void) {}
    +
    13 #else /* USE_JPEG2000 */
    +
    14 
    +
    15 #include <stdio.h>
    +
    16 #include <stdlib.h>
    +
    17 #include <string.h>
    +
    18 #include "grib2.h"
    +
    19 #include "jasper/jasper.h"
    +
    20 #define JAS_1_700_2
    +
    21 
    +
    41 int
    +
    42 dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
    +
    43 {
    +
    44  g2int i, j, k;
    +
    45  jas_image_t *image = NULL;
    +
    46  jas_stream_t *jpcstream;
    +
    47  jas_image_cmpt_t *pcmpt;
    +
    48  char *opts = NULL;
    +
    49  jas_matrix_t *data;
    +
    50 
    +
    51  /* Create jas_stream_t containing input JPEG200 codestream in
    +
    52  * memory. */
    +
    53  jpcstream = jas_stream_memopen(injpc, bufsize);
    +
    54 
    +
    55  /* Decode JPEG200 codestream into jas_image_t structure. */
    +
    56  if (!(image = jpc_decode(jpcstream, opts)))
    +
    57  {
    +
    58  printf(" jpc_decode return\n");
    +
    59  return -3;
    +
    60  }
    +
    61 
    +
    62  pcmpt = image->cmpts_[0];
    +
    63  /*
    +
    64  printf(" SAGOUT DECODE:\n");
    +
    65  printf(" tlx %d \n", image->tlx_);
    +
    66  printf(" tly %d \n", image->tly_);
    +
    67  printf(" brx %d \n", image->brx_);
    +
    68  printf(" bry %d \n", image->bry_);
    +
    69  printf(" numcmpts %d \n", image->numcmpts_);
    +
    70  printf(" maxcmpts %d \n", image->maxcmpts_);
    +
    71  #ifdef JAS_1_500_4
    +
    72  printf(" colormodel %d \n", image->colormodel_);
    +
    73  #endif
    +
    74  #ifdef JAS_1_700_2
    +
    75  printf(" colorspace %d \n", image->clrspc_);
    +
    76  #endif
    +
    77  printf(" inmem %d \n", image->inmem_);
    +
    78  printf(" COMPONENT:\n");
    +
    79  printf(" tlx %d \n", pcmpt->tlx_);
    +
    80  printf(" tly %d \n", pcmpt->tly_);
    +
    81  printf(" hstep %d \n", pcmpt->hstep_);
    +
    82  printf(" vstep %d \n", pcmpt->vstep_);
    +
    83  printf(" width %d \n", pcmpt->width_);
    +
    84  printf(" height %d \n", pcmpt->height_);
    +
    85  printf(" prec %d \n", pcmpt->prec_);
    +
    86  printf(" sgnd %d \n", pcmpt->sgnd_);
    +
    87  printf(" cps %d \n", pcmpt->cps_);
    +
    88  #ifdef JAS_1_700_2
    +
    89  printf(" type %d \n", pcmpt->type_);
    +
    90  #endif
    +
    91  */
    +
    92 
    +
    93  /* Expecting jpeg2000 image to be grayscale only. No color components. */
    +
    94  if (image->numcmpts_ != 1)
    +
    95  {
    +
    96  printf("dec_jpeg2000: Found color image. Grayscale expected.\n");
    +
    97  return (-5);
    +
    98  }
    +
    99 
    +
    100  /* Create a data matrix of grayscale image values decoded from the
    +
    101  * jpeg2000 codestream. */
    +
    102  data = jas_matrix_create(jas_image_height(image), jas_image_width(image));
    +
    103  jas_image_readcmpt(image, 0, 0, 0, jas_image_width(image),
    +
    104  jas_image_height(image), data);
    +
    105 
    +
    106  /* Copy data matrix to output integer array. */
    +
    107  k = 0;
    +
    108  for (i = 0; i < pcmpt->height_; i++)
    +
    109  for (j = 0; j < pcmpt->width_; j++)
    +
    110  outfld[k++] = data->rows_[i][j];
    +
    111 
    +
    112  /* Clean up JasPer work structures. */
    +
    113  jas_matrix_destroy(data);
    +
    114  jas_stream_close(jpcstream);
    +
    115  jas_image_destroy(image);
    +
    116 
    +
    117  return 0;
    +
    118 }
    +
    119 #endif /* USE_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....
    Definition: dec_jpeg2000.c:42
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dec__png_8c.html b/ver-1.7.0/ver-1.6.4/dec__png_8c.html new file mode 100644 index 00000000..cbf8f529 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__png_8c.html @@ -0,0 +1,261 @@ + + + + + + + +NCEPLIBS-g2c: dec_png.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    dec_png.c File Reference
    +
    +
    + +

    PNG functions. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <png.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Typedefs

    typedef struct png_stream png_stream
     Typedef for PNG stream. More...
     
    + + + + + + + +

    +Functions

    int dec_png (unsigned char *pngbuf, g2int *width, g2int *height, char *cout)
     Decode PNG. More...
     
    void user_read_data (png_structp png_ptr, png_bytep data, png_uint_32 length)
     Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk. More...
     
    +

    Detailed Description

    +

    PNG functions.

    +
    Author
    Stephen Gilbert
    + +

    Definition in file dec_png.c.

    +

    Typedef Documentation

    + +

    ◆ png_stream

    + +
    +
    + + + + +
    typedef struct png_stream png_stream
    +
    + +

    Typedef for PNG stream.

    + +

    Definition at line 1 of file dec_png.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ dec_png()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dec_png (unsigned char * pngbuf,
    g2intwidth,
    g2intheight,
    char * cout 
    )
    +
    + +

    Decode PNG.

    +
    Parameters
    + + + + + +
    pngbufPointer to PNG buffer.
    widthPointer to width.
    heightPointer to height.
    coutOutput buffer.
    +
    +
    +
    Returns
    0 for success, error code otherwise.
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 71 of file dec_png.c.

    + +

    References user_read_data().

    + +

    Referenced by pngunpack().

    + +
    +
    + +

    ◆ user_read_data()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_read_data (png_structp png_ptr,
    png_bytep data,
    png_uint_32 length 
    )
    +
    + +

    Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk.

    +
    Parameters
    + + + + +
    png_ptrPointer to PNG.
    dataPointer to data.
    lengthLength.
    +
    +
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 44 of file dec_png.c.

    + +

    Referenced by dec_png().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dec__png_8c.js b/ver-1.7.0/ver-1.6.4/dec__png_8c.js new file mode 100644 index 00000000..411d70f8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__png_8c.js @@ -0,0 +1,6 @@ +var dec__png_8c = +[ + [ "png_stream", "dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3", null ], + [ "dec_png", "dec__png_8c.html#a2d370c4ca9daeca099b249a1ed3e4500", null ], + [ "user_read_data", "dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/dec__png_8c_source.html b/ver-1.7.0/ver-1.6.4/dec__png_8c_source.html new file mode 100644 index 00000000..ef0a3960 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dec__png_8c_source.html @@ -0,0 +1,229 @@ + + + + + + + +NCEPLIBS-g2c: dec_png.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    dec_png.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #ifndef USE_PNG
    +
    12 void dummy(void) {}
    +
    13 #else /* USE_PNG */
    +
    14 
    +
    15 #include <stdio.h>
    +
    16 #include <stdlib.h>
    +
    17 #include <string.h>
    +
    18 #include <png.h>
    +
    19 #include "grib2.h"
    +
    20 
    +
    24 struct png_stream
    +
    25 {
    +
    26  unsigned char *stream_ptr;
    +
    27  g2int stream_len;
    +
    28 };
    +
    29 typedef struct png_stream png_stream;
    +
    31 void user_read_data(png_structp, png_bytep, png_uint_32);
    +
    32 
    +
    43 void
    +
    44 user_read_data(png_structp png_ptr, png_bytep data, png_uint_32 length)
    +
    45 {
    +
    46  char *ptr;
    +
    47  g2int offset;
    +
    48  png_stream *mem;
    +
    49 
    +
    50  mem = (png_stream *)png_get_io_ptr(png_ptr);
    +
    51  ptr = (void *)mem->stream_ptr;
    +
    52  offset = mem->stream_len;
    +
    53 /* printf("SAGrd %ld %ld %x\n",offset,length,ptr); */
    +
    54  memcpy(data, ptr + offset, length);
    +
    55  mem->stream_len += length;
    +
    56 }
    +
    57 
    +
    70 int
    +
    71 dec_png(unsigned char *pngbuf, g2int *width, g2int *height, char *cout)
    +
    72 {
    +
    73  int interlace, color, compres, filter, bit_depth;
    +
    74  g2int j, k, n, bytes, clen;
    +
    75  png_structp png_ptr;
    +
    76  png_infop info_ptr, end_info;
    +
    77  png_bytepp row_pointers;
    +
    78  png_stream read_io_ptr;
    +
    79  png_uint_32 h32, w32;
    +
    80 
    +
    81  /* Check if stream is a valid PNG format. */
    +
    82  if (png_sig_cmp(pngbuf, 0, 8) != 0)
    +
    83  return (-3);
    +
    84 
    +
    85  /* Create and initialize png_structs. */
    +
    86  if (!(png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
    +
    87  NULL, NULL)))
    +
    88  return (-1);
    +
    89 
    +
    90  if (!(info_ptr = png_create_info_struct(png_ptr)))
    +
    91  {
    +
    92  png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
    +
    93  return (-2);
    +
    94  }
    +
    95 
    +
    96  if (!(end_info = png_create_info_struct(png_ptr)))
    +
    97  {
    +
    98  png_destroy_read_struct(&png_ptr, (png_infopp)info_ptr, (png_infopp)NULL);
    +
    99  return (-2);
    +
    100  }
    +
    101 
    +
    102  /* Set Error callback. */
    +
    103  if (setjmp(png_jmpbuf(png_ptr)))
    +
    104  {
    +
    105  png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
    +
    106  return (-3);
    +
    107  }
    +
    108 
    +
    109  /* Initialize info for reading PNG stream from memory. */
    +
    110  read_io_ptr.stream_ptr = (png_voidp)pngbuf;
    +
    111  read_io_ptr.stream_len = 0;
    +
    112 
    +
    113  /* Set new custom read function. */
    +
    114  png_set_read_fn(png_ptr, (png_voidp)&read_io_ptr, (png_rw_ptr)user_read_data);
    +
    115 
    +
    116  /* Read and decode PNG stream. */
    +
    117  png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
    +
    118 
    +
    119  /* Get pointer to each row of image data. */
    +
    120  row_pointers = png_get_rows(png_ptr, info_ptr);
    +
    121 
    +
    122  /* Get image info, such as size, depth, colortype, etc... */
    +
    123  /*printf("SAGT:png %d %d %d\n", info_ptr->width, info_ptr->height, info_ptr->bit_depth);*/
    +
    124  // (void)png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *)width, (png_uint_32 *)height,
    +
    125  (void)png_get_IHDR(png_ptr, info_ptr, &w32, &h32,
    +
    126  &bit_depth, &color, &interlace, &compres, &filter);
    +
    127 
    +
    128  *height = h32;
    +
    129  *width = w32;
    +
    130 
    +
    131  /* Check if image was grayscale. */
    +
    132  /*
    +
    133  if (color != PNG_COLOR_TYPE_GRAY) {
    +
    134  fprintf(stderr, "dec_png: Grayscale image was expected. \n");
    +
    135  }
    +
    136  */
    +
    137  if (color == PNG_COLOR_TYPE_RGB)
    +
    138  bit_depth = 24;
    +
    139  else if (color == PNG_COLOR_TYPE_RGB_ALPHA)
    +
    140  bit_depth = 32;
    +
    141 
    +
    142  /* Copy image data to output string */
    +
    143  n = 0;
    +
    144  bytes = bit_depth / 8;
    +
    145  clen = (*width) * bytes;
    +
    146  for (j = 0; j < *height; j++)
    +
    147  {
    +
    148  for (k = 0; k < clen; k++)
    +
    149  {
    +
    150  cout[n] = *(row_pointers[j] + k);
    +
    151  n++;
    +
    152  }
    +
    153  }
    +
    154 
    +
    155  /* Clean up. */
    +
    156  png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
    +
    157  return 0;
    +
    158 }
    +
    159 
    +
    160 #endif /* USE_PNG */
    +
    int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, char *cout)
    Decode PNG.
    Definition: dec_png.c:71
    +
    struct png_stream png_stream
    Typedef for PNG stream.
    Definition: dec_png.c:29
    +
    void user_read_data(png_structp, png_bytep, png_uint_32)
    Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk...
    Definition: dec_png.c:44
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c.html b/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c.html new file mode 100644 index 00000000..51b73a85 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c.html @@ -0,0 +1,112 @@ + + + + + + + +NCEPLIBS-g2c: decenc_openjpeg.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    decenc_openjpeg.c File Reference
    +
    +
    + +

    JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c. +More...

    + +

    Go to the source code of this file.

    +

    Detailed Description

    +

    JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c.

    +

    Copyright 2005-2019 ECMWF.

    +

    This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.

    +

    In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.

    +
    Author
    ECMWF programmer
    + +

    Definition in file decenc_openjpeg.c.

    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c_source.html b/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c_source.html new file mode 100644 index 00000000..c950149c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/decenc__openjpeg_8c_source.html @@ -0,0 +1,431 @@ + + + + + + + +NCEPLIBS-g2c: decenc_openjpeg.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    decenc_openjpeg.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    19 #if !defined USE_JPEG2000 && defined USE_OPENJPEG
    +
    20 
    +
    21 #include "grib2.h"
    +
    22 #include "openjpeg.h"
    +
    23 
    +
    24 #include <assert.h>
    +
    25 #include <stdio.h>
    +
    26 #include <stdlib.h>
    +
    27 #include <string.h>
    +
    28 
    +
    37 static void openjpeg_warning(const char *msg, void *client_data)
    +
    38 {
    +
    39  (void)client_data;
    +
    40  fprintf(stderr,"openjpeg: %s",msg);
    +
    41 }
    +
    42 
    +
    51 static void openjpeg_error(const char *msg, void *client_data)
    +
    52 {
    +
    53  (void)client_data;
    +
    54  fprintf(stderr,"openjpeg: %s",msg);
    +
    55 }
    +
    56 
    +
    65 static void openjpeg_info(const char *msg, void *client_data)
    +
    66 {
    +
    67  (void)msg;
    +
    68  (void)client_data;
    +
    69  /* fprintf(stderr,"openjpeg: %s",msg); */
    +
    70 }
    +
    71 
    +
    72 /* opj_* Helper code from
    +
    73  * https://groups.google.com/forum/#!topic/openjpeg/8cebr0u7JgY
    +
    74  */
    +
    75 /* These routines are added to use memory instead of a file for input and output */
    +
    76 /* struct need to treat memory as a stream */
    +
    77 typedef struct
    +
    78 {
    +
    79  OPJ_UINT8* pData; /* our data */
    +
    80  OPJ_SIZE_T dataSize; /* how big is our data */
    +
    81  OPJ_SIZE_T offset; /* where we are currently in our data */
    +
    82 } opj_memory_stream;
    +
    83 
    +
    95 static OPJ_SIZE_T opj_memory_stream_read(void *buffer, OPJ_SIZE_T nb_bytes, void * p_user_data)
    +
    96 {
    +
    97  opj_memory_stream* mstream = (opj_memory_stream*) p_user_data; /* Our data */
    +
    98  OPJ_SIZE_T nb_bytes_read = nb_bytes; /* Amount to move to buffer */
    +
    99 
    +
    100  /* Check if the current offset is outside our data buffer */
    +
    101  if (mstream->offset >= mstream->dataSize)
    +
    102  return (OPJ_SIZE_T) -1;
    +
    103 
    +
    104  /* Check if we are reading more than we have */
    +
    105  if (nb_bytes > (mstream->dataSize - mstream->offset))
    +
    106  nb_bytes_read = mstream->dataSize - mstream->offset;
    +
    107 
    +
    108  memcpy(buffer, &(mstream->pData[mstream->offset]), nb_bytes_read);
    +
    109  mstream->offset += nb_bytes_read; /* Update the pointer to the new location */
    +
    110  return nb_bytes_read;
    +
    111 }
    +
    112 
    +
    124 static OPJ_SIZE_T opj_memory_stream_write(void *buffer, OPJ_SIZE_T nb_bytes, void *user_data)
    +
    125 {
    +
    126  opj_memory_stream* mstream = (opj_memory_stream*) user_data; /* our data */
    +
    127  OPJ_SIZE_T nb_bytes_write = nb_bytes; /* Amount to move to buffer */
    +
    128 
    +
    129  /* Check if the current offset is outside our data buffer */
    +
    130  if (mstream->offset >= mstream->dataSize)
    +
    131  return (OPJ_SIZE_T)-1;
    +
    132 
    +
    133  /* Check if we are writing more than we have space for */
    +
    134  if (nb_bytes > (mstream->dataSize - mstream->offset))
    +
    135  nb_bytes_write = mstream->dataSize - mstream->offset;
    +
    136 
    +
    137  /* Copy the data from the internal buffer */
    +
    138  memcpy(&(mstream->pData[mstream->offset]), buffer, nb_bytes_write);
    +
    139  mstream->offset += nb_bytes_write; /* Update the pointer to the new location */
    +
    140  return nb_bytes_write;
    +
    141 }
    +
    142 
    +
    153 static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void *user_data)
    +
    154 {
    +
    155  opj_memory_stream* mstream = (opj_memory_stream*) user_data;
    +
    156  OPJ_SIZE_T l_nb_bytes;
    +
    157 
    +
    158  if (nb_bytes < 0)
    +
    159  return -1; /* No skipping backwards */
    +
    160  l_nb_bytes = (OPJ_SIZE_T) nb_bytes; /* Allowed because it is positive */
    +
    161  /* Do not allow jumping past the end */
    +
    162  if (l_nb_bytes > mstream->dataSize - mstream->offset)
    +
    163  l_nb_bytes = mstream->dataSize - mstream->offset;
    +
    164  mstream->offset += l_nb_bytes;
    +
    165  return (OPJ_OFF_T)l_nb_bytes; /* Return how far we jumped */
    +
    166 }
    +
    167 
    +
    178 static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T nb_bytes, void * user_data)
    +
    179 {
    +
    180  opj_memory_stream* mstream = (opj_memory_stream*) user_data;
    +
    181 
    +
    182  if (nb_bytes < 0)
    +
    183  return OPJ_FALSE; /* Not before the buffer */
    +
    184  if (nb_bytes >(OPJ_OFF_T) mstream->dataSize)
    +
    185  return OPJ_FALSE; /* Not after the buffer */
    +
    186  mstream->offset = (OPJ_SIZE_T) nb_bytes; /* Move to new position */
    +
    187  return OPJ_TRUE;
    +
    188 }
    +
    189 
    +
    197 static void opj_memory_stream_do_nothing(void * p_user_data)
    +
    198 {
    +
    199  OPJ_ARG_NOT_USED(p_user_data);
    +
    200 }
    +
    201 
    +
    212 static opj_stream_t* opj_stream_create_default_memory_stream(opj_memory_stream* memoryStream, OPJ_BOOL is_read_stream)
    +
    213 {
    +
    214  opj_stream_t* stream;
    +
    215 
    +
    216  if (!(stream = opj_stream_default_create(is_read_stream)))
    +
    217  return (NULL);
    +
    218  /* Set how to work with the frame buffer */
    +
    219  if (is_read_stream)
    +
    220  opj_stream_set_read_function(stream, opj_memory_stream_read);
    +
    221  else
    +
    222  opj_stream_set_write_function(stream, opj_memory_stream_write);
    +
    223 
    +
    224  opj_stream_set_seek_function(stream, opj_memory_stream_seek);
    +
    225  opj_stream_set_skip_function(stream, opj_memory_stream_skip);
    +
    226  opj_stream_set_user_data(stream, memoryStream, opj_memory_stream_do_nothing);
    +
    227  opj_stream_set_user_data_length(stream, memoryStream->dataSize);
    +
    228  return stream;
    +
    229 }
    +
    230 
    +
    252 int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
    +
    253 {
    +
    254  int iret = 0;
    +
    255  OPJ_INT32 mask;
    +
    256 
    +
    257  opj_stream_t *stream = NULL;
    +
    258  opj_image_t *image = NULL;
    +
    259  opj_codec_t *codec = NULL;
    +
    260 
    +
    261  /* set decoding parameters to default values */
    +
    262  opj_dparameters_t parameters = {0,}; /* decompression parameters */
    +
    263  opj_set_default_decoder_parameters(&parameters);
    +
    264  parameters.decod_format = 1; /* JP2_FMT */
    +
    265 
    +
    266  /* JPEG-2000 codestream */
    +
    267 #define DUMP_JPEG_STREAM
    +
    268 #ifdef DUMP_JPEG_STREAM
    +
    269  FILE *fp=fopen("dump_openjpeg.j2k", "wb");
    +
    270  fwrite(injpc, 1, (size_t)bufsize, fp);
    +
    271  fclose(fp);
    +
    272 #endif
    +
    273 
    +
    274  /* get a decoder handle */
    +
    275  codec = opj_create_decompress(OPJ_CODEC_J2K);
    +
    276 
    +
    277  /* catch events using our callbacks */
    +
    278  opj_set_info_handler(codec, openjpeg_info, NULL);
    +
    279  opj_set_warning_handler(codec, openjpeg_warning, NULL);
    +
    280  opj_set_error_handler(codec, openjpeg_error,NULL);
    +
    281 
    +
    282  /* initialize our memory stream */
    +
    283  opj_memory_stream mstream;
    +
    284  mstream.pData = (OPJ_UINT8 *)injpc;
    +
    285  mstream.dataSize = (OPJ_SIZE_T)bufsize;
    +
    286  mstream.offset = 0;
    +
    287  /* open a byte stream from memory stream */
    +
    288  stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_READ);
    +
    289 
    +
    290  /* setup the decoder decoding parameters using user parameters */
    +
    291  if (!opj_setup_decoder(codec, &parameters)) {
    +
    292  fprintf(stderr,"openjpeg: failed to setup decoder");
    +
    293  iret = -3;
    +
    294  goto cleanup;
    +
    295  }
    +
    296  if (!opj_read_header(stream, codec, &image)) {
    +
    297  fprintf(stderr,"openjpeg: failed to read the header");
    +
    298  iret = -3;
    +
    299  goto cleanup;
    +
    300  }
    +
    301  if (!opj_decode(codec, stream, image)) {
    +
    302  fprintf(stderr,"openjpeg: failed to decode");
    +
    303  iret = -3;
    +
    304  goto cleanup;
    +
    305  }
    +
    306 
    +
    307  if ( (image->numcomps != 1) || (image->x1 * image->y1)==0 ) {
    +
    308  iret = -3;
    +
    309  goto cleanup;
    +
    310  }
    +
    311 
    +
    312  assert(image->comps[0].sgnd == 0);
    +
    313  assert(image->comps[0].prec < sizeof(mask)*8-1);
    +
    314 
    +
    315  mask = (1 << image->comps[0].prec) - 1;
    +
    316 
    +
    317  for(unsigned int i = 0; i < image->comps[0].w * image->comps[0].h ; i++)
    +
    318  outfld[i] = (g2int) (image->comps[0].data[i] & mask);
    +
    319 
    +
    320  if (!opj_end_decompress(codec, stream)) {
    +
    321  fprintf(stderr,"openjpeg: failed in opj_end_decompress");
    +
    322  iret = -3;
    +
    323  }
    +
    324 
    +
    325 cleanup:
    +
    326  /* close the byte stream */
    +
    327  if (codec) opj_destroy_codec(codec);
    +
    328  if (stream) opj_stream_destroy(stream);
    +
    329  if (image) opj_image_destroy(image);
    +
    330 
    +
    331  return iret;
    +
    332 }
    +
    333 
    +
    367 int enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
    +
    368  g2int ltype, g2int ratio, g2int retry, char *outjpc,
    +
    369  g2int jpclen)
    +
    370 {
    +
    371  (void) retry;
    +
    372  int iret = 0;
    +
    373  const int numcomps = 1;
    +
    374 
    +
    375  opj_codec_t *codec = NULL;
    +
    376  opj_image_t *image = NULL;
    +
    377  opj_stream_t *stream = NULL;
    +
    378 
    +
    379  /* set encoding parameters to default values */
    +
    380  opj_cparameters_t parameters = {0,}; /* compression parameters */
    +
    381  opj_set_default_encoder_parameters(&parameters);
    +
    382 
    +
    383  parameters.tcp_numlayers = 1;
    +
    384  parameters.cp_disto_alloc = 1;
    +
    385  if (ltype == 1) {
    +
    386  assert(ratio != 255);
    +
    387  parameters.tcp_rates[0] = 1.0f/(float)ratio;
    +
    388  }
    +
    389 
    +
    390  /* By default numresolution = 6 (must be between 1 and 32)
    +
    391  * This may be too large for some of our datasets, eg. 1xn, so adjust ...
    +
    392  */
    +
    393  parameters.numresolution = 6;
    +
    394  while ( (width < (1 << (parameters.numresolution - 1)) ) ||
    +
    395  (height < (1 << (parameters.numresolution - 1)) ))
    +
    396  {
    +
    397  parameters.numresolution--;
    +
    398  }
    +
    399 
    +
    400  /* initialize image component */
    +
    401  opj_image_cmptparm_t cmptparm = {0,};
    +
    402  cmptparm.prec = (OPJ_UINT32)nbits;
    +
    403  cmptparm.bpp = (OPJ_UINT32)nbits;
    +
    404  cmptparm.sgnd = 0;
    +
    405  cmptparm.dx = 1;
    +
    406  cmptparm.dy = 1;
    +
    407  cmptparm.w = (OPJ_UINT32)width;
    +
    408  cmptparm.h = (OPJ_UINT32)height;
    +
    409 
    +
    410  /* create the image */
    +
    411  image = opj_image_create(numcomps, &cmptparm, OPJ_CLRSPC_GRAY);
    +
    412  if(!image) {
    +
    413  iret = -3;
    +
    414  goto cleanup;
    +
    415  }
    +
    416  image->x0 = 0;
    +
    417  image->y0 = 0;
    +
    418  image->x1 = (OPJ_UINT32)width;
    +
    419  image->y1 = (OPJ_UINT32)height;
    +
    420 
    +
    421  assert(cmptparm.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */
    +
    422 
    +
    423  /* Simple packing */
    +
    424  for(int i=0; i< width*height; i++){
    +
    425  image->comps[0].data[i] = cin[i];
    +
    426  }
    +
    427 
    +
    428  /* get a J2K compressor handle */
    +
    429  codec = opj_create_compress(OPJ_CODEC_J2K);
    +
    430 
    +
    431  opj_set_info_handler(codec, openjpeg_info, NULL);
    +
    432  opj_set_warning_handler(codec, openjpeg_warning, NULL);
    +
    433  opj_set_error_handler(codec, openjpeg_error,NULL);
    +
    434 
    +
    435  /* setup the encoder parameters using the current image and user parameters */
    +
    436  if (!opj_setup_encoder(codec, &parameters, image)) {
    +
    437  fprintf(stderr,"openjpeg: failed to setup encoder");
    +
    438  iret = -3;
    +
    439  goto cleanup;
    +
    440  }
    +
    441 
    +
    442  /* open a byte stream for writing */
    +
    443  opj_memory_stream mstream;
    +
    444  mstream.pData = (OPJ_UINT8*) outjpc;
    +
    445  mstream.offset = 0;
    +
    446  mstream.dataSize = (OPJ_SIZE_T)jpclen;
    +
    447  stream = opj_stream_create_default_memory_stream(&mstream, OPJ_STREAM_WRITE);
    +
    448  if (stream == NULL) {
    +
    449  fprintf(stderr,"openjpeg: failed create default memory stream");
    +
    450  iret = -3;
    +
    451  goto cleanup;
    +
    452  }
    +
    453 
    +
    454  if (!opj_start_compress(codec, image, stream)) {
    +
    455  fprintf(stderr,"openjpeg: failed to setup encoder");
    +
    456  iret = -3;
    +
    457  goto cleanup;
    +
    458  }
    +
    459 
    +
    460  /* encode image */
    +
    461  if (!opj_encode(codec, stream)) {
    +
    462  fprintf(stderr,"openjpeg: opj_encode failed");
    +
    463  iret = -3;
    +
    464  goto cleanup;
    +
    465  }
    +
    466 
    +
    467  if (!opj_end_compress(codec, stream)) {
    +
    468  fprintf(stderr,"openjpeg: opj_end_compress failed");
    +
    469  iret = -3;
    +
    470  goto cleanup;
    +
    471  }
    +
    472  iret = (int)mstream.offset;
    +
    473 
    +
    474 cleanup:
    +
    475  if (codec) opj_destroy_codec(codec);
    +
    476  if (stream) opj_stream_destroy(stream);
    +
    477  if (image) opj_image_destroy(image);
    +
    478 
    +
    479  return iret;
    +
    480 }
    +
    481 
    +
    482 #endif
    +
    int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
    This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
    Definition: dec_jpeg2000.c:42
    +
    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 ...
    Definition: enc_jpeg2000.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dir_1120c50dc01af8bc3323139f424a1f58.html b/ver-1.7.0/ver-1.6.4/dir_1120c50dc01af8bc3323139f424a1f58.html new file mode 100644 index 00000000..96ce7c68 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dir_1120c50dc01af8bc3323139f424a1f58.html @@ -0,0 +1,106 @@ + + + + + + + +NCEPLIBS-g2c: src Directory Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    src Directory Reference
    +
    +
    + + + + + +

    +Files

    file  grib2.h [code]
     Header file for NCEPLIBS-g2c library.
     
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dir_49e56c817e5e54854c35e136979f97ca.html b/ver-1.7.0/ver-1.6.4/dir_49e56c817e5e54854c35e136979f97ca.html new file mode 100644 index 00000000..864b20de --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dir_49e56c817e5e54854c35e136979f97ca.html @@ -0,0 +1,99 @@ + + + + + + + +NCEPLIBS-g2c: docs Directory Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    docs Directory Reference
    +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/ver-1.7.0/ver-1.6.4/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 00000000..fefd079a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,244 @@ + + + + + + + +NCEPLIBS-g2c: src Directory Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    src Directory Reference
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Files

    file  cmplxpack.c [code]
     Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
     
    file  compack.c [code]
     Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
     
    file  comunpack.c [code]
     Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.
     
    file  dec_jpeg2000.c [code]
     Decodes JPEG2000 code stream.
     
    file  dec_png.c [code]
     PNG functions.
     
    file  decenc_openjpeg.c [code]
     JPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c.
     
    file  drstemplates.c [code]
     Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion.
     
    file  drstemplates.h [code]
     This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS).
     
    file  enc_jpeg2000.c [code]
     Encodes JPEG2000 code stream.
     
    file  enc_png.c [code]
     Functions for dealing with PNG.
     
    file  g2_addfield.c [code]
     Pack up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
     
    file  g2_addgrid.c [code]
     Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
     
    file  g2_addlocal.c [code]
     Add a Local Use Section (Section 2) to a GRIB2 message.
     
    file  g2_create.c [code]
     Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
     
    file  g2_free.c [code]
     Free up memory that was allocated for struct gribfield.
     
    file  g2_getfld.c [code]
     Return all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field.
     
    file  g2_gribend.c [code]
     Finalize a GRIB2 message after all grids and fields have been added.
     
    file  g2_info.c [code]
     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.
     
    file  g2_miss.c [code]
     Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field.
     
    file  g2_unpack1.c [code]
     Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.
     
    file  g2_unpack2.c [code]
     Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2.
     
    file  g2_unpack3.c [code]
     Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
     
    file  g2_unpack4.c [code]
     Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2.
     
    file  g2_unpack5.c [code]
     Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2.
     
    file  g2_unpack6.c [code]
     Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
     
    file  g2_unpack7.c [code]
     Unpack Section 7 (Data Section) as defined in GRIB Edition 2.
     
    file  gbits.c [code]
     Functions to pack and unpack bits to/from a packed bit string.
     
    file  getdim.c [code]
     Return the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.
     
    file  getpoly.c [code]
     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.
     
    file  gridtemplates.c [code]
     Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).
     
    file  gridtemplates.h [code]
     This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).
     
    file  int_power.c [code]
     Provide function similar to C pow() power function.
     
    file  jpcpack.c [code]
     Pack up a data field into a JPEG2000 code stream.
     
    file  jpcunpack.c [code]
     Unpack a data field that was packed into a JPEG2000 code stream.
     
    file  misspack.c [code]
     Pack up a data field using a complex packing algorithm as defined in the GRIB2 documention.
     
    file  mkieee.c [code]
     
    file  pack_gp.c [code]
     
    file  pdstemplates.c [code]
     Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS).
     
    file  pdstemplates.h [code]
     This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml).
     
    file  pngpack.c [code]
     Function to pack data with PNG compression.
     
    file  pngunpack.c [code]
     Contains a function to unpack data packed with PNG compression.
     
    file  rdieee.c [code]
     Read a list of real values in 32-bit IEEE floating point format.
     
    file  reduce.c [code]
     Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.
     
    file  seekgb.c [code]
     Searches a file for the next GRIB message.
     
    file  simpack.c [code]
     Pack up a data field using the simple packing algorithm.
     
    file  simunpack.c [code]
     
    file  specpack.c [code]
     Pack a spectral data field using the complex packing algorithm for spherical harmonic data.
     
    file  specunpack.c [code]
     Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data.
     
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/doc.png b/ver-1.7.0/ver-1.6.4/doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/doc.png differ diff --git a/ver-1.7.0/ver-1.6.4/doxygen.css b/ver-1.7.0/ver-1.6.4/doxygen.css new file mode 100644 index 00000000..ffbff022 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/doxygen.css @@ -0,0 +1,1793 @@ +/* The standard CSS for doxygen 1.9.1 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + border-right: 1px solid #A3B4D7; + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: #A0A0A0; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.odd { + background-color: #F8F9FC; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +.contents a.qindexHL:visited { + color: #FFFFFF; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #FFFFFF; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +blockquote.DocNodeRTL { + border-left: 0; + border-right: 2px solid #9CAFD4; + margin: 0 4px 0 24px; + padding: 0 16px 0 12px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.section.DocNodeRTL { + margin-right: 0px; + padding-right: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.note.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.deprecated.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.todo.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.test.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.bug.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +.PageDocRTL-title div.toc { + float: left !important; + text-align: right; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +.PageDocRTL-title div.toc li { + background-position-x: right !important; + padding-left: 0 !important; + padding-right: 10px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +.PageDocRTL-title div.toc li.level1 { + margin-left: 0 !important; + margin-right: 0; +} + +.PageDocRTL-title div.toc li.level2 { + margin-left: 0 !important; + margin-right: 15px; +} + +.PageDocRTL-title div.toc li.level3 { + margin-left: 0 !important; + margin-right: 30px; +} + +.PageDocRTL-title div.toc li.level4 { + margin-left: 0 !important; + margin-right: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +.DocNodeRTL { + text-align: right; + direction: rtl; +} + +.DocNodeLTR { + text-align: left; + direction: ltr; +} + +table.DocNodeRTL { + width: auto; + margin-right: 0; + margin-left: auto; +} + +table.DocNodeLTR { + width: auto; + margin-right: auto; + margin-left: 0; +} + +tt, code, kbd, samp +{ + display: inline-block; + direction:ltr; +} +/* @end */ + +u { + text-decoration: underline; +} + diff --git a/ver-1.7.0/ver-1.6.4/doxygen.svg b/ver-1.7.0/ver-1.6.4/doxygen.svg new file mode 100644 index 00000000..d42dad52 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8c.html b/ver-1.7.0/ver-1.6.4/drstemplates_8c.html new file mode 100644 index 00000000..2fa4e491 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8c.html @@ -0,0 +1,257 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    drstemplates.c File Reference
    +
    +
    + +

    Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion. +More...

    +
    #include <stdlib.h>
    +#include "grib2.h"
    +#include "drstemplates.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    gtemplateextdrstemplate (g2int number, g2int *list)
     This subroutine generates the remaining octet map for a given Data Representation Template, if required. More...
     
    g2int getdrsindex (g2int number)
     This function returns the index of specified Data Representation Template. More...
     
    gtemplategetdrstemplate (g2int number)
     This subroutine returns DRS template information for a specified Data Representation Template. More...
     
    +

    Detailed Description

    +

    Functions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion.

    +

    +Program History Log

    + + + + + + + +
    Date Programmer Comments
    2001-06-28 Gilbert Initial
    2009-01-14 Vuong Changed structure name template to gtemplate
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition in file drstemplates.c.

    +

    Function Documentation

    + +

    ◆ extdrstemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extdrstemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numberThe number of the Data Representation Template that is being requested.
    listThe 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 110 of file drstemplates.c.

    + +

    References getdrsindex(), and getdrstemplate().

    + +

    Referenced by g2_unpack5().

    + +
    +
    + +

    ◆ getdrsindex()

    + +
    +
    + + + + + + + + +
    g2int getdrsindex (g2int number)
    +
    + +

    This function returns the index of specified Data Representation Template.

    +
    Parameters
    + + +
    numberThe number of the Data Representation Template that is being requested.
    +
    +
    +
    Returns
    Index of the DRT in array gtemplates, if it exists. -1, otherwise.
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition at line 32 of file drstemplates.c.

    + +

    References MAXDRSTEMP, and templatesdrs.

    + +

    Referenced by extdrstemplate(), and getdrstemplate().

    + +
    +
    + +

    ◆ getdrstemplate()

    + +
    +
    + + + + + + + + +
    gtemplate* getdrstemplate (g2int number)
    +
    + +

    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
    + + +
    numberThe 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 64 of file drstemplates.c.

    + +

    References getdrsindex(), drstemplate::mapdrslen, drstemplate::needext, drstemplate::template_num, and templatesdrs.

    + +

    Referenced by extdrstemplate(), g2_addfield(), and g2_unpack5().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8c.js b/ver-1.7.0/ver-1.6.4/drstemplates_8c.js new file mode 100644 index 00000000..4665c403 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8c.js @@ -0,0 +1,6 @@ +var drstemplates_8c = +[ + [ "extdrstemplate", "drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c", null ], + [ "getdrsindex", "drstemplates_8c.html#a6a9ca8f896b19b546743be48393c8330", null ], + [ "getdrstemplate", "drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8c_source.html b/ver-1.7.0/ver-1.6.4/drstemplates_8c_source.html new file mode 100644 index 00000000..5e711784 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8c_source.html @@ -0,0 +1,188 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    drstemplates.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    15 #include <stdlib.h>
    +
    16 #include "grib2.h"
    +
    17 #include "drstemplates.h"
    +
    18 
    +
    31 g2int
    + +
    33 {
    +
    34  g2int j, getdrsindex = -1;
    +
    35 
    +
    36  for (j = 0; j < MAXDRSTEMP; j++)
    +
    37  {
    +
    38  if (number == templatesdrs[j].template_num)
    +
    39  {
    +
    40  getdrsindex = j;
    +
    41  return(getdrsindex);
    +
    42  }
    +
    43  }
    +
    44 
    +
    45  return(getdrsindex);
    +
    46 }
    +
    47 
    +
    63 gtemplate *
    + +
    65 {
    +
    66  g2int index;
    +
    67  gtemplate *new;
    +
    68 
    +
    69  index = getdrsindex(number);
    +
    70 
    +
    71  if (index != -1)
    +
    72  {
    +
    73  new = malloc(sizeof(gtemplate));
    +
    74  new->type = 5;
    +
    75  new->num = templatesdrs[index].template_num;
    +
    76  new->maplen = templatesdrs[index].mapdrslen;
    +
    77  new->needext = templatesdrs[index].needext;
    +
    78  new->map = (g2int *)templatesdrs[index].mapdrs;
    +
    79  new->extlen = 0;
    +
    80  new->ext = NULL;
    +
    81  return(new);
    +
    82  }
    +
    83  else
    +
    84  {
    +
    85  printf("getdrstemplate: DRS Template 5.%d not defined.\n", (int)number);
    +
    86  return(NULL);
    +
    87  }
    +
    88 
    +
    89  return(NULL);
    +
    90 }
    +
    91 
    +
    109 gtemplate *
    +
    110 extdrstemplate(g2int number, g2int *list)
    +
    111 {
    +
    112  gtemplate *new;
    +
    113  g2int index, i;
    +
    114 
    +
    115  index = getdrsindex(number);
    +
    116  if (index == -1)
    +
    117  return(0);
    +
    118 
    +
    119  new = getdrstemplate(number);
    +
    120 
    +
    121  if (!new->needext)
    +
    122  return(new);
    +
    123 
    +
    124  if (number == 1)
    +
    125  {
    +
    126  new->extlen = list[10] + list[12];
    +
    127  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    128  for (i = 0; i < new->extlen; i++)
    +
    129  {
    +
    130  new->ext[i] = 4;
    +
    131  }
    +
    132  }
    +
    133  return(new);
    +
    134 }
    +
    gtemplate * extdrstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Data Representation Template,...
    Definition: drstemplates.c:110
    +
    g2int getdrsindex(g2int number)
    This function returns the index of specified Data Representation Template.
    Definition: drstemplates.c:32
    +
    gtemplate * getdrstemplate(g2int number)
    This subroutine returns DRS template information for a specified Data Representation Template.
    Definition: drstemplates.c:64
    +
    This C struct contains info on all the available GRIB2 Data Representation Templates used in Section ...
    +
    const struct drstemplate templatesdrs[MAXDRSTEMP]
    Stuct holding data for GRIB2 Data Representation Section (DRS) template.
    Definition: drstemplates.h:54
    +
    g2int needext
    Whether the Template needs to be extended.
    Definition: drstemplates.h:46
    +
    g2int mapdrslen
    Length of map of the template.
    Definition: drstemplates.h:45
    +
    #define MAXDRSTEMP
    maximum number of templates
    Definition: drstemplates.h:36
    +
    g2int template_num
    The number of entries in the template.
    Definition: drstemplates.h:44
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8h.html b/ver-1.7.0/ver-1.6.4/drstemplates_8h.html new file mode 100644 index 00000000..2bd0f821 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8h.html @@ -0,0 +1,247 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.h File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    drstemplates.h File Reference
    +
    +
    + +

    This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS). +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Data Structures

    struct  drstemplate
     Stuct for GRIB2 Data Representation Section (DRS) template. More...
     
    + + + + + + + +

    +Macros

    #define MAXDRSMAPLEN   200
     maximum template map length More...
     
    #define MAXDRSTEMP   9
     maximum number of templates More...
     
    + + + + +

    +Variables

    const struct drstemplate templatesdrs [MAXDRSTEMP]
     Stuct holding data for GRIB2 Data Representation Section (DRS) template. More...
     
    +

    Detailed Description

    +

    This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS).

    +

    The information decribing each template is stored in the drstemplate structure defined below.

    +

    Each Template has three parts:

      +
    1. The number of entries in the template (mapdrslen).
    2. +
    3. A map of the template (mapdrs), which contains the number of octets in which to pack each of the template values.
    4. +
    5. 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 5.1 as an example.)
    6. +
    +
    Note
    Array mapdrs contains the number of octets in which the corresponding template values will be stored. A negative value in mapdrs 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 mapdrs 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 mapdrs.
    +
    Author
    Stephen Gilbeert
    +
    Date
    2002-10-26
    + +

    Definition in file drstemplates.h.

    +

    Data Type Documentation

    + +

    ◆ drstemplate

    + +
    +
    + + + + +
    struct drstemplate
    +
    +

    Stuct for GRIB2 Data Representation Section (DRS) template.

    + +

    Definition at line 42 of file drstemplates.h.

    +
    + + + + + + + + + + + + + +
    Data Fields
    +g2int +mapdrs[MAXDRSMAPLEN] +A map of the template.
    +g2int +mapdrslen +Length of map of the template.
    +g2int +needext +Whether the Template needs to be extended.
    +g2int +template_num +The number of entries in the template.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ MAXDRSMAPLEN

    + +
    +
    + + + + +
    #define MAXDRSMAPLEN   200
    +
    + +

    maximum template map length

    + +

    Definition at line 37 of file drstemplates.h.

    + +
    +
    + +

    ◆ MAXDRSTEMP

    + +
    +
    + + + + +
    #define MAXDRSTEMP   9
    +
    + +

    maximum number of templates

    + +

    Definition at line 36 of file drstemplates.h.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ templatesdrs

    + +
    +
    + + + + +
    const struct drstemplate templatesdrs[MAXDRSTEMP]
    +
    + +

    Stuct holding data for GRIB2 Data Representation Section (DRS) template.

    + +

    Definition at line 1 of file drstemplates.h.

    + +

    Referenced by getdrsindex(), and getdrstemplate().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8h.js b/ver-1.7.0/ver-1.6.4/drstemplates_8h.js new file mode 100644 index 00000000..08dbd925 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8h.js @@ -0,0 +1,12 @@ +var drstemplates_8h = +[ + [ "drstemplate", "drstemplates_8h.html#structdrstemplate", [ + [ "mapdrs", "drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4", null ], + [ "mapdrslen", "drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9", null ], + [ "needext", "drstemplates_8h.html#a6f2f478357352200fbac1f72091de752", null ], + [ "template_num", "drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4", null ] + ] ], + [ "MAXDRSMAPLEN", "drstemplates_8h.html#ade593949cef71416060205db106c2828", null ], + [ "MAXDRSTEMP", "drstemplates_8h.html#a94872ea1f11e8ea068177a6506e0a3e4", null ], + [ "templatesdrs", "drstemplates_8h.html#a08f7c019317d1e6235a863ee8ce6e9e2", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8h_source.html b/ver-1.7.0/ver-1.6.4/drstemplates_8h_source.html new file mode 100644 index 00000000..6d4bbbdd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8h_source.html @@ -0,0 +1,150 @@ + + + + + + + +NCEPLIBS-g2c: drstemplates.h Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    drstemplates.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    31 #ifndef _drstemplates_H
    +
    32 #define _drstemplates_H
    +
    33 
    +
    34 #include "grib2.h"
    +
    35 
    +
    36 #define MAXDRSTEMP 9
    +
    37 #define MAXDRSMAPLEN 200
    + +
    43 {
    + + + + +
    48 };
    +
    49 
    +
    54 const struct drstemplate templatesdrs[MAXDRSTEMP] =
    +
    55 {
    +
    58  { 0, 5, 0, {4,-2,-2,1,1} },
    +
    59 
    +
    62  { 2, 16, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1} },
    +
    63 
    +
    66  { 3, 18, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1,1,1} },
    +
    67 
    +
    70  { 50, 5, 0, {4,-2,-2,1,4} },
    +
    71 
    +
    74  { 51, 10, 0, {4,-2,-2,1,-4,2,2,2,4,1} },
    +
    75 
    +
    76  /* 5.1: Matrix values at gridpoint - Simple packing */
    +
    77  /* { 1, 15, 1, {4,-2,-2,1,1,1,4,2,2,1,1,1,1,1,1} }, */
    +
    78 
    +
    81  { 40, 7, 0, {4,-2,-2,1,1,1,1} },
    +
    82 
    +
    85  { 41, 5, 0, {4,-2,-2,1,1} },
    +
    86 
    +
    88  { 40000, 7, 0, {4,-2,-2,1,1,1,1} },
    +
    89 
    +
    91  { 40010, 5, 0, {4,-2,-2,1,1} }
    +
    92 } ;
    +
    93 
    +
    94 #endif /* _drstemplates_H */
    +
    const struct drstemplate templatesdrs[MAXDRSTEMP]
    Stuct holding data for GRIB2 Data Representation Section (DRS) template.
    Definition: drstemplates.h:54
    +
    g2int needext
    Whether the Template needs to be extended.
    Definition: drstemplates.h:46
    +
    g2int mapdrslen
    Length of map of the template.
    Definition: drstemplates.h:45
    +
    #define MAXDRSTEMP
    maximum number of templates
    Definition: drstemplates.h:36
    +
    g2int template_num
    The number of entries in the template.
    Definition: drstemplates.h:44
    +
    g2int mapdrs[MAXDRSMAPLEN]
    A map of the template.
    Definition: drstemplates.h:47
    +
    #define MAXDRSMAPLEN
    maximum template map length
    Definition: drstemplates.h:37
    +
    Stuct for GRIB2 Data Representation Section (DRS) template.
    Definition: drstemplates.h:43
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/drstemplates_8h_structdrstemplate.js b/ver-1.7.0/ver-1.6.4/drstemplates_8h_structdrstemplate.js new file mode 100644 index 00000000..febe2403 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/drstemplates_8h_structdrstemplate.js @@ -0,0 +1,7 @@ +var drstemplates_8h_structdrstemplate = +[ + [ "mapdrs", "drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4", null ], + [ "mapdrslen", "drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9", null ], + [ "needext", "drstemplates_8h.html#a6f2f478357352200fbac1f72091de752", null ], + [ "template_num", "drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/dynsections.js b/ver-1.7.0/ver-1.6.4/dynsections.js new file mode 100644 index 00000000..88f2c27e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/dynsections.js @@ -0,0 +1,128 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +NCEPLIBS-g2c: enc_jpeg2000.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    enc_jpeg2000.c File Reference
    +
    +
    + +

    Encodes JPEG2000 code stream. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +#include "jasper/jasper.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define JAS_1_700_2
     Define for JAS. More...
     
    #define MAXOPTSSIZE   1024
     Maximum size of options. More...
     
    + + + + +

    +Functions

    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 version 1.500.4 (or 1.700.2) written by the University of British Columbia, Image Power Inc, and others. More...
     
    +

    Detailed Description

    +

    Encodes JPEG2000 code stream.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition in file enc_jpeg2000.c.

    +

    Macro Definition Documentation

    + +

    ◆ JAS_1_700_2

    + +
    +
    + + + + +
    #define JAS_1_700_2
    +
    + +

    Define for JAS.

    + +

    Definition at line 14 of file enc_jpeg2000.c.

    + +
    +
    + +

    ◆ MAXOPTSSIZE

    + +
    +
    + + + + +
    #define MAXOPTSSIZE   1024
    +
    + +

    Maximum size of options.

    + +

    Definition at line 15 of file enc_jpeg2000.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ 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 version 1.500.4 (or 1.700.2) written by the University of British Columbia, Image Power Inc, and others.

    +

    JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.

    +

    +Program History Log

    + + + + + + + +
    Date Programmer Comments
    2002-12-02 Gilbert Initial
    2004-12-16 Gilbert Added retry argument allowing increased guard bits.
    +
    Parameters
    + + + + + + + + + + +
    cinPacked matrix of Grayscale image values to encode.
    widthwidth of image.
    heightheight of image.
    nbitsdepth (in bits) of image. i.e number of bits used to hold each data value.
    ltypeindicator of lossless or lossy compression.
      +
    • 1, for lossy compression
    • +
    • != 1, for lossless compression
    • +
    +
    ratiotarget compression ratio. (ratio:1) Used only when ltype == 1.
    retryIf 1 try increasing number of guard bits otherwise, no additional options.
    outjpcOutput encoded JPEG2000 code stream.
    jpclenNumber of bytes allocated for the output JPEG2000 code stream in outjpc.
    +
    +
    +
    Returns
      +
    • > 0 = Length in bytes of encoded JPEG2000 code stream
    • +
    • -3 = Error decode jpeg2000 code stream.
    • +
    • -5 = decoded image had multiple color components. Only grayscale is expected.
    • +
    +
    +
    Note
    Requires JasPer Software version 1.500.4 or 1.700.2 or later.
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition at line 57 of file enc_jpeg2000.c.

    + +

    References MAXOPTSSIZE.

    + +

    Referenced by jpcpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/enc__jpeg2000_8c.js b/ver-1.7.0/ver-1.6.4/enc__jpeg2000_8c.js new file mode 100644 index 00000000..35c6b986 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/enc__jpeg2000_8c.js @@ -0,0 +1,6 @@ +var enc__jpeg2000_8c = +[ + [ "JAS_1_700_2", "enc__jpeg2000_8c.html#a61429602b0de9ba46b443e66a2c1d8cb", null ], + [ "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/ver-1.6.4/enc__jpeg2000_8c_source.html b/ver-1.7.0/ver-1.6.4/enc__jpeg2000_8c_source.html new file mode 100644 index 00000000..97795147 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/enc__jpeg2000_8c_source.html @@ -0,0 +1,201 @@ + + + + + + + +NCEPLIBS-g2c: enc_jpeg2000.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    enc_jpeg2000.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #ifndef USE_JPEG2000
    +
    7 void dummy(void) {}
    +
    8 #else /* USE_JPEG2000 */
    +
    9 
    +
    10 #include <stdio.h>
    +
    11 #include <stdlib.h>
    +
    12 #include "grib2.h"
    +
    13 #include "jasper/jasper.h"
    +
    14 #define JAS_1_700_2
    +
    15 #define MAXOPTSSIZE 1024
    +
    56 int
    +
    57 enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
    +
    58  g2int ltype, g2int ratio, g2int retry, char *outjpc,
    +
    59  g2int jpclen)
    +
    60 {
    +
    61  int ier, rwcnt;
    +
    62  jas_image_t image;
    +
    63  jas_stream_t *jpcstream, *istream;
    +
    64  jas_image_cmpt_t cmpt, *pcmpt;
    +
    65  char opts[MAXOPTSSIZE];
    +
    66 
    +
    67  /* Set lossy compression options, if requested. */
    +
    68  if (ltype != 1)
    +
    69  opts[0] = (char)0;
    +
    70  else
    +
    71  snprintf(opts,MAXOPTSSIZE,"mode=real\nrate=%f",1.0/(float)ratio);
    +
    72 
    +
    73  if (retry == 1) /* option to increase number of guard bits */
    +
    74  strcat(opts,"\nnumgbits=4");
    +
    75 
    +
    76  /* Initialize the JasPer image structure describing the grayscale
    +
    77  * image to encode into the JPEG2000 code stream. */
    +
    78  image.tlx_ = 0;
    +
    79  image.tly_ = 0;
    +
    80 #ifdef JAS_1_500_4
    +
    81  image.brx_ = (uint_fast32_t)width;
    +
    82  image.bry_ = (uint_fast32_t)height;
    +
    83 #endif
    +
    84 #ifdef JAS_1_700_2
    +
    85  image.brx_ = (jas_image_coord_t)width;
    +
    86  image.bry_ = (jas_image_coord_t)height;
    +
    87 #endif
    +
    88  image.numcmpts_ = 1;
    +
    89  image.maxcmpts_ = 1;
    +
    90 #ifdef JAS_1_500_4
    +
    91  image.colormodel_ = JAS_IMAGE_CM_GRAY; /* grayscale Image */
    +
    92 #endif
    +
    93 #ifdef JAS_1_700_2
    +
    94  image.clrspc_ = JAS_CLRSPC_SGRAY; /* grayscale Image */
    +
    95  image.cmprof_ = 0;
    +
    96 #endif
    +
    97 
    +
    98  cmpt.tlx_ = 0;
    +
    99  cmpt.tly_ = 0;
    +
    100  cmpt.hstep_ = 1;
    +
    101  cmpt.vstep_ = 1;
    +
    102 #ifdef JAS_1_500_4
    +
    103  cmpt.width_ = (uint_fast32_t)width;
    +
    104  cmpt.height_ = (uint_fast32_t)height;
    +
    105 #endif
    +
    106 #ifdef JAS_1_700_2
    +
    107  cmpt.width_ = (jas_image_coord_t)width;
    +
    108  cmpt.height_ = (jas_image_coord_t)height;
    +
    109  cmpt.type_ = JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y);
    +
    110 #endif
    +
    111  cmpt.prec_ = nbits;
    +
    112  cmpt.sgnd_ = 0;
    +
    113  cmpt.cps_ = (nbits + 7) / 8;
    +
    114 
    +
    115  pcmpt = &cmpt;
    +
    116  image.cmpts_ = &pcmpt;
    +
    117 
    +
    118  /* Open a JasPer stream containing the input grayscale values. */
    +
    119  istream = jas_stream_memopen((char *)cin, height * width * cmpt.cps_);
    +
    120  cmpt.stream_ = istream;
    +
    121 
    +
    122  /* Open an output stream that will contain the encoded jpeg2000
    +
    123  * code stream. */
    +
    124  jpcstream = jas_stream_memopen(outjpc, (int)jpclen);
    +
    125 
    +
    126  /* Encode image. */
    +
    127  if ((ier = jpc_encode(&image, jpcstream, opts)))
    +
    128  {
    +
    129  printf(" jpc_encode return = %d \n",ier);
    +
    130  return -3;
    +
    131  }
    +
    132 
    +
    133  /* Clean up JasPer work structures. */
    +
    134  rwcnt = jpcstream->rwcnt_;
    +
    135  ier = jas_stream_close(istream);
    +
    136  ier = jas_stream_close(jpcstream);
    +
    137 
    +
    138  /* Return size of jpeg2000 code stream. */
    +
    139  return (rwcnt);
    +
    140 }
    +
    141 
    +
    142 #endif /* USE_JPEG2000 */
    +
    #define MAXOPTSSIZE
    Maximum size of options.
    Definition: enc_jpeg2000.c:15
    +
    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 ...
    Definition: enc_jpeg2000.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/enc__png_8c.html b/ver-1.7.0/ver-1.6.4/enc__png_8c.html new file mode 100644 index 00000000..6c24804e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/enc__png_8c.html @@ -0,0 +1,302 @@ + + + + + + + +NCEPLIBS-g2c: enc_png.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    enc_png.c File Reference
    +
    +
    + +

    Functions for dealing with PNG. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <png.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Typedefs

    typedef struct png_stream png_stream
     Typedef for PNG stream. More...
     
    + + + + + + + + + + +

    +Functions

    int enc_png (char *data, g2int width, g2int height, g2int nbits, 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...
     
    +

    Detailed Description

    +

    Functions for dealing with PNG.

    +
    Author
    Stephen Gilbert
    + +

    Definition in file enc_png.c.

    +

    Typedef Documentation

    + +

    ◆ png_stream

    + +
    +
    + + + + +
    typedef struct png_stream png_stream
    +
    + +

    Typedef for PNG stream.

    + +

    Definition at line 1 of file enc_png.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ enc_png()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int enc_png (char * data,
    g2int width,
    g2int height,
    g2int nbits,
    char * pngbuf 
    )
    +
    + +

    Encode PNG.

    +
    Parameters
    + + + + + + +
    datadata.
    widthwidth.
    heightheight.
    nbitsnumber of bits.
    pngbufPNG buffer.
    +
    +
    +
    Returns
    PNG length, or negative number for error.
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 81 of file enc_png.c.

    + +

    References user_flush_data(), and user_write_data().

    + +

    Referenced by pngpack().

    + +
    +
    + +

    ◆ user_flush_data()

    + +
    +
    + + + + + + + + +
    void user_flush_data (png_structp png_ptr)
    +
    + +

    Dummy Custom flush function.

    +
    Parameters
    + + +
    png_ptrPointer to PNG struct.
    +
    +
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 61 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_ptrpointer
    datadata
    lengthlength
    +
    +
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 41 of file enc_png.c.

    + +

    Referenced by enc_png().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/enc__png_8c.js b/ver-1.7.0/ver-1.6.4/enc__png_8c.js new file mode 100644 index 00000000..594d48bd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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#a0f4eb9634c16b9a7d55002bddcaa9449", 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/ver-1.6.4/enc__png_8c_source.html b/ver-1.7.0/ver-1.6.4/enc__png_8c_source.html new file mode 100644 index 00000000..71ec7571 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/enc__png_8c_source.html @@ -0,0 +1,216 @@ + + + + + + + +NCEPLIBS-g2c: enc_png.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    enc_png.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include <string.h>
    +
    9 #include <png.h>
    +
    10 #include "grib2.h"
    +
    11 
    +
    12 #ifndef USE_PNG
    +
    13 void dummy(void) {}
    +
    14 #else /* USE_PNG */
    +
    15 
    +
    19 struct png_stream
    +
    20 {
    +
    21  unsigned char *stream_ptr;
    +
    22  g2int stream_len;
    +
    23 };
    +
    24 
    +
    25 typedef struct png_stream png_stream;
    +
    27 void user_write_data(png_structp, png_bytep, png_uint_32);
    +
    28 void user_flush_data(png_structp);
    +
    29 
    +
    40 void
    +
    41 user_write_data(png_structp png_ptr, png_bytep data, png_uint_32 length)
    +
    42 {
    +
    43  unsigned char *ptr;
    +
    44  g2int offset;
    +
    45  png_stream *mem;
    +
    46 
    +
    47  mem = (png_stream *)png_get_io_ptr(png_ptr);
    +
    48  ptr = mem->stream_ptr;
    +
    49  offset = mem->stream_len;
    +
    50  memcpy(ptr + offset, data, length);
    +
    51  mem->stream_len += length;
    +
    52 }
    +
    53 
    +
    61 void user_flush_data(png_structp png_ptr)
    +
    62 {
    +
    63  int *do_nothing;
    +
    64  do_nothing = NULL;
    +
    65 }
    +
    66 
    +
    80 int
    +
    81 enc_png(char *data, g2int width, g2int height, g2int nbits, char *pngbuf)
    +
    82 {
    +
    83  int color_type;
    +
    84  g2int j, bytes, pnglen, bit_depth;
    +
    85  png_structp png_ptr;
    +
    86  png_infop info_ptr;
    +
    87  png_bytep **row_pointers;
    +
    88  png_stream write_io_ptr;
    +
    89 
    +
    90  /* Create and initialize png_structs. */
    +
    91  if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)))
    +
    92  return (-1);
    +
    93 
    +
    94  if (!(info_ptr = png_create_info_struct(png_ptr)))
    +
    95  {
    +
    96  png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
    +
    97  return (-2);
    +
    98  }
    +
    99 
    +
    100  /* Set Error callback. */
    +
    101  if (setjmp(png_jmpbuf(png_ptr)))
    +
    102  {
    +
    103  png_destroy_write_struct(&png_ptr, &info_ptr);
    +
    104  return (-3);
    +
    105  }
    +
    106 
    +
    107  /* Initialize info for writing PNG stream to memory. */
    +
    108  write_io_ptr.stream_ptr = (png_voidp)pngbuf;
    +
    109  write_io_ptr.stream_len = 0;
    +
    110 
    +
    111  /* Set new custom write functions. */
    +
    112  png_set_write_fn(png_ptr, (png_voidp)&write_io_ptr, (png_rw_ptr)user_write_data,
    +
    113  (png_flush_ptr)user_flush_data);
    +
    114 
    +
    115  /* Set the image size, colortype, filter type, etc... */
    +
    116  bit_depth = nbits;
    +
    117  color_type = PNG_COLOR_TYPE_GRAY;
    +
    118  if (nbits == 24)
    +
    119  {
    +
    120  bit_depth = 8;
    +
    121  color_type = PNG_COLOR_TYPE_RGB;
    +
    122  }
    +
    123  else if (nbits == 32)
    +
    124  {
    +
    125  bit_depth = 8;
    +
    126  color_type = PNG_COLOR_TYPE_RGB_ALPHA;
    +
    127  }
    +
    128  png_set_IHDR(png_ptr, info_ptr, width, height,
    +
    129  bit_depth, color_type, PNG_INTERLACE_NONE,
    +
    130  PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    +
    131 
    +
    132  /* Put image data into the PNG info structure. */
    +
    133  bytes = nbits / 8;
    +
    134  row_pointers = malloc(height * sizeof(png_bytep));
    +
    135  for (j = 0; j < height; j++)
    +
    136  row_pointers[j] = (png_bytep *)(data + (j * width * bytes));
    +
    137  png_set_rows(png_ptr, info_ptr, (png_bytepp)row_pointers);
    +
    138 
    +
    139  /* Do the PNG encoding, and write out PNG stream. */
    +
    140  png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
    +
    141 
    +
    142  /* Clean up. */
    +
    143  png_destroy_write_struct(&png_ptr, &info_ptr);
    +
    144  free(row_pointers);
    +
    145  pnglen = write_io_ptr.stream_len;
    +
    146  return pnglen;
    +
    147 }
    +
    148 
    +
    149 #endif /* USE_PNG */
    +
    int enc_png(char *data, g2int width, g2int height, g2int nbits, char *pngbuf)
    Encode PNG.
    Definition: enc_png.c:81
    +
    struct png_stream png_stream
    Typedef for PNG stream.
    Definition: enc_png.c:25
    +
    void user_flush_data(png_structp)
    Dummy Custom flush function.
    Definition: enc_png.c:61
    +
    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.
    Definition: enc_png.c:41
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/files.html b/ver-1.7.0/ver-1.6.4/files.html new file mode 100644 index 00000000..20203fa5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/files.html @@ -0,0 +1,151 @@ + + + + + + + +NCEPLIBS-g2c: File List + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    File List
    +
    +
    +
    Here is a list of all documented files with brief descriptions:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     cmplxpack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
     compack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
     comunpack.cUnpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention
     dec_jpeg2000.cDecodes JPEG2000 code stream
     dec_png.cPNG functions
     decenc_openjpeg.cJPEG functions, originally from ECMWF, modified for use in NCEPLIBS-g2c
     drstemplates.cFunctions for GRIB2 Data Representation Templates (DRT) for the Data Representation Setcion
     drstemplates.hThis C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS)
     enc_jpeg2000.cEncodes JPEG2000 code stream
     enc_png.cFunctions for dealing with PNG
     g2_addfield.cPack up Sections 4 through 7 for a given field and adds them to a GRIB2 message
     g2_addgrid.cPack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message
     g2_addlocal.cAdd a Local Use Section (Section 2) to a GRIB2 message
     g2_create.cInitializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section)
     g2_free.cFree up memory that was allocated for struct gribfield
     g2_getfld.cReturn all the metadata, template values, Bit-map (if applicable), and the unpacked data for a given data field
     g2_gribend.cFinalize a GRIB2 message after all grids and fields have been added
     g2_info.cSearch 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.cCheck the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field
     g2_unpack1.cUnpack Section 1 (Identification Section) as defined in GRIB Edition 2
     g2_unpack2.cUnpack Section 2 (Local Use Section) as defined in GRIB Edition 2
     g2_unpack3.cUnpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2
     g2_unpack4.cUnpack Section 4 (Product Definition Section) as defined in GRIB Edition 2
     g2_unpack5.cUnpack Section 5 (Data Representation Section) as defined in GRIB Edition 2
     g2_unpack6.cUnpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2
     g2_unpack7.cUnpack Section 7 (Data Section) as defined in GRIB Edition 2
     gbits.cFunctions to pack and unpack bits to/from a packed bit string
     getdim.cReturn the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format
     getpoly.cReturn 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.hHeader file for NCEPLIBS-g2c library
     gridtemplates.cReturns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS)
     gridtemplates.hThis header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS)
     int_power.cProvide function similar to C pow() power function
     jpcpack.cPack up a data field into a JPEG2000 code stream
     jpcunpack.cUnpack a data field that was packed into a JPEG2000 code stream
     misspack.cPack up a data field using a complex packing algorithm as defined in the GRIB2 documention
     mkieee.c
     pack_gp.c
     pdstemplates.cFunctions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS)
     pdstemplates.hThis include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml)
     pngpack.cFunction to pack data with PNG compression
     pngunpack.cContains a function to unpack data packed with PNG compression
     rdieee.cRead a list of real values in 32-bit IEEE floating point format
     reduce.cDetermines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment
     seekgb.cSearches a file for the next GRIB message
     simpack.cPack up a data field using the simple packing algorithm
     simunpack.c
     specpack.cPack a spectral data field using the complex packing algorithm for spherical harmonic data
     specunpack.cUnpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/files_dup.js b/ver-1.7.0/ver-1.6.4/files_dup.js new file mode 100644 index 00000000..232f73d5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/files_dup.js @@ -0,0 +1,52 @@ +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" ], + [ "drstemplates.h", "drstemplates_8h.html", "drstemplates_8h" ], + [ "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" ], + [ "gridtemplates.c", "gridtemplates_8c.html", "gridtemplates_8c" ], + [ "gridtemplates.h", "gridtemplates_8h.html", "gridtemplates_8h" ], + [ "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" ], + [ "pdstemplates.h", "pdstemplates_8h.html", "pdstemplates_8h" ], + [ "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" ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/folderclosed.png b/ver-1.7.0/ver-1.6.4/folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/folderclosed.png differ diff --git a/ver-1.7.0/ver-1.6.4/folderopen.png b/ver-1.7.0/ver-1.6.4/folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/folderopen.png differ diff --git a/ver-1.7.0/ver-1.6.4/functions.html b/ver-1.7.0/ver-1.6.4/functions.html new file mode 100644 index 00000000..b1887e39 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/functions.html @@ -0,0 +1,283 @@ + + + + + + + +NCEPLIBS-g2c: Data Fields + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    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/ver-1.6.4/functions_vars.html b/ver-1.7.0/ver-1.6.4/functions_vars.html new file mode 100644 index 00000000..74591c42 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/functions_vars.html @@ -0,0 +1,283 @@ + + + + + + + +NCEPLIBS-g2c: Data Fields - Variables + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +  + +

    - b -

    + + +

    - c -

    + + +

    - d -

    + + +

    - e -

    + + +

    - f -

    + + +

    - g -

    + + +

    - i -

    + + +

    - l -

    + + +

    - m -

    + + +

    - n -

    + + +

    - t -

    + + +

    - u -

    + + +

    - v -

    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addfield_8c.html b/ver-1.7.0/ver-1.6.4/g2__addfield_8c.html new file mode 100644 index 00000000..711f713b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addfield_8c.html @@ -0,0 +1,840 @@ + + + + + + + +NCEPLIBS-g2c: g2_addfield.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_addfield.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    void cmplxpack (g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
     
    g2int g2_addfield (unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *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 getdim (unsigned char *, g2int *, g2int *, g2int *)
     This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format. More...
     
    g2int getpoly (unsigned char *, g2int *, g2int *, g2int *)
     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...
     
    void jpcpack (g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field into a JPEG2000 code stream. More...
     
    void pngpack (g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field into PNG image format. More...
     
    void simpack (g2float *, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 documention. More...
     
    void specpack (g2float *, g2int, g2int, g2int, g2int, g2int *, unsigned char *, g2int *)
     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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ cmplxpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmplxpack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplContains 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 )
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2004-08-27
    + +

    Definition at line 35 of file cmplxpack.c.

    + +

    References compack(), and misspack().

    + +

    Referenced by g2_addfield().

    + +
    +
    + +

    ◆ g2_addfield()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_addfield (unsigned char * cgrib,
    g2int ipdsnum,
    g2intipdstmpl,
    g2floatcoordlist,
    g2int numcoord,
    g2int idrsnum,
    g2intidrstmpl,
    g2floatfld,
    g2int ngrdpts,
    g2int ibmap,
    g2intbmap 
    )
    +
    + +

    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
    + + + + + + + + + + + + +
    cgribChar 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.
    ipdsnumProduct Definition Template Number (see Code Table 4.0).
    ipdstmplContains the data values for the Product Definition Template specified by ipdsnum.
    coordlistArray containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
    numcoordnumber of values in array coordlist.
    idrsnumData Representation Template Number (see Code Table 5.0).
    idrstmplThe 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.
    fldArray of data points to pack.
    ngrdptsNumber of data points in grid. i.e. size of fld and bmap.
    ibmapBitmap 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.
    • +
    +
    bmapInteger array containing bitmap to be added (if ibmap = 0).
    +
    +
    +
    Returns
      +
    • > 0 Current size of updated GRIB2 message
    • +
    • -1 GRIB message was not initialized. Need to call routine g2_create() first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count.
    • +
    • -4 Previous Section was not 3 or 7.
    • +
    • -5 Could not find requested Product Definition Template.
    • +
    • -6 Section 3 (GDS) not previously defined in message.
    • +
    • -7 Tried to use unsupported Data Representationi Template.
    • +
    • -8 Specified use of a previously defined bitmap, but one does not exist in the GRIB message.
    • +
    • -9 GDT of one of 5.50 through 5.53 required to pack field using DRT 5.51.
    • +
    • -10 Error packing data field.
    • +
    +
    +
    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 106 of file g2_addfield.c.

    + +

    References cmplxpack(), gtemplate::ext, gtemplate::extlen, extpdstemplate(), gbit(), getdim(), getdrstemplate(), getpdstemplate(), getpoly(), jpcpack(), gtemplate::map, gtemplate::maplen, mkieee(), gtemplate::needext, pngpack(), sbit(), sbits(), simpack(), and specpack().

    + +
    +
    + +

    ◆ getdim()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int getdim (unsigned char * csec3,
    g2intwidth,
    g2intheight,
    g2intiscan 
    )
    +
    + +

    This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.

    +
    Parameters
    + + + + + +
    csec3Character array that contains the packed GRIB2 GDS.
    widthx (or i) dimension of the grid. 0 if grid is not recognized.
    heighty (or j) dimension of the grid. 0 if grid is not recognized.
    iscanScanning 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().

    + +
    +
    + +

    ◆ getpoly()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int getpoly (unsigned char * csec3,
    g2intjj,
    g2intkk,
    g2intmm 
    )
    +
    + +

    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
    + + + + + +
    csec3Character array that contains the packed GRIB2 GDS.
    jjJ pentagonal resolution parameter.
    kkK pentagonal resolution parameter.
    mmM 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().

    + +
    +
    + +

    ◆ jpcpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void jpcpack (g2floatfld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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.

    +

    +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.
    +
    Parameters
    + + + + + + + +
    fldContains the data values to pack.
    widthnumber of points in the x direction.
    heightnumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpackPointer that points to a g2int which contains the length of packed field in cpack. This must be set by the calling function.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-17
    + +

    Definition at line 53 of file jpcpack.c.

    + +

    References enc_jpeg2000(), int_power(), mkieee(), and sbits().

    + +

    Referenced by g2_addfield().

    + +
    +
    + +

    ◆ pngpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void pngpack (g2floatfld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    This subroutine packs up a 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
    + + + + + + + +
    fldContains the data values to pack.
    widthnumber of points in the x direction.
    heightnumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 38 of file pngpack.c.

    + +

    References enc_png(), int_power(), mkieee(), and sbits().

    + +

    Referenced by g2_addfield().

    + +
    +
    + +

    ◆ simpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void simpack (g2floatfld,
    g2int ndpts,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field
    lcpacklength of packed field starting at cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-06
    + +

    Definition at line 34 of file simpack.c.

    + +

    References int_power(), mkieee(), sbit(), and sbits().

    + +

    Referenced by g2_addfield(), and specpack().

    + +
    +
    + +

    ◆ specpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void specpack (g2floatfld,
    g2int ndpts,
    g2int JJ,
    g2int KK,
    g2int MM,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + + + +
    fldContains the data values to be packed.
    ndptsThe number of data values to pack.
    JJJ - pentagonal resolution parameter.
    KKK - pentagonal resolution parameter.
    MMM - pentagonal resolution parameter.
    idrstmplContains 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).
    cpackPointer that gets the packed data field. Must be allocated by caller.
    lcpacklength 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addfield_8c.js b/ver-1.7.0/ver-1.6.4/g2__addfield_8c.js new file mode 100644 index 00000000..0e83d267 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addfield_8c.js @@ -0,0 +1,11 @@ +var g2__addfield_8c = +[ + [ "cmplxpack", "g2__addfield_8c.html#a65f21910802e4f976ca833f1eca18dfe", null ], + [ "g2_addfield", "g2__addfield_8c.html#afdf096f036ed768ec874389f5389ee26", null ], + [ "getdim", "g2__addfield_8c.html#a082494772d42da82adfd50c68d77971a", null ], + [ "getpoly", "g2__addfield_8c.html#a0532897a31a122af171633b075a150c6", null ], + [ "jpcpack", "g2__addfield_8c.html#ae9c19967000623138e0d9218f6c949ab", null ], + [ "pngpack", "g2__addfield_8c.html#aa19673a03d5b0df2730903c39b9e5002", null ], + [ "simpack", "g2__addfield_8c.html#ad6296345c25609fc7443aba106dc0cb2", null ], + [ "specpack", "g2__addfield_8c.html#aa8873944e9960b8fcf6e200cdb71b64b", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/g2__addfield_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__addfield_8c_source.html new file mode 100644 index 00000000..254e373f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addfield_8c_source.html @@ -0,0 +1,566 @@ + + + + + + + +NCEPLIBS-g2c: g2_addfield.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_addfield.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    10 g2int getdim(unsigned char *, g2int *, g2int *, g2int *);
    +
    11 g2int getpoly(unsigned char *, g2int *, g2int *, g2int *);
    +
    12 void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *);
    +
    13 void cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *);
    +
    14 void specpack(g2float *, g2int, g2int, g2int, g2int, g2int *, unsigned char *,
    +
    15  g2int *);
    +
    16 #ifdef USE_PNG
    +
    17 void pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *);
    +
    18 #endif /* USE_PNG */
    +
    19 #if defined USE_JPEG2000 || defined USE_OPENJPEG
    +
    20 void jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *);
    +
    21 #endif /* USE_JPEG2000 */
    +
    22 
    +
    23 
    +
    105 g2int
    +
    106 g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl,
    +
    107  g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl,
    +
    108  g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap)
    +
    109 {
    +
    110  g2int ierr = 0;
    +
    111  static unsigned char G = 0x47; /* 'G' */
    +
    112  static unsigned char R = 0x52; /* 'R' */
    +
    113  static unsigned char I = 0x49; /* 'I' */
    +
    114  static unsigned char B = 0x42; /* 'B' */
    +
    115  static unsigned char s7 = 0x37; /* '7' */
    +
    116 
    +
    117  unsigned char *cpack;
    +
    118  static g2int zero = 0, one = 1, four = 4, five = 5, six = 6, seven = 7;
    +
    119  const g2int minsize = 50000;
    +
    120  g2int iofst, ibeg, lencurr, len, nsize;
    +
    121  g2int ilen, isecnum, i, nbits, temp, left;
    +
    122  g2int ibmprev, j, lcpack, ioctet, newlen, ndpts;
    +
    123  g2int lensec4, lensec5, lensec6, lensec7;
    +
    124  g2int issec3 = 0, isprevbmap = 0, lpos3 = 0, JJ, KK, MM;
    +
    125  g2int *coordieee;
    +
    126  g2int width, height, iscan, itemp;
    +
    127  g2float *pfld;
    +
    128  gtemplate *mappds, *mapdrs;
    +
    129  unsigned int allones = 4294967295u;
    +
    130 
    +
    131  /* Check to see if beginning of GRIB message exists. */
    +
    132  if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B)
    +
    133  {
    +
    134  printf("g2_addfield: GRIB not found in given message.\n");
    +
    135  printf("g2_addfield: Call to routine g2_create required to initialize GRIB messge.\n");
    +
    136  ierr = -1;
    +
    137  return ierr;
    +
    138  }
    +
    139 
    +
    140  /* Get current length of GRIB message. */
    +
    141  gbit(cgrib, &lencurr, 96, 32);
    +
    142 
    +
    143  /* Check to see if GRIB message is already complete. */
    +
    144  if (cgrib[lencurr-4] == s7 && cgrib[lencurr-3] == s7 &&
    +
    145  cgrib[lencurr-2] == s7 && cgrib[lencurr-1] == s7)
    +
    146  {
    +
    147  printf("g2_addfield: GRIB message already complete. Cannot add new section.\n");
    +
    148  ierr = -2;
    +
    149  return ierr;
    +
    150  }
    +
    151 
    +
    152  /* Loop through all current sections of the GRIB message to find
    +
    153  * the last section number. */
    +
    154  len = 16; /* length of Section 0 */
    +
    155  for (;;)
    +
    156  {
    +
    157  /* Get number and length of next section. */
    +
    158  iofst = len * 8;
    +
    159  gbit(cgrib, &ilen, iofst, 32);
    +
    160  iofst = iofst + 32;
    +
    161  gbit(cgrib, &isecnum, iofst, 8);
    +
    162  iofst = iofst + 8;
    +
    163 
    +
    164  /* Check if previous Section 3 exists. */
    +
    165  if (isecnum == 3)
    +
    166  {
    +
    167  issec3 = 1;
    +
    168  lpos3 = len;
    +
    169  }
    +
    170  /* Check if a previous defined bitmap exists. */
    +
    171  if (isecnum == 6)
    +
    172  {
    +
    173  gbit(cgrib, &ibmprev, iofst, 8);
    +
    174  iofst = iofst + 8;
    +
    175  if (ibmprev >= 0 && ibmprev <= 253)
    +
    176  isprevbmap = 1;
    +
    177  }
    +
    178  len = len + ilen;
    +
    179 
    +
    180  /* Exit loop if last section reached. */
    +
    181  if (len == lencurr)
    +
    182  break;
    +
    183 
    +
    184  /* If byte count for each section doesn't match current */
    +
    185  /* total length, then there is a problem. */
    +
    186  if (len > lencurr)
    +
    187  {
    +
    188  printf("g2_addfield: Section byte counts don''t add to total.\n");
    +
    189  printf("g2_addfield: Sum of section byte counts = %ld\n", len);
    +
    190  printf("g2_addfield: Total byte count in Section 0 = %ld\n", lencurr);
    +
    191  ierr = -3;
    +
    192  return ierr;
    +
    193  }
    +
    194  }
    +
    195 
    +
    196  /* Sections 4 through 7 can only be added after section 3 or 7. */
    +
    197  if ((isecnum != 3) && (isecnum != 7))
    +
    198  {
    +
    199  printf("g2_addfield: Sections 4-7 can only be added after Section 3 or 7.\n");
    +
    200  printf("g2_addfield: Section ',isecnum,' was the last found in given GRIB message.\n");
    +
    201  ierr = -4;
    +
    202  return ierr;
    +
    203  }
    +
    204  else if (!issec3)
    +
    205  {
    +
    206  /* Sections 4 through 7 can only be added if section 3 was previously defined. */
    +
    207  printf("g2_addfield: Sections 4-7 can only be added if Section 3 was previously included.\n");
    +
    208  printf("g2_addfield: Section 3 was not found in given GRIB message.\n");
    +
    209  printf("g2_addfield: Call to routine addgrid required to specify Grid definition.\n");
    +
    210  ierr = -6;
    +
    211  return ierr;
    +
    212  }
    +
    213 
    +
    214  /* Add Section 4 - Product Definition Section. */
    +
    215  ibeg = lencurr * 8; /* Calculate offset for beginning of section 4 */
    +
    216  iofst = ibeg + 32; /* leave space for length of section */
    +
    217  sbit(cgrib, &four, iofst, 8); /* Store section number (4) */
    +
    218  iofst = iofst + 8;
    +
    219  sbit(cgrib, &numcoord, iofst, 16); /* Store num of coordinate values */
    +
    220  iofst = iofst + 16;
    +
    221  sbit(cgrib, &ipdsnum, iofst, 16); /* Store Prod Def Template num. */
    +
    222  iofst = iofst + 16;
    +
    223 
    +
    224  /* Get Product Definition Template. */
    +
    225  if (!(mappds = getpdstemplate(ipdsnum)))
    +
    226  { /* undefined template */
    +
    227  ierr = -5;
    +
    228  return ierr;
    +
    229  }
    +
    230 
    +
    231  /* Extend the Product Definition Template, if necessary. The */
    +
    232  /* number of values in a specific template may vary depending on */
    +
    233  /* data specified in the "static" part of the template. */
    +
    234  if (mappds->needext)
    +
    235  {
    +
    236  free(mappds);
    +
    237  mappds = extpdstemplate(ipdsnum, ipdstmpl);
    +
    238  }
    +
    239 
    +
    240  /* Pack up each input value in array ipdstmpl into the the */
    +
    241  /* appropriate number of octets, which are specified in */
    +
    242  /* corresponding entries in array mappds. */
    +
    243  for (i = 0; i < mappds->maplen; i++)
    +
    244  {
    +
    245  nbits = abs(mappds->map[i]) * 8;
    +
    246  if ((mappds->map[i] >= 0) || (ipdstmpl[i] >= 0))
    +
    247  sbit(cgrib, ipdstmpl + i, iofst, nbits);
    +
    248  else
    +
    249  {
    +
    250  sbit(cgrib, &one, iofst, 1);
    +
    251  temp = abs(ipdstmpl[i]);
    +
    252  sbit(cgrib, &temp, iofst + 1, nbits-1);
    +
    253  }
    +
    254  iofst = iofst + nbits;
    +
    255  }
    +
    256 
    +
    257  /* Pack template extension, if appropriate. */
    +
    258  j = mappds->maplen;
    +
    259  if (mappds->needext && (mappds->extlen > 0))
    +
    260  {
    +
    261  for (i = 0; i < mappds->extlen; i++)
    +
    262  {
    +
    263  nbits = abs(mappds->ext[i]) * 8;
    +
    264  if ((mappds->ext[i] >= 0) || (ipdstmpl[j] >= 0))
    +
    265  sbit(cgrib, ipdstmpl + j, iofst, nbits);
    +
    266  else
    +
    267  {
    +
    268  sbit(cgrib, &one, iofst, 1);
    +
    269  temp = abs(ipdstmpl[j]);
    +
    270  sbit(cgrib, &temp, iofst + 1, nbits-1);
    +
    271  }
    +
    272  iofst = iofst + nbits;
    +
    273  j++;
    +
    274  }
    +
    275  }
    +
    276  free(mappds);
    +
    277 
    +
    278  /* Add Optional list of vertical coordinate values after the */
    +
    279  /* Product Definition Template, if necessary. */
    +
    280  if (numcoord != 0)
    +
    281  {
    +
    282  coordieee = calloc(numcoord, sizeof(g2int));
    +
    283  mkieee(coordlist, coordieee, numcoord);
    +
    284  sbits(cgrib, coordieee, iofst, 32, 0, numcoord);
    +
    285  iofst = iofst + (32*numcoord);
    +
    286  free(coordieee);
    +
    287  }
    +
    288 
    +
    289  /* Calculate length of section 4 and store it in octets 1-4 of */
    +
    290  /* section 4. */
    +
    291  lensec4 = (iofst - ibeg) / 8;
    +
    292  sbit(cgrib, &lensec4, ibeg, 32);
    +
    293 
    +
    294  /* Pack Data using appropriate algorithm Get Data Representation */
    +
    295  /* Template */
    +
    296  if (!(mapdrs = getdrstemplate(idrsnum)))
    +
    297  {
    +
    298  ierr = -5;
    +
    299  return ierr;
    +
    300  }
    +
    301 
    +
    302  /* Contract data field, removing data at invalid grid points, if */
    +
    303  /* bit-map is provided with field. */
    +
    304  if (ibmap == 0 || ibmap == 254)
    +
    305  {
    +
    306  pfld = malloc(ngrdpts * sizeof(g2float));
    +
    307  ndpts = 0;
    +
    308  for (j = 0; j < ngrdpts; j++)
    +
    309  {
    +
    310  if (bmap[j] == 1)
    +
    311  pfld[ndpts++] = fld[j];
    +
    312  }
    +
    313  }
    +
    314  else
    +
    315  {
    +
    316  ndpts = ngrdpts;
    +
    317  pfld = fld;
    +
    318  }
    +
    319 
    +
    320  /* Allocate storage for the packed data. */
    +
    321  nsize = ndpts * 4;
    +
    322  if (nsize < minsize)
    +
    323  nsize = minsize;
    +
    324  cpack = malloc(nsize);
    +
    325 
    +
    326  /* Call packing function based on idrsnum. */
    +
    327  if (idrsnum == 0) /* Simple Packing */
    +
    328  simpack(pfld, ndpts, idrstmpl, cpack, &lcpack);
    +
    329  else if (idrsnum == 2 || idrsnum == 3) /* Complex Packing */
    +
    330  cmplxpack(pfld, ndpts, idrsnum, idrstmpl, cpack, &lcpack);
    +
    331  else if (idrsnum == 50) /* Sperical Harmonic Simple Packing */
    +
    332  {
    +
    333  simpack(pfld + 1, ndpts - 1, idrstmpl, cpack, &lcpack);
    +
    334  mkieee(pfld, idrstmpl + 4, 1); /* ensure RE(0, 0) value is IEEE format */
    +
    335  }
    +
    336  else if (idrsnum == 51) /* Sperical Harmonic Complex Packing */
    +
    337  {
    +
    338  getpoly(cgrib + lpos3, &JJ, &KK, &MM);
    +
    339  if (JJ != 0 && KK != 0 && MM != 0)
    +
    340  specpack(pfld, ndpts, JJ, KK, MM, idrstmpl, cpack, &lcpack);
    +
    341  else
    +
    342  {
    +
    343  printf("g2_addfield: Cannot pack DRT 5.51.\n");
    +
    344  return -9;
    +
    345  }
    +
    346  }
    +
    347 #if defined USE_JPEG2000 || defined USE_OPENJPEG
    +
    348  else if (idrsnum == 40 || idrsnum == 40000)
    +
    349  { /* JPEG2000 encoding */
    +
    350  if (ibmap == 255)
    +
    351  {
    +
    352  getdim(cgrib + lpos3, &width, &height, &iscan);
    +
    353  if (width == 0 || height == 0)
    +
    354  {
    +
    355  width = ndpts;
    +
    356  height = 1;
    +
    357  }
    +
    358  else if (width == allones || height == allones)
    +
    359  {
    +
    360  width = ndpts;
    +
    361  height = 1;
    +
    362  }
    +
    363  else if ((iscan&32) == 32)
    +
    364  { /* Scanning mode: bit 3 */
    +
    365  itemp = width;
    +
    366  width = height;
    +
    367  height = itemp;
    +
    368  }
    +
    369  }
    +
    370  else
    +
    371  {
    +
    372  width = ndpts;
    +
    373  height = 1;
    +
    374  }
    +
    375  lcpack = nsize;
    +
    376  jpcpack(pfld, width, height, idrstmpl, cpack, &lcpack);
    +
    377  }
    +
    378 #endif /* USE_JPEG2000 */
    +
    379 #ifdef USE_PNG
    +
    380  else if (idrsnum == 41 || idrsnum == 40010)
    +
    381  { /* PNG encoding */
    +
    382  if (ibmap == 255)
    +
    383  {
    +
    384  getdim(cgrib + lpos3, &width, &height, &iscan);
    +
    385  if (width==0 || height==0)
    +
    386  {
    +
    387  width = ndpts;
    +
    388  height = 1;
    +
    389  }
    +
    390  else if (width == allones || height == allones)
    +
    391  {
    +
    392  width = ndpts;
    +
    393  height = 1;
    +
    394  }
    +
    395  else if ((iscan & 32) == 32)
    +
    396  { /* Scanning mode: bit 3 */
    +
    397  itemp = width;
    +
    398  width = height;
    +
    399  height = itemp;
    +
    400  }
    +
    401  }
    +
    402  else
    +
    403  {
    +
    404  width = ndpts;
    +
    405  height = 1;
    +
    406  }
    +
    407  pngpack(pfld, width, height, idrstmpl, cpack, &lcpack);
    +
    408  }
    +
    409 #endif /* USE_PNG */
    +
    410  else
    +
    411  {
    +
    412  printf("g2_addfield: Data Representation Template 5.%ld not yet implemented.\n", idrsnum);
    +
    413  ierr = -7;
    +
    414  return ierr;
    +
    415  }
    +
    416  if (ibmap == 0 || ibmap == 254)
    +
    417  { /* free temp space */
    +
    418  if (fld != pfld)
    +
    419  free(pfld);
    +
    420  }
    +
    421  if (lcpack < 0)
    +
    422  {
    +
    423  if (cpack)
    +
    424  free(cpack);
    +
    425  ierr = -10;
    +
    426  return ierr;
    +
    427  }
    +
    428 
    +
    429  /* Add Section 5 - Data Representation Section */
    +
    430  ibeg = iofst; /* Calculate offset for beginning of section 5 */
    +
    431  iofst = ibeg + 32; /* leave space for length of section */
    +
    432  sbit(cgrib, &five, iofst, 8); /* Store section number (5) */
    +
    433  iofst = iofst + 8;
    +
    434  sbit(cgrib, &ndpts, iofst, 32); /* Store num of actual data points */
    +
    435  iofst = iofst + 32;
    +
    436  sbit(cgrib, &idrsnum, iofst, 16); /* Store Data Repr. Template num. */
    +
    437  iofst = iofst + 16;
    +
    438 
    +
    439  /* Pack up each input value in array idrstmpl into the */
    +
    440  /* the appropriate number of octets, which are specified in */
    +
    441  /* corresponding entries in array mapdrs. */
    +
    442  for (i = 0; i < mapdrs->maplen; i++)
    +
    443  {
    +
    444  nbits = abs(mapdrs->map[i]) * 8;
    +
    445  if ((mapdrs->map[i] >= 0) || (idrstmpl[i] >= 0))
    +
    446  sbit(cgrib, idrstmpl + i, iofst, nbits);
    +
    447  else
    +
    448  {
    +
    449  sbit(cgrib, &one, iofst, 1);
    +
    450  temp = abs(idrstmpl[i]);
    +
    451  sbit(cgrib, &temp, iofst + 1, nbits - 1);
    +
    452  }
    +
    453  iofst = iofst + nbits;
    +
    454  }
    +
    455  free(mapdrs);
    +
    456 
    +
    457  /* Calculate length of section 5 and store it in octets */
    +
    458  /* 1-4 of section 5. */
    +
    459  lensec5 = (iofst - ibeg) / 8;
    +
    460  sbit(cgrib, &lensec5, ibeg, 32);
    +
    461 
    +
    462  /* Add Section 6 - Bit-Map Section */
    +
    463  ibeg = iofst; /* Calculate offset for beginning of section 6 */
    +
    464  iofst = ibeg + 32; /* leave space for length of section */
    +
    465  sbit(cgrib, &six, iofst, 8); /* Store section number (6) */
    +
    466  iofst = iofst + 8;
    +
    467  sbit(cgrib, &ibmap, iofst, 8); /* Store Bit Map indicator */
    +
    468  iofst = iofst + 8;
    +
    469 
    +
    470  /* Store bitmap, if supplied */
    +
    471  if (ibmap == 0)
    +
    472  {
    +
    473  sbits(cgrib, bmap, iofst, 1, 0, ngrdpts); /* Store BitMap */
    +
    474  iofst = iofst + ngrdpts;
    +
    475  }
    +
    476 
    +
    477  /* If specifying a previously defined bit-map, make sure */
    +
    478  /* one already exists in the current GRIB message. */
    +
    479  if (ibmap == 254 && !isprevbmap)
    +
    480  {
    +
    481  printf("g2_addfield: Requested previously defined bitmap,");
    +
    482  printf(" but one does not exist in the current GRIB message.\n");
    +
    483  ierr = -8;
    +
    484  return ierr;
    +
    485  }
    +
    486 
    +
    487  /* Calculate length of section 6 and store it in octets */
    +
    488  /* 1-4 of section 6. Pad to end of octect, if necessary. */
    +
    489  left = 8 - (iofst % 8);
    +
    490  if (left != 8)
    +
    491  {
    +
    492  sbit(cgrib, &zero, iofst, left); /* Pad with zeros to fill Octet */
    +
    493  iofst = iofst + left;
    +
    494  }
    +
    495  lensec6 = (iofst-ibeg) / 8;
    +
    496  sbit(cgrib, &lensec6, ibeg, 32);
    +
    497 
    +
    498  /* Add Section 7 - Data Section */
    +
    499  ibeg = iofst; /* Calculate offset for beginning of section 7 */
    +
    500  iofst = ibeg + 32; /* leave space for length of section */
    +
    501  sbit(cgrib, &seven, iofst, 8); /* Store section number (7) */
    +
    502  iofst = iofst + 8;
    +
    503 
    +
    504  /* Store Packed Binary Data values, if non-constant field. */
    +
    505  if (lcpack != 0)
    +
    506  {
    +
    507  ioctet = iofst / 8;
    +
    508  /*cgrib(ioctet + 1:ioctet + lcpack)=cpack(1:lcpack) */
    +
    509  for (j = 0; j < lcpack; j++)
    +
    510  cgrib[ioctet + j] = cpack[j];
    +
    511  iofst = iofst + (8*lcpack);
    +
    512  }
    +
    513 
    +
    514  /* Calculate length of section 7 and store it in octets */
    +
    515  /* 1-4 of section 7. */
    +
    516  lensec7 = (iofst - ibeg) / 8;
    +
    517  sbit(cgrib, &lensec7, ibeg, 32);
    +
    518 
    +
    519  if (cpack != 0)
    +
    520  free(cpack);
    +
    521 
    +
    522  /* Update current byte total of message in Section 0 */
    +
    523  newlen = lencurr + lensec4 + lensec5 + lensec6 + lensec7;
    +
    524  sbit(cgrib, &newlen, 96, 32);
    +
    525 
    +
    526  return newlen;
    +
    527 
    +
    528 }
    +
    gtemplate * getdrstemplate(g2int number)
    This subroutine returns DRS template information for a specified Data Representation Template.
    Definition: drstemplates.c:64
    +
    g2int getpoly(unsigned char *, g2int *, g2int *, g2int *)
    This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Def...
    Definition: getpoly.c:40
    +
    g2int getdim(unsigned char *, g2int *, g2int *, g2int *)
    This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid De...
    Definition: getdim.c:29
    +
    void cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
    Definition: cmplxpack.c:35
    +
    void pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field into PNG image format.
    Definition: pngpack.c:38
    +
    void specpack(g2float *, g2int, g2int, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs a spectral data field using the complex packing algorithm for spherical harmoni...
    Definition: specpack.c:33
    +
    void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 docu...
    Definition: simpack.c:34
    +
    void jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field into a JPEG2000 code stream.
    Definition: jpcpack.c:53
    +
    g2int g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *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.
    Definition: g2_addfield.c:106
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    gtemplate * extpdstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Product Definition Template,...
    Definition: pdstemplates.c:121
    +
    gtemplate * getpdstemplate(g2int number)
    This subroutine returns PDS template information for a specified Product Definition Template.
    Definition: pdstemplates.c:73
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addgrid_8c.html b/ver-1.7.0/ver-1.6.4/g2__addgrid_8c.html new file mode 100644 index 00000000..ef3bdc95 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addgrid_8c.html @@ -0,0 +1,215 @@ + + + + + + + +NCEPLIBS-g2c: g2_addgrid.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_addgrid.c File Reference
    +
    +
    + +

    Pack up a Grid Definition Section (Section 3) and adds it to a GRIB2 message. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_addgrid()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_addgrid (unsigned char * cgrib,
    g2intigds,
    g2intigdstmpl,
    g2intideflist,
    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
    + + + + + + +
    cgribChar array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message.
    igdsContains 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).
    • +
    +
    igdstmplContains 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
    • +
    • -1 GRIB message was not initialized. Need to call routine gribcreate first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 1, 2 or 7.
    • +
    • -5 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 66 of file g2_addgrid.c.

    + +

    References gtemplate::ext, extgridtemplate(), gtemplate::extlen, gbit(), getgridtemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, sbit(), and sbits().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addgrid_8c.js b/ver-1.7.0/ver-1.6.4/g2__addgrid_8c.js new file mode 100644 index 00000000..05a5294e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__addgrid_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__addgrid_8c_source.html new file mode 100644 index 00000000..d2e2ca8c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addgrid_8c_source.html @@ -0,0 +1,288 @@ + + + + + + + +NCEPLIBS-g2c: g2_addgrid.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_addgrid.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    8 #include <stdio.h>
    +
    9 #include <stdlib.h>
    +
    10 #include "grib2.h"
    +
    11 
    +
    65 g2int
    +
    66 g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist,
    +
    67  g2int idefnum)
    +
    68 {
    +
    69  g2int ierr = 0;
    +
    70  static unsigned char G = 0x47; /* 'G' */
    +
    71  static unsigned char R = 0x52; /* 'R' */
    +
    72  static unsigned char I = 0x49; /* 'I' */
    +
    73  static unsigned char B = 0x42; /* 'B' */
    +
    74  static unsigned char seven = 0x37; /* '7' */
    +
    75 
    +
    76  static g2int one = 1, three = 3, miss = 65535;
    +
    77  g2int lensec3, iofst, ibeg, lencurr, len;
    +
    78  g2int i, j, temp, ilen, isecnum, nbits;
    +
    79  gtemplate *mapgrid = 0;
    +
    80 
    +
    81  /* Check to see if beginning of GRIB message exists. */
    +
    82  if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B)
    +
    83  {
    +
    84  printf("g2_addgrid: GRIB not found in given message.\n");
    +
    85  printf("g2_addgrid: Call to routine gribcreate required to initialize GRIB messge.\n");
    +
    86  ierr = -1;
    +
    87  return(ierr);
    +
    88  }
    +
    89 
    +
    90  /* Get current length of GRIB message. */
    +
    91  gbit(cgrib, &lencurr, 96, 32);
    +
    92 
    +
    93  /* Check to see if GRIB message is already complete. */
    +
    94  if (cgrib[lencurr - 4] == seven && cgrib[lencurr - 3] == seven &&
    +
    95  cgrib[lencurr - 2] == seven && cgrib[lencurr - 1] == seven)
    +
    96  {
    +
    97  printf("g2_addgrid: GRIB message already complete. Cannot add new section.\n");
    +
    98  ierr = -2;
    +
    99  return(ierr);
    +
    100  }
    +
    101 
    +
    102  /* Loop through all current sections of the GRIB message to find
    +
    103  * the last section number. */
    +
    104  len = 16; /* length of Section 0 */
    +
    105  for (;;)
    +
    106  {
    +
    107  /* Get section number and length of next section. */
    +
    108  iofst = len * 8;
    +
    109  gbit(cgrib, &ilen, iofst, 32);
    +
    110  iofst = iofst + 32;
    +
    111  gbit(cgrib, &isecnum, iofst, 8);
    +
    112  len = len + ilen;
    +
    113  /* Exit loop if last section reached. */
    +
    114  if (len == lencurr) break;
    +
    115  /* If byte count for each section doesn't match current total
    +
    116  * length, then there is a problem. */
    +
    117  if (len > lencurr)
    +
    118  {
    +
    119  printf("g2_addgrid: Section byte counts don''t add to total.\n");
    +
    120  printf("g2_addgrid: Sum of section byte counts = %ld\n", len);
    +
    121  printf("g2_addgrid: Total byte count in Section 0 = %ld\n", lencurr);
    +
    122  ierr = -3;
    +
    123  return(ierr);
    +
    124  }
    +
    125  }
    +
    126 
    +
    127  /* Section 3 can only be added after sections 1, 2 and 7. */
    +
    128  if (isecnum != 1 && isecnum != 2 && isecnum != 7)
    +
    129  {
    +
    130  printf("g2_addgrid: Section 3 can only be added after Section 1, 2 or 7.\n");
    +
    131  printf("g2_addgrid: Section ',isecnum,' was the last found in given GRIB message.\n");
    +
    132  ierr = -4;
    +
    133  return(ierr);
    +
    134  }
    +
    135 
    +
    136  /* Add Section 3 - Grid Definition Section. */
    +
    137  ibeg = lencurr * 8; /* Calculate offset for beginning of section 3 */
    +
    138  iofst = ibeg + 32; /* leave space for length of section */
    +
    139  sbit(cgrib, &three, iofst, 8); /* Store section number (3) */
    +
    140  iofst = iofst + 8;
    +
    141  sbit(cgrib, igds+0, iofst, 8); /* Store source of Grid def. */
    +
    142  iofst = iofst + 8;
    +
    143  sbit(cgrib, igds+1, iofst, 32); /* Store number of data pts. */
    +
    144  iofst = iofst + 32;
    +
    145  sbit(cgrib, igds+2, iofst, 8); /* Store number of extra octets. */
    +
    146  iofst = iofst + 8;
    +
    147  sbit(cgrib, igds+3, iofst, 8); /* Store interp. of extra octets. */
    +
    148  iofst = iofst + 8;
    +
    149 
    +
    150  /* if Octet 6 is not equal to zero, Grid Definition Template may
    +
    151  * not be supplied. */
    +
    152  if (igds[0] == 0)
    +
    153  sbit(cgrib, igds+4, iofst, 16); /* Store Grid Def Template num. */
    +
    154  else
    +
    155  sbit(cgrib, &miss, iofst, 16); /* Store missing value as Grid Def Template num. */
    +
    156  iofst = iofst + 16;
    +
    157 
    +
    158  /* Get Grid Definition Template. */
    +
    159  if (igds[0] == 0)
    +
    160  {
    +
    161  if (!(mapgrid = getgridtemplate(igds[4])))
    +
    162  { /* undefined template */
    +
    163  ierr = -5;
    +
    164  return ierr;
    +
    165  }
    +
    166 
    +
    167  /* Extend the Grid Definition Template, if necessary. The
    +
    168  * number of values in a specific template may vary depending
    +
    169  * on data specified in the "static" part of the template. */
    +
    170  if (mapgrid->needext)
    +
    171  {
    +
    172  free(mapgrid);
    +
    173  mapgrid = extgridtemplate(igds[4], igdstmpl);
    +
    174  }
    +
    175  }
    +
    176 
    +
    177  /* Pack up each input value in array igdstmpl into the
    +
    178  * appropriate number of octets, which are specified in
    +
    179  * corresponding entries in array mapgrid. */
    +
    180  for (i = 0; i < mapgrid->maplen; i++)
    +
    181  {
    +
    182  nbits = abs(mapgrid->map[i]) * 8;
    +
    183  if ((mapgrid->map[i] >= 0) || (igdstmpl[i] >= 0))
    +
    184  sbit(cgrib, igdstmpl+i, iofst, nbits);
    +
    185  else
    +
    186  {
    +
    187  sbit(cgrib, &one, iofst, 1);
    +
    188  temp = abs(igdstmpl[i]);
    +
    189  sbit(cgrib, &temp, iofst+1, nbits-1);
    +
    190  }
    +
    191  iofst = iofst + nbits;
    +
    192  }
    +
    193 
    +
    194  /* Pack template extension, if appropriate. */
    +
    195  j = mapgrid->maplen;
    +
    196  if (mapgrid->needext && mapgrid->extlen > 0)
    +
    197  {
    +
    198  for (i = 0; i < mapgrid->extlen; i++)
    +
    199  {
    +
    200  nbits = abs(mapgrid->ext[i]) * 8;
    +
    201  if (mapgrid->ext[i] >= 0 || igdstmpl[j] >= 0)
    +
    202  sbit(cgrib, igdstmpl + j, iofst, nbits);
    +
    203  else
    +
    204  {
    +
    205  sbit(cgrib, &one, iofst, 1);
    +
    206  temp = abs(igdstmpl[j]);
    +
    207  sbit(cgrib, &temp, iofst + 1, nbits - 1);
    +
    208  }
    +
    209  iofst = iofst + nbits;
    +
    210  j++;
    +
    211  }
    +
    212  }
    +
    213  free(mapgrid);
    +
    214 
    +
    215  /* If requested, insert optional list of numbers defining number
    +
    216  * of points in each row or column. This is used for non regular
    +
    217  * grids. */
    +
    218  if (igds[2] != 0)
    +
    219  {
    +
    220  nbits = igds[2] * 8;
    +
    221  sbits(cgrib, ideflist, iofst, nbits, 0, idefnum);
    +
    222  iofst = iofst + (nbits * idefnum);
    +
    223  }
    +
    224 
    +
    225  /* Calculate length of section 3 and store it in octets 1-4 of section 3. */
    +
    226  lensec3 = (iofst - ibeg) / 8;
    +
    227  sbit(cgrib, &lensec3, ibeg, 32);
    +
    228 
    +
    229  /* Update current byte total of message in Section 0. */
    +
    230  lencurr += lensec3;
    +
    231  sbit(cgrib, &lencurr, 96, 32);
    +
    232 
    +
    233  return lencurr;
    +
    234 }
    +
    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.
    Definition: g2_addgrid.c:66
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    gtemplate * extgridtemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Grid Definition Template,...
    +
    gtemplate * getgridtemplate(g2int number)
    This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
    Definition: gridtemplates.c:75
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addlocal_8c.html b/ver-1.7.0/ver-1.6.4/g2__addlocal_8c.html new file mode 100644 index 00000000..6bc9e230 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addlocal_8c.html @@ -0,0 +1,181 @@ + + + + + + + +NCEPLIBS-g2c: g2_addlocal.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_addlocal.c File Reference
    +
    +
    + +

    Add a Local Use Section (Section 2) to a GRIB2 message. +More...

    +
    #include <stdio.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    Add a Local Use Section (Section 2) to a GRIB2 message.

    +
    Author
    Stephen Gilbeert
    +
    Date
    2002-11-01
    + +

    Definition in file g2_addlocal.c.

    +

    Function Documentation

    + +

    ◆ 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. g2_create() must be called first to initialize a new GRIB2 message.

    +
    Parameters
    + + + + +
    cgribChar array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
    csec2Character array containing information to be added in Section 2.
    lcsec2Number of bytes of character array csec2 to be added to Section 2.
    +
    +
    +
    Returns
    > 0 = Current size of updated GRIB2 message.
      +
    • -1 GRIB message was not initialized. Need to call routine gribcreate first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 1 or 7.
    • +
    +
    +
    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 37 of file g2_addlocal.c.

    + +

    References gbit(), and sbit().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__addlocal_8c.js b/ver-1.7.0/ver-1.6.4/g2__addlocal_8c.js new file mode 100644 index 00000000..1a181d6b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__addlocal_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__addlocal_8c_source.html new file mode 100644 index 00000000..c0d5ed37 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__addlocal_8c_source.html @@ -0,0 +1,198 @@ + + + + + + + +NCEPLIBS-g2c: g2_addlocal.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_addlocal.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    36 g2int
    +
    37 g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
    +
    38 {
    +
    39  static unsigned char G = 0x47; /* 'G' */
    +
    40  static unsigned char R = 0x52; /* 'R' */
    +
    41  static unsigned char I = 0x49; /* 'I' */
    +
    42  static unsigned char B = 0x42; /* 'B' */
    +
    43  static unsigned char seven = 0x37; /* '7' */
    +
    44 
    +
    45  static g2int two = 2;
    +
    46  g2int j, k, lensec2, iofst, ibeg, lencurr, ilen, len, istart;
    +
    47  g2int isecnum;
    +
    48  g2int ierr = 0;
    +
    49 
    +
    50  /* Check to see if beginning of GRIB message exists. */
    +
    51  if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B)
    +
    52  {
    +
    53  printf("g2_addlocal: GRIB not found in given message.\n");
    +
    54  printf("g2_addlocal: Call to routine g2_create required to initialize GRIB messge.\n");
    +
    55  ierr = -1;
    +
    56  return(ierr);
    +
    57  }
    +
    58 
    +
    59  /* Get current length of GRIB message. */
    +
    60  gbit(cgrib, &lencurr, 96, 32);
    +
    61 
    +
    62  /* Check to see if GRIB message is already complete. */
    +
    63  if (cgrib[lencurr - 4] == seven && cgrib[lencurr - 3] == seven &&
    +
    64  cgrib[lencurr - 2] == seven && cgrib[lencurr - 1] == seven)
    +
    65  {
    +
    66  printf("g2_addlocal: GRIB message already complete. Cannot add new section.\n");
    +
    67  ierr = -2;
    +
    68  return(ierr);
    +
    69  }
    +
    70 
    +
    71  /* Loop through all current sections of the GRIB message to find
    +
    72  * the last section number. */
    +
    73  len = 16; /* length of Section 0 */
    +
    74  for (;;)
    +
    75  {
    +
    76  /* Get section number and length of next section. */
    +
    77  iofst = len * 8;
    +
    78  gbit(cgrib, &ilen, iofst, 32);
    +
    79  iofst = iofst + 32;
    +
    80  gbit(cgrib, &isecnum, iofst, 8);
    +
    81  len = len + ilen;
    +
    82  /* Exit loop if last section reached. */
    +
    83  if (len == lencurr)
    +
    84  break;
    +
    85  /* If byte count for each section doesn't match current total
    +
    86  * length, then there is a problem. */
    +
    87  if (len > lencurr)
    +
    88  {
    +
    89  printf("g2_addlocal: Section byte counts don't add to total.\n");
    +
    90  printf("g2_addlocal: Sum of section byte counts = %ld\n", len);
    +
    91  printf("g2_addlocal: Total byte count in Section 0 = %ld\n", lencurr);
    +
    92  ierr = -3;
    +
    93  return(ierr);
    +
    94  }
    +
    95  }
    +
    96 
    +
    97  /* Section 2 can only be added after sections 1 and 7. */
    +
    98  if (isecnum != 1 && isecnum != 7)
    +
    99  {
    +
    100  printf("g2_addlocal: Section 2 can only be added after Section 1 or Section 7.\n");
    +
    101  printf("g2_addlocal: Section %ld was the last found in given GRIB message.\n", isecnum);
    +
    102  ierr = -4;
    +
    103  return(ierr);
    +
    104  }
    +
    105 
    +
    106  /* Add Section 2 - Local Use Section. */
    +
    107  ibeg = lencurr * 8; /* Calculate offset for beginning of section 2 */
    +
    108  iofst = ibeg + 32; /* leave space for length of section */
    +
    109  sbit(cgrib, &two, iofst, 8); /* Store section number (2) */
    +
    110  istart = lencurr + 5;
    +
    111  //cgrib(istart+1:istart+lcsec2) = csec2(1:lcsec2)
    +
    112  k = 0;
    +
    113  for (j = istart; j < istart + lcsec2; j++)
    +
    114  cgrib[j] = csec2[k++];
    +
    115 
    +
    116  /* Calculate length of section 2 and store it in octets 1-4 of section 2. */
    +
    117  lensec2 = lcsec2 + 5; /* bytes */
    +
    118  sbit(cgrib, &lensec2, ibeg, 32);
    +
    119 
    +
    120  /* Update current byte total of message in Section 0. */
    +
    121  lencurr += lensec2;
    +
    122  sbit(cgrib, &lencurr, 96, 32);
    +
    123 
    +
    124  return(lencurr);
    +
    125 }
    +
    g2int g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
    This routine adds a Local Use Section (Section 2) to a GRIB2 message.
    Definition: g2_addlocal.c:37
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__create_8c.html b/ver-1.7.0/ver-1.6.4/g2__create_8c.html new file mode 100644 index 00000000..a65852ad --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__create_8c.html @@ -0,0 +1,244 @@ + + + + + + + +NCEPLIBS-g2c: g2_create.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_create.c File Reference
    +
    +
    + +

    Initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section). +More...

    +
    #include <stdio.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define LENSEC0   16
     Length of GRIB Section 0. More...
     
    #define MAPSEC1LEN   13
     Length of Map Section 1. More...
     
    + + + + +

    +Functions

    g2int g2_create (unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
     This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section). More...
     
    +

    Detailed Description

    +

    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.

    +

    Macro Definition Documentation

    + +

    ◆ 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.

    + +
    +
    +

    Function Documentation

    + +

    ◆ g2_create()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_create (unsigned char * cgrib,
    g2intlistsec0,
    g2intlistsec1 
    )
    +
    + +

    This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 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]cgribCharacter array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
    [in]listsec0Contains 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]listsec1Contains 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
      +
    • -1 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 63 of file g2_create.c.

    + +

    References LENSEC0, MAPSEC1LEN, and sbit().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__create_8c.js b/ver-1.7.0/ver-1.6.4/g2__create_8c.js new file mode 100644 index 00000000..1eef7573 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__create_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__create_8c_source.html new file mode 100644 index 00000000..1a388a4e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__create_8c_source.html @@ -0,0 +1,171 @@ + + + + + + + +NCEPLIBS-g2c: g2_create.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_create.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    10 #define MAPSEC1LEN 13
    +
    11 #define LENSEC0 16
    +
    62 g2int
    +
    63 g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
    +
    64 {
    +
    65  g2int ierr = 0;
    +
    66  g2int zero = 0, one = 1;
    +
    67 
    +
    68  /* The mapsec1 array tells us how many bytes are used in the GRIB
    +
    69  * message by each element of the listsec1 array. For example the
    +
    70  * first two elements of listsec1 are identifcation of originating
    +
    71  * section and sub-section - these are each 2-byte entries in the
    +
    72  * GRIB section 1 table, the IDENTIFICATION SECTION. (See
    +
    73  * https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect1.shtml). */
    +
    74  g2int mapsec1[MAPSEC1LEN] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
    +
    75  g2int i, lensec1, iofst, ibeg, nbits, len;
    +
    76 
    +
    77  /* Only GRIB Edition 2 is acceptable. */
    +
    78  if (listsec0[1] != 2)
    +
    79  {
    +
    80  printf("g2_create: can only code GRIB edition 2.");
    +
    81  ierr = -1;
    +
    82  return (ierr);
    +
    83  }
    +
    84 
    +
    85  /* Pack Section 0 - Indicator Section (except for total length of
    +
    86  * GRIB message). */
    +
    87  cgrib[0] = 0x47; /* 'G' */
    +
    88  cgrib[1] = 0x52; /* 'R' */
    +
    89  cgrib[2] = 0x49; /* 'I' */
    +
    90  cgrib[3] = 0x42; /* 'B' */
    +
    91  sbit(cgrib, &zero, 32, 16); /* reserved for future use */
    +
    92  sbit(cgrib, listsec0 + 0, 48, 8); /* Discipline */
    +
    93  sbit(cgrib, listsec0 + 1, 56, 8); /* GRIB edition number */
    +
    94 
    +
    95  /* Pack Section 1 - Identification Section. */
    +
    96  ibeg = LENSEC0 * 8; /* Calculate offset for beginning of section 1. */
    +
    97  iofst = ibeg + 32; /* Leave space for length of section. */
    +
    98  sbit(cgrib, &one, iofst, 8); /* Store section number (1). */
    +
    99  iofst = iofst + 8;
    +
    100 
    +
    101  /* Pack up each input value in array listsec1 into the the
    +
    102  * appropriate number of octets, which are specified in
    +
    103  * corresponding entries in array mapsec1. */
    +
    104  for (i = 0; i < MAPSEC1LEN; i++)
    +
    105  {
    +
    106  nbits = mapsec1[i] * 8;
    +
    107  sbit(cgrib, listsec1 + i, iofst, nbits);
    +
    108  iofst = iofst + nbits;
    +
    109  }
    +
    110 
    +
    111  /* Calculate length of section 1 and store it in octets 1-4 of
    +
    112  * section 1. */
    +
    113  lensec1 = (iofst - ibeg) / 8;
    +
    114  sbit(cgrib, &lensec1, ibeg, 32);
    +
    115 
    +
    116  /* Put current byte total of message into Section 0. */
    +
    117  sbit(cgrib, &zero, 64, 32);
    +
    118  len = LENSEC0 + lensec1;
    +
    119  sbit(cgrib, &len, 96, 32);
    +
    120  return (len);
    +
    121 }
    +
    g2int g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1)
    This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Id...
    Definition: g2_create.c:63
    +
    #define LENSEC0
    Length of GRIB Section 0.
    Definition: g2_create.c:11
    +
    #define MAPSEC1LEN
    Length of Map Section 1.
    Definition: g2_create.c:10
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__free_8c.html b/ver-1.7.0/ver-1.6.4/g2__free_8c.html new file mode 100644 index 00000000..2731bdf7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__free_8c.html @@ -0,0 +1,155 @@ + + + + + + + +NCEPLIBS-g2c: g2_free.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_free.c File Reference
    +
    +
    + +

    Free up memory that was allocated for struct gribfield. +More...

    +
    #include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void g2_free (gribfield *gfld)
     This routine frees up memory that was allocated for struct gribfield. More...
     
    +

    Detailed Description

    +

    Free up memory that was allocated for struct gribfield.

    +
    Author
    Stephen Gilbeert
    +
    Date
    2002-10-28
    + +

    Definition in file g2_free.c.

    +

    Function Documentation

    + +

    ◆ g2_free()

    + +
    +
    + + + + + + + + +
    void g2_free (gribfieldgfld)
    +
    + +

    This routine frees up memory that was allocated for struct gribfield.

    +
    Parameters
    + + +
    gfldpointer 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.

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__free_8c.js b/ver-1.7.0/ver-1.6.4/g2__free_8c.js new file mode 100644 index 00000000..fcd0c051 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__free_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__free_8c_source.html new file mode 100644 index 00000000..49bc5902 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__free_8c_source.html @@ -0,0 +1,131 @@ + + + + + + + +NCEPLIBS-g2c: g2_free.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_free.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    23 void
    + +
    25 {
    +
    26  if (gfld->idsect != 0 ) free(gfld->idsect);
    +
    27  if (gfld->local != 0 ) free(gfld->local);
    +
    28  if (gfld->list_opt != 0 ) free(gfld->list_opt);
    +
    29  if (gfld->igdtmpl != 0 ) free(gfld->igdtmpl);
    +
    30  if (gfld->ipdtmpl != 0 ) free(gfld->ipdtmpl);
    +
    31  if (gfld->coord_list != 0 ) free(gfld->coord_list);
    +
    32  if (gfld->idrtmpl != 0 ) free(gfld->idrtmpl);
    +
    33  if (gfld->bmap != 0 ) free(gfld->bmap);
    +
    34  if (gfld->fld != 0 ) free(gfld->fld);
    +
    35  free(gfld);
    +
    36 
    +
    37  return;
    +
    38 }
    +
    void g2_free(gribfield *gfld)
    This routine frees up memory that was allocated for struct gribfield.
    Definition: g2_free.c:24
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2float * coord_list
    Array containing floating point values intended to document the vertical discretisation associated to...
    Definition: grib2.h:191
    +
    g2int * ipdtmpl
    Contains the data values for the Product Definition Template specified by ipdtnum.
    Definition: grib2.h:183
    +
    g2int * igdtmpl
    Contains the data values for the Grid Definition Template specified by igdtnum.
    Definition: grib2.h:171
    +
    g2int * idrtmpl
    Contains the data values for the Data Representation Template specified by idrtnum.
    Definition: grib2.h:205
    +
    g2int * list_opt
    (Used if numoct_opt .ne.
    Definition: grib2.h:159
    +
    g2int * idsect
    Contains the entries in the Identification Section (Section 1).
    Definition: grib2.h:115
    +
    g2float * fld
    Array of ndpts unpacked data points.
    Definition: grib2.h:233
    +
    unsigned char * local
    Pointer to character array containing contents of Local Section 2, if included.
    Definition: grib2.h:122
    +
    g2int * bmap
    Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
    Definition: grib2.h:230
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__getfld_8c.html b/ver-1.7.0/ver-1.6.4/g2__getfld_8c.html new file mode 100644 index 00000000..ad4d180d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__getfld_8c.html @@ -0,0 +1,902 @@ + + + + + + + +NCEPLIBS-g2c: g2_getfld.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_getfld.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    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_unpack1 (unsigned char *, g2int *, g2int **, g2int *)
     This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2. More...
     
    g2int g2_unpack2 (unsigned char *, g2int *, g2int *, unsigned char **)
     This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack3 (unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
     This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack4 (unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *)
     This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack5 (unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *)
     This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack6 (unsigned char *, g2int *, g2int, g2int *, g2int **)
     This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack7 (unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **)
     This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ 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
    + + + + + + +
    cgribCharacter pointer to the GRIB2 message.
    ifldnumSpecifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
    unpackBoolean value indicating whether to unpack bitmap/data field.
      +
    • 1 unpack bitmap (if present) and data values.
    • +
    • 0 do not unpack bitmap and data values.
    • +
    +
    expandBoolean 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.
    • +
    +
    gfldpointer to structure gribfield containing all decoded data for the data field.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 1 Beginning characters "GRIB" not found.
    • +
    • 2 GRIB message is not Edition 2.
    • +
    • 3 The data field request number was not positive.
    • +
    • 4 End string "7777" found, but not where expected.
    • +
    • 6 GRIB message did not contain the requested number of data fields.
    • +
    • 7 End string "7777" not found at end of message.
    • +
    • 8 Unrecognized Section encountered.
    • +
    • 9 Data Representation Template 5.NN not yet implemented.
    • +
    • 15 Error unpacking Section 1.
    • +
    • 16 Error unpacking Section 2.
    • +
    • 10 Error unpacking Section 3.
    • +
    • 11 Error unpacking Section 4.
    • +
    • 12 Error unpacking Section 5.
    • +
    • 13 Error unpacking Section 6.
    • +
    • 14 Error unpacking Section 7.
    • +
    • 17 Previous bitmap specified, yet none exists.
    • +
    +
    +
    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:

    +
    #include "grib2.h"
    +
    gribfield *gfld;
    +
    ret=g2_getfld(cgrib,1,1,1,&gfld);
    +
    ...
    +
    g2_free(gfld);
    +
    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),...
    Definition: g2_getfld.c:102
    +
    Header file for NCEPLIBS-g2c library.
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +

    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 102 of file g2_getfld.c.

    + +

    References gribfield::bmap, gribfield::coord_list, gribfield::discipline, gribfield::expanded, gribfield::fld, 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_unpack1()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack1 (unsigned char * cgrib,
    g2intiofst,
    g2int ** ids,
    g2intidslen 
    )
    +
    + +

    This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + +
    cgribchar array containing Section 1 of the GRIB2 message.
    iofstBit offset for the beginning of Section 1 in cgrib.
    idsPointer 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).
    • +
    +
    idslenNumber of elements in ids.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Array passed is not section 1
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition at line 55 of file g2_unpack1.c.

    + +

    References gbit().

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ g2_unpack2()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack2 (unsigned char * cgrib,
    g2intiofst,
    g2intlencsec2,
    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
    + + + + + +
    cgribchar array containing Section 2 of the GRIB2 message.
    iofstBit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
    lencsec2Length (in octets) of Local Use data.
    csec2Pointer to a char array containing local use data.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Array passed is not section 2
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 37 of file g2_unpack2.c.

    + +

    References gbit().

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ g2_unpack3()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack3 (unsigned char * cgrib,
    g2intiofst,
    g2int ** igds,
    g2int ** igdstmpl,
    g2intmapgridlen,
    g2int ** ideflist,
    g2intidefnum 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribChar array ontaining Section 3 of the GRIB2 message.
    iofstBit offset for the beginning of Section 3 in cgrib.
    igdsContains 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).
    • +
    +
    igdstmplPointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
    mapgridlenNumber 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
      +
    • 0 no error
    • +
    • 2 Not Section 3
    • +
    • 5 message contains an undefined Grid Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 57 of file g2_unpack3.c.

    + +

    References gtemplate::ext, extgridtemplate(), gtemplate::extlen, 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,
    g2intiofst,
    g2intipdsnum,
    g2int ** ipdstmpl,
    g2intmappdslen,
    g2float ** coordlist,
    g2intnumcoord 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribArray containing Section 4 of the GRIB2 message.
    iofstBit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
    ipdsnumProduct Definition Template Number (see Table 4.0).
    ipdstmplPointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
    mappdslenNumber of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
    coordlistPointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
    numcoordnumber of values in array coordlist.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 4
    • +
    • 5 "GRIB" message contains an undefined Product Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 45 of file g2_unpack4.c.

    + +

    References gtemplate::ext, gtemplate::extlen, extpdstemplate(), gbit(), gbits(), getpdstemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, and rdieee().

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ g2_unpack5()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack5 (unsigned char * cgrib,
    g2intiofst,
    g2intndpts,
    g2intidrsnum,
    g2int ** idrstmpl,
    g2intmapdrslen 
    )
    +
    + +

    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
    + + + + + + + +
    cgribchar array containing Section 5 of the GRIB2 message.
    iofstBit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
    ndptsNumber of data points unpacked and returned.
    idrsnumData Representation Template Number (see Code Table 5.0).
    idrstmplPointer 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
      +
    • 0 no error
    • +
    • 2 Not Section 5
    • +
    • 6 memory allocation error
    • +
    • 7 "GRIB" message contains an undefined Data Representation Template.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 42 of file g2_unpack5.c.

    + +

    References gtemplate::ext, extdrstemplate(), gtemplate::extlen, gbit(), getdrstemplate(), gtemplate::map, gtemplate::maplen, and gtemplate::needext.

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ g2_unpack6()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack6 (unsigned char * cgrib,
    g2intiofst,
    g2int ngpts,
    g2intibmap,
    g2int ** bmap 
    )
    +
    + +

    This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + + +
    cgribchar array containing Section 6 of the GRIB2 message.
    iofstBit offset of the beginning of Section 6 in cgrib.
    ngptsNumber of grid points specified in the bit-map
    ibmapBitmap 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.
    • +
    +
    bmapPointer to an integer array containing decoded bitmap. (if ibmap=0)
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not Section 6
    • +
    • 4 Unrecognized pre-defined bit-map.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 33 of file g2_unpack6.c.

    + +

    References gbit(), and gbits().

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ g2_unpack7()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack7 (unsigned char * cgrib,
    g2intiofst,
    g2int igdsnum,
    g2intigdstmpl,
    g2int idrsnum,
    g2intidrstmpl,
    g2int ndpts,
    g2float ** 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
    + + + + + + + + + +
    cgribchar array containing Section 7 of the GRIB2 message
    iofstBit offset of the beginning of Section 7 in cgrib.
    igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
    igdstmplPointer 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).
    idrsnumData Representation Template Number (see Code Table 5.0)
    idrstmplPointer 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
    ndptsNumber of data points unpacked and returned.
    fldPointer to a float array containing the unpacked data field.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 7
    • +
    • 4 Unrecognized Data Representation Template
    • +
    • 5 need one of GDT 3.50 through 3.53 to decode DRT 5.51
    • +
    • 6 memory allocation error
    • +
    • 7 corrupt section 7.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 65 of file g2_unpack7.c.

    + +

    References comunpack(), gbit(), jpcunpack(), pngunpack(), rdieee(), simunpack(), and specunpack().

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__getfld_8c.js b/ver-1.7.0/ver-1.6.4/g2__getfld_8c.js new file mode 100644 index 00000000..9307ee5e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__getfld_8c.js @@ -0,0 +1,11 @@ +var g2__getfld_8c = +[ + [ "g2_getfld", "g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e", null ], + [ "g2_unpack1", "g2__getfld_8c.html#a3796bb89e5b8aba66fc624bc8b377a3b", null ], + [ "g2_unpack2", "g2__getfld_8c.html#a44c84dc7f9ca05a7901013cd5051000d", null ], + [ "g2_unpack3", "g2__getfld_8c.html#a7f3d062f236f46e6835f689a149ef88a", null ], + [ "g2_unpack4", "g2__getfld_8c.html#a91d98f7e471cce705c43b039b7d87533", null ], + [ "g2_unpack5", "g2__getfld_8c.html#a37ec4c9e3f74008a74bd11828152df5c", null ], + [ "g2_unpack6", "g2__getfld_8c.html#a27a12127e9cfe2155056e19b035f9256", null ], + [ "g2_unpack7", "g2__getfld_8c.html#a1783305479f24e498089dd59309215f6", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/g2__getfld_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__getfld_8c_source.html new file mode 100644 index 00000000..0e12895b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__getfld_8c_source.html @@ -0,0 +1,443 @@ + + + + + + + +NCEPLIBS-g2c: g2_getfld.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_getfld.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    10 g2int g2_unpack1(unsigned char *,g2int *,g2int **,g2int *);
    +
    11 g2int g2_unpack2(unsigned char *,g2int *,g2int *,unsigned char **);
    +
    12 g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
    +
    13  g2int *,g2int **,g2int *);
    +
    14 g2int g2_unpack4(unsigned char *,g2int *,g2int *,g2int **,
    +
    15  g2int *,g2float **,g2int *);
    +
    16 g2int g2_unpack5(unsigned char *,g2int *,g2int *,g2int *, g2int **,g2int *);
    +
    17 g2int g2_unpack6(unsigned char *,g2int *,g2int ,g2int *, g2int **);
    +
    18 g2int g2_unpack7(unsigned char *,g2int *,g2int ,g2int *,
    +
    19  g2int ,g2int *,g2int ,g2float **);
    +
    20 
    +
    101 g2int
    +
    102 g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand,
    +
    103  gribfield **gfld)
    +
    104 {
    +
    105 
    +
    106  g2int have3 = 0, have4 = 0, have5 = 0, have6 = 0, have7 = 0, ierr = 0, jerr;
    +
    107  g2int numfld = 0, j, n, istart, iofst, ipos;
    +
    108  g2int disc, ver, lensec0, lengrib, lensec, isecnum;
    +
    109  g2int *igds;
    +
    110  g2int *bmpsave;
    +
    111  g2float *newfld;
    +
    112  gribfield *lgfld;
    +
    113 
    +
    114  lgfld = malloc(sizeof(gribfield));
    +
    115  *gfld = lgfld;
    +
    116 
    +
    117  lgfld->locallen = 0;
    +
    118  lgfld->idsect = 0;
    +
    119  lgfld->local = 0;
    +
    120  lgfld->list_opt = 0;
    +
    121  lgfld->igdtmpl = 0;
    +
    122  lgfld->ipdtmpl = 0;
    +
    123  lgfld->idrtmpl = 0;
    +
    124  lgfld->coord_list = 0;
    +
    125  lgfld->bmap = 0;
    +
    126  lgfld->fld = 0;
    +
    127 
    +
    128  /* Check for valid request number. */
    +
    129  if (ifldnum <= 0) {
    +
    130  printf("g2_getfld: Request for field number must be positive.\n");
    +
    131  ierr = 3;
    +
    132  return(ierr);
    +
    133  }
    +
    134 
    +
    135  /* Check for beginning of GRIB message in the first 100 bytes. */
    +
    136  istart = -1;
    +
    137  for (j = 0; j < 100; j++) {
    +
    138  if (cgrib[j] == 'G' && cgrib[j + 1] == 'R' &&cgrib[j + 2] == 'I' &&
    +
    139  cgrib[j + 3] == 'B') {
    +
    140  istart = j;
    +
    141  break;
    +
    142  }
    +
    143  }
    +
    144  if (istart == -1) {
    +
    145  printf("g2_getfld: Beginning characters GRIB not found.\n");
    +
    146  ierr = 1;
    +
    147  return(ierr);
    +
    148  }
    +
    149 
    +
    150  /* Unpack Section 0 - Indicator Section. */
    +
    151  iofst = 8 * (istart + 6);
    +
    152  gbit(cgrib, &disc, iofst, 8); /* Discipline */
    +
    153  iofst = iofst + 8;
    +
    154  gbit(cgrib, &ver, iofst, 8); /* GRIB edition number */
    +
    155  iofst = iofst + 8;
    +
    156  iofst = iofst + 32;
    +
    157  gbit(cgrib, &lengrib, iofst, 32); /* Length of GRIB message */
    +
    158  iofst = iofst + 32;
    +
    159  lensec0 = 16;
    +
    160  ipos = istart + lensec0;
    +
    161 
    +
    162  /* Currently handles only GRIB Edition 2. */
    +
    163  if (ver != 2) {
    +
    164  printf("g2_getfld: can only decode GRIB edition 2.\n");
    +
    165  ierr = 2;
    +
    166  return(ierr);
    +
    167  }
    +
    168 
    +
    169  /* Loop through the remaining sections keeping track of the
    +
    170  * length of each. Also keep the latest Grid Definition Section
    +
    171  * info. Unpack the requested field number. */
    +
    172  for (;;) {
    +
    173  /* Check to see if we are at end of GRIB message */
    +
    174  if (cgrib[ipos] == '7' && cgrib[ipos+1] == '7' && cgrib[ipos+2] == '7' &&
    +
    175  cgrib[ipos+3] == '7') {
    +
    176  ipos = ipos+4;
    +
    177  /* If end of GRIB message not where expected, issue error */
    +
    178  if (ipos != (istart+lengrib)) {
    +
    179  printf("g2_getfld: '7777' found, but not where expected.\n");
    +
    180  ierr = 4;
    +
    181  return(ierr);
    +
    182  }
    +
    183  break;
    +
    184  }
    +
    185  /* Get length of Section and Section number */
    +
    186  iofst = (ipos - 1) * 8;
    +
    187  iofst = ipos * 8;
    +
    188  gbit(cgrib, &lensec, iofst, 32); /* Get Length of Section */
    +
    189  iofst = iofst + 32;
    +
    190  gbit(cgrib, &isecnum, iofst, 8); /* Get Section number */
    +
    191  iofst = iofst + 8;
    +
    192  /*printf(" lensec= %ld secnum= %ld \n", lensec, isecnum); */
    +
    193 
    +
    194  /* Check to see if section number is valid. */
    +
    195  if (isecnum < 1 || isecnum > 7) {
    +
    196  printf("g2_getfld: Unrecognized Section Encountered=%ld\n", isecnum);
    +
    197  ierr = 8;
    +
    198  return(ierr);
    +
    199  }
    +
    200 
    +
    201  /* If found Section 1, decode elements in Identification Section. */
    +
    202  if (isecnum == 1) {
    +
    203  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    204  jerr = g2_unpack1(cgrib, &iofst, &lgfld->idsect, &lgfld->idsectlen);
    +
    205  if (jerr !=0) {
    +
    206  ierr = 15;
    +
    207  return(ierr);
    +
    208  }
    +
    209  }
    +
    210 
    +
    211  /* If found Section 2, Grab local section. Save in case this
    +
    212  * is the latest one before the requested field. */
    +
    213  if (isecnum == 2) {
    +
    214  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    215  if (lgfld->local != 0)
    +
    216  free(lgfld->local);
    +
    217  jerr = g2_unpack2(cgrib, &iofst, &lgfld->locallen, &lgfld->local);
    +
    218  if (jerr != 0) {
    +
    219  ierr = 16;
    +
    220  return(ierr);
    +
    221  }
    +
    222  }
    +
    223 
    +
    224  /* If found Section 3, unpack the GDS info using the
    +
    225  * appropriate template. Save in case this is the latest grid
    +
    226  * before the requested field. */
    +
    227  if (isecnum == 3) {
    +
    228  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    229  if (lgfld->igdtmpl!=0) free(lgfld->igdtmpl);
    +
    230  if (lgfld->list_opt!=0) free(lgfld->list_opt);
    +
    231  jerr = g2_unpack3(cgrib, &iofst, &igds, &lgfld->igdtmpl,
    +
    232  &lgfld->igdtlen, &lgfld->list_opt, &lgfld->num_opt);
    +
    233  if (jerr == 0) {
    +
    234  have3 = 1;
    +
    235  lgfld->griddef = igds[0];
    +
    236  lgfld->ngrdpts = igds[1];
    +
    237  lgfld->numoct_opt = igds[2];
    +
    238  lgfld->interp_opt = igds[3];
    +
    239  lgfld->igdtnum = igds[4];
    +
    240  free(igds);
    +
    241  }
    +
    242  else {
    +
    243  ierr = 10;
    +
    244  return(ierr);
    +
    245  }
    +
    246  }
    +
    247 
    +
    248  /* If found Section 4, check to see if this field is the one
    +
    249  * requested. */
    +
    250  if (isecnum == 4) {
    +
    251  numfld = numfld + 1;
    +
    252  if (numfld == ifldnum) {
    +
    253  lgfld->discipline = disc;
    +
    254  lgfld->version = ver;
    +
    255  lgfld->ifldnum = ifldnum;
    +
    256  lgfld->unpacked = unpack;
    +
    257  lgfld->expanded = 0;
    +
    258  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    259  jerr = g2_unpack4(cgrib, &iofst, &lgfld->ipdtnum,
    +
    260  &lgfld->ipdtmpl, &lgfld->ipdtlen, &lgfld->coord_list,
    +
    261  &lgfld->num_coord);
    +
    262  if (jerr == 0)
    +
    263  have4 = 1;
    +
    264  else {
    +
    265  ierr = 11;
    +
    266  return(ierr);
    +
    267  }
    +
    268  }
    +
    269  }
    +
    270 
    +
    271  /* If found Section 5, check to see if this field is the one
    +
    272  * requested. */
    +
    273  if (isecnum == 5 && numfld == ifldnum) {
    +
    274  iofst = iofst-40; /* reset offset to beginning of section */
    +
    275  jerr = g2_unpack5(cgrib, &iofst, &lgfld->ndpts, &lgfld->idrtnum,
    +
    276  &lgfld->idrtmpl, &lgfld->idrtlen);
    +
    277  if (jerr == 0)
    +
    278  have5 = 1;
    +
    279  else {
    +
    280  ierr = 12;
    +
    281  return(ierr);
    +
    282  }
    +
    283  }
    +
    284 
    +
    285  /* If found Section 6, Unpack bitmap. Save in case this is
    +
    286  * the latest bitmap before the requested field. */
    +
    287  if (isecnum == 6) {
    +
    288  if (unpack) { /* unpack bitmap */
    +
    289  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    290  bmpsave = lgfld->bmap; /* save pointer to previous bitmap */
    +
    291  jerr = g2_unpack6(cgrib, &iofst, lgfld->ngrdpts, &lgfld->ibmap,
    +
    292  &lgfld->bmap);
    +
    293  if (jerr == 0) {
    +
    294  have6 = 1;
    +
    295  if (lgfld->ibmap == 254) /* use previously specified bitmap */
    +
    296  if (bmpsave != 0)
    +
    297  lgfld->bmap = bmpsave;
    +
    298  else {
    +
    299  printf("g2_getfld: Prev bit-map specified, but none exist.\n");
    +
    300  ierr = 17;
    +
    301  return(ierr);
    +
    302  }
    +
    303  else /* get rid of it */
    +
    304  if (bmpsave!=0)
    +
    305  free(bmpsave);
    +
    306  }
    +
    307  else {
    +
    308  ierr = 13;
    +
    309  return(ierr);
    +
    310  }
    +
    311  }
    +
    312  else { /* do not unpack bitmap */
    +
    313  gbit(cgrib, &lgfld->ibmap, iofst, 8); /* Get BitMap Indicator */
    +
    314  have6 = 1;
    +
    315  }
    +
    316  }
    +
    317 
    +
    318  /* If found Section 7, check to see if this field is the one
    +
    319  * requested. */
    +
    320  if (isecnum == 7 && numfld == ifldnum && unpack) {
    +
    321  iofst = iofst - 40; /* reset offset to beginning of section */
    +
    322  jerr = g2_unpack7(cgrib, &iofst, lgfld->igdtnum, lgfld->igdtmpl,
    +
    323  lgfld->idrtnum, lgfld->idrtmpl, lgfld->ndpts,
    +
    324  &lgfld->fld);
    +
    325  if (jerr == 0) {
    +
    326  have7 = 1;
    +
    327  /* If bitmap is used with this field, expand data field */
    +
    328  /* to grid, if possible. */
    +
    329  if (lgfld->ibmap != 255 && lgfld->bmap != 0) {
    +
    330  if (expand == 1) {
    +
    331  n = 0;
    +
    332  newfld = calloc(lgfld->ngrdpts, sizeof(g2float));
    +
    333  for (j = 0;j<lgfld->ngrdpts;j++) {
    +
    334  if (lgfld->bmap[j] == 1)
    +
    335  newfld[j] = lgfld->fld[n++];
    +
    336  }
    +
    337  free(lgfld->fld);
    +
    338  lgfld->fld = newfld;
    +
    339  lgfld->expanded = 1;
    +
    340  }
    +
    341  else {
    +
    342  lgfld->expanded = 0;
    +
    343  }
    +
    344  }
    +
    345  else {
    +
    346  lgfld->expanded = 1;
    +
    347  }
    +
    348  }
    +
    349  else {
    +
    350  printf("g2_getfld: return from g2_unpack7 = %d \n", (int)jerr);
    +
    351  ierr = 14;
    +
    352  return(ierr);
    +
    353  }
    +
    354  }
    +
    355 
    +
    356  /* Check to see if we read pass the end of the GRIB message
    +
    357  * and missed the terminator string '7777'. */
    +
    358  ipos = ipos + lensec; /* Update beginning of section pointer */
    +
    359  if (ipos > (istart + lengrib)) {
    +
    360  printf("g2_getfld: '7777' not found at end of GRIB message.\n");
    +
    361  ierr = 7;
    +
    362  return(ierr);
    +
    363  }
    +
    364 
    +
    365  /* If unpacking requested, return when all sections have been
    +
    366  * processed. */
    +
    367  if (unpack && have3 && have4 && have5 && have6 && have7)
    +
    368  return(ierr);
    +
    369 
    +
    370  /* If unpacking is not requested, return when sections 3
    +
    371  * through 6 have been processed. */
    +
    372  if ((!unpack) && have3 && have4 && have5 && have6)
    +
    373  return(ierr);
    +
    374 
    +
    375  }
    +
    376 
    +
    377  /* If exited from above loop, the end of the GRIB message was
    +
    378  * reached before the requested field was found. */
    +
    379  printf("g2_getfld: GRIB message contained %ld different fields.\n", numfld);
    +
    380  printf("g2_getfld: The request was for field %ld.\n", ifldnum);
    +
    381  ierr = 6;
    +
    382 
    +
    383  return(ierr);
    +
    384 
    +
    385 }
    +
    g2int g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **)
    This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
    Definition: g2_unpack7.c:65
    +
    g2int g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **)
    This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
    Definition: g2_unpack6.c:33
    +
    g2int g2_unpack1(unsigned char *, g2int *, g2int **, g2int *)
    This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
    Definition: g2_unpack1.c:55
    +
    g2int g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *)
    This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
    Definition: g2_unpack5.c:42
    +
    g2int g2_unpack2(unsigned char *, g2int *, g2int *, unsigned char **)
    This subroutine unpacks Section 2 (Local Use Section) as defined in GRIB Edition 2.
    Definition: g2_unpack2.c:37
    +
    g2int g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
    This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack3.c:57
    +
    g2int g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *)
    This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack4.c:45
    +
    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),...
    Definition: g2_getfld.c:102
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2int igdtnum
    Grid Definition Template Number (See Table 3.1).
    Definition: grib2.h:163
    +
    g2int locallen
    Length of array local.
    Definition: grib2.h:125
    +
    g2int ibmap
    Bitmap indicator (see Table 6.0).
    Definition: grib2.h:226
    +
    g2int interp_opt
    Interpretation of list for optional points definition.
    Definition: grib2.h:148
    +
    g2int ngrdpts
    Number of grid points in the defined grid.
    Definition: grib2.h:138
    +
    g2int ifldnum
    Field number within GRIB message.
    Definition: grib2.h:128
    +
    g2float * coord_list
    Array containing floating point values intended to document the vertical discretisation associated to...
    Definition: grib2.h:191
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    g2int griddef
    Source of grid definition (see Table 3.0).
    Definition: grib2.h:135
    +
    g2int ipdtnum
    Product Definition Template Number (see Table 4.0).
    Definition: grib2.h:175
    +
    g2int * ipdtmpl
    Contains the data values for the Product Definition Template specified by ipdtnum.
    Definition: grib2.h:183
    +
    g2int discipline
    Message Discipline (see Table 0.0).
    Definition: grib2.h:67
    +
    g2int numoct_opt
    Number of octets needed for each additional grid points definition.
    Definition: grib2.h:143
    +
    g2int idrtlen
    Number of elements in idrtmpl.
    Definition: grib2.h:201
    +
    g2int unpacked
    Logical value indicating whether the bitmap and data values were unpacked.
    Definition: grib2.h:209
    +
    g2int idsectlen
    Number of elements in idsect.
    Definition: grib2.h:118
    +
    g2int ipdtlen
    Number of elements in ipdtmpl - i.e.
    Definition: grib2.h:179
    +
    g2int * igdtmpl
    Contains the data values for the Grid Definition Template specified by igdtnum.
    Definition: grib2.h:171
    +
    g2int idrtnum
    Data Representation Template Number (see Table 5.0).
    Definition: grib2.h:198
    +
    g2int ndpts
    Number of data points unpacked and returned.
    Definition: grib2.h:194
    +
    g2int * idrtmpl
    Contains the data values for the Data Representation Template specified by idrtnum.
    Definition: grib2.h:205
    +
    g2int * list_opt
    (Used if numoct_opt .ne.
    Definition: grib2.h:159
    +
    g2int version
    GRIB edition number (2).
    Definition: grib2.h:63
    +
    g2int * idsect
    Contains the entries in the Identification Section (Section 1).
    Definition: grib2.h:115
    +
    g2float * fld
    Array of ndpts unpacked data points.
    Definition: grib2.h:233
    +
    g2int num_coord
    Number of values in array coord_list.
    Definition: grib2.h:186
    +
    unsigned char * local
    Pointer to character array containing contents of Local Section 2, if included.
    Definition: grib2.h:122
    +
    g2int expanded
    Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
    Definition: grib2.h:218
    +
    g2int num_opt
    (Used if numoct_opt .ne.
    Definition: grib2.h:154
    +
    g2int igdtlen
    Number of elements in igdtmpl - i.e.
    Definition: grib2.h:167
    +
    g2int * bmap
    Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
    Definition: grib2.h:230
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__gribend_8c.html b/ver-1.7.0/ver-1.6.4/g2__gribend_8c.html new file mode 100644 index 00000000..f6080998 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__gribend_8c.html @@ -0,0 +1,164 @@ + + + + + + + +NCEPLIBS-g2c: g2_gribend.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_gribend.c File Reference
    +
    +
    + +

    Finalize a GRIB2 message after all grids and fields have been added. +More...

    +
    #include <stdio.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    g2int g2_gribend (unsigned char *cgrib)
     This routine finalizes a GRIB2 message after all grids and fields have been added. More...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ 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
    + + +
    cgribChar array containing all the data sections added be previous calls to g2_create(), g2_addlocal(), g2_addgrid(), and g2_addfield(). After function is called, contains the finalized GRIB2 message.
    +
    +
    +
    Returns
      +
    • > 0 Length of the final GRIB2 message in bytes.
    • +
    • -1 GRIB message was not initialized. Need to call routine g2_create first.
    • +
    • -2 GRIB message already complete.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 7.
    • +
    +
    +
    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 35 of file g2_gribend.c.

    + +

    References gbit(), and sbit().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__gribend_8c.js b/ver-1.7.0/ver-1.6.4/g2__gribend_8c.js new file mode 100644 index 00000000..fe05f974 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__gribend_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__gribend_8c_source.html new file mode 100644 index 00000000..37bc337e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__gribend_8c_source.html @@ -0,0 +1,174 @@ + + + + + + + +NCEPLIBS-g2c: g2_gribend.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_gribend.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    35 g2int g2_gribend(unsigned char *cgrib)
    +
    36 {
    +
    37 
    +
    38  g2int iofst, lencurr, len, ilen, isecnum;
    +
    39  g2int ierr = 0, lengrib;
    +
    40  static unsigned char G = 0x47; /* 'G' */
    +
    41  static unsigned char R = 0x52; /* 'R' */
    +
    42  static unsigned char I = 0x49; /* 'I' */
    +
    43  static unsigned char B = 0x42; /* 'B' */
    +
    44  static unsigned char seven = 0x37; /* '7' */
    +
    45 
    +
    46  /* Check to see if beginning of GRIB message exists. */
    +
    47  if (cgrib[0] != G || cgrib[1] != R || cgrib[2] != I || cgrib[3] != B) {
    +
    48  printf("g2_gribend: GRIB not found in given message.\n");
    +
    49  ierr = -1;
    +
    50  return (ierr);
    +
    51  }
    +
    52 
    +
    53  /* Get current length of GRIB message. */
    +
    54  gbit(cgrib, &lencurr, 96, 32);
    +
    55 
    +
    56  /* Loop through all current sections of the GRIB message to find
    +
    57  * the last section number. */
    +
    58  len = 16; /* Length of Section 0. */
    +
    59  for (;;) {
    +
    60  /* Get number and length of next section. */
    +
    61  iofst = len * 8;
    +
    62  gbit(cgrib, &ilen, iofst, 32);
    +
    63  iofst = iofst + 32;
    +
    64  gbit(cgrib, &isecnum, iofst, 8);
    +
    65  len = len + ilen;
    +
    66  /* Exit loop if last section reached. */
    +
    67  if (len == lencurr)
    +
    68  break;
    +
    69  /* If byte count for each section doesn't match current
    +
    70  * total length, then there is a problem. */
    +
    71  if (len > lencurr) {
    +
    72  printf("g2_gribend: Section byte counts don''t add to total.\n");
    +
    73  printf("g2_gribend: Sum of section byte counts = %d\n", (int)len);
    +
    74  printf("g2_gribend: Total byte count in Section 0 = %d\n", (int)lencurr);
    +
    75  ierr = -3;
    +
    76  return (ierr);
    +
    77  }
    +
    78  }
    +
    79 
    +
    80  /* Can only add End Section (Section 8) after Section 7. */
    +
    81  if (isecnum != 7 ) {
    +
    82  printf("g2_gribend: Section 8 can only be added after Section 7.\n");
    +
    83  printf("g2_gribend: Section %ld was the last found in given GRIB message.\n", isecnum);
    +
    84  ierr = -4;
    +
    85  return (ierr);
    +
    86  }
    +
    87 
    +
    88  /* Add Section 8 - End Section */
    +
    89  cgrib[lencurr] = seven;
    +
    90  cgrib[lencurr + 1] = seven;
    +
    91  cgrib[lencurr + 2] = seven;
    +
    92  cgrib[lencurr + 3] = seven;
    +
    93 
    +
    94  /* Update current byte total of message in Section 0. */
    +
    95  lengrib = lencurr + 4;
    +
    96  sbit(cgrib, &lengrib, 96, 32);
    +
    97 
    +
    98  return (lengrib);
    +
    99 
    +
    100 }
    +
    g2int g2_gribend(unsigned char *cgrib)
    This routine finalizes a GRIB2 message after all grids and fields have been added.
    Definition: g2_gribend.c:35
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__info_8c.html b/ver-1.7.0/ver-1.6.4/g2__info_8c.html new file mode 100644 index 00000000..80f40b82 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__info_8c.html @@ -0,0 +1,217 @@ + + + + + + + +NCEPLIBS-g2c: g2_info.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_info.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_info()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_info (unsigned char * cgrib,
    g2intlistsec0,
    g2intlistsec1,
    g2intnumfields,
    g2intnumlocal 
    )
    +
    + +

    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
    + + + + + + +
    cgribCharacter pointer to the GRIB2 message.
    listsec0pointer 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.
    • +
    +
    listsec1Pointer 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).
    • +
    +
    numfieldsThe number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
    numlocalThe number of Local Use Sections ( Section 2 ) found in the GRIB message.
    +
    +
    +
    Returns
    0 foe success, otherwise:
      +
    • 1 Beginning characters "GRIB" not found.
    • +
    • 2 GRIB message is not Edition 2.
    • +
    • 3 Could not find Section 1, where expected.
    • +
    • 4 End string "7777" found, but not where expected.
    • +
    • 5 End string "7777" not found at end of message.
    • +
    • 6 Invalid section number found.
    • +
    +
    +
    Author
    Stephen Gilbeert
    +
    Date
    2002-10-28
    + +

    Definition at line 67 of file g2_info.c.

    + +

    References gbit().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__info_8c.js b/ver-1.7.0/ver-1.6.4/g2__info_8c.js new file mode 100644 index 00000000..883eea00 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__info_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__info_8c_source.html new file mode 100644 index 00000000..4f6d5e02 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__info_8c_source.html @@ -0,0 +1,234 @@ + + + + + + + +NCEPLIBS-g2c: g2_info.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_info.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    10 #include <stdio.h>
    +
    11 #include <stdlib.h>
    +
    12 #include "grib2.h"
    +
    13 
    +
    66 g2int
    +
    67 g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1,
    +
    68  g2int *numfields, g2int *numlocal)
    +
    69 {
    +
    70  g2int ierr, 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;
    +
    74 
    +
    75  ierr = 0;
    +
    76  *numlocal = 0;
    +
    77  *numfields = 0;
    +
    78 
    +
    79  /* Check for beginning of GRIB message in the first 100 bytes. */
    +
    80  istart = -1;
    +
    81  for (j = 0; j < 100; j++)
    +
    82  {
    +
    83  if (cgrib[j] == 'G' && cgrib[j + 1] == 'R' && cgrib[j + 2] == 'I' &&
    +
    84  cgrib[j + 3] == 'B')
    +
    85  {
    +
    86  istart = j;
    +
    87  break;
    +
    88  }
    +
    89  }
    +
    90  if (istart == -1)
    +
    91  {
    +
    92  printf("g2_info: Beginning characters GRIB not found.");
    +
    93  ierr = 1;
    +
    94  return(ierr);
    +
    95  }
    +
    96 
    +
    97  /* Unpack Section 0 - Indicator Section. */
    +
    98  iofst = 8 * (istart + 6);
    +
    99  gbit(cgrib, listsec0, iofst, 8); /* Discipline */
    +
    100  iofst = iofst + 8;
    +
    101  gbit(cgrib, listsec0 + 1, iofst, 8); /* GRIB edition number */
    +
    102  iofst = iofst + 8;
    +
    103  iofst = iofst + 32;
    +
    104  gbit(cgrib, &lengrib, iofst, 32); /* Length of GRIB message */
    +
    105  iofst = iofst + 32;
    +
    106  listsec0[2] = lengrib;
    +
    107  lensec0 = 16;
    +
    108  ipos = istart + lensec0;
    +
    109 
    +
    110  /* Currently handles only GRIB Edition 2. */
    +
    111  if (listsec0[1] != 2)
    +
    112  {
    +
    113  printf("g2_info: can only decode GRIB edition 2.");
    +
    114  ierr = 2;
    +
    115  return(ierr);
    +
    116  }
    +
    117 
    +
    118  /* Unpack Section 1 - Identification Section */
    +
    119  gbit(cgrib, &lensec1, iofst, 32); /* Length of Section 1 */
    +
    120  iofst = iofst + 32;
    +
    121  gbit(cgrib, &isecnum, iofst, 8); /* Section number (1) */
    +
    122  iofst = iofst + 8;
    +
    123  if (isecnum != 1)
    +
    124  {
    +
    125  printf("g2_info: Could not find section 1.");
    +
    126  ierr = 3;
    +
    127  return(ierr);
    +
    128  }
    +
    129 
    +
    130  /* Unpack each input value in array listsec1 into the
    +
    131  appropriate number of octets, which are specified in
    +
    132  corresponding entries in array mapsec1. */
    +
    133  for (i = 0;i<mapsec1len;i++)
    +
    134  {
    +
    135  nbits = mapsec1[i]*8;
    +
    136  gbit(cgrib, listsec1 + i, iofst, nbits);
    +
    137  iofst = iofst + nbits;
    +
    138  }
    +
    139  ipos = ipos + lensec1;
    +
    140 
    +
    141  /* Loop through the remaining sections to see if they are
    +
    142  * valid. Also count the number of times Section 2 and Section
    +
    143  * 4 appear. */
    +
    144  for (;;)
    +
    145  {
    +
    146  if (cgrib[ipos]=='7' && cgrib[ipos + 1]=='7' && cgrib[ipos + 2]=='7' &&
    +
    147  cgrib[ipos + 3]=='7')
    +
    148  {
    +
    149  ipos = ipos + 4;
    +
    150  if (ipos != (istart + lengrib))
    +
    151  {
    +
    152  printf("g2_info: '7777' found, but not where expected.\n");
    +
    153  ierr = 4;
    +
    154  return(ierr);
    +
    155  }
    +
    156  break;
    +
    157  }
    +
    158 
    +
    159  iofst = ipos*8;
    +
    160  gbit(cgrib, &lensec, iofst, 32); /* Get Length of Section */
    +
    161  iofst = iofst + 32;
    +
    162  gbit(cgrib, &isecnum, iofst, 8); /* Get Section number */
    +
    163  iofst = iofst + 8;
    +
    164  ipos = ipos + lensec; /* Update beginning of section pointer */
    +
    165  if (ipos > (istart + lengrib))
    +
    166  {
    +
    167  printf("g2_info: '7777' not found at end of GRIB message.\n");
    +
    168  ierr = 5;
    +
    169  return(ierr);
    +
    170  }
    +
    171  if ( isecnum>=2 && isecnum<=7 )
    +
    172  {
    +
    173  if (isecnum == 2) /* Local Section 2 */
    +
    174  /* increment counter for total number of local sections found */
    +
    175  (*numlocal)++;
    +
    176 
    +
    177  else if (isecnum == 4)
    +
    178  /* increment counter for total number of fields found */
    +
    179  (*numfields)++;
    +
    180  }
    +
    181  else
    +
    182  {
    +
    183  printf("g2_info: Invalid section number found in GRIB message: %ld\n", isecnum);
    +
    184  ierr = 6;
    +
    185  return(ierr);
    +
    186  }
    +
    187  }
    +
    188 
    +
    189  return(0);
    +
    190 
    +
    191 }
    +
    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...
    Definition: g2_info.c:67
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__miss_8c.html b/ver-1.7.0/ver-1.6.4/g2__miss_8c.html new file mode 100644 index 00000000..ac031580 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__miss_8c.html @@ -0,0 +1,171 @@ + + + + + + + +NCEPLIBS-g2c: g2_miss.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_miss.c File Reference
    +
    +
    + +

    Check the Data Representation Template to see if missing value management is used, and returns the missing value(s) in the data field. +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_miss()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void g2_miss (gribfieldgfld,
    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
    + + + + +
    gfldpointer to gribfield structure.
    rmissList of the missing values used.
    nmissNUmber 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/ver-1.6.4/g2__miss_8c.js b/ver-1.7.0/ver-1.6.4/g2__miss_8c.js new file mode 100644 index 00000000..2a21cb71 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__miss_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__miss_8c_source.html new file mode 100644 index 00000000..8e901310 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__miss_8c_source.html @@ -0,0 +1,150 @@ + + + + + + + +NCEPLIBS-g2c: g2_miss.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_miss.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    8 #include "grib2.h"
    +
    9 
    +
    23 void
    +
    24 g2_miss(gribfield *gfld, float *rmiss, int *nmiss)
    +
    25 {
    +
    26  g2int itype;
    +
    27 
    +
    28  /* Missing value management currnetly only used in DRT's 5.2 and
    +
    29  * 5.3. */
    +
    30  if (gfld->idrtnum != 2 && gfld->idrtnum != 3)
    +
    31  {
    +
    32  *nmiss = 0;
    +
    33  return;
    +
    34  }
    +
    35 
    +
    36  itype = gfld->idrtmpl[4];
    +
    37  if (gfld->idrtmpl[6] == 1)
    +
    38  {
    +
    39  *nmiss = 1;
    +
    40  if (itype == 0)
    +
    41  rdieee(gfld->idrtmpl + 7, rmiss+0, 1);
    +
    42  else
    +
    43  rmiss[0] = (float)gfld->idrtmpl[7];
    +
    44  }
    +
    45  else if (gfld->idrtmpl[6] == 2)
    +
    46  {
    +
    47  *nmiss = 2;
    +
    48  if (itype == 0)
    +
    49  {
    +
    50  rdieee(gfld->idrtmpl + 7, rmiss, 1);
    +
    51  rdieee(gfld->idrtmpl + 8, rmiss + 1, 1);
    +
    52  }
    +
    53  else
    +
    54  {
    +
    55  rmiss[0] = (float)gfld->idrtmpl[7];
    +
    56  rmiss[1] = (float)gfld->idrtmpl[8];
    +
    57  }
    +
    58  }
    +
    59  else
    +
    60  {
    +
    61  *nmiss = 0;
    +
    62  }
    +
    63 }
    +
    void g2_miss(gribfield *gfld, float *rmiss, int *nmiss)
    This routine checks the Data Representation Template to see if missing value management is used,...
    Definition: g2_miss.c:24
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2int idrtnum
    Data Representation Template Number (see Table 5.0).
    Definition: grib2.h:198
    +
    g2int * idrtmpl
    Contains the data values for the Data Representation Template specified by idrtnum.
    Definition: grib2.h:205
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack1_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack1_8c.html new file mode 100644 index 00000000..edb97d73 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack1_8c.html @@ -0,0 +1,203 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack1.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack1.c File Reference
    +
    +
    + +

    Unpack Section 1 (Identification Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    Unpack Section 1 (Identification Section) as defined in GRIB Edition 2.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file g2_unpack1.c.

    +

    Function Documentation

    + +

    ◆ g2_unpack1()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack1 (unsigned char * cgrib,
    g2intiofst,
    g2int ** ids,
    g2intidslen 
    )
    +
    + +

    This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + +
    cgribchar array containing Section 1 of the GRIB2 message.
    iofstBit offset for the beginning of Section 1 in cgrib.
    idsPointer 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).
    • +
    +
    idslenNumber of elements in ids.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Array passed is not section 1
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition at line 55 of file g2_unpack1.c.

    + +

    References gbit().

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack1_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack1_8c.js new file mode 100644 index 00000000..64d45a4d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__unpack1_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack1_8c_source.html new file mode 100644 index 00000000..9b896289 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack1_8c_source.html @@ -0,0 +1,152 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack1.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack1.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #include <stdio.h>
    +
    10 #include <stdlib.h>
    +
    11 #include "grib2.h"
    +
    12 
    +
    54 g2int
    +
    55 g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
    +
    56 {
    +
    57 
    +
    58  g2int i, lensec, nbits, ierr, isecnum;
    +
    59  /* The map holds the number of bytes used by each value in section
    +
    60  * 1. */
    +
    61  g2int mapid[13]={2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
    +
    62 
    +
    63  ierr = 0;
    +
    64  *idslen = 13;
    +
    65 
    +
    66  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    67  *iofst = *iofst + 32;
    +
    68  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    69  *iofst = *iofst + 8;
    +
    70 
    +
    71  if (isecnum != 1)
    +
    72  {
    +
    73  ierr = 2;
    +
    74  *idslen = 13;
    +
    75  fprintf(stderr, "g2_unpack1: Not Section 1 data.\n");
    +
    76  return(ierr);
    +
    77  }
    +
    78 
    +
    79  /* Unpack each value into array ids from the appropriate number of
    +
    80  * octets, which are specified in` corresponding entries in array
    +
    81  * mapid. */
    +
    82  *ids = calloc(*idslen, sizeof(g2int));
    +
    83  if (*ids == 0)
    +
    84  {
    +
    85  ierr = 6;
    +
    86  return(ierr);
    +
    87  }
    +
    88 
    +
    89  for (i = 0; i < *idslen; i++)
    +
    90  {
    +
    91  nbits = mapid[i] * 8;
    +
    92  gbit(cgrib, *ids + i, *iofst, nbits);
    +
    93  *iofst = *iofst + nbits;
    +
    94  }
    +
    95 
    +
    96  return(ierr); // End of Section 1 processing
    +
    97 }
    +
    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.
    Definition: g2_unpack1.c:55
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack2_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack2_8c.html new file mode 100644 index 00000000..b4ac2c4a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack2_8c.html @@ -0,0 +1,200 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack2.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack2.c File Reference
    +
    +
    + +

    Unpack Section 2 (Local Use Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_unpack2()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack2 (unsigned char * cgrib,
    g2intiofst,
    g2intlencsec2,
    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
    + + + + + +
    cgribchar array containing Section 2 of the GRIB2 message.
    iofstBit offset for the beginning of Section 2 in cgrib. The modified version will be returned.
    lencsec2Length (in octets) of Local Use data.
    csec2Pointer to a char array containing local use data.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Array passed is not section 2
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 37 of file g2_unpack2.c.

    + +

    References gbit().

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack2_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack2_8c.js new file mode 100644 index 00000000..64334e55 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__unpack2_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack2_8c_source.html new file mode 100644 index 00000000..af2838b4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack2_8c_source.html @@ -0,0 +1,154 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack2.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack2.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    36 g2int
    +
    37 g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2,
    +
    38  unsigned char **csec2)
    +
    39 {
    +
    40  g2int ierr = 0, isecnum;
    +
    41  g2int lensec, ipos, j;
    +
    42 
    +
    43  *lencsec2 = 0;
    +
    44  *csec2 = NULL;
    +
    45 
    +
    46  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    47  *iofst = *iofst + 32;
    +
    48  *lencsec2 = lensec - 5;
    +
    49  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    50  *iofst = *iofst + 8;
    +
    51  ipos = (*iofst/8);
    +
    52 
    +
    53  if ( isecnum != 2 )
    +
    54  {
    +
    55  ierr = 2;
    +
    56  *lencsec2 = 0;
    +
    57  fprintf(stderr, "g2_unpack2: Not Section 2 data.\n");
    +
    58  return(ierr);
    +
    59  }
    +
    60 
    +
    61  if (*lencsec2 == 0)
    +
    62  {
    +
    63  ierr = 0;
    +
    64  return(ierr);
    +
    65  }
    +
    66 
    +
    67  if (!(*csec2 = malloc(*lencsec2 + 1)))
    +
    68  {
    +
    69  ierr = 6;
    +
    70  *lencsec2 = 0;
    +
    71  return(ierr);
    +
    72  }
    +
    73 
    +
    74  /*printf(" SAGIPO %d \n", (int)ipos);*/
    +
    75  for (j = 0; j < *lencsec2; j++)
    +
    76  *(*csec2 + j) = cgrib[ipos + j];
    +
    77 
    +
    78  *iofst = *iofst + (*lencsec2 * 8);
    +
    79 
    +
    80  return(ierr); /* End of Section 2 processing */
    +
    81 }
    +
    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.
    Definition: g2_unpack2.c:37
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack3_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack3_8c.html new file mode 100644 index 00000000..58dd7101 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack3_8c.html @@ -0,0 +1,227 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack3.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack3.c File Reference
    +
    +
    + +

    Unpack Section 3 (Grid Definition Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_unpack3()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack3 (unsigned char * cgrib,
    g2intiofst,
    g2int ** igds,
    g2int ** igdstmpl,
    g2intmapgridlen,
    g2int ** ideflist,
    g2intidefnum 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribChar array ontaining Section 3 of the GRIB2 message.
    iofstBit offset for the beginning of Section 3 in cgrib.
    igdsContains 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).
    • +
    +
    igdstmplPointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
    mapgridlenNumber 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
      +
    • 0 no error
    • +
    • 2 Not Section 3
    • +
    • 5 message contains an undefined Grid Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 57 of file g2_unpack3.c.

    + +

    References gtemplate::ext, extgridtemplate(), gtemplate::extlen, gbit(), gbits(), getgridtemplate(), gtemplate::map, gtemplate::maplen, and gtemplate::needext.

    + +

    Referenced by g2_getfld(), getdim(), and getpoly().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack3_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack3_8c.js new file mode 100644 index 00000000..16867bc3 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__unpack3_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack3_8c_source.html new file mode 100644 index 00000000..e9393e60 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack3_8c_source.html @@ -0,0 +1,277 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack3.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack3.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    56 g2int
    +
    57 g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl,
    +
    58  g2int *mapgridlen, g2int **ideflist, g2int *idefnum)
    +
    59 {
    +
    60  g2int ierr, i, j, nbits, isecnum;
    +
    61  g2int lensec, ibyttem = 0, isign, newlen;
    +
    62  g2int *ligds, *ligdstmpl = NULL, *lideflist = NULL;
    +
    63  gtemplate *mapgrid;
    +
    64 
    +
    65  ierr = 0;
    +
    66  *igds = NULL;
    +
    67  *igdstmpl = NULL;
    +
    68  *ideflist = NULL;
    +
    69 
    +
    70  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    71  *iofst = *iofst + 32;
    +
    72  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    73  *iofst = *iofst + 8;
    +
    74 
    +
    75  if (isecnum != 3)
    +
    76  {
    +
    77  ierr = 2;
    +
    78  *idefnum = 0;
    +
    79  *mapgridlen = 0;
    +
    80  /* fprintf(stderr, "g2_unpack3: Not Section 3 data.\n"); */
    +
    81  return(ierr);
    +
    82  }
    +
    83 
    +
    84  ligds = calloc(5, sizeof(g2int));
    +
    85  *igds = ligds;
    +
    86 
    +
    87  gbit(cgrib, &ligds[0], *iofst, 8); /* Get source of Grid def. */
    +
    88  *iofst = *iofst + 8;
    +
    89  gbit(cgrib, &ligds[1], *iofst, 32); /* Get number of grid pts. */
    +
    90  *iofst = *iofst + 32;
    +
    91  gbit(cgrib, &ligds[2], *iofst, 8); /* Get num octets for opt. list */
    +
    92  *iofst = *iofst + 8;
    +
    93  gbit(cgrib, &ligds[3], *iofst, 8); /* Get interpret. for opt. list */
    +
    94  *iofst = *iofst + 8;
    +
    95  gbit(cgrib, &ligds[4], *iofst, 16); /* Get Grid Def Template num. */
    +
    96  *iofst = *iofst + 16;
    +
    97 
    +
    98  if (ligds[4] != 65535)
    +
    99  {
    +
    100  /* Get Grid Definition Template */
    +
    101  mapgrid = getgridtemplate(ligds[4]);
    +
    102  if (!mapgrid)
    +
    103  { /* undefined template */
    +
    104  ierr = 5;
    +
    105  return(ierr);
    +
    106  }
    +
    107  *mapgridlen = mapgrid->maplen;
    +
    108 
    +
    109  /* Unpack each value into array igdstmpl from the the
    +
    110  * appropriate number of octets, which are specified in
    +
    111  * corresponding entries in array mapgrid. */
    +
    112  if (*mapgridlen > 0)
    +
    113  {
    +
    114  if (!(ligdstmpl = calloc(*mapgridlen, sizeof(g2int))))
    +
    115  {
    +
    116  ierr = 6;
    +
    117  *mapgridlen = 0;
    +
    118  *igdstmpl = NULL;
    +
    119  if (mapgrid)
    +
    120  free(mapgrid);
    +
    121  return(ierr);
    +
    122  }
    +
    123  *igdstmpl = ligdstmpl;
    +
    124  }
    +
    125  ibyttem = 0;
    +
    126  for (i = 0; i < *mapgridlen; i++)
    +
    127  {
    +
    128  nbits = abs(mapgrid->map[i]) * 8;
    +
    129  if (mapgrid->map[i] >= 0)
    +
    130  {
    +
    131  gbit(cgrib, ligdstmpl + i, *iofst, nbits);
    +
    132  }
    +
    133  else
    +
    134  {
    +
    135  gbit(cgrib, &isign, *iofst, 1);
    +
    136  gbit(cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
    +
    137  if (isign == 1)
    +
    138  ligdstmpl[i] = -1 * ligdstmpl[i];
    +
    139  }
    +
    140  *iofst = *iofst + nbits;
    +
    141  ibyttem = ibyttem + abs(mapgrid->map[i]);
    +
    142  }
    +
    143 
    +
    144  /* Check to see if the Grid Definition Template needs to be
    +
    145  * extended. The number of values in a specific template may
    +
    146  * vary depending on data specified in the "static" part of
    +
    147  * the gtemplate. */
    +
    148  if (mapgrid->needext == 1)
    +
    149  {
    +
    150  free(mapgrid);
    +
    151  mapgrid = extgridtemplate(ligds[4], ligdstmpl);
    +
    152  /* Unpack the rest of the Grid Definition Template */
    +
    153  newlen = mapgrid->maplen + mapgrid->extlen;
    +
    154  ligdstmpl = realloc(ligdstmpl, newlen * sizeof(g2int));
    +
    155  *igdstmpl = ligdstmpl;
    +
    156  j = 0;
    +
    157  for (i = *mapgridlen; i < newlen; i++)
    +
    158  {
    +
    159  nbits = abs(mapgrid->ext[j]) * 8;
    +
    160  if (mapgrid->ext[j] >= 0)
    +
    161  {
    +
    162  gbit(cgrib, ligdstmpl + i, *iofst, nbits);
    +
    163  }
    +
    164  else
    +
    165  {
    +
    166  gbit(cgrib, &isign, *iofst, 1);
    +
    167  gbit(cgrib, ligdstmpl + i, *iofst + 1, nbits - 1);
    +
    168  if (isign == 1)
    +
    169  ligdstmpl[i] = -1 * ligdstmpl[i];
    +
    170  }
    +
    171  *iofst = *iofst + nbits;
    +
    172  ibyttem = ibyttem + abs(mapgrid->ext[j]);
    +
    173  j++;
    +
    174  }
    +
    175  *mapgridlen = newlen;
    +
    176  }
    +
    177  if (mapgrid->ext)
    +
    178  free(mapgrid->ext);
    +
    179  if (mapgrid)
    +
    180  free(mapgrid);
    +
    181  }
    +
    182  else
    +
    183  { /* No Grid Definition Template */
    +
    184  *mapgridlen = 0;
    +
    185  *igdstmpl = 0;
    +
    186  }
    +
    187 
    +
    188  /* Unpack optional list of numbers defining number of points in
    +
    189  * each row or column, if included. This is used for non
    +
    190  * regular grids. */
    +
    191  if ( ligds[2] != 0 )
    +
    192  {
    +
    193  nbits = ligds[2] * 8;
    +
    194  *idefnum = (lensec - 14 - ibyttem) / ligds[2];
    +
    195  if (*idefnum > 0)
    +
    196  lideflist = calloc(*idefnum, sizeof(g2int));
    +
    197  if (!lideflist)
    +
    198  {
    +
    199  ierr = 6;
    +
    200  *idefnum = 0;
    +
    201  *ideflist = NULL;
    +
    202  return(ierr);
    +
    203  }
    +
    204  *ideflist = lideflist;
    +
    205  gbits(cgrib, lideflist, *iofst, nbits, 0, *idefnum);
    +
    206  *iofst = *iofst + (nbits * *idefnum);
    +
    207  }
    +
    208  else
    +
    209  {
    +
    210  *idefnum = 0;
    +
    211  *ideflist = NULL;
    +
    212  }
    +
    213 
    +
    214  return(ierr); /* End of Section 3 processing */
    +
    215 }
    +
    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.
    Definition: g2_unpack3.c:57
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    gtemplate * extgridtemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Grid Definition Template,...
    +
    gtemplate * getgridtemplate(g2int number)
    This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
    Definition: gridtemplates.c:75
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.html new file mode 100644 index 00000000..ea43f6c1 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.html @@ -0,0 +1,220 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack4.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack4.c File Reference
    +
    +
    + +

    Unpack Section 4 (Product Definition Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    g2int g2_unpack4 (unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord)
     This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2. More...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_unpack4()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack4 (unsigned char * cgrib,
    g2intiofst,
    g2intipdsnum,
    g2int ** ipdstmpl,
    g2intmappdslen,
    g2float ** coordlist,
    g2intnumcoord 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribArray containing Section 4 of the GRIB2 message.
    iofstBit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
    ipdsnumProduct Definition Template Number (see Table 4.0).
    ipdstmplPointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
    mappdslenNumber of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
    coordlistPointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
    numcoordnumber of values in array coordlist.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 4
    • +
    • 5 "GRIB" message contains an undefined Product Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 45 of file g2_unpack4.c.

    + +

    References gtemplate::ext, gtemplate::extlen, extpdstemplate(), gbit(), gbits(), getpdstemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, and rdieee().

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.js new file mode 100644 index 00000000..ce6c1dbb --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c.js @@ -0,0 +1,4 @@ +var g2__unpack4_8c = +[ + [ "g2_unpack4", "g2__unpack4_8c.html#a16eaee8c9cd73c1589475d7af259f950", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack4_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c_source.html new file mode 100644 index 00000000..82ddf5d7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack4_8c_source.html @@ -0,0 +1,265 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack4.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack4.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    44 g2int
    +
    45 g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl,
    +
    46  g2int *mappdslen, g2float **coordlist, g2int *numcoord)
    +
    47 {
    +
    48 
    +
    49  g2int ierr, needext, i, j, nbits, isecnum;
    +
    50  g2int lensec, isign, newlen;
    +
    51  g2int *coordieee;
    +
    52  g2int *lipdstmpl = 0;
    +
    53  g2float *lcoordlist;
    +
    54  gtemplate *mappds;
    +
    55 
    +
    56  ierr = 0;
    +
    57  *ipdstmpl = NULL;
    +
    58  *coordlist = NULL;
    +
    59 
    +
    60  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    61  *iofst = *iofst + 32;
    +
    62  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    63  *iofst = *iofst + 8;
    +
    64 
    +
    65  if (isecnum != 4)
    +
    66  {
    +
    67  ierr = 2;
    +
    68  *numcoord = 0;
    +
    69  *mappdslen = 0;
    +
    70  /* fprintf(stderr, "g2_unpack4: Not Section 4 data.\n");*/
    +
    71  return(ierr);
    +
    72  }
    +
    73 
    +
    74  gbit(cgrib, numcoord, *iofst, 16); /* Get num of coordinate values */
    +
    75  *iofst = *iofst + 16;
    +
    76  gbit(cgrib, ipdsnum, *iofst, 16); /* Get Prod. Def Template num. */
    +
    77  *iofst = *iofst + 16;
    +
    78 
    +
    79  /* Get Product Definition Template */
    +
    80  mappds = getpdstemplate(*ipdsnum);
    +
    81  if (mappds == 0)
    +
    82  { /* undefine template */
    +
    83  ierr = 5;
    +
    84  *mappdslen = 0;
    +
    85  return(ierr);
    +
    86  }
    +
    87  *mappdslen = mappds->maplen;
    +
    88  needext = mappds->needext;
    +
    89 
    +
    90  /* Unpack each value into array ipdstmpl from the the
    +
    91  * appropriate number of octets, which are specified in
    +
    92  * corresponding entries in array mappds. */
    +
    93  if (*mappdslen > 0)
    +
    94  lipdstmpl = calloc(*mappdslen, sizeof(g2int));
    +
    95  if (lipdstmpl == 0)
    +
    96  {
    +
    97  ierr = 6;
    +
    98  *mappdslen = 0;
    +
    99  *ipdstmpl = NULL;
    +
    100  if (mappds)
    +
    101  free(mappds);
    +
    102  return(ierr);
    +
    103  }
    +
    104  *ipdstmpl = lipdstmpl;
    +
    105 
    +
    106  for (i = 0; i < mappds->maplen; i++)
    +
    107  {
    +
    108  nbits = abs(mappds->map[i]) * 8;
    +
    109  if (mappds->map[i] >= 0)
    +
    110  {
    +
    111  gbit(cgrib, lipdstmpl + i, *iofst, nbits);
    +
    112  }
    +
    113  else
    +
    114  {
    +
    115  gbit(cgrib, &isign, *iofst, 1);
    +
    116  gbit(cgrib, lipdstmpl + i, *iofst + 1, nbits - 1);
    +
    117  if (isign == 1) lipdstmpl[i] = -1 * lipdstmpl[i];
    +
    118  }
    +
    119  *iofst = *iofst + nbits;
    +
    120  }
    +
    121 
    +
    122  /* Check to see if the Product Definition Template needs to be
    +
    123  * extended. The number of values in a specific template may
    +
    124  * vary depending on data specified in the "static" part of the
    +
    125  * gtemplate. */
    +
    126  if (needext == 1)
    +
    127  {
    +
    128  free(mappds);
    +
    129  mappds = extpdstemplate(*ipdsnum, lipdstmpl);
    +
    130  newlen = mappds->maplen+mappds->extlen;
    +
    131  lipdstmpl = realloc(lipdstmpl, newlen * sizeof(g2int));
    +
    132  *ipdstmpl = lipdstmpl;
    +
    133  /* Unpack the rest of the Product Definition Template */
    +
    134  j = 0;
    +
    135  for (i = *mappdslen; i < newlen; i++)
    +
    136  {
    +
    137  nbits = abs(mappds->ext[j]) * 8;
    +
    138  if (mappds->ext[j] >= 0)
    +
    139  {
    +
    140  gbit(cgrib, lipdstmpl + i, *iofst, nbits);
    +
    141  }
    +
    142  else
    +
    143  {
    +
    144  gbit(cgrib, &isign, *iofst, 1);
    +
    145  gbit(cgrib, lipdstmpl + i, *iofst+1, nbits-1);
    +
    146  if (isign == 1)
    +
    147  lipdstmpl[i] = -1 * lipdstmpl[i];
    +
    148  }
    +
    149  *iofst = *iofst + nbits;
    +
    150  j++;
    +
    151  }
    +
    152  *mappdslen = newlen;
    +
    153  }
    +
    154  if (mappds->ext)
    +
    155  free(mappds->ext);
    +
    156  if (mappds)
    +
    157  free(mappds);
    +
    158 
    +
    159  /* Get Optional list of vertical coordinate values after the
    +
    160  * Product Definition Template, if necessary. */
    +
    161  *coordlist = 0; /* NULL */
    +
    162  if (*numcoord != 0)
    +
    163  {
    +
    164  coordieee = calloc(*numcoord, sizeof(g2int));
    +
    165  lcoordlist = calloc(*numcoord, sizeof(g2float));
    +
    166  if (coordieee == 0 || lcoordlist == 0)
    +
    167  {
    +
    168  ierr = 6;
    +
    169  *numcoord = 0;
    +
    170  *coordlist = 0; /* NULL */
    +
    171  if (coordieee)
    +
    172  free(coordieee);
    +
    173  if (lcoordlist)
    +
    174  free(lcoordlist);
    +
    175  return(ierr);
    +
    176  }
    +
    177  else
    +
    178  {
    +
    179  *coordlist = lcoordlist;
    +
    180  }
    +
    181  gbits(cgrib, coordieee, *iofst, 32, 0, *numcoord);
    +
    182  rdieee(coordieee, *coordlist, *numcoord);
    +
    183  free(coordieee);
    +
    184  *iofst = *iofst + (32 * (*numcoord));
    +
    185  }
    +
    186 
    +
    187  return(ierr); /* End of Section 4 processing */
    +
    188 
    +
    189 }
    +
    g2int g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord)
    This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack4.c:45
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    gtemplate * extpdstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Product Definition Template,...
    Definition: pdstemplates.c:121
    +
    gtemplate * getpdstemplate(g2int number)
    This subroutine returns PDS template information for a specified Product Definition Template.
    Definition: pdstemplates.c:73
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack5_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack5_8c.html new file mode 100644 index 00000000..cd155ee4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack5_8c.html @@ -0,0 +1,213 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack5.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack5.c File Reference
    +
    +
    + +

    Unpack Section 5 (Data Representation Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_unpack5()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack5 (unsigned char * cgrib,
    g2intiofst,
    g2intndpts,
    g2intidrsnum,
    g2int ** idrstmpl,
    g2intmapdrslen 
    )
    +
    + +

    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
    + + + + + + + +
    cgribchar array containing Section 5 of the GRIB2 message.
    iofstBit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
    ndptsNumber of data points unpacked and returned.
    idrsnumData Representation Template Number (see Code Table 5.0).
    idrstmplPointer 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
      +
    • 0 no error
    • +
    • 2 Not Section 5
    • +
    • 6 memory allocation error
    • +
    • 7 "GRIB" message contains an undefined Data Representation Template.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 42 of file g2_unpack5.c.

    + +

    References gtemplate::ext, extdrstemplate(), gtemplate::extlen, gbit(), getdrstemplate(), gtemplate::map, gtemplate::maplen, and gtemplate::needext.

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack5_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack5_8c.js new file mode 100644 index 00000000..8f8fe21b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__unpack5_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack5_8c_source.html new file mode 100644 index 00000000..5f5ed3bc --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack5_8c_source.html @@ -0,0 +1,233 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack5.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack5.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    41 g2int
    +
    42 g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum,
    +
    43  g2int **idrstmpl, g2int *mapdrslen)
    +
    44 {
    +
    45  g2int ierr, needext, i, j, nbits, isecnum;
    +
    46  g2int lensec, isign, newlen;
    +
    47  g2int *lidrstmpl = 0;
    +
    48  gtemplate *mapdrs;
    +
    49 
    +
    50  ierr = 0;
    +
    51  *idrstmpl = 0; /* NULL*/
    +
    52 
    +
    53  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    54  *iofst = *iofst + 32;
    +
    55  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    56  *iofst = *iofst + 8;
    +
    57 
    +
    58  if (isecnum != 5)
    +
    59  {
    +
    60  ierr = 2;
    +
    61  *ndpts = 0;
    +
    62  *mapdrslen = 0;
    +
    63  /* fprintf(stderr, "g2_unpack5: Not Section 5 data.\n"); */
    +
    64  return(ierr);
    +
    65  }
    +
    66 
    +
    67  gbit(cgrib, ndpts, *iofst, 32); /* Get num of data points */
    +
    68  *iofst = *iofst + 32;
    +
    69  gbit(cgrib, idrsnum, *iofst, 16); /* Get Data Rep Template Num. */
    +
    70  *iofst = *iofst + 16;
    +
    71 
    +
    72  /* Gen Data Representation Template */
    +
    73  mapdrs = getdrstemplate(*idrsnum);
    +
    74  if (mapdrs == 0)
    +
    75  {
    +
    76  ierr = 7;
    +
    77  *mapdrslen = 0;
    +
    78  return(ierr);
    +
    79  }
    +
    80  *mapdrslen = mapdrs->maplen;
    +
    81  needext = mapdrs->needext;
    +
    82 
    +
    83  /* Unpack each value into array ipdstmpl from the appropriate
    +
    84  * number of octets, which are specified in corresponding
    +
    85  * entries in array mapdrs. */
    +
    86  if (*mapdrslen > 0)
    +
    87  lidrstmpl = calloc(*mapdrslen, sizeof(g2int));
    +
    88  if (lidrstmpl == 0)
    +
    89  {
    +
    90  ierr = 6;
    +
    91  *mapdrslen = 0;
    +
    92  *idrstmpl = NULL;
    +
    93  if (mapdrs)
    +
    94  free(mapdrs);
    +
    95  return(ierr);
    +
    96  }
    +
    97  else
    +
    98  {
    +
    99  *idrstmpl = lidrstmpl;
    +
    100  }
    +
    101  for (i = 0; i < mapdrs->maplen; i++)
    +
    102  {
    +
    103  nbits = abs(mapdrs->map[i]) * 8;
    +
    104  if (mapdrs->map[i] >= 0)
    +
    105  {
    +
    106  gbit(cgrib, lidrstmpl + i, *iofst, nbits);
    +
    107  }
    +
    108  else
    +
    109  {
    +
    110  gbit(cgrib, &isign, *iofst, 1);
    +
    111  gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits - 1);
    +
    112  if (isign == 1)
    +
    113  lidrstmpl[i] = -1 * lidrstmpl[i];
    +
    114  }
    +
    115  *iofst = *iofst + nbits;
    +
    116  }
    +
    117 
    +
    118  /* Check to see if the Data Representation Template needs to be
    +
    119  * extended. The number of values in a specific gtemplate may
    +
    120  * vary depending on data specified in the "static" part of the
    +
    121  * gtemplate. */
    +
    122  if (needext == 1)
    +
    123  {
    +
    124  free(mapdrs);
    +
    125  mapdrs = extdrstemplate(*idrsnum, lidrstmpl);
    +
    126  newlen = mapdrs->maplen + mapdrs->extlen;
    +
    127  lidrstmpl = realloc(lidrstmpl, newlen * sizeof(g2int));
    +
    128  *idrstmpl = lidrstmpl;
    +
    129  /* Unpack the rest of the Data Representation Template */
    +
    130  j = 0;
    +
    131  for (i = *mapdrslen; i < newlen; i++)
    +
    132  {
    +
    133  nbits = abs(mapdrs->ext[j])*8;
    +
    134  if (mapdrs->ext[j] >= 0)
    +
    135  {
    +
    136  gbit(cgrib, lidrstmpl + i, *iofst, nbits);
    +
    137  }
    +
    138  else
    +
    139  {
    +
    140  gbit(cgrib, &isign, *iofst, 1);
    +
    141  gbit(cgrib, lidrstmpl + i, *iofst + 1, nbits-1);
    +
    142  if (isign == 1)
    +
    143  lidrstmpl[i] = -1*lidrstmpl[i];
    +
    144  }
    +
    145  *iofst = *iofst + nbits;
    +
    146  j++;
    +
    147  }
    +
    148  *mapdrslen = newlen;
    +
    149  }
    +
    150  if (mapdrs->ext)
    +
    151  free(mapdrs->ext);
    +
    152  if (mapdrs)
    +
    153  free(mapdrs);
    +
    154 
    +
    155  return(ierr); /* End of Section 5 processing */
    +
    156 
    +
    157 }
    +
    gtemplate * extdrstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Data Representation Template,...
    Definition: drstemplates.c:110
    +
    gtemplate * getdrstemplate(g2int number)
    This subroutine returns DRS template information for a specified Data Representation Template.
    Definition: drstemplates.c:64
    +
    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.
    Definition: g2_unpack5.c:42
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack6_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack6_8c.html new file mode 100644 index 00000000..bc8e97a0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack6_8c.html @@ -0,0 +1,202 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack6.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack6.c File Reference
    +
    +
    + +

    Unpack Section 6 (Bit-Map Section) as defined in GRIB Edition 2. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ g2_unpack6()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack6 (unsigned char * cgrib,
    g2intiofst,
    g2int ngpts,
    g2intibmap,
    g2int ** bmap 
    )
    +
    + +

    This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + + +
    cgribchar array containing Section 6 of the GRIB2 message.
    iofstBit offset of the beginning of Section 6 in cgrib.
    ngptsNumber of grid points specified in the bit-map
    ibmapBitmap 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.
    • +
    +
    bmapPointer to an integer array containing decoded bitmap. (if ibmap=0)
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not Section 6
    • +
    • 4 Unrecognized pre-defined bit-map.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 33 of file g2_unpack6.c.

    + +

    References gbit(), and gbits().

    + +

    Referenced by g2_getfld().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack6_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack6_8c.js new file mode 100644 index 00000000..6879523f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/g2__unpack6_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack6_8c_source.html new file mode 100644 index 00000000..496f4c44 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack6_8c_source.html @@ -0,0 +1,168 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack6.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack6.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdio.h>
    +
    6 #include <stdlib.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    32 g2int
    +
    33 g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap,
    +
    34  g2int **bmap)
    +
    35 {
    +
    36  g2int j, ierr = 0, isecnum;
    +
    37  g2int *lbmap = 0;
    +
    38  g2int *intbmap;
    +
    39 
    +
    40  *bmap = NULL;
    +
    41 
    +
    42  *iofst = *iofst + 32; /* skip Length of Section */
    +
    43  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    44  *iofst = *iofst + 8;
    +
    45 
    +
    46  if (isecnum != 6)
    +
    47  {
    +
    48  ierr = 2;
    +
    49  fprintf(stderr, "g2_unpack6: Not Section 6 data.\n");
    +
    50  return(ierr);
    +
    51  }
    +
    52 
    +
    53  gbit(cgrib, ibmap, *iofst, 8); /* Get bit-map indicator */
    +
    54  *iofst = *iofst + 8;
    +
    55 
    +
    56  if (*ibmap == 0)
    +
    57  { /* Unpack bitmap */
    +
    58  if (ngpts > 0)
    +
    59  lbmap = calloc(ngpts, sizeof(g2int));
    +
    60  if (lbmap == 0)
    +
    61  {
    +
    62  ierr = 6;
    +
    63  return(ierr);
    +
    64  }
    +
    65  else
    +
    66  {
    +
    67  *bmap = lbmap;
    +
    68  }
    +
    69  intbmap = calloc(ngpts, sizeof(g2int));
    +
    70  gbits(cgrib, intbmap, *iofst, 1, 0, ngpts);
    +
    71  *iofst = *iofst + ngpts;
    +
    72  for (j = 0; j < ngpts; j++)
    +
    73  {
    +
    74  lbmap[j] = (g2int)intbmap[j];
    +
    75  }
    +
    76  free(intbmap);
    +
    77  /*
    +
    78  else if (*ibmap.eq.254) ! Use previous bitmap
    +
    79  return(ierr);
    +
    80  else if (*ibmap.eq.255) ! No bitmap in message
    +
    81  bmap(1:ngpts)=.true.
    +
    82  else {
    +
    83  print *,'gf_unpack6: Predefined bitmap ',*ibmap,' not recognized.'
    +
    84  ierr=4;
    +
    85  */
    +
    86  }
    +
    87 
    +
    88  return(ierr); /* End of Section 6 processing */
    +
    89 
    +
    90 }
    +
    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.
    Definition: g2_unpack6.c:33
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.html b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.html new file mode 100644 index 00000000..382ff4ca --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.html @@ -0,0 +1,614 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack7.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    g2_unpack7.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + +

    +Functions

    int comunpack (unsigned char *, g2int, g2int, g2int *, g2int, g2float *)
     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...
     
    g2int g2_unpack7 (unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld)
     This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More...
     
    g2int jpcunpack (unsigned char *, g2int, g2int *, g2int, g2float *)
     This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
     
    g2int pngunpack (unsigned char *, g2int, g2int *, g2int, g2float *)
     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 simunpack (unsigned char *, g2int *, g2int, g2float *)
     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...
     
    g2int specunpack (unsigned char *, g2int *, g2int, g2int, g2int, g2int, g2float *)
     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...
     
    +

    Detailed Description

    +

    Unpack Section 7 (Data Section) as defined in GRIB Edition 2.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition in file g2_unpack7.c.

    +

    Function Documentation

    + +

    ◆ comunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int comunpack (unsigned char * cpack,
    g2int lensec,
    g2int idrsnum,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + + +
    cpackpointer to the packed data field.
    lenseclength of section 7 (used for error checking).
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplpointer to the array of values for Data Representation Template 5.2 or 5.3
    ndptsThe number of data values to unpack
    fldContains the unpacked data values. Must be allocated with at least ndpts * sizeof(g2float) 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().

    + +
    +
    + +

    ◆ g2_unpack7()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack7 (unsigned char * cgrib,
    g2intiofst,
    g2int igdsnum,
    g2intigdstmpl,
    g2int idrsnum,
    g2intidrstmpl,
    g2int ndpts,
    g2float ** 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
    + + + + + + + + + +
    cgribchar array containing Section 7 of the GRIB2 message
    iofstBit offset of the beginning of Section 7 in cgrib.
    igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
    igdstmplPointer 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).
    idrsnumData Representation Template Number (see Code Table 5.0)
    idrstmplPointer 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
    ndptsNumber of data points unpacked and returned.
    fldPointer to a float array containing the unpacked data field.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 7
    • +
    • 4 Unrecognized Data Representation Template
    • +
    • 5 need one of GDT 3.50 through 3.53 to decode DRT 5.51
    • +
    • 6 memory allocation error
    • +
    • 7 corrupt section 7.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 65 of file g2_unpack7.c.

    + +

    References comunpack(), gbit(), jpcunpack(), pngunpack(), rdieee(), simunpack(), and specunpack().

    + +

    Referenced by g2_getfld().

    + +
    +
    + +

    ◆ jpcunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int jpcunpack (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

    +
    Parameters
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack.
    idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values.
    +
    +
    +
    Returns
    0 for success, 1 for memory allocation error.
    +
    Author
    Stephem Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 31 of file jpcunpack.c.

    + +

    References dec_jpeg2000(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    + +

    ◆ pngunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int pngunpack (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack().
    idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values.
    +
    +
    +
    Returns
    0 for success, 1 for memory allocation error.
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 30 of file pngunpack.c.

    + +

    References dec_png(), gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    + +

    ◆ simunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int simunpack (unsigned char * cpack,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.0.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values. fld must be `* allocated with at least ndpts * sizeof(g2float) 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 gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    + +

    ◆ specunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int specunpack (unsigned char * cpack,
    g2intidrstmpl,
    g2int ndpts,
    g2int JJ,
    g2int KK,
    g2int MM,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.51.
    ndptsThe number of data values to unpack (real and imaginary parts).
    JJpentagonal resolution parameter.
    KKpentagonal resolution parameter.
    MMpentagonal resolution parameter.
    fldContains the unpacked data values. fld must be allocated with at least ndpts * sizeof(g2float) 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 gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.js b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.js new file mode 100644 index 00000000..2ad68040 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c.js @@ -0,0 +1,9 @@ +var g2__unpack7_8c = +[ + [ "comunpack", "g2__unpack7_8c.html#a425a343ae39d48b54346b391c5af90f0", null ], + [ "g2_unpack7", "g2__unpack7_8c.html#a9f18066e6b00b576ff8472bc364af3e6", null ], + [ "jpcunpack", "g2__unpack7_8c.html#a0ec40c3c58c9648a08b9198de8e82bc1", null ], + [ "pngunpack", "g2__unpack7_8c.html#a188b50820544141523fc0c67dbb3ed42", null ], + [ "simunpack", "g2__unpack7_8c.html#a044c5f7ba4057129fc06a0b7946eff94", null ], + [ "specunpack", "g2__unpack7_8c.html#ac00f233927a3a6eb64e741089953284d", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/g2__unpack7_8c_source.html b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c_source.html new file mode 100644 index 00000000..b40ebe9a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/g2__unpack7_8c_source.html @@ -0,0 +1,217 @@ + + + + + + + +NCEPLIBS-g2c: g2_unpack7.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    g2_unpack7.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdio.h>
    +
    6 #include <stdlib.h>
    +
    7 #include <memory.h>
    +
    8 #include <string.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    11 g2int simunpack(unsigned char *,g2int *, g2int,g2float *);
    +
    12 int comunpack(unsigned char *,g2int,g2int,g2int *,g2int,g2float *);
    +
    13 g2int specunpack(unsigned char *,g2int *,g2int,g2int,g2int, g2int, g2float *);
    +
    14 #ifdef USE_PNG
    +
    15 g2int pngunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
    +
    16 #endif /* USE_PNG */
    +
    17 #if defined USE_JPEG2000 || defined USE_OPENJPEG
    +
    18 g2int jpcunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
    +
    19 #endif /* USE_JPEG2000 */
    +
    20 
    +
    64 g2int
    +
    65 g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl,
    +
    66  g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld)
    +
    67 {
    +
    68  g2int ierr, isecnum;
    +
    69  g2int ipos, lensec;
    +
    70  g2float *lfld;
    +
    71 
    +
    72  ierr = 0;
    +
    73  *fld = 0; /*NULL*/
    +
    74 
    +
    75  gbit(cgrib, &lensec, *iofst, 32); /* Get Length of Section */
    +
    76  *iofst = *iofst + 32;
    +
    77  gbit(cgrib, &isecnum, *iofst, 8); /* Get Section Number */
    +
    78  *iofst = *iofst + 8;
    +
    79 
    +
    80  if (isecnum != 7)
    +
    81  {
    +
    82  ierr = 2;
    +
    83  /*fprintf(stderr, "g2_unpack7: Not Section 7 data.\n"); */
    +
    84  return ierr;
    +
    85  }
    +
    86 
    +
    87  ipos = (*iofst / 8);
    +
    88  lfld = calloc(ndpts ? ndpts : 1, sizeof(g2float));
    +
    89  if (lfld == 0)
    +
    90  {
    +
    91  ierr = 6;
    +
    92  return ierr;
    +
    93  }
    +
    94  else
    +
    95  {
    +
    96  *fld = lfld;
    +
    97  }
    +
    98 
    +
    99  if (idrsnum == 0)
    +
    100  simunpack(cgrib + ipos, idrstmpl, ndpts, lfld);
    +
    101  else if (idrsnum == 2 || idrsnum == 3)
    +
    102  {
    +
    103  if (comunpack(cgrib+ipos, lensec, idrsnum, idrstmpl, ndpts, lfld) != 0)
    +
    104  {
    +
    105  return 7;
    +
    106  }
    +
    107  }
    +
    108  else if (idrsnum == 50)
    +
    109  { /* Spectral Simple */
    +
    110  simunpack(cgrib + ipos, idrstmpl, ndpts - 1, lfld + 1);
    +
    111  rdieee(idrstmpl + 4, lfld, 1);
    +
    112  }
    +
    113  else if (idrsnum == 51) /* Spectral complex */
    +
    114  if (igdsnum>=50 && igdsnum <=53)
    +
    115  specunpack(cgrib + ipos, idrstmpl, ndpts, igdstmpl[0], igdstmpl[2],
    +
    116  igdstmpl[2], lfld);
    +
    117  else
    +
    118  {
    +
    119  fprintf(stderr, "g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",
    +
    120  (int)igdsnum);
    +
    121  ierr = 5;
    +
    122  if (lfld)
    +
    123  free(lfld);
    +
    124  *fld = NULL;
    +
    125  return ierr;
    +
    126  }
    +
    127 #if defined USE_JPEG2000 || defined USE_OPENJPEG
    +
    128  else if (idrsnum == 40 || idrsnum == 40000)
    +
    129  {
    +
    130  jpcunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
    +
    131  }
    +
    132 #endif /* USE_JPEG2000 */
    +
    133 #ifdef USE_PNG
    +
    134  else if (idrsnum == 41 || idrsnum == 40010)
    +
    135  {
    +
    136  pngunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
    +
    137  }
    +
    138 #endif /* USE_PNG */
    +
    139  else
    +
    140  {
    +
    141  fprintf(stderr, "g2_unpack7: Data Representation Template 5.%d not yet "
    +
    142  "implemented.\n", (int)idrsnum);
    +
    143  ierr = 4;
    +
    144  if (lfld)
    +
    145  free(lfld);
    +
    146  *fld = NULL;
    +
    147  return ierr;
    +
    148  }
    +
    149 
    +
    150  *iofst = *iofst + (8 * lensec);
    +
    151 
    +
    152  return ierr; /* End of Section 7 processing */
    +
    153 }
    +
    g2int simunpack(unsigned char *, g2int *, g2int, g2float *)
    This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
    Definition: simunpack.c:26
    +
    g2int jpcunpack(unsigned char *, g2int, g2int *, g2int, g2float *)
    This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the ...
    Definition: jpcunpack.c:31
    +
    g2int pngunpack(unsigned char *, g2int, g2int *, g2int, g2float *)
    This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
    Definition: pngunpack.c:30
    +
    int comunpack(unsigned char *, g2int, g2int, g2int *, g2int, g2float *)
    This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in ...
    Definition: comunpack.c:42
    +
    g2int g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld)
    This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
    Definition: g2_unpack7.c:65
    +
    g2int specunpack(unsigned char *, g2int *, g2int, g2int, g2int, g2int, g2float *)
    This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...
    Definition: specunpack.c:35
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gbits_8c.html b/ver-1.7.0/ver-1.6.4/gbits_8c.html new file mode 100644 index 00000000..ab7fbfc4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gbits_8c.html @@ -0,0 +1,385 @@ + + + + + + + +NCEPLIBS-g2c: gbits.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    gbits.c File Reference
    +
    +
    + +

    Functions to pack and unpack bits to/from a packed bit string. +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + +

    +Functions

    void gbit (unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
     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 nbyte, 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 nbyte)
     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 nbyte, 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...
     
    +

    Detailed Description

    +

    Functions to pack and unpack bits to/from a packed bit string.

    +
    Author
    NOAA Programmer
    + +

    Definition in file gbits.c.

    +

    Function Documentation

    + +

    ◆ gbit()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void gbit (unsigned char * in,
    g2intiout,
    g2int iskip,
    g2int nbyte 
    )
    +
    + +

    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.

    +
    Parameters
    + + + + + +
    inpointer to character array input.
    ioutpointer to unpacked array output.
    iskipinitial number of bits to skip.
    nbytenumber 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(), and seekgb().

    + +
    +
    + +

    ◆ gbits()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void gbits (unsigned char * in,
    g2intiout,
    g2int iskip,
    g2int nbyte,
    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
    + + + + + + + +
    inPointer to character array input.
    ioutPointer to unpacked array output.
    iskipInitial number of bits to skip.
    nbyteNumber of bits to take.
    nskipAdditional number of bits to skip on each iteration.
    nNumber of iterations.
    +
    +
    +
    Author
    NOAA Programmer
    + +

    Definition at line 57 of file gbits.c.

    + +

    Referenced by comunpack(), g2_unpack3(), g2_unpack4(), g2_unpack6(), gbit(), pngunpack(), simunpack(), and specunpack().

    + +
    +
    + +

    ◆ sbit()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sbit (unsigned char * out,
    g2intin,
    g2int iskip,
    g2int nbyte 
    )
    +
    + +

    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.

    +
    Parameters
    + + + + + +
    outPointer to packed array output. Must be allocated large enough to hold output.
    inPointer to unpacked array input.
    iskipInitial number of bits to skip.
    nbyteNumber 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,
    g2intin,
    g2int iskip,
    g2int nbyte,
    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
    + + + + + + + +
    outPointer to packed array output. Must be allocated large enough to hold output.
    inPointer to unpacked array input.
    iskipInitial number of bits to skip.
    nbyteNumber of bits to pack.
    nskipAdditional number of bits to skip on each iteration.
    nNumber of iterations.
    +
    +
    +
    Author
    NOAA Programmer
    + +

    Definition at line 114 of file gbits.c.

    + +

    Referenced by compack(), g2_addfield(), g2_addgrid(), jpcpack(), misspack(), pngpack(), sbit(), and simpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gbits_8c.js b/ver-1.7.0/ver-1.6.4/gbits_8c.js new file mode 100644 index 00000000..1fb18568 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gbits_8c.js @@ -0,0 +1,7 @@ +var gbits_8c = +[ + [ "gbit", "gbits_8c.html#a5d36ba9d46c32188872d0e9ab86f3e47", null ], + [ "gbits", "gbits_8c.html#ab3ebb34ac18fa0ad9baa48eb894689e7", null ], + [ "sbit", "gbits_8c.html#a7f475eed9a6d6f6d3d8fc26b38572950", null ], + [ "sbits", "gbits_8c.html#ad5a2832a80724dc38d71de38d0a9d6e8", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/gbits_8c_source.html b/ver-1.7.0/ver-1.6.4/gbits_8c_source.html new file mode 100644 index 00000000..26fc2eb5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gbits_8c_source.html @@ -0,0 +1,215 @@ + + + + + + + +NCEPLIBS-g2c: gbits.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    gbits.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include "grib2.h"
    +
    7 
    +
    19 void
    +
    20 gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    +
    21 {
    +
    22  gbits(in, iout, iskip, nbyte, (g2int)0, (g2int)1);
    +
    23 }
    +
    24 
    +
    37 void
    +
    38 sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    +
    39 {
    +
    40  sbits(out, in, iskip, nbyte, (g2int)0, (g2int)1);
    +
    41 }
    +
    42 
    +
    56 void
    +
    57 gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte,
    +
    58  g2int nskip, g2int n)
    +
    59 {
    +
    60  g2int i, tbit, bitcnt, ibit, itmp;
    +
    61  g2int nbit, index;
    +
    62  static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
    +
    63 
    +
    64  /* nbit is the start position of the field in bits */
    +
    65  nbit = iskip;
    +
    66  for (i = 0; i < n; i++)
    +
    67  {
    +
    68  bitcnt = nbyte;
    +
    69  index = nbit / 8;
    +
    70  ibit = nbit % 8;
    +
    71  nbit = nbit + nbyte + nskip;
    +
    72 
    +
    73  /* first byte */
    +
    74  tbit = (bitcnt < (8 - ibit)) ? bitcnt : 8 - ibit; // find min
    +
    75  itmp = (int)*(in + index) & ones[7 - ibit];
    +
    76  if (tbit != 8 - ibit) itmp >>= (8 - ibit - tbit);
    +
    77  index++;
    +
    78  bitcnt = bitcnt - tbit;
    +
    79 
    +
    80  /* now transfer whole bytes */
    +
    81  while (bitcnt >= 8)
    +
    82  {
    +
    83  itmp = itmp << 8 | (int)*(in + index);
    +
    84  bitcnt = bitcnt - 8;
    +
    85  index++;
    +
    86  }
    +
    87 
    +
    88  /* get data from last byte */
    +
    89  if (bitcnt > 0)
    +
    90  {
    +
    91  itmp = ( itmp << bitcnt ) |
    +
    92  (((int)*(in + index) >> (8 - bitcnt)) & ones[bitcnt - 1]);
    +
    93  }
    +
    94 
    +
    95  *(iout + i) = itmp;
    +
    96  }
    +
    97 }
    +
    98 
    +
    113 void
    +
    114 sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte,
    +
    115  g2int nskip, g2int n)
    +
    116 {
    +
    117  g2int i, bitcnt, tbit, ibit, itmp, imask, itmp2, itmp3;
    +
    118  g2int nbit, index;
    +
    119  static g2int ones[]={1, 3, 7, 15, 31, 63, 127, 255};
    +
    120 
    +
    121  /* number bits from zero to ... nbit is the last bit of the field
    +
    122  * to be filled. */
    +
    123  nbit = iskip + nbyte - 1;
    +
    124  for (i = 0; i < n; i++)
    +
    125  {
    +
    126  itmp = *(in + i);
    +
    127  bitcnt = nbyte;
    +
    128  index = nbit / 8;
    +
    129  ibit = nbit % 8;
    +
    130  nbit = nbit + nbyte + nskip;
    +
    131 
    +
    132  /* make byte aligned */
    +
    133  if (ibit != 7)
    +
    134  {
    +
    135  tbit = (bitcnt < (ibit+1)) ? bitcnt : ibit + 1; /* find min */
    +
    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;
    +
    141  itmp = itmp >> tbit;
    +
    142  index--;
    +
    143  }
    +
    144  /* now byte aligned */
    +
    145 
    +
    146  /* do by bytes */
    +
    147  while (bitcnt >= 8)
    +
    148  {
    +
    149  out[index] = (unsigned char)(itmp & 255);
    +
    150  itmp = itmp >> 8;
    +
    151  bitcnt = bitcnt - 8;
    +
    152  index--;
    +
    153  }
    +
    154 
    +
    155  /* do last byte */
    +
    156  if (bitcnt > 0)
    +
    157  {
    +
    158  itmp2 = itmp & ones[bitcnt - 1];
    +
    159  itmp3 = (int)*(out + index) & (255 - ones[bitcnt - 1]);
    +
    160  out[index] = (unsigned char)(itmp2 | itmp3);
    +
    161  }
    +
    162  }
    +
    163 
    +
    164 }
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/getdim_8c.html b/ver-1.7.0/ver-1.6.4/getdim_8c.html new file mode 100644 index 00000000..4f49e719 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/getdim_8c.html @@ -0,0 +1,183 @@ + + + + + + + +NCEPLIBS-g2c: getdim.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    getdim.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ getdim()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int getdim (unsigned char * csec3,
    g2intwidth,
    g2intheight,
    g2intiscan 
    )
    +
    + +

    This subroutine returns the dimensions and scanning mode of a grid definition packed in GRIB2 Grid Definition Section 3 format.

    +
    Parameters
    + + + + + +
    csec3Character array that contains the packed GRIB2 GDS.
    widthx (or i) dimension of the grid. 0 if grid is not recognized.
    heighty (or j) dimension of the grid. 0 if grid is not recognized.
    iscanScanning 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/ver-1.6.4/getdim_8c.js b/ver-1.7.0/ver-1.6.4/getdim_8c.js new file mode 100644 index 00000000..5e739da4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/getdim_8c_source.html b/ver-1.7.0/ver-1.6.4/getdim_8c_source.html new file mode 100644 index 00000000..18b100b8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/getdim_8c_source.html @@ -0,0 +1,200 @@ + + + + + + + +NCEPLIBS-g2c: getdim.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    getdim.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    28 g2int
    +
    29 getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan)
    +
    30 {
    +
    31  g2int *igdstmpl = NULL, *list_opt = NULL;
    +
    32  g2int *igds = NULL;
    +
    33  g2int iofst, igdtlen, num_opt, jerr;
    +
    34 
    +
    35  iofst = 0; /* set offset to beginning of section */
    +
    36  if (!(jerr = g2_unpack3(csec3, &iofst, &igds, &igdstmpl, &igdtlen,
    +
    37  &list_opt, &num_opt)))
    +
    38  {
    +
    39  switch (igds[4]) /* Template number */
    +
    40  {
    +
    41  case 0: /* Lat/Lon */
    +
    42  case 1:
    +
    43  case 2:
    +
    44  case 3:
    +
    45  {
    +
    46  *width = igdstmpl[7];
    +
    47  *height = igdstmpl[8];
    +
    48  *iscan = igdstmpl[18];
    +
    49  break;
    +
    50  }
    +
    51  case 10: /* Mercator */
    +
    52  {
    +
    53  *width = igdstmpl[7];
    +
    54  *height = igdstmpl[8];
    +
    55  *iscan = igdstmpl[15];
    +
    56  break;
    +
    57  }
    +
    58  case 20: /* Polar Stereographic */
    +
    59  {
    +
    60  *width = igdstmpl[7];
    +
    61  *height = igdstmpl[8];
    +
    62  *iscan = igdstmpl[17];
    +
    63  break;
    +
    64  }
    +
    65  case 30: /* Lambert Conformal */
    +
    66  {
    +
    67  *width = igdstmpl[7];
    +
    68  *height = igdstmpl[8];
    +
    69  *iscan = igdstmpl[17];
    +
    70  break;
    +
    71  }
    +
    72  case 40: /* Gaussian */
    +
    73  case 41:
    +
    74  case 42:
    +
    75  case 43:
    +
    76  {
    +
    77  *width = igdstmpl[7];
    +
    78  *height = igdstmpl[8];
    +
    79  *iscan = igdstmpl[18];
    +
    80  break;
    +
    81  }
    +
    82  case 90: /* Space View/Orthographic */
    +
    83  {
    +
    84  *width = igdstmpl[7];
    +
    85  *height = igdstmpl[8];
    +
    86  *iscan = igdstmpl[16];
    +
    87  break;
    +
    88  }
    +
    89  case 110: /* Equatorial Azimuthal */
    +
    90  {
    +
    91  *width = igdstmpl[7];
    +
    92  *height = igdstmpl[8];
    +
    93  *iscan = igdstmpl[15];
    +
    94  break;
    +
    95  }
    +
    96  default:
    +
    97  {
    +
    98  *width = 0;
    +
    99  *height = 0;
    +
    100  *iscan = 0;
    +
    101  break;
    +
    102  }
    +
    103  } /* end switch */
    +
    104  }
    +
    105  else
    +
    106  {
    +
    107  *width = 0;
    +
    108  *height = 0;
    +
    109  }
    +
    110 
    +
    111  if (igds)
    +
    112  free(igds);
    +
    113  if (igdstmpl)
    +
    114  free(igdstmpl);
    +
    115  if (list_opt)
    +
    116  free(list_opt);
    +
    117 
    +
    118  return 0;
    +
    119 }
    +
    g2int g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
    This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack3.c:57
    +
    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...
    Definition: getdim.c:29
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/getpoly_8c.html b/ver-1.7.0/ver-1.6.4/getpoly_8c.html new file mode 100644 index 00000000..1e8fa6ca --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/getpoly_8c.html @@ -0,0 +1,190 @@ + + + + + + + +NCEPLIBS-g2c: getpoly.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    getpoly.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ getpoly()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int getpoly (unsigned char * csec3,
    g2intjj,
    g2intkk,
    g2intmm 
    )
    +
    + +

    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
    + + + + + +
    csec3Character array that contains the packed GRIB2 GDS.
    jjJ pentagonal resolution parameter.
    kkK pentagonal resolution parameter.
    mmM 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/ver-1.6.4/getpoly_8c.js b/ver-1.7.0/ver-1.6.4/getpoly_8c.js new file mode 100644 index 00000000..4a760148 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/getpoly_8c_source.html b/ver-1.7.0/ver-1.6.4/getpoly_8c_source.html new file mode 100644 index 00000000..496ee854 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/getpoly_8c_source.html @@ -0,0 +1,157 @@ + + + + + + + +NCEPLIBS-g2c: getpoly.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    getpoly.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    39 g2int
    +
    40 getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm)
    +
    41 {
    +
    42 
    +
    43  g2int *igdstmpl, *list_opt;
    +
    44  g2int *igds;
    +
    45  g2int iofst, igdtlen, num_opt;
    +
    46 
    +
    47  iofst = 0; /* set offset to beginning of section */
    +
    48  if (!g2_unpack3(csec3, &iofst, &igds, &igdstmpl, &igdtlen,
    +
    49  &list_opt, &num_opt))
    +
    50  {
    +
    51  switch (igds[4]) /* Template number */
    +
    52  {
    +
    53  case 50: /* Spherical harmonic coefficients */
    +
    54  case 51:
    +
    55  case 52:
    +
    56  case 53:
    +
    57  {
    +
    58  *jj = igdstmpl[0];
    +
    59  *kk = igdstmpl[1];
    +
    60  *mm = igdstmpl[2];
    +
    61  break;
    +
    62  }
    +
    63  default:
    +
    64  {
    +
    65  *jj = 0;
    +
    66  *kk = 0;
    +
    67  *mm = 0;
    +
    68  break;
    +
    69  }
    +
    70  } /* end switch */
    +
    71  }
    +
    72  else
    +
    73  {
    +
    74  *jj = 0;
    +
    75  *kk = 0;
    +
    76  *mm = 0;
    +
    77  }
    +
    78 
    +
    79  if (igds)
    +
    80  free(igds);
    +
    81  if (igdstmpl)
    +
    82  free(igdstmpl);
    +
    83  if (list_opt)
    +
    84  free(list_opt);
    +
    85 
    +
    86  return 0;
    +
    87 }
    +
    g2int g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
    This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack3.c:57
    +
    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...
    Definition: getpoly.c:40
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/globals.html b/ver-1.7.0/ver-1.6.4/globals.html new file mode 100644 index 00000000..a35da0c0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/globals.html @@ -0,0 +1,450 @@ + + + + + + + +NCEPLIBS-g2c: Globals + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
    + +

    - c -

    + + +

    - d -

    + + +

    - e -

    + + +

    - f -

    + + +

    - g -

    + + +

    - i -

    + + +

    - j -

    + + +

    - l -

    + + +

    - m -

    + + +

    - p -

    + + +

    - r -

    + + +

    - s -

    + + +

    - t -

    + + +

    - u -

    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/globals_defs.html b/ver-1.7.0/ver-1.6.4/globals_defs.html new file mode 100644 index 00000000..d016d4d6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/globals_defs.html @@ -0,0 +1,135 @@ + + + + + + + +NCEPLIBS-g2c: Globals + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/globals_func.html b/ver-1.7.0/ver-1.6.4/globals_func.html new file mode 100644 index 00000000..4cf10a9e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/globals_func.html @@ -0,0 +1,361 @@ + + + + + + + +NCEPLIBS-g2c: Globals + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +  + +

    - c -

    + + +

    - d -

    + + +

    - e -

    + + +

    - g -

    + + +

    - i -

    + + +

    - j -

    + + +

    - m -

    + + +

    - p -

    + + +

    - r -

    + + +

    - s -

    + + +

    - u -

    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/globals_type.html b/ver-1.7.0/ver-1.6.4/globals_type.html new file mode 100644 index 00000000..03352a98 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/globals_type.html @@ -0,0 +1,125 @@ + + + + + + + +NCEPLIBS-g2c: Globals + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/globals_vars.html b/ver-1.7.0/ver-1.6.4/globals_vars.html new file mode 100644 index 00000000..fbaf9301 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/globals_vars.html @@ -0,0 +1,105 @@ + + + + + + + +NCEPLIBS-g2c: Globals + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/grib2_8h.html b/ver-1.7.0/ver-1.6.4/grib2_8h.html new file mode 100644 index 00000000..86e19ac5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/grib2_8h.html @@ -0,0 +1,3153 @@ + + + + + + + +NCEPLIBS-g2c: grib2.h File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    grib2.h File Reference
    +
    +
    + +

    Header file for NCEPLIBS-g2c library. +More...

    +
    #include <stdio.h>
    +#include <stdint.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Data Structures

    struct  gribfield
     Struct for GRIB field. More...
     
    struct  gtemplate
     Struct for GRIB template. More...
     
    + + + + +

    +Macros

    #define G2_VERSION   "g2clib-1.6.4"
     Current version of NCEPLIBS-g2c library. More...
     
    + + + + + + + + + + + + + + + + +

    +Typedefs

    typedef float g2float
     Float type. More...
     
    typedef int64_t g2int
     Long integer type. More...
     
    typedef uint64_t g2intu
     Unsigned long integer type. More...
     
    typedef struct gribfield gribfield
     Struct for GRIB field. More...
     
    typedef struct gtemplate gtemplate
     Struct for GRIB template. More...
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    void compack (g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
     
    gtemplateextdrstemplate (g2int, g2int *)
     This subroutine generates the remaining octet map for a given Data Representation Template, if required. More...
     
    gtemplateextgridtemplate (g2int, g2int *)
     This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More...
     
    gtemplateextpdstemplate (g2int, g2int *)
     This subroutine generates the remaining octet map for a given Product Definition Template, if required. More...
     
    g2int g2_addfield (unsigned char *, g2int, g2int *, g2float *, g2int, g2int, g2int *, g2float *, g2int, g2int, g2int *)
     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 *, g2int *, g2int *, g2int *, g2int)
     This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message. More...
     
    g2int g2_addlocal (unsigned char *, unsigned char *, g2int)
     This routine adds a Local Use Section (Section 2) to a GRIB2 message. More...
     
    g2int g2_create (unsigned char *, g2int *, g2int *)
     This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Identification Section). More...
     
    void g2_free (gribfield *)
     This routine frees up memory that was allocated for struct gribfield. More...
     
    g2int g2_getfld (unsigned char *, g2int, g2int, g2int, gribfield **)
     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 *)
     This routine finalizes a GRIB2 message after all grids and fields have been added. More...
     
    g2int g2_info (unsigned char *, g2int *, g2int *, g2int *, g2int *)
     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 *, g2int *, g2int **, g2int *)
     This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2. More...
     
    g2int g2_unpack3 (unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
     This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack4 (unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *)
     This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack5 (unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *)
     This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack6 (unsigned char *, g2int *, g2int, g2int *, g2int **)
     This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2. More...
     
    g2int g2_unpack7 (unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **)
     This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More...
     
    void gbit (unsigned char *, g2int *, g2int, g2int)
     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 *, g2int *, g2int, g2int, g2int, g2int)
     Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array. More...
     
    gtemplategetdrstemplate (g2int)
     This subroutine returns DRS template information for a specified Data Representation Template. More...
     
    gtemplategetgridtemplate (g2int)
     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...
     
    gtemplategetpdstemplate (g2int)
     This subroutine returns PDS template information for a specified Product Definition Template. More...
     
    double int_power (double, g2int)
     Function similar to C pow() power function. More...
     
    void misspack (g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
     
    void mkieee (g2float *, g2int *, g2int)
     This subroutine stores a list of real values in 32-bit IEEE floating point format. More...
     
    int pack_gp (g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *)
     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 rdieee (g2int *, g2float *, g2int)
     This subroutine reads a list of real values in 32-bit IEEE floating point format. More...
     
    void sbit (unsigned char *, g2int *, g2int, g2int)
     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 *, g2int *, g2int, g2int, g2int, g2int)
     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 seekgb (FILE *, g2int, g2int, g2int *, g2int *)
     This subprogram searches a file for the next GRIB Message. More...
     
    void simpack (g2float *, g2int, g2int *, unsigned char *, g2int *)
     This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 documention. More...
     
    +

    Detailed Description

    +

    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
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition in file grib2.h.

    +

    Data Type Documentation

    + +

    ◆ gribfield

    + +
    +
    + + + + +
    struct gribfield
    +
    +

    Struct for GRIB field.

    + +

    Definition at line 60 of file grib2.h.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Data Fields
    +g2int * +bmap +Integer array containing decoded bitmap, if ibmap=0 or ibap=254.

    Otherwise NULL.

    +
    +g2float * +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.

    +
    +g2float * +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).
    + +
    +
    + +

    ◆ gtemplate

    + +
    +
    + + + + +
    struct gtemplate
    +
    +

    Struct for GRIB template.

    + +

    Definition at line 27 of file grib2.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.

    +
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ G2_VERSION

    + +
    +
    + + + + +
    #define G2_VERSION   "g2clib-1.6.4"
    +
    + +

    Current version of NCEPLIBS-g2c library.

    + +

    Definition at line 18 of file grib2.h.

    + +
    +
    +

    Typedef Documentation

    + +

    ◆ g2float

    + +
    +
    + + + + +
    typedef float g2float
    +
    + +

    Float type.

    + +

    Definition at line 22 of file grib2.h.

    + +
    +
    + +

    ◆ g2int

    + +
    +
    + + + + +
    typedef int64_t g2int
    +
    + +

    Long integer type.

    + +

    Definition at line 20 of file grib2.h.

    + +
    +
    + +

    ◆ g2intu

    + +
    +
    + + + + +
    typedef uint64_t g2intu
    +
    + +

    Unsigned long integer type.

    + +

    Definition at line 21 of file grib2.h.

    + +
    +
    + +

    ◆ gribfield

    + +
    +
    + + + + +
    typedef struct gribfield gribfield
    +
    + +

    Struct for GRIB field.

    + +

    Definition at line 22 of file grib2.h.

    + +
    +
    + +

    ◆ gtemplate

    + +
    +
    + + + + +
    typedef struct gtemplate gtemplate
    +
    + +

    Struct for GRIB template.

    + +

    Definition at line 22 of file grib2.h.

    + +
    +
    +

    Function Documentation

    + +

    ◆ compack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void compack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrsnumData Representation Template number. Must equal 2 or 3.
    idrstmplContains 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)
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-07
    + +

    Definition at line 42 of file compack.c.

    + +

    References int_power(), mkieee(), pack_gp(), sbit(), and sbits().

    + +

    Referenced by cmplxpack().

    + +
    +
    + +

    ◆ extdrstemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extdrstemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numberThe number of the Data Representation Template that is being requested.
    listThe 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 110 of file drstemplates.c.

    + +

    References getdrsindex(), and getdrstemplate().

    + +

    Referenced by g2_unpack5().

    + +
    +
    + +

    ◆ extgridtemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extgridtemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numberThe number of the Grid Definition Template that is being requested.
    listThe 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 124 of file gridtemplates.c.

    + +

    References getgridindex(), and getgridtemplate().

    + +

    Referenced by g2_addgrid(), and g2_unpack3().

    + +
    +
    + +

    ◆ extpdstemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extpdstemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numbernumber of the Product Definition Template 4.NN that is being requested.
    listThe 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 121 of file pdstemplates.c.

    + +

    References getpdsindex(), and getpdstemplate().

    + +

    Referenced by g2_addfield(), and g2_unpack4().

    + +
    +
    + +

    ◆ g2_addfield()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_addfield (unsigned char * cgrib,
    g2int ipdsnum,
    g2intipdstmpl,
    g2floatcoordlist,
    g2int numcoord,
    g2int idrsnum,
    g2intidrstmpl,
    g2floatfld,
    g2int ngrdpts,
    g2int ibmap,
    g2intbmap 
    )
    +
    + +

    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
    + + + + + + + + + + + + +
    cgribChar 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.
    ipdsnumProduct Definition Template Number (see Code Table 4.0).
    ipdstmplContains the data values for the Product Definition Template specified by ipdsnum.
    coordlistArray containg floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
    numcoordnumber of values in array coordlist.
    idrsnumData Representation Template Number (see Code Table 5.0).
    idrstmplThe 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.
    fldArray of data points to pack.
    ngrdptsNumber of data points in grid. i.e. size of fld and bmap.
    ibmapBitmap 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.
    • +
    +
    bmapInteger array containing bitmap to be added (if ibmap = 0).
    +
    +
    +
    Returns
      +
    • > 0 Current size of updated GRIB2 message
    • +
    • -1 GRIB message was not initialized. Need to call routine g2_create() first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count.
    • +
    • -4 Previous Section was not 3 or 7.
    • +
    • -5 Could not find requested Product Definition Template.
    • +
    • -6 Section 3 (GDS) not previously defined in message.
    • +
    • -7 Tried to use unsupported Data Representationi Template.
    • +
    • -8 Specified use of a previously defined bitmap, but one does not exist in the GRIB message.
    • +
    • -9 GDT of one of 5.50 through 5.53 required to pack field using DRT 5.51.
    • +
    • -10 Error packing data field.
    • +
    +
    +
    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 106 of file g2_addfield.c.

    + +

    References cmplxpack(), gtemplate::ext, gtemplate::extlen, extpdstemplate(), 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,
    g2intigds,
    g2intigdstmpl,
    g2intideflist,
    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
    + + + + + + +
    cgribChar array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message.
    igdsContains 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).
    • +
    +
    igdstmplContains 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
    • +
    • -1 GRIB message was not initialized. Need to call routine gribcreate first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 1, 2 or 7.
    • +
    • -5 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 66 of file g2_addgrid.c.

    + +

    References gtemplate::ext, extgridtemplate(), gtemplate::extlen, 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. g2_create() must be called first to initialize a new GRIB2 message.

    +
    Parameters
    + + + + +
    cgribChar array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
    csec2Character array containing information to be added in Section 2.
    lcsec2Number of bytes of character array csec2 to be added to Section 2.
    +
    +
    +
    Returns
    > 0 = Current size of updated GRIB2 message.
      +
    • -1 GRIB message was not initialized. Need to call routine gribcreate first.
    • +
    • -2 GRIB message already complete. Cannot add new section.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 1 or 7.
    • +
    +
    +
    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 37 of file g2_addlocal.c.

    + +

    References gbit(), and sbit().

    + +
    +
    + +

    ◆ g2_create()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_create (unsigned char * cgrib,
    g2intlistsec0,
    g2intlistsec1 
    )
    +
    + +

    This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 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]cgribCharacter array to contain the GRIB2 message. Must be allocated large enough to store the entire GRIB2 message.
    [in]listsec0Contains 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]listsec1Contains 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
      +
    • -1 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 63 of file g2_create.c.

    + +

    References LENSEC0, MAPSEC1LEN, and sbit().

    + +
    +
    + +

    ◆ g2_free()

    + +
    +
    + + + + + + + + +
    void g2_free (gribfieldgfld)
    +
    + +

    This routine frees up memory that was allocated for struct gribfield.

    +
    Parameters
    + + +
    gfldpointer 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.

    + +
    +
    + +

    ◆ 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
    + + + + + + +
    cgribCharacter pointer to the GRIB2 message.
    ifldnumSpecifies which field in the GRIB2 message to return. The first field is number 1, Fortran style.
    unpackBoolean value indicating whether to unpack bitmap/data field.
      +
    • 1 unpack bitmap (if present) and data values.
    • +
    • 0 do not unpack bitmap and data values.
    • +
    +
    expandBoolean 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.
    • +
    +
    gfldpointer to structure gribfield containing all decoded data for the data field.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 1 Beginning characters "GRIB" not found.
    • +
    • 2 GRIB message is not Edition 2.
    • +
    • 3 The data field request number was not positive.
    • +
    • 4 End string "7777" found, but not where expected.
    • +
    • 6 GRIB message did not contain the requested number of data fields.
    • +
    • 7 End string "7777" not found at end of message.
    • +
    • 8 Unrecognized Section encountered.
    • +
    • 9 Data Representation Template 5.NN not yet implemented.
    • +
    • 15 Error unpacking Section 1.
    • +
    • 16 Error unpacking Section 2.
    • +
    • 10 Error unpacking Section 3.
    • +
    • 11 Error unpacking Section 4.
    • +
    • 12 Error unpacking Section 5.
    • +
    • 13 Error unpacking Section 6.
    • +
    • 14 Error unpacking Section 7.
    • +
    • 17 Previous bitmap specified, yet none exists.
    • +
    +
    +
    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:

    +
    #include "grib2.h"
    +
    gribfield *gfld;
    +
    ret=g2_getfld(cgrib,1,1,1,&gfld);
    +
    ...
    +
    g2_free(gfld);
    +
    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),...
    Definition: g2_getfld.c:102
    +
    Header file for NCEPLIBS-g2c library.
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +

    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 102 of file g2_getfld.c.

    + +

    References gribfield::bmap, gribfield::coord_list, gribfield::discipline, gribfield::expanded, gribfield::fld, 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
    + + +
    cgribChar array containing all the data sections added be previous calls to g2_create(), g2_addlocal(), g2_addgrid(), and g2_addfield(). After function is called, contains the finalized GRIB2 message.
    +
    +
    +
    Returns
      +
    • > 0 Length of the final GRIB2 message in bytes.
    • +
    • -1 GRIB message was not initialized. Need to call routine g2_create first.
    • +
    • -2 GRIB message already complete.
    • +
    • -3 Sum of Section byte counts doesn't add to total byte count
    • +
    • -4 Previous Section was not 7.
    • +
    +
    +
    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 35 of file g2_gribend.c.

    + +

    References gbit(), and sbit().

    + +
    +
    + +

    ◆ g2_info()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_info (unsigned char * cgrib,
    g2intlistsec0,
    g2intlistsec1,
    g2intnumfields,
    g2intnumlocal 
    )
    +
    + +

    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
    + + + + + + +
    cgribCharacter pointer to the GRIB2 message.
    listsec0pointer 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.
    • +
    +
    listsec1Pointer 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).
    • +
    +
    numfieldsThe number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.
    numlocalThe number of Local Use Sections ( Section 2 ) found in the GRIB message.
    +
    +
    +
    Returns
    0 foe success, otherwise:
      +
    • 1 Beginning characters "GRIB" not found.
    • +
    • 2 GRIB message is not Edition 2.
    • +
    • 3 Could not find Section 1, where expected.
    • +
    • 4 End string "7777" found, but not where expected.
    • +
    • 5 End string "7777" not found at end of message.
    • +
    • 6 Invalid section number found.
    • +
    +
    +
    Author
    Stephen Gilbeert
    +
    Date
    2002-10-28
    + +

    Definition at line 67 of file g2_info.c.

    + +

    References gbit().

    + +
    +
    + +

    ◆ g2_unpack1()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack1 (unsigned char * cgrib,
    g2intiofst,
    g2int ** ids,
    g2intidslen 
    )
    +
    + +

    This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + +
    cgribchar array containing Section 1 of the GRIB2 message.
    iofstBit offset for the beginning of Section 1 in cgrib.
    idsPointer 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).
    • +
    +
    idslenNumber of elements in ids.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Array passed is not section 1
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition at line 55 of file g2_unpack1.c.

    + +
    +
    + +

    ◆ g2_unpack3()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack3 (unsigned char * cgrib,
    g2intiofst,
    g2int ** igds,
    g2int ** igdstmpl,
    g2intmapgridlen,
    g2int ** ideflist,
    g2intidefnum 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribChar array ontaining Section 3 of the GRIB2 message.
    iofstBit offset for the beginning of Section 3 in cgrib.
    igdsContains 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).
    • +
    +
    igdstmplPointer to integer array containing the data values for the Grid Definition Template specified by igds[4].
    mapgridlenNumber 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
      +
    • 0 no error
    • +
    • 2 Not Section 3
    • +
    • 5 message contains an undefined Grid Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 57 of file g2_unpack3.c.

    + +
    +
    + +

    ◆ g2_unpack4()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack4 (unsigned char * cgrib,
    g2intiofst,
    g2intipdsnum,
    g2int ** ipdstmpl,
    g2intmappdslen,
    g2float ** coordlist,
    g2intnumcoord 
    )
    +
    + +

    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
    + + + + + + + + +
    cgribArray containing Section 4 of the GRIB2 message.
    iofstBit offset of the beginning of Section 4 in cgrib. Returned with updated bit offset.
    ipdsnumProduct Definition Template Number (see Table 4.0).
    ipdstmplPointer that gets an integer array containing the data values for the Product Definition Template specified by ipdsnum.
    mappdslenNumber of elements in ipdstmpl - i.e. number of entries in Product Defintion Template specified by ipdsnum.
    coordlistPointer that gets an array containing floating point values intended to document the vertical discretisation associated to model data on hybrid coordinate vertical levels.
    numcoordnumber of values in array coordlist.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 4
    • +
    • 5 "GRIB" message contains an undefined Product Definition Template.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 45 of file g2_unpack4.c.

    + +
    +
    + +

    ◆ g2_unpack5()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack5 (unsigned char * cgrib,
    g2intiofst,
    g2intndpts,
    g2intidrsnum,
    g2int ** idrstmpl,
    g2intmapdrslen 
    )
    +
    + +

    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
    + + + + + + + +
    cgribchar array containing Section 5 of the GRIB2 message.
    iofstBit offset for the beginning of Section 5 in cgrib. Returned with bit offset at the end of Section 5.
    ndptsNumber of data points unpacked and returned.
    idrsnumData Representation Template Number (see Code Table 5.0).
    idrstmplPointer 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
      +
    • 0 no error
    • +
    • 2 Not Section 5
    • +
    • 6 memory allocation error
    • +
    • 7 "GRIB" message contains an undefined Data Representation Template.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 42 of file g2_unpack5.c.

    + +
    +
    + +

    ◆ g2_unpack6()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack6 (unsigned char * cgrib,
    g2intiofst,
    g2int ngpts,
    g2intibmap,
    g2int ** bmap 
    )
    +
    + +

    This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.

    +
    Parameters
    + + + + + + +
    cgribchar array containing Section 6 of the GRIB2 message.
    iofstBit offset of the beginning of Section 6 in cgrib.
    ngptsNumber of grid points specified in the bit-map
    ibmapBitmap 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.
    • +
    +
    bmapPointer to an integer array containing decoded bitmap. (if ibmap=0)
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not Section 6
    • +
    • 4 Unrecognized pre-defined bit-map.
    • +
    • 6 memory allocation error
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 33 of file g2_unpack6.c.

    + +
    +
    + +

    ◆ g2_unpack7()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int g2_unpack7 (unsigned char * cgrib,
    g2intiofst,
    g2int igdsnum,
    g2intigdstmpl,
    g2int idrsnum,
    g2intidrstmpl,
    g2int ndpts,
    g2float ** 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
    + + + + + + + + + +
    cgribchar array containing Section 7 of the GRIB2 message
    iofstBit offset of the beginning of Section 7 in cgrib.
    igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
    igdstmplPointer 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).
    idrsnumData Representation Template Number (see Code Table 5.0)
    idrstmplPointer 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
    ndptsNumber of data points unpacked and returned.
    fldPointer to a float array containing the unpacked data field.
    +
    +
    +
    Returns
      +
    • 0 no error
    • +
    • 2 Not section 7
    • +
    • 4 Unrecognized Data Representation Template
    • +
    • 5 need one of GDT 3.50 through 3.53 to decode DRT 5.51
    • +
    • 6 memory allocation error
    • +
    • 7 corrupt section 7.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-31
    + +

    Definition at line 65 of file g2_unpack7.c.

    + +
    +
    + +

    ◆ gbit()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void gbit (unsigned char * in,
    g2intiout,
    g2int iskip,
    g2int nbyte 
    )
    +
    + +

    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked iout array.

    +
    Parameters
    + + + + + +
    inpointer to character array input.
    ioutpointer to unpacked array output.
    iskipinitial number of bits to skip.
    nbytenumber 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(), and seekgb().

    + +
    +
    + +

    ◆ gbits()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void gbits (unsigned char * in,
    g2intiout,
    g2int iskip,
    g2int nbyte,
    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
    + + + + + + + +
    inPointer to character array input.
    ioutPointer to unpacked array output.
    iskipInitial number of bits to skip.
    nbyteNumber of bits to take.
    nskipAdditional number of bits to skip on each iteration.
    nNumber of iterations.
    +
    +
    +
    Author
    NOAA Programmer
    + +

    Definition at line 57 of file gbits.c.

    + +

    Referenced by comunpack(), g2_unpack3(), g2_unpack4(), g2_unpack6(), gbit(), pngunpack(), simunpack(), and specunpack().

    + +
    +
    + +

    ◆ getdrstemplate()

    + +
    +
    + + + + + + + + +
    gtemplate* getdrstemplate (g2int number)
    +
    + +

    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
    + + +
    numberThe 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 64 of file drstemplates.c.

    + +

    References getdrsindex(), drstemplate::mapdrslen, drstemplate::needext, drstemplate::template_num, and templatesdrs.

    + +

    Referenced by extdrstemplate(), g2_addfield(), and g2_unpack5().

    + +
    +
    + +

    ◆ getgridtemplate()

    + +
    +
    + + + + + + + + +
    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).

    +

    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
    + + +
    numberThe 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 75 of file gridtemplates.c.

    + +

    References getgridindex(), gridtemplate::mapgridlen, gridtemplate::needext, gridtemplate::template_num, and templatesgrid.

    + +

    Referenced by extgridtemplate(), g2_addgrid(), and g2_unpack3().

    + +
    +
    + +

    ◆ getpdstemplate()

    + +
    +
    + + + + + + + + +
    gtemplate* getpdstemplate (g2int number)
    +
    + +

    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
    + + +
    numberthe 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 73 of file pdstemplates.c.

    + +

    References getpdsindex(), pdstemplate::mappdslen, pdstemplate::needext, pdstemplate::template_num, and templatespds.

    + +

    Referenced by extpdstemplate(), g2_addfield(), and g2_unpack4().

    + +
    +
    + +

    ◆ int_power()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    double int_power (double x,
    g2int y 
    )
    +
    + +

    Function similar to C pow() power function.

    +
    Parameters
    + + + +
    xThe base value whose power is to be calculated.
    yThe power value.
    +
    +
    +
    Returns
    x**y
    +
    Author
    Wesley Ebisuzaki
    + +

    Definition at line 17 of file int_power.c.

    + +

    Referenced by compack(), comunpack(), jpcpack(), jpcunpack(), misspack(), mkieee(), pngpack(), pngunpack(), rdieee(), simpack(), simunpack(), and specunpack().

    + +
    +
    + +

    ◆ misspack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void misspack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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. This version assumes that Missing Value Management is being used and that 1 or 2 missing values appear in the data.

    +
    Parameters
    + + + + + + + +
    fldContains the data values to pack
    ndptsThe number of data values in array fld
    idrsnumData Representation Template number 5.N Must equal 2 or 3.
    idrstmplContains 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).
    • +
    +
    cpackThe packed data field (character*1 array).
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2000-06-21
    + +

    Definition at line 43 of file misspack.c.

    + +

    References int_power(), mkieee(), pack_gp(), rdieee(), sbit(), and sbits().

    + +

    Referenced by cmplxpack().

    + +
    +
    + +

    ◆ mkieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void mkieee (g2floata,
    g2intrieee,
    g2int num 
    )
    +
    + +

    This subroutine stores a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    aInput array of floating point values.
    numNumber of floating point values to convert.
    rieeeOutput 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 21 of file mkieee.c.

    + +

    References int_power().

    + +

    Referenced by compack(), g2_addfield(), jpcpack(), misspack(), pngpack(), simpack(), and specpack().

    + +
    +
    + +

    ◆ pack_gp()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int pack_gp (integerkfildo,
    integeric,
    integernxy,
    integeris523,
    integerminpk,
    integerinc,
    integermissp,
    integermisss,
    integerjmin,
    integerjmax,
    integerlbit,
    integernov,
    integerndg,
    integerlx,
    integeribit,
    integerjbit,
    integerkbit,
    integernovref,
    integerlbitref,
    integerier 
    )
    +
    + +

    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 integer. 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
    + + + + + + + + + + + + + + + + + + + + + +
    kfildounit number for output (print) file. (input)
    icarray 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 integer values will be retained exactly through packing and unpacking. (input)
    nxynumber of values in ic( ). also treated as its dimension. (input)
    is523missing value management 0=data contains no missing values 1=data contains primary missing values 2=data contains primary and secondary missing values (input)
    minpkthe minimum size of each group, except possibly the last one. (input)
    incthe 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)
    misspwhen 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)
    missssecondary missing value indicator (see missp). (input)
    jminthe minimum of each group (j=1,lx). (output)
    jmaxthe 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)
    lbitthe 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)
    novthe number of values in each group (j=1,lx). (output)
    ndgthe dimension of jmin, jmax, lbit, and nov. (input)
    lxthe number of groups determined. (output)
    ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (output)
    jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (output)
    kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. (output)
    novrefreference value for nov( ). (output)
    lbitrefreference value for lbit( ). (output)
    ierError 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 integer 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 integer 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.
    +                      (logical)
    +             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 256 of file pack_gp.c.

    + +

    References FALSE_, reduce(), and TRUE_.

    + +

    Referenced by compack(), and misspack().

    + +
    +
    + +

    ◆ rdieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void rdieee (g2intrieee,
    g2floata,
    g2int num 
    )
    +
    + +

    This subroutine reads a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    rieeeg2int array of floating point values in 32-bit IEEE format.
    numNumber of floating point values to convert.
    afloat array of real values. a must be allocated with at least 4*num bytes of memory before calling this function.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition at line 20 of file rdieee.c.

    + +

    References int_power().

    + +

    Referenced by comunpack(), g2_miss(), g2_unpack4(), g2_unpack7(), jpcunpack(), misspack(), pngunpack(), simunpack(), and specunpack().

    + +
    +
    + +

    ◆ sbit()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sbit (unsigned char * out,
    g2intin,
    g2int iskip,
    g2int nbyte 
    )
    +
    + +

    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each value in the unpacked array.

    +
    Parameters
    + + + + + +
    outPointer to packed array output. Must be allocated large enough to hold output.
    inPointer to unpacked array input.
    iskipInitial number of bits to skip.
    nbyteNumber 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,
    g2intin,
    g2int iskip,
    g2int nbyte,
    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
    + + + + + + + +
    outPointer to packed array output. Must be allocated large enough to hold output.
    inPointer to unpacked array input.
    iskipInitial number of bits to skip.
    nbyteNumber of bits to pack.
    nskipAdditional number of bits to skip on each iteration.
    nNumber of iterations.
    +
    +
    +
    Author
    NOAA Programmer
    + +

    Definition at line 114 of file gbits.c.

    + +

    Referenced by compack(), g2_addfield(), g2_addgrid(), jpcpack(), misspack(), pngpack(), sbit(), and simpack().

    + +
    +
    + +

    ◆ seekgb()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void seekgb (FILE * lugb,
    g2int iseek,
    g2int mseek,
    g2intlskip,
    g2intlgrib 
    )
    +
    + +

    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:

      +
    • 2002-10-28 GILBERT Modified from Iredell's skgb subroutine
    • +
    • 2009-01-16 VUONG Changed lskip to 4 instead of sizof(g2int)
    • +
    +
    Parameters
    + + + + + + +
    lugbFILE pointer for the file to search. File must be opened before this routine is called.
    iseeknumber of bytes in the file to skip before search.
    mseeknumber of bytes to search at a time.
    lskipnumber of bytes to skip from the beggining of the file to where the GRIB message starts.
    lgribnumber of bytes in message (set to 0, if no message found).
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-28
    + +

    Definition at line 32 of file seekgb.c.

    + +

    References gbit().

    + +
    +
    + +

    ◆ simpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void simpack (g2floatfld,
    g2int ndpts,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field
    lcpacklength of packed field starting at cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-06
    + +

    Definition at line 34 of file simpack.c.

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/grib2_8h.js b/ver-1.7.0/ver-1.6.4/grib2_8h.js new file mode 100644 index 00000000..7984bc91 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/grib2_8h.js @@ -0,0 +1,82 @@ +var grib2_8h = +[ + [ "gribfield", "grib2_8h.html#structgribfield", [ + [ "bmap", "grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369", null ], + [ "coord_list", "grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5", null ], + [ "discipline", "grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574", null ], + [ "expanded", "grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20", null ], + [ "fld", "grib2_8h.html#ade69d8c093b2aa18c720c833def6198f", 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 ] + ] ], + [ "gtemplate", "grib2_8h.html#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 ] + ] ], + [ "G2_VERSION", "grib2_8h.html#abdcadc6336632657f0b90b4cff01709f", 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 ], + [ "gtemplate", "grib2_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63", null ], + [ "compack", "grib2_8h.html#af29cd0a48b10eb36018a46cee9d3b51b", null ], + [ "extdrstemplate", "grib2_8h.html#a3f9e059d95b70f538f9c2c8991e32cd4", null ], + [ "extgridtemplate", "grib2_8h.html#ae9558def8f621d909934341dae971e4d", null ], + [ "extpdstemplate", "grib2_8h.html#abfcda5b8de694e1e37e1343f8dae0980", null ], + [ "g2_addfield", "grib2_8h.html#ad246d411efa50751af412bb9c79fa2af", null ], + [ "g2_addgrid", "grib2_8h.html#a232f92335d98c2b6eb4f0d831691817e", null ], + [ "g2_addlocal", "grib2_8h.html#ab4f951ffae2dfca49cd53ef71985d721", null ], + [ "g2_create", "grib2_8h.html#aac286696ed3f69ac01d472c43a5b5d02", null ], + [ "g2_free", "grib2_8h.html#ad99dd0bc820e765764b331384ad9a5d9", null ], + [ "g2_getfld", "grib2_8h.html#a4c569e4ca36f7027411b10331386459c", null ], + [ "g2_gribend", "grib2_8h.html#a5879573202b0fed6eca832fabb9ebb4a", null ], + [ "g2_info", "grib2_8h.html#a8bd1cfb013499982dea5eee69bc95a6e", null ], + [ "g2_unpack1", "grib2_8h.html#a3796bb89e5b8aba66fc624bc8b377a3b", null ], + [ "g2_unpack3", "grib2_8h.html#a7f3d062f236f46e6835f689a149ef88a", null ], + [ "g2_unpack4", "grib2_8h.html#a91d98f7e471cce705c43b039b7d87533", null ], + [ "g2_unpack5", "grib2_8h.html#a37ec4c9e3f74008a74bd11828152df5c", null ], + [ "g2_unpack6", "grib2_8h.html#a27a12127e9cfe2155056e19b035f9256", null ], + [ "g2_unpack7", "grib2_8h.html#a1783305479f24e498089dd59309215f6", null ], + [ "gbit", "grib2_8h.html#aceafa00632b779e830443ef1869f7bb9", null ], + [ "gbits", "grib2_8h.html#a43257e455b339d9ec75d1959f280224c", null ], + [ "getdrstemplate", "grib2_8h.html#a7f643c0f52bd4f76a0fa0e9e713ac489", null ], + [ "getgridtemplate", "grib2_8h.html#a92118ff293a94c42b11d1a39f4994392", null ], + [ "getpdstemplate", "grib2_8h.html#a19df3971bf764abc547d897f841cef61", null ], + [ "int_power", "grib2_8h.html#a3681c8c54464e3e97b3f48de09a5ed92", null ], + [ "misspack", "grib2_8h.html#a5ed56e006562c2783cbce1ddb811b5c5", null ], + [ "mkieee", "grib2_8h.html#a06ba2196366d23a6a06feb820c1456b0", null ], + [ "pack_gp", "grib2_8h.html#a82727fba138c096a0efbf936803d892a", null ], + [ "rdieee", "grib2_8h.html#afdcb02bbf4c7f835fb19f5501d27cf57", null ], + [ "sbit", "grib2_8h.html#a52d2f723b1a656b67fac76d59442a5ac", null ], + [ "sbits", "grib2_8h.html#af1a424b880c33be2d0c3c20939a2567b", null ], + [ "seekgb", "grib2_8h.html#ae0ccb44cd5adec3a64d997b7a21bf828", null ], + [ "simpack", "grib2_8h.html#ad6296345c25609fc7443aba106dc0cb2", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/grib2_8h_source.html b/ver-1.7.0/ver-1.6.4/grib2_8h_source.html new file mode 100644 index 00000000..7a49a8a0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/grib2_8h_source.html @@ -0,0 +1,312 @@ + + + + + + + +NCEPLIBS-g2c: grib2.h Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    grib2.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    13 #ifndef _grib2_H
    +
    14 #define _grib2_H
    +
    15 #include <stdio.h>
    +
    16 #include <stdint.h>
    +
    17 
    +
    18 #define G2_VERSION "g2clib-1.6.4"
    +
    20 typedef int64_t g2int;
    +
    21 typedef uint64_t g2intu;
    +
    22 typedef float g2float;
    +
    27 struct gtemplate
    +
    28 {
    + +
    34 
    + + +
    39 
    + +
    43 
    + +
    46 
    + +
    49 
    + +
    53 };
    +
    54 
    +
    55 typedef struct gtemplate gtemplate;
    +
    60 struct gribfield
    +
    61 {
    + +
    64 
    + +
    68 
    + +
    116 
    + +
    119 
    +
    122  unsigned char *local;
    +
    123 
    + +
    126 
    + +
    129 
    + +
    136 
    + +
    139 
    + +
    144 
    + +
    149 
    + +
    155 
    + +
    160 
    + +
    164 
    + +
    168 
    + +
    172 
    + +
    176 
    + +
    180 
    + +
    184 
    + +
    187 
    + +
    192 
    + +
    195 
    + +
    199 
    + +
    202 
    + +
    206 
    + +
    210 
    + +
    219 
    + +
    227 
    + +
    231 
    + +
    234 };
    +
    235 
    +
    236 typedef struct gribfield gribfield;
    +
    238 /* Prototypes for unpacking sections API */
    +
    239 g2int g2_unpack1(unsigned char *,g2int *,g2int **,g2int *);
    +
    240 g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,g2int *,g2int **,g2int *);
    +
    241 g2int g2_unpack4(unsigned char *,g2int *,g2int *,g2int **,g2int *,g2float **,g2int *);
    +
    242 g2int g2_unpack5(unsigned char *,g2int *,g2int *,g2int *,g2int **,g2int *);
    +
    243 g2int g2_unpack6(unsigned char *,g2int *,g2int ,g2int *,g2int **);
    +
    244 g2int g2_unpack7(unsigned char *,g2int *,g2int ,g2int *,g2int ,g2int *,g2int ,g2float **);
    +
    245 
    +
    246 /* Prototypes for unpacking API */
    +
    247 void seekgb(FILE *,g2int ,g2int ,g2int *,g2int *);
    +
    248 g2int g2_info(unsigned char *,g2int *,g2int *,g2int *,g2int *);
    +
    249 g2int g2_getfld(unsigned char *,g2int ,g2int ,g2int ,gribfield **);
    +
    250 void g2_free(gribfield *);
    +
    251 
    +
    252 /* Prototypes for packing API */
    +
    253 g2int g2_create(unsigned char *,g2int *,g2int *);
    +
    254 g2int g2_addlocal(unsigned char *,unsigned char *,g2int );
    +
    255 g2int g2_addgrid(unsigned char *,g2int *,g2int *,g2int *,g2int );
    +
    256 g2int g2_addfield(unsigned char *,g2int ,g2int *,
    +
    257  g2float *,g2int ,g2int ,g2int *,
    +
    258  g2float *,g2int ,g2int ,g2int *);
    +
    259 g2int g2_gribend(unsigned char *);
    +
    260 
    +
    261 /* Prototypes for supporting routines */
    +
    262 extern double int_power(double, g2int );
    +
    263 extern void mkieee(g2float *,g2int *,g2int);
    +
    264 void rdieee(g2int *,g2float *,g2int );
    + + + + + + +
    271 extern void simpack(g2float *,g2int,g2int *,unsigned char *,g2int *);
    +
    272 extern void compack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
    +
    273 void misspack(g2float *,g2int ,g2int ,g2int *, unsigned char *, g2int *);
    +
    274 void gbit(unsigned char *,g2int *,g2int ,g2int );
    +
    275 void sbit(unsigned char *,g2int *,g2int ,g2int );
    +
    276 void gbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
    +
    277 void sbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
    +
    278 
    +
    279 int pack_gp(g2int *, g2int *, g2int *,
    +
    280  g2int *, g2int *, g2int *, g2int *, g2int *,
    +
    281  g2int *, g2int *, g2int *, g2int *,
    +
    282  g2int *, g2int *, g2int *, g2int *, g2int *,
    +
    283  g2int *, g2int *, g2int *);
    +
    284 
    +
    285 #endif /* _grib2_H */
    +
    g2int igdtnum
    Grid Definition Template Number (See Table 3.1).
    Definition: grib2.h:163
    +
    void mkieee(g2float *, g2int *, g2int)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    g2int locallen
    Length of array local.
    Definition: grib2.h:125
    +
    g2int ibmap
    Bitmap indicator (see Table 6.0).
    Definition: grib2.h:226
    +
    g2int g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **)
    This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
    Definition: g2_unpack7.c:65
    +
    gtemplate * getpdstemplate(g2int)
    This subroutine returns PDS template information for a specified Product Definition Template.
    Definition: pdstemplates.c:73
    +
    g2int interp_opt
    Interpretation of list for optional points definition.
    Definition: grib2.h:148
    +
    g2int ngrdpts
    Number of grid points in the defined grid.
    Definition: grib2.h:138
    +
    g2int g2_addgrid(unsigned char *, g2int *, g2int *, g2int *, g2int)
    This routine packs up a Grid Definition Section (Section 3) and adds it to a GRIB2 message.
    Definition: g2_addgrid.c:66
    +
    g2int g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **)
    This subroutine unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
    Definition: g2_unpack6.c:33
    +
    g2int ifldnum
    Field number within GRIB message.
    Definition: grib2.h:128
    +
    g2float * coord_list
    Array containing floating point values intended to document the vertical discretisation associated to...
    Definition: grib2.h:191
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    g2int * ext
    Number of octets of each entry in the extension part of the template.
    Definition: grib2.h:52
    +
    double int_power(double, g2int)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    g2int g2_unpack1(unsigned char *, g2int *, g2int **, g2int *)
    This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
    Definition: g2_unpack1.c:55
    +
    g2int g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *)
    This subroutine unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
    Definition: g2_unpack5.c:42
    +
    gtemplate * extdrstemplate(g2int, g2int *)
    This subroutine generates the remaining octet map for a given Data Representation Template,...
    Definition: drstemplates.c:110
    +
    g2int griddef
    Source of grid definition (see Table 3.0).
    Definition: grib2.h:135
    +
    void gbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    g2int ipdtnum
    Product Definition Template Number (see Table 4.0).
    Definition: grib2.h:175
    +
    g2int * ipdtmpl
    Contains the data values for the Product Definition Template specified by ipdtnum.
    Definition: grib2.h:183
    +
    g2int discipline
    Message Discipline (see Table 0.0).
    Definition: grib2.h:67
    +
    g2int g2_getfld(unsigned char *, g2int, g2int, g2int, gribfield **)
    This subroutine returns all the metadata, template values, bit-map (if applicable),...
    Definition: g2_getfld.c:102
    +
    g2int numoct_opt
    Number of octets needed for each additional grid points definition.
    Definition: grib2.h:143
    +
    void sbit(unsigned char *, g2int *, g2int, g2int)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    g2int g2_gribend(unsigned char *)
    This routine finalizes a GRIB2 message after all grids and fields have been added.
    Definition: g2_gribend.c:35
    +
    void misspack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
    Definition: misspack.c:43
    +
    g2int idrtlen
    Number of elements in idrtmpl.
    Definition: grib2.h:201
    +
    g2int extlen
    Number of entries in the template extension.
    Definition: grib2.h:48
    +
    g2int unpacked
    Logical value indicating whether the bitmap and data values were unpacked.
    Definition: grib2.h:209
    +
    g2int g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *)
    This routine unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack3.c:57
    +
    gtemplate * getdrstemplate(g2int)
    This subroutine returns DRS template information for a specified Data Representation Template.
    Definition: drstemplates.c:64
    +
    int pack_gp(g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *)
    Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
    Definition: pack_gp.c:256
    +
    g2int * map
    Number of octets of each entry in the static part of the template.
    Definition: grib2.h:42
    +
    g2int idsectlen
    Number of elements in idsect.
    Definition: grib2.h:118
    +
    g2int g2_info(unsigned char *, g2int *, g2int *, g2int *, g2int *)
    This subroutine searches through a GRIB2 message and returns the number of gridded fields found in th...
    Definition: g2_info.c:67
    +
    g2int ipdtlen
    Number of elements in ipdtmpl - i.e.
    Definition: grib2.h:179
    +
    g2int needext
    Indicates whether or not the template needs to be extended.
    Definition: grib2.h:45
    +
    g2int g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *)
    This subroutine unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
    Definition: g2_unpack4.c:45
    +
    gtemplate * getgridtemplate(g2int)
    This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
    Definition: gridtemplates.c:75
    +
    uint64_t g2intu
    Unsigned long integer type.
    Definition: grib2.h:21
    +
    g2int num
    The template number.
    Definition: grib2.h:35
    +
    g2int * igdtmpl
    Contains the data values for the Grid Definition Template specified by igdtnum.
    Definition: grib2.h:171
    +
    g2int idrtnum
    Data Representation Template Number (see Table 5.0).
    Definition: grib2.h:198
    +
    g2int ndpts
    Number of data points unpacked and returned.
    Definition: grib2.h:194
    +
    g2int g2_create(unsigned char *, g2int *, g2int *)
    This routine initializes a new GRIB2 message and packs GRIB2 sections 0 (Indicator Section) and 1 (Id...
    Definition: g2_create.c:63
    +
    g2int * idrtmpl
    Contains the data values for the Data Representation Template specified by idrtnum.
    Definition: grib2.h:205
    +
    g2int g2_addlocal(unsigned char *, unsigned char *, g2int)
    This routine adds a Local Use Section (Section 2) to a GRIB2 message.
    Definition: g2_addlocal.c:37
    +
    g2int * list_opt
    (Used if numoct_opt .ne.
    Definition: grib2.h:159
    +
    gtemplate * extpdstemplate(g2int, g2int *)
    This subroutine generates the remaining octet map for a given Product Definition Template,...
    Definition: pdstemplates.c:121
    +
    g2int version
    GRIB edition number (2).
    Definition: grib2.h:63
    +
    void gbit(unsigned char *, g2int *, g2int, g2int)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    g2int g2_addfield(unsigned char *, g2int, g2int *, g2float *, g2int, g2int, g2int *, g2float *, g2int, g2int, g2int *)
    This routine packs up Sections 4 through 7 for a given field and adds them to a GRIB2 message.
    Definition: g2_addfield.c:106
    +
    g2int type
    The template type: 3 Grid Defintion Template.
    Definition: grib2.h:33
    +
    void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 docu...
    Definition: simpack.c:34
    +
    g2int * idsect
    Contains the entries in the Identification Section (Section 1).
    Definition: grib2.h:115
    +
    void g2_free(gribfield *)
    This routine frees up memory that was allocated for struct gribfield.
    Definition: g2_free.c:24
    +
    g2float * fld
    Array of ndpts unpacked data points.
    Definition: grib2.h:233
    +
    g2int num_coord
    Number of values in array coord_list.
    Definition: grib2.h:186
    +
    void seekgb(FILE *, g2int, g2int, g2int *, g2int *)
    This subprogram searches a file for the next GRIB Message.
    Definition: seekgb.c:32
    +
    unsigned char * local
    Pointer to character array containing contents of Local Section 2, if included.
    Definition: grib2.h:122
    +
    g2int expanded
    Logical value indicating whether the data field was expanded to the grid in the case where a bit-map ...
    Definition: grib2.h:218
    +
    g2int num_opt
    (Used if numoct_opt .ne.
    Definition: grib2.h:154
    +
    g2int igdtlen
    Number of elements in igdtmpl - i.e.
    Definition: grib2.h:167
    +
    gtemplate * extgridtemplate(g2int, g2int *)
    This subroutine generates the remaining octet map for a given Grid Definition Template,...
    +
    g2int maplen
    Number of entries in the static part of the template.
    Definition: grib2.h:38
    +
    g2int * bmap
    Integer array containing decoded bitmap, if ibmap=0 or ibap=254.
    Definition: grib2.h:230
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    void sbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    void compack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 docum...
    Definition: compack.c:42
    +
    void rdieee(g2int *, g2float *, g2int)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    Struct for GRIB field.
    Definition: grib2.h:61
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/grib2_8h_structgribfield.js b/ver-1.7.0/ver-1.6.4/grib2_8h_structgribfield.js new file mode 100644 index 00000000..78742177 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/grib2_8h_structgribfield.js @@ -0,0 +1,33 @@ +var grib2_8h_structgribfield = +[ + [ "bmap", "grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369", null ], + [ "coord_list", "grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5", null ], + [ "discipline", "grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574", null ], + [ "expanded", "grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20", null ], + [ "fld", "grib2_8h.html#ade69d8c093b2aa18c720c833def6198f", 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/ver-1.6.4/grib2_8h_structgtemplate.js b/ver-1.7.0/ver-1.6.4/grib2_8h_structgtemplate.js new file mode 100644 index 00000000..21119c99 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/gridtemplates_8c.html b/ver-1.7.0/ver-1.6.4/gridtemplates_8c.html new file mode 100644 index 00000000..d0e78f50 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gridtemplates_8c.html @@ -0,0 +1,267 @@ + + + + + + + +NCEPLIBS-g2c: gridtemplates.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    gridtemplates.c File Reference
    +
    +
    + +

    Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS). +More...

    +
    #include <stdlib.h>
    +#include "grib2.h"
    +#include "gridtemplates.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    gtemplateextgridtemplate (g2int number, g2int *list)
     This subroutine generates the remaining octet map for a given Grid Definition Template, if required. More...
     
    g2int getgridindex (g2int number)
     This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml). More...
     
    gtemplategetgridtemplate (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...
     
    +

    Detailed Description

    +

    Returns grid template information for a specified Grid Definition Template for Section 3 - the Grid Definition Section (GDS).

    +

    +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.

    +

    Function Documentation

    + +

    ◆ extgridtemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extgridtemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numberThe number of the Grid Definition Template that is being requested.
    listThe 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 124 of file gridtemplates.c.

    + +

    References getgridindex(), and getgridtemplate().

    + +

    Referenced by g2_addgrid(), and g2_unpack3().

    + +
    +
    + +

    ◆ getgridindex()

    + +
    +
    + + + + + + + + +
    g2int getgridindex (g2int number)
    +
    + +

    This function returns the index of specified Grid Definition Template in array templates for [Section 3 - the Grid Definition Section (GDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml).

    +
    Parameters
    + + +
    numberThe number of the Grid Definition Template being requested.
    +
    +
    +
    Returns
    Index of the Grid Definition Template(GDT) in array templates, if template exists. -1, otherwise.
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition at line 37 of file gridtemplates.c.

    + +

    References MAXGRIDTEMP, and templatesgrid.

    + +

    Referenced by extgridtemplate(), and getgridtemplate().

    + +
    +
    + +

    ◆ getgridtemplate()

    + +
    +
    + + + + + + + + +
    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).

    +

    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
    + + +
    numberThe 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 75 of file gridtemplates.c.

    + +

    References getgridindex(), gridtemplate::mapgridlen, gridtemplate::needext, gridtemplate::template_num, and templatesgrid.

    + +

    Referenced by extgridtemplate(), g2_addgrid(), and g2_unpack3().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gridtemplates_8c.js b/ver-1.7.0/ver-1.6.4/gridtemplates_8c.js new file mode 100644 index 00000000..83e7c316 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gridtemplates_8c.js @@ -0,0 +1,6 @@ +var gridtemplates_8c = +[ + [ "extgridtemplate", "gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9", null ], + [ "getgridindex", "gridtemplates_8c.html#a87376e69f794ea1c07c762e7d359715e", null ], + [ "getgridtemplate", "gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/gridtemplates_8c_source.html b/ver-1.7.0/ver-1.6.4/gridtemplates_8c_source.html new file mode 100644 index 00000000..812dc71d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gridtemplates_8c_source.html @@ -0,0 +1,240 @@ + + + + + + + +NCEPLIBS-g2c: gridtemplates.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    gridtemplates.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    18 #include <stdlib.h>
    +
    19 #include "grib2.h"
    +
    20 #include "gridtemplates.h"
    +
    21 
    +
    36 g2int
    + +
    38 {
    +
    39  g2int j, getgridindex = -1;
    +
    40 
    +
    41  for (j = 0; j < MAXGRIDTEMP; j++)
    +
    42  {
    +
    43  if (number == templatesgrid[j].template_num)
    +
    44  {
    +
    45  getgridindex = j;
    +
    46  return(getgridindex);
    +
    47  }
    +
    48  }
    +
    49 
    +
    50  return(getgridindex);
    +
    51 }
    +
    52 
    +
    74 gtemplate *
    + +
    76 {
    +
    77  g2int index;
    +
    78  gtemplate *new;
    +
    79 
    +
    80  index = getgridindex(number);
    +
    81 
    +
    82  if (index != -1)
    +
    83  {
    +
    84  new = malloc(sizeof(gtemplate));
    +
    85  new->type = 3;
    +
    86  new->num = templatesgrid[index].template_num;
    +
    87  new->maplen = templatesgrid[index].mapgridlen;
    +
    88  new->needext = templatesgrid[index].needext;
    +
    89  new->map = (g2int *)templatesgrid[index].mapgrid;
    +
    90  new->extlen = 0;
    +
    91  new->ext = NULL;
    +
    92  return(new);
    +
    93  }
    +
    94  else
    +
    95  {
    +
    96  printf("getgridtemplate: GDT Template 3.%d not defined.\n", (int)number);
    +
    97  return(NULL);
    +
    98  }
    +
    99 
    +
    100  return(NULL);
    +
    101 }
    +
    102 
    +
    123 gtemplate *
    + +
    125 {
    +
    126  gtemplate *new;
    +
    127  g2int index, i;
    +
    128 
    +
    129  index = getgridindex(number);
    +
    130  if (index == -1)
    +
    131  return(0);
    +
    132 
    +
    133  new = getgridtemplate(number);
    +
    134 
    +
    135  if (!new->needext)
    +
    136  return(new);
    +
    137 
    +
    138  if (number == 120)
    +
    139  {
    +
    140  new->extlen = list[1] * 2;
    +
    141  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    142  for (i = 0; i < new->extlen; i++)
    +
    143  {
    +
    144  if (i % 2 == 0)
    +
    145  new->ext[i] = 2;
    +
    146  else
    +
    147  new->ext[i] = -2;
    +
    148  }
    +
    149  }
    +
    150  else if (number == 4)
    +
    151  {
    +
    152  new->extlen = list[7];
    +
    153  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    154  for (i = 0; i < new->extlen; i++)
    +
    155  {
    +
    156  new->ext[i] = 4;
    +
    157  }
    +
    158  new->extlen = list[8];
    +
    159  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    160  for (i = 0; i < new->extlen; i++)
    +
    161  {
    +
    162  new->ext[i] = -4;
    +
    163  }
    +
    164  }
    +
    165  else if (number == 5)
    +
    166  {
    +
    167  new->extlen = list[7];
    +
    168  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    169  for (i = 0; i < new->extlen; i++)
    +
    170  {
    +
    171  new->ext[i] = 4;
    +
    172  }
    +
    173  new->extlen = list[8];
    +
    174  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    175  for (i = 0; i < new->extlen; i++)
    +
    176  {
    +
    177  new->ext[i] = -4;
    +
    178  }
    +
    179  }
    +
    180  else if (number == 1000)
    +
    181  {
    +
    182  new->extlen = list[19];
    +
    183  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    184  for (i = 0; i < new->extlen; i++)
    +
    185  {
    +
    186  new->ext[i] = 4;
    +
    187  }
    +
    188  }
    +
    189  else if (number == 1200)
    +
    190  {
    +
    191  new->extlen = list[15];
    +
    192  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    193  for (i = 0; i < new->extlen; i++)
    +
    194  {
    +
    195  new->ext[i] = 4;
    +
    196  }
    +
    197  }
    +
    198 
    +
    199  return(new);
    +
    200 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    gtemplate * extgridtemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Grid Definition Template,...
    +
    g2int getgridindex(g2int number)
    This function returns the index of specified Grid Definition Template in array templates for [Section...
    Definition: gridtemplates.c:37
    +
    gtemplate * getgridtemplate(g2int number)
    This subroutine returns grid template information for a specified Grid Definition Template for [Secti...
    Definition: gridtemplates.c:75
    +
    This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3...
    +
    g2int template_num
    Template number.
    Definition: gridtemplates.h:51
    +
    #define MAXGRIDTEMP
    Maximum number of templates.
    Definition: gridtemplates.h:43
    +
    g2int needext
    Does template need extension?
    Definition: gridtemplates.h:53
    +
    g2int mapgridlen
    The number of entries in the template.
    Definition: gridtemplates.h:52
    +
    const struct gridtemplate templatesgrid[MAXGRIDTEMP]
    Templates grid.
    Definition: gridtemplates.h:60
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gridtemplates_8h.html b/ver-1.7.0/ver-1.6.4/gridtemplates_8h.html new file mode 100644 index 00000000..f3d1c152 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gridtemplates_8h.html @@ -0,0 +1,263 @@ + + + + + + + +NCEPLIBS-g2c: gridtemplates.h File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    gridtemplates.h File Reference
    +
    +
    + +

    This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS). +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Data Structures

    struct  gridtemplate
     Struct for grid template. More...
     
    + + + + + + + +

    +Macros

    #define MAXGRIDMAPLEN   200
     Maximum template map length. More...
     
    #define MAXGRIDTEMP   31
     Maximum number of templates. More...
     
    + + + + +

    +Variables

    const struct gridtemplate templatesgrid [MAXGRIDTEMP]
     Templates grid. More...
     
    +

    Detailed Description

    +

    This header file contains info on all the available GRIB2 Grid Definition Templates used in Section 3 (GDS).

    +

    Each Template has three parts:

      +
    1. The number of entries in the template (mapgridlen).
    2. +
    3. A map of the template (mapgrid), which contains the number of octets in which to pack each of the template values.
    4. +
    5. A logical value (needext) that indicates whether the Template needs to be extended.
    6. +
    +

    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.

    +

    Data Type Documentation

    + +

    ◆ 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.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ 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.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ templatesgrid

    + +
    +
    + + + + +
    const struct gridtemplate templatesgrid[MAXGRIDTEMP]
    +
    + +

    Templates grid.

    + +

    Definition at line 1 of file gridtemplates.h.

    + +

    Referenced by getgridindex(), and getgridtemplate().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gridtemplates_8h.js b/ver-1.7.0/ver-1.6.4/gridtemplates_8h.js new file mode 100644 index 00000000..642c5727 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/gridtemplates_8h_source.html b/ver-1.7.0/ver-1.6.4/gridtemplates_8h_source.html new file mode 100644 index 00000000..bc19893e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/gridtemplates_8h_source.html @@ -0,0 +1,193 @@ + + + + + + + +NCEPLIBS-g2c: gridtemplates.h Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    gridtemplates.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    39 #ifndef _gridtemplates_H
    +
    40 #define _gridtemplates_H
    +
    41 #include "grib2.h"
    +
    42 
    +
    43 #define MAXGRIDTEMP 31
    +
    44 #define MAXGRIDMAPLEN 200
    + +
    50 {
    + + + + +
    55 };
    +
    56 
    + +
    61 {
    +
    62  /* 3.0: Lat/Lon grid */
    +
    63  { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
    +
    64  /* 3.1: Rotated Lat/Lon grid */
    +
    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} },
    +
    66  /* 3.2: Stretched Lat/Lon grid */
    +
    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} },
    +
    68  /* 3.3: Stretched & Rotated Lat/Lon grid */
    +
    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} },
    +
    70  /* Added GDT 3.4,3.5 (08/05/2013) */
    +
    71  /* 3.4: Variable resolution Latitude/Longitude */
    +
    72  { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
    +
    73  /* 3.5: Variable resolution rotate Latitude/Longitude */
    +
    74  { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
    +
    75  /* 3.12: Transverse Mercator */
    +
    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} },
    +
    77  /* 3.101: General unstructured grid */
    +
    78  {101, 4, 0, {1,4,1,-4} },
    +
    79  /* 3.140: Lambert Azimuthal Equal Area Projection */
    +
    80  {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
    +
    81 
    +
    82  /* 3.10: Mercator */
    +
    83  {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
    +
    84  /* 3.20: Polar Stereographic Projection */
    +
    85  {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
    +
    86  /* 3.30: Lambert Conformal */
    +
    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} },
    +
    88  /* 3.31: Albers equal area */
    +
    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} },
    +
    90  /* 3.40: Guassian Lat/Lon */
    +
    91  {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
    +
    92  /* 3.41: Rotated Gaussian Lat/Lon */
    +
    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} },
    +
    94  /* 3.42: Stretched Gaussian Lat/Lon */
    +
    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} },
    +
    96  /* 3.43: Stretched and Rotated Gaussian Lat/Lon */
    +
    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} },
    +
    98  /* 3.50: Spherical Harmonic Coefficients */
    +
    99  {50, 5, 0, {4,4,4,1,1} },
    +
    100  /* 3.51: Rotated Spherical Harmonic Coefficients */
    +
    101  {51, 8, 0, {4,4,4,1,1,-4,4,4} },
    +
    102  /* 3.52: Stretched Spherical Harmonic Coefficients */
    +
    103  {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
    +
    104  /* 3.53: Stretched and Rotated Spherical Harmonic Coefficients */
    +
    105  {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
    +
    106  /* 3.90: Space View Perspective or orthographic */
    +
    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} },
    +
    108  /* 3.100: Triangular grid based on an icosahedron */
    +
    109  {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
    +
    110  /* 3.110: Equatorial Azimuthal equidistant */
    +
    111  {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
    +
    112  /* 3.120: Azimuth-range projection */
    +
    113  {120, 7, 1, {4,4,-4,4,4,4,1} },
    +
    114  /* 3.204: Curvilinear Orthogonal Grid */
    +
    115  {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
    +
    116  /* 3.32768: Rot Lat/Lon E-grid (Arakawa) */
    +
    117  {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
    +
    118  /* 3.32769: Rot Lat/Lon Non-E Staggered grid (Arakawa) */
    +
    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} },
    +
    120  /* 3.1000: Cross Section Grid */
    +
    121  {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
    +
    122  /* 3.1100: Hovmoller Diagram Grid */
    +
    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} },
    +
    124  /* 3.1200: Time Section Grid */
    +
    125  {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
    +
    126 } ;
    +
    127 
    +
    128 #endif /* _gridtemplates_H */
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    g2int template_num
    Template number.
    Definition: gridtemplates.h:51
    +
    #define MAXGRIDTEMP
    Maximum number of templates.
    Definition: gridtemplates.h:43
    +
    g2int needext
    Does template need extension?
    Definition: gridtemplates.h:53
    +
    g2int mapgridlen
    The number of entries in the template.
    Definition: gridtemplates.h:52
    +
    #define MAXGRIDMAPLEN
    Maximum template map length.
    Definition: gridtemplates.h:44
    +
    g2int mapgrid[MAXGRIDMAPLEN]
    Number of bytes for each template value.
    Definition: gridtemplates.h:54
    +
    const struct gridtemplate templatesgrid[MAXGRIDTEMP]
    Templates grid.
    Definition: gridtemplates.h:60
    +
    Struct for grid template.
    Definition: gridtemplates.h:50
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/gridtemplates_8h_structgridtemplate.js b/ver-1.7.0/ver-1.6.4/gridtemplates_8h_structgridtemplate.js new file mode 100644 index 00000000..9713c90c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/index.html b/ver-1.7.0/ver-1.6.4/index.html new file mode 100644 index 00000000..4276c19b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/index.html @@ -0,0 +1,135 @@ + + + + + + + +NCEPLIBS-g2c: Main Page + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    NCEPLIBS-g2c Documentation
    +
    +
    +

    +NCEPLIBS-g2c

    +

    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/ver-1.6.4/int__power_8c.html b/ver-1.7.0/ver-1.6.4/int__power_8c.html new file mode 100644 index 00000000..84a652dc --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/int__power_8c.html @@ -0,0 +1,163 @@ + + + + + + + +NCEPLIBS-g2c: int_power.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    int_power.c File Reference
    +
    +
    + +

    Provide function similar to C pow() power function. +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    double int_power (double x, g2int y)
     Function similar to C pow() power function. More...
     
    +

    Detailed Description

    +

    Provide function similar to C pow() power function.

    +
    Author
    Wesley Ebisuzaki
    + +

    Definition in file int_power.c.

    +

    Function Documentation

    + +

    ◆ int_power()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    double int_power (double x,
    g2int y 
    )
    +
    + +

    Function similar to C pow() power function.

    +
    Parameters
    + + + +
    xThe base value whose power is to be calculated.
    yThe power value.
    +
    +
    +
    Returns
    x**y
    +
    Author
    Wesley Ebisuzaki
    + +

    Definition at line 17 of file int_power.c.

    + +

    Referenced by compack(), comunpack(), jpcpack(), jpcunpack(), misspack(), mkieee(), pngpack(), pngunpack(), rdieee(), simpack(), simunpack(), and specunpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/int__power_8c.js b/ver-1.7.0/ver-1.6.4/int__power_8c.js new file mode 100644 index 00000000..016df97d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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/ver-1.6.4/int__power_8c_source.html b/ver-1.7.0/ver-1.6.4/int__power_8c_source.html new file mode 100644 index 00000000..b773b022 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/int__power_8c_source.html @@ -0,0 +1,124 @@ + + + + + + + +NCEPLIBS-g2c: int_power.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    int_power.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include "grib2.h"
    +
    6 
    +
    17 double int_power(double x, g2int y) {
    +
    18 
    +
    19  double value;
    +
    20 
    +
    21  if (y < 0) {
    +
    22  y = -y;
    +
    23  x = 1.0 / x;
    +
    24  }
    +
    25  value = 1.0;
    +
    26 
    +
    27  while (y) {
    +
    28  if (y & 1) {
    +
    29  value *= x;
    +
    30  }
    +
    31  x = x * x;
    +
    32  y >>= 1;
    +
    33  }
    +
    34  return value;
    +
    35 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/jpcpack_8c.html b/ver-1.7.0/ver-1.6.4/jpcpack_8c.html new file mode 100644 index 00000000..89ef8f66 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcpack_8c.html @@ -0,0 +1,339 @@ + + + + + + + +NCEPLIBS-g2c: jpcpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    jpcpack.c File Reference
    +
    +
    + +

    Pack up a data field into a JPEG2000 code stream. +More...

    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    int enc_jpeg2000 (unsigned char *, g2int, g2int, g2int, g2int, g2int, g2int, char *, g2int)
     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 version 1.500.4 (or 1.700.2) written by the University of British Columbia, Image Power Inc, and others. More...
     
    void jpcpack (g2float *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...
     
    +

    Detailed Description

    +

    Pack up a data field into a JPEG2000 code stream.

    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-17
    + +

    Definition in file jpcpack.c.

    +

    Function Documentation

    + +

    ◆ 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 version 1.500.4 (or 1.700.2) written by the University of British Columbia, Image Power Inc, and others.

    +

    JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.

    +

    +Program History Log

    + + + + + + + +
    Date Programmer Comments
    2002-12-02 Gilbert Initial
    2004-12-16 Gilbert Added retry argument allowing increased guard bits.
    +
    Parameters
    + + + + + + + + + + +
    cinPacked matrix of Grayscale image values to encode.
    widthwidth of image.
    heightheight of image.
    nbitsdepth (in bits) of image. i.e number of bits used to hold each data value.
    ltypeindicator of lossless or lossy compression.
      +
    • 1, for lossy compression
    • +
    • != 1, for lossless compression
    • +
    +
    ratiotarget compression ratio. (ratio:1) Used only when ltype == 1.
    retryIf 1 try increasing number of guard bits otherwise, no additional options.
    outjpcOutput encoded JPEG2000 code stream.
    jpclenNumber of bytes allocated for the output JPEG2000 code stream in outjpc.
    +
    +
    +
    Returns
      +
    • > 0 = Length in bytes of encoded JPEG2000 code stream
    • +
    • -3 = Error decode jpeg2000 code stream.
    • +
    • -5 = decoded image had multiple color components. Only grayscale is expected.
    • +
    +
    +
    Note
    Requires JasPer Software version 1.500.4 or 1.700.2 or later.
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition at line 57 of file enc_jpeg2000.c.

    + +

    References MAXOPTSSIZE.

    + +

    Referenced by jpcpack().

    + +
    +
    + +

    ◆ jpcpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void jpcpack (g2floatfld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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.

    +

    +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.
    +
    Parameters
    + + + + + + + +
    fldContains the data values to pack.
    widthnumber of points in the x direction.
    heightnumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpackPointer that points to a g2int which contains the length of packed field in cpack. This must be set by the calling function.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-17
    + +

    Definition at line 53 of file jpcpack.c.

    + +

    References enc_jpeg2000(), int_power(), mkieee(), and sbits().

    + +

    Referenced by g2_addfield().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/jpcpack_8c.js b/ver-1.7.0/ver-1.6.4/jpcpack_8c.js new file mode 100644 index 00000000..3e771e8e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcpack_8c.js @@ -0,0 +1,5 @@ +var jpcpack_8c = +[ + [ "enc_jpeg2000", "jpcpack_8c.html#a8a415bdd3beda56d05a706a614608a7c", null ], + [ "jpcpack", "jpcpack_8c.html#a9342b7e883d454cc9c9c5051e40cf557", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/jpcpack_8c_source.html b/ver-1.7.0/ver-1.6.4/jpcpack_8c_source.html new file mode 100644 index 00000000..c2e69259 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcpack_8c_source.html @@ -0,0 +1,221 @@ + + + + + + + +NCEPLIBS-g2c: jpcpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    jpcpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdlib.h>
    +
    6 #include <math.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    9 int enc_jpeg2000(unsigned char *, g2int, g2int, g2int,
    +
    10  g2int, g2int, g2int, char *, g2int);
    +
    11 
    +
    52 void
    +
    53 jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl,
    +
    54  unsigned char *cpack, g2int *lcpack)
    +
    55 {
    +
    56  g2int *ifld;
    +
    57  static g2float alog2 = 0.69314718; /* ln(2.0) */
    +
    58  g2int j, nbits, imin, imax, maxdif;
    +
    59  g2int ndpts, nbytes, nsize, retry;
    +
    60  g2float bscale, dscale, rmax, rmin, temp;
    +
    61  unsigned char *ctemp;
    +
    62 
    +
    63  ifld = 0;
    +
    64  ndpts = width * height;
    +
    65  bscale = int_power(2.0, -idrstmpl[1]);
    +
    66  dscale = int_power(10.0, idrstmpl[2]);
    +
    67 
    +
    68  /* Find max and min values in the data. */
    +
    69  rmax = fld[0];
    +
    70  rmin = fld[0];
    +
    71  for (j = 1; j < ndpts; j++)
    +
    72  {
    +
    73  if (fld[j] > rmax)
    +
    74  rmax = fld[j];
    +
    75  if (fld[j] < rmin)
    +
    76  rmin = fld[j];
    +
    77  }
    +
    78  if (idrstmpl[1] == 0)
    +
    79  maxdif = (g2int)(rint(rmax * dscale) - rint(rmin * dscale));
    +
    80  else
    +
    81  maxdif = (g2int)rint((rmax - rmin) * dscale * bscale);
    +
    82 
    +
    83  /* If max and min values are not equal, pack up field. If they are
    +
    84  * equal, we have a constant field, and the reference value (rmin)
    +
    85  * is the value for each point in the field and set nbits to 0. */
    +
    86  if (rmin != rmax && maxdif != 0)
    +
    87  {
    +
    88  ifld = malloc(ndpts * sizeof(g2int));
    +
    89 
    +
    90  /* Determine which algorithm to use based on user-supplied
    +
    91  * binary scale factor and number of bits. */
    +
    92  if (idrstmpl[1] == 0)
    +
    93  {
    +
    94  /* No binary scaling and calculate minumum number of bits
    +
    95  * in which the data will fit. */
    +
    96  imin = (g2int)rint(rmin * dscale);
    +
    97  imax = (g2int)rint(rmax * dscale);
    +
    98  maxdif = imax - imin;
    +
    99  temp = log((double)(maxdif + 1)) / alog2;
    +
    100  nbits = (g2int)ceil(temp);
    +
    101  rmin = (g2float)imin;
    +
    102  /* scale data */
    +
    103  for(j = 0; j < ndpts; j++)
    +
    104  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
    +
    105  }
    +
    106  else
    +
    107  {
    +
    108  /* Use binary scaling factor and calculate minumum number
    +
    109  * of bits in which the data will fit. */
    +
    110  rmin = rmin * dscale;
    +
    111  rmax = rmax * dscale;
    +
    112  maxdif = (g2int)rint((rmax - rmin) * bscale);
    +
    113  temp = log((double)(maxdif + 1)) / alog2;
    +
    114  nbits = (g2int)ceil(temp);
    +
    115  /* scale data */
    +
    116  for (j = 0; j < ndpts; j++)
    +
    117  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    118  }
    +
    119 
    +
    120  /* Pack data into full octets, then do JPEG 2000 encode and
    +
    121  * calculate the length of the packed data in bytes. */
    +
    122  retry = 0;
    +
    123  nbytes = (nbits + 7) / 8;
    +
    124  nsize = *lcpack; /* needed for input to enc_jpeg2000 */
    +
    125  ctemp = calloc(ndpts, nbytes);
    +
    126  sbits(ctemp, ifld, 0, nbytes * 8, 0, ndpts);
    +
    127  if ((*lcpack = (g2int)enc_jpeg2000(ctemp, width, height, nbits, idrstmpl[5],
    +
    128  idrstmpl[6], retry, (char *)cpack, nsize)) <= 0)
    +
    129  {
    +
    130  printf("jpcpack: ERROR Packing JPC = %d\n", (int)*lcpack);
    +
    131  if (*lcpack == -3)
    +
    132  {
    +
    133  retry = 1;
    +
    134  if ((*lcpack = (g2int)enc_jpeg2000(ctemp, width, height, nbits, idrstmpl[5],
    +
    135  idrstmpl[6], retry, (char *)cpack, nsize)) <= 0)
    +
    136  printf("jpcpack: Retry Failed.\n");
    +
    137  else
    +
    138  printf("jpcpack: Retry Successful.\n");
    +
    139  }
    +
    140  }
    +
    141  free(ctemp);
    +
    142  }
    +
    143  else
    +
    144  {
    +
    145  nbits = 0;
    +
    146  *lcpack = 0;
    +
    147  }
    +
    148 
    +
    149  /* Fill in ref value and number of bits in Template 5.0. */
    +
    150  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format. */
    +
    151  idrstmpl[3] = nbits;
    +
    152  idrstmpl[4] = 0; /* original data were reals */
    +
    153  if (idrstmpl[5] == 0)
    +
    154  idrstmpl[6] = 255; /* lossy not used */
    +
    155  if (ifld)
    +
    156  free(ifld);
    +
    157 }
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    int enc_jpeg2000(unsigned char *, g2int, g2int, g2int, g2int, g2int, g2int, char *, g2int)
    This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 ...
    Definition: enc_jpeg2000.c:57
    +
    void jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
    This subroutine packs up a data field into a JPEG2000 code stream.
    Definition: jpcpack.c:53
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/jpcunpack_8c.html b/ver-1.7.0/ver-1.6.4/jpcunpack_8c.html new file mode 100644 index 00000000..fe6e034b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcunpack_8c.html @@ -0,0 +1,250 @@ + + + + + + + +NCEPLIBS-g2c: jpcunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    jpcunpack.c File Reference
    +
    +
    + +

    Unpack a data field that was packed into a JPEG2000 code stream. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    int dec_jpeg2000 (char *, g2int, g2int *)
     This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software written by the University of British Columbia and Image Power Inc, and others. More...
     
    g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld)
     This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
     
    +

    Detailed Description

    +

    Unpack a data field that was packed into a JPEG2000 code stream.

    +
    Author
    Stephem Gilbert
    +
    Date
    2003-08-27
    + +

    Definition in file jpcunpack.c.

    +

    Function Documentation

    + +

    ◆ dec_jpeg2000()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dec_jpeg2000 (char * injpc,
    g2int bufsize,
    g2intoutfld 
    )
    +
    + +

    This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software written by the University of British Columbia and Image Power Inc, and others.

    +

    JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.

    +
    Parameters
    + + + + +
    injpcInput JPEG2000 code stream.
    bufsizeLength (in bytes) of the input JPEG2000 code stream.
    outfldOutput matrix of grayscale image values.
    +
    +
    +
    Returns
      +
    • 0 Successful decode
    • +
    • -3 Error decode jpeg2000 code stream.
    • +
    • -5 decoded image had multiple color components. Only grayscale is expected.
    • +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-02
    + +

    Definition at line 42 of file dec_jpeg2000.c.

    + +

    Referenced by jpcunpack().

    + +
    +
    + +

    ◆ jpcunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int jpcunpack (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

    +
    Parameters
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack.
    idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values.
    +
    +
    +
    Returns
    0 for success, 1 for memory allocation error.
    +
    Author
    Stephem Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 31 of file jpcunpack.c.

    + +

    References dec_jpeg2000(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/jpcunpack_8c.js b/ver-1.7.0/ver-1.6.4/jpcunpack_8c.js new file mode 100644 index 00000000..881fbe6f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcunpack_8c.js @@ -0,0 +1,5 @@ +var jpcunpack_8c = +[ + [ "dec_jpeg2000", "jpcunpack_8c.html#ab5842a1a8efddeee4661a9cd4607750d", null ], + [ "jpcunpack", "jpcunpack_8c.html#adcf25467e143e6705a2108caaad9fd88", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/jpcunpack_8c_source.html b/ver-1.7.0/ver-1.6.4/jpcunpack_8c_source.html new file mode 100644 index 00000000..dd24b476 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/jpcunpack_8c_source.html @@ -0,0 +1,149 @@ + + + + + + + +NCEPLIBS-g2c: jpcunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    jpcunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    10 int dec_jpeg2000(char *, g2int, g2int *);
    +
    11 
    +
    30 g2int
    +
    31 jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
    +
    32  g2float *fld)
    +
    33 {
    +
    34  g2int *ifld;
    +
    35  g2int j, nbits;
    +
    36  g2float ref, bscale, dscale;
    +
    37 
    +
    38  rdieee(idrstmpl, &ref, 1);
    +
    39  bscale = int_power(2.0, idrstmpl[1]);
    +
    40  dscale = int_power(10.0, -idrstmpl[2]);
    +
    41  nbits = idrstmpl[3];
    +
    42 
    +
    43  /* If nbits equals 0, we have a constant field where the reference
    +
    44  * value is the data value at each gridpoint. */
    +
    45  if (nbits != 0)
    +
    46  {
    +
    47  ifld = calloc(ndpts, sizeof(g2int));
    +
    48  if (ifld == 0)
    +
    49  {
    +
    50  fprintf(stderr, "Could not allocate space in jpcunpack.\n Data field NOT upacked.\n");
    +
    51  return(1);
    +
    52  }
    +
    53  dec_jpeg2000(cpack, len, ifld);
    +
    54  for (j = 0; j < ndpts; j++)
    +
    55  fld[j] = (((g2float)ifld[j] * bscale) + ref) * dscale;
    +
    56  free(ifld);
    +
    57  }
    +
    58  else
    +
    59  {
    +
    60  for (j = 0; j < ndpts; j++)
    +
    61  fld[j] = ref;
    +
    62  }
    +
    63 
    +
    64  return(0);
    +
    65 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    int dec_jpeg2000(char *, g2int, g2int *)
    This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
    Definition: dec_jpeg2000.c:42
    +
    g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld)
    This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the ...
    Definition: jpcunpack.c:31
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/jquery.js b/ver-1.7.0/ver-1.6.4/jquery.js new file mode 100644 index 00000000..103c32d7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/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=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
    "),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
    ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
    "),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
    "),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element +},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
    ').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/menu.js b/ver-1.7.0/ver-1.6.4/menu.js new file mode 100644 index 00000000..2fe2214f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/menu.js @@ -0,0 +1,51 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+=''; + } + return result; + } + + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchEnabled) { + if (serverSide) { + $('#main-menu').append('
  • '); + } else { + $('#main-menu').append('
  • '); + } + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/ver-1.7.0/ver-1.6.4/menudata.js b/ver-1.7.0/ver-1.6.4/menudata.js new file mode 100644 index 00000000..98ba1dd5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/menudata.js @@ -0,0 +1,90 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Data Types List",url:"annotated.html",children:[ +{text:"Data Types List",url:"annotated.html"}, +{text:"Data Fields",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"b",url:"functions.html#index_b"}, +{text:"c",url:"functions.html#index_c"}, +{text:"d",url:"functions.html#index_d"}, +{text:"e",url:"functions.html#index_e"}, +{text:"f",url:"functions.html#index_f"}, +{text:"g",url:"functions.html#index_g"}, +{text:"i",url:"functions.html#index_i"}, +{text:"l",url:"functions.html#index_l"}, +{text:"m",url:"functions.html#index_m"}, +{text:"n",url:"functions.html#index_n"}, +{text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}, +{text:"v",url:"functions.html#index_v"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"b",url:"functions_vars.html#index_b"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"d",url:"functions_vars.html#index_d"}, +{text:"e",url:"functions_vars.html#index_e"}, +{text:"f",url:"functions_vars.html#index_f"}, +{text:"g",url:"functions_vars.html#index_g"}, +{text:"i",url:"functions_vars.html#index_i"}, +{text:"l",url:"functions_vars.html#index_l"}, +{text:"m",url:"functions_vars.html#index_m"}, +{text:"n",url:"functions_vars.html#index_n"}, +{text:"t",url:"functions_vars.html#index_t"}, +{text:"u",url:"functions_vars.html#index_u"}, +{text:"v",url:"functions_vars.html#index_v"}]}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"Globals",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"c",url:"globals.html#index_c"}, +{text:"d",url:"globals.html#index_d"}, +{text:"e",url:"globals.html#index_e"}, +{text:"f",url:"globals.html#index_f"}, +{text:"g",url:"globals.html#index_g"}, +{text:"i",url:"globals.html#index_i"}, +{text:"j",url:"globals.html#index_j"}, +{text:"l",url:"globals.html#index_l"}, +{text:"m",url:"globals.html#index_m"}, +{text:"p",url:"globals.html#index_p"}, +{text:"r",url:"globals.html#index_r"}, +{text:"s",url:"globals.html#index_s"}, +{text:"t",url:"globals.html#index_t"}, +{text:"u",url:"globals.html#index_u"}]}, +{text:"Functions/Subroutines",url:"globals_func.html",children:[ +{text:"c",url:"globals_func.html#index_c"}, +{text:"d",url:"globals_func.html#index_d"}, +{text:"e",url:"globals_func.html#index_e"}, +{text:"g",url:"globals_func.html#index_g"}, +{text:"i",url:"globals_func.html#index_i"}, +{text:"j",url:"globals_func.html#index_j"}, +{text:"m",url:"globals_func.html#index_m"}, +{text:"p",url:"globals_func.html#index_p"}, +{text:"r",url:"globals_func.html#index_r"}, +{text:"s",url:"globals_func.html#index_s"}, +{text:"u",url:"globals_func.html#index_u"}]}, +{text:"Variables",url:"globals_vars.html"}, +{text:"Typedefs",url:"globals_type.html"}, +{text:"Macros",url:"globals_defs.html"}]}]}]} diff --git a/ver-1.7.0/ver-1.6.4/misspack_8c.html b/ver-1.7.0/ver-1.6.4/misspack_8c.html new file mode 100644 index 00000000..a73698b4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/misspack_8c.html @@ -0,0 +1,206 @@ + + + + + + + +NCEPLIBS-g2c: misspack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    misspack.c File Reference
    +
    +
    + +

    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.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void misspack (g2float *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...
     
    +

    Detailed Description

    +

    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.

    +

    Function Documentation

    + +

    ◆ misspack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void misspack (g2floatfld,
    g2int ndpts,
    g2int idrsnum,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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. This version assumes that Missing Value Management is being used and that 1 or 2 missing values appear in the data.

    +
    Parameters
    + + + + + + + +
    fldContains the data values to pack
    ndptsThe number of data values in array fld
    idrsnumData Representation Template number 5.N Must equal 2 or 3.
    idrstmplContains 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).
    • +
    +
    cpackThe packed data field (character*1 array).
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2000-06-21
    + +

    Definition at line 43 of file misspack.c.

    + +

    References int_power(), mkieee(), pack_gp(), rdieee(), sbit(), and sbits().

    + +

    Referenced by cmplxpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/misspack_8c.js b/ver-1.7.0/ver-1.6.4/misspack_8c.js new file mode 100644 index 00000000..957ecfb6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/misspack_8c.js @@ -0,0 +1,4 @@ +var misspack_8c = +[ + [ "misspack", "misspack_8c.html#a33440a1e301c24cf2996122f63ee3cae", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/misspack_8c_source.html b/ver-1.7.0/ver-1.6.4/misspack_8c_source.html new file mode 100644 index 00000000..d82b9d3d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/misspack_8c_source.html @@ -0,0 +1,635 @@ + + + + + + + +NCEPLIBS-g2c: misspack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    misspack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdlib.h>
    +
    8 #include <math.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    42 void
    +
    43 misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl,
    +
    44  unsigned char *cpack, g2int *lcpack)
    +
    45 {
    +
    46  g2int *ifld, *ifldmiss, *jfld;
    +
    47  g2int *jmin, *jmax, *lbit;
    +
    48  static g2int zero = 0;
    +
    49  g2int *gref, *gwidth, *glen;
    +
    50  g2int glength, grpwidth;
    +
    51  g2int i, n, iofst, imin, ival1, ival2, isd, minsd, nbitsd;
    +
    52  g2int nbitsgref, left, iwmax, ngwidthref, nbitsgwidth, ilmax;
    +
    53  g2int nglenref, nglenlast, nbitsglen;
    +
    54  g2int j, missopt, nonmiss, itemp, maxorig, nbitorig, miss1, miss2;
    +
    55  g2int ngroups, ng, num0, num1, num2;
    +
    56  g2int imax, lg, mtemp, ier, igmax;
    +
    57  g2int kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
    +
    58  g2float rmissp, rmisss, bscale, dscale, rmin, temp;
    +
    59  static g2int simple_alg = 0;
    +
    60  static g2float alog2 = 0.69314718; // ln(2.0)
    +
    61  static g2int one = 1;
    +
    62 
    +
    63  bscale = int_power(2.0, -idrstmpl[1]);
    +
    64  dscale = int_power(10.0, idrstmpl[2]);
    +
    65  missopt = idrstmpl[6];
    +
    66  if (missopt != 1 && missopt != 2)
    +
    67  {
    +
    68  printf("misspack: Unrecognized option.\n");
    +
    69  *lcpack = -1;
    +
    70  return;
    +
    71  }
    +
    72  else
    +
    73  { /* Get missing values */
    +
    74  rdieee(idrstmpl + 7, &rmissp, 1);
    +
    75  if (missopt == 2)
    +
    76  rdieee(idrstmpl + 8, &rmisss, 1);
    +
    77  }
    +
    78 
    +
    79  /* Find min value of non-missing values in the data, AND set up
    +
    80  * missing value mapping of the field. */
    +
    81  ifldmiss = calloc(ndpts, sizeof(g2int));
    +
    82  rmin = 1E+37;
    +
    83  if (missopt == 1)
    +
    84  { /* Primary missing value only */
    +
    85  for (j = 0; j < ndpts; j++)
    +
    86  {
    +
    87  if (fld[j] == rmissp)
    +
    88  {
    +
    89  ifldmiss[j] = 1;
    +
    90  }
    +
    91  else
    +
    92  {
    +
    93  ifldmiss[j] = 0;
    +
    94  if (fld[j] < rmin)
    +
    95  rmin = fld[j];
    +
    96  }
    +
    97  }
    +
    98  }
    +
    99  if (missopt == 2)
    +
    100  { /* Primary and secondary missing values */
    +
    101  for (j = 0; j < ndpts; j++)
    +
    102  {
    +
    103  if (fld[j] == rmissp)
    +
    104  {
    +
    105  ifldmiss[j] = 1;
    +
    106  }
    +
    107  else if (fld[j] == rmisss)
    +
    108  {
    +
    109  ifldmiss[j] = 2;
    +
    110  }
    +
    111  else
    +
    112  {
    +
    113  ifldmiss[j] = 0;
    +
    114  if (fld[j] < rmin)
    +
    115  rmin = fld[j];
    +
    116  }
    +
    117  }
    +
    118  }
    +
    119 
    +
    120  /* Allocate work arrays: Note: -ifldmiss[j],j = 0,ndpts-1 is a map
    +
    121  * of original field indicating which of the original data values
    +
    122  * are primary missing (1), sencondary missing (2) or non-missing
    +
    123  * (0). -jfld[j],j = 0,nonmiss-1 is a subarray of just the
    +
    124  * non-missing values from the original field. */
    +
    125  iofst = 0;
    +
    126  ifld = calloc(ndpts, sizeof(g2int));
    +
    127  jfld = calloc(ndpts, sizeof(g2int));
    +
    128  gref = calloc(ndpts, sizeof(g2int));
    +
    129  gwidth = calloc(ndpts, sizeof(g2int));
    +
    130  glen = calloc(ndpts, sizeof(g2int));
    +
    131 
    +
    132  /* Scale original data. */
    +
    133  nonmiss = 0;
    +
    134  if (idrstmpl[1] == 0)
    +
    135  { /* No binary scaling */
    +
    136  imin = (g2int)rint(rmin * dscale);
    +
    137  rmin = (g2float)imin;
    +
    138  for (j = 0; j < ndpts; j++)
    +
    139  {
    +
    140  if (ifldmiss[j] == 0)
    +
    141  {
    +
    142  jfld[nonmiss] = (g2int)rint(fld[j] * dscale) - imin;
    +
    143  nonmiss++;
    +
    144  }
    +
    145  }
    +
    146  }
    +
    147  else
    +
    148  { /* Use binary scaling factor */
    +
    149  rmin = rmin * dscale;
    +
    150  for (j = 0; j < ndpts; j++)
    +
    151  {
    +
    152  if (ifldmiss[j] == 0)
    +
    153  {
    +
    154  jfld[nonmiss] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    155  nonmiss++;
    +
    156  }
    +
    157  }
    +
    158  }
    +
    159 
    +
    160  /* Calculate Spatial differences, if using DRS Template 5.3. */
    +
    161  if (idrsnum == 3)
    +
    162  { /* spatial differences */
    +
    163  if (idrstmpl[16] != 1 && idrstmpl[16] != 2)
    +
    164  idrstmpl[16] = 2;
    +
    165  if (idrstmpl[16] == 1)
    +
    166  { /* first order */
    +
    167  ival1 = jfld[0];
    +
    168  for (j = nonmiss - 1; j > 0; j--)
    +
    169  jfld[j] = jfld[j] - jfld[j - 1];
    +
    170  jfld[0] = 0;
    +
    171  }
    +
    172  else if (idrstmpl[16] == 2)
    +
    173  { /* second order */
    +
    174  ival1 = jfld[0];
    +
    175  ival2 = jfld[1];
    +
    176  for (j = nonmiss - 1; j > 1; j--)
    +
    177  jfld[j] = jfld[j] - (2 * jfld[j - 1]) + jfld[j - 2];
    +
    178  jfld[0] = 0;
    +
    179  jfld[1] = 0;
    +
    180  }
    +
    181 
    +
    182  /* Subtract min value from spatial diff field. */
    +
    183  isd = idrstmpl[16];
    +
    184  minsd = jfld[isd];
    +
    185  for (j = isd; j < nonmiss; j++)
    +
    186  if (jfld[j] < minsd)
    +
    187  minsd = jfld[j];
    +
    188  for (j = isd; j < nonmiss; j++)
    +
    189  jfld[j] = jfld[j] - minsd;
    +
    190 
    +
    191  /* Find num of bits need to store minsd and add 1 extra bit to
    +
    192  * indicate sign. */
    +
    193  temp = log((double)(abs(minsd) + 1)) / alog2;
    +
    194  nbitsd = (g2int)ceil(temp) + 1;
    +
    195 
    +
    196  /* Find num of bits need to store ifld[0] (and ifld[1] if
    +
    197  * using 2nd order differencing). */
    +
    198  maxorig = ival1;
    +
    199  if (idrstmpl[16] == 2 && ival2 > ival1)
    +
    200  maxorig = ival2;
    +
    201  temp = log((double)(maxorig + 1)) / alog2;
    +
    202  nbitorig = (g2int)ceil(temp) + 1;
    +
    203  if (nbitorig > nbitsd)
    +
    204  nbitsd = nbitorig;
    +
    205 
    +
    206  /* increase number of bits to even multiple of 8 (octet) */
    +
    207  if ((nbitsd%8) != 0)
    +
    208  nbitsd = nbitsd+(8-(nbitsd%8));
    +
    209 
    +
    210  /* Store extra spatial differencing info into the packed data
    +
    211  * section. */
    +
    212  if (nbitsd != 0)
    +
    213  {
    +
    214  /* pack first original value */
    +
    215  if (ival1 >= 0) {
    +
    216  sbit(cpack, &ival1, iofst, nbitsd);
    +
    217  iofst = iofst + nbitsd;
    +
    218  }
    +
    219  else
    +
    220  {
    +
    221  sbit(cpack, &one, iofst, 1);
    +
    222  iofst = iofst + 1;
    +
    223  itemp = abs(ival1);
    +
    224  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    225  iofst = iofst + nbitsd - 1;
    +
    226  }
    +
    227  if (idrstmpl[16] == 2)
    +
    228  {
    +
    229  /* pack second original value */
    +
    230  if (ival2 >= 0)
    +
    231  {
    +
    232  sbit(cpack, &ival2, iofst, nbitsd);
    +
    233  iofst = iofst + nbitsd;
    +
    234  }
    +
    235  else
    +
    236  {
    +
    237  sbit(cpack, &one, iofst, 1);
    +
    238  iofst = iofst + 1;
    +
    239  itemp = abs(ival2);
    +
    240  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    241  iofst = iofst + nbitsd - 1;
    +
    242  }
    +
    243  }
    +
    244  /* pack overall min of spatial differences */
    +
    245  if (minsd >= 0)
    +
    246  {
    +
    247  sbit(cpack, &minsd, iofst, nbitsd);
    +
    248  iofst = iofst + nbitsd;
    +
    249  }
    +
    250  else
    +
    251  {
    +
    252  sbit(cpack, &one, iofst, 1);
    +
    253  iofst = iofst + 1;
    +
    254  itemp = abs(minsd);
    +
    255  sbit(cpack, &itemp, iofst, nbitsd-1);
    +
    256  iofst = iofst + nbitsd - 1;
    +
    257  }
    +
    258  }
    +
    259  } /* end of spatial diff section */
    +
    260 
    +
    261  /* Expand non-missing data values to original grid. */
    +
    262  miss1 = jfld[0];
    +
    263  for (j = 0; j < nonmiss; j++)
    +
    264  if (jfld[j] < miss1)
    +
    265  miss1 = jfld[j];
    +
    266  miss1--;
    +
    267  miss2 = miss1-1;
    +
    268  n = 0;
    +
    269  for (j = 0; j < ndpts; j++)
    +
    270  {
    +
    271  if (ifldmiss[j] == 0)
    +
    272  {
    +
    273  ifld[j] = jfld[n];
    +
    274  n++;
    +
    275  }
    +
    276  else if (ifldmiss[j] == 1)
    +
    277  {
    +
    278  ifld[j] = miss1;
    +
    279  }
    +
    280  else if (ifldmiss[j] == 2)
    +
    281  {
    +
    282  ifld[j] = miss2;
    +
    283  }
    +
    284  }
    +
    285 
    +
    286  /* Determine Groups to be used. */
    +
    287  if (simple_alg == 1)
    +
    288  {
    +
    289  /* Set group length to 10 : calculate number of groups and length of last group. */
    +
    290  ngroups = ndpts / 10;
    +
    291  for (j = 0; j < ngroups; j++)
    +
    292  glen[j] = 10;
    +
    293  itemp = ndpts % 10;
    +
    294  if (itemp != 0)
    +
    295  {
    +
    296  ngroups++;
    +
    297  glen[ngroups - 1] = itemp;
    +
    298  }
    +
    299  }
    +
    300  else
    +
    301  {
    +
    302  /* Use Dr. Glahn's algorithm for determining grouping. */
    +
    303  kfildo = 6;
    +
    304  minpk = 10;
    +
    305  inc = 1;
    +
    306  maxgrps = (ndpts / minpk) + 1;
    +
    307  jmin = calloc(maxgrps, sizeof(g2int));
    +
    308  jmax = calloc(maxgrps, sizeof(g2int));
    +
    309  lbit = calloc(maxgrps, sizeof(g2int));
    +
    310  pack_gp(&kfildo, ifld, &ndpts, &missopt, &minpk, &inc, &miss1, &miss2,
    +
    311  jmin, jmax, lbit, glen, &maxgrps, &ngroups, &ibit, &jbit,
    +
    312  &kbit, &novref, &lbitref, &ier);
    +
    313  for (ng = 0; ng < ngroups; ng++)
    +
    314  glen[ng] = glen[ng]+novref;
    +
    315  free(jmin);
    +
    316  free(jmax);
    +
    317  free(lbit);
    +
    318  }
    +
    319 
    +
    320  /* For each group, find the group's reference value (min) and the
    +
    321  * number of bits needed to hold the remaining values. */
    +
    322  n = 0;
    +
    323  for (ng = 0; ng<ngroups; ng++)
    +
    324  {
    +
    325  /* how many of each type? */
    +
    326  num0 = num1 = num2 = 0;
    +
    327  for (j = n; j < n + glen[ng]; j++)
    +
    328  {
    +
    329  if (ifldmiss[j] == 0)
    +
    330  num0++;
    +
    331  if (ifldmiss[j] == 1)
    +
    332  num1++;
    +
    333  if (ifldmiss[j] == 2)
    +
    334  num2++;
    +
    335  }
    +
    336  if (num0 == 0)
    +
    337  { /* all missing values */
    +
    338  if (num1 == 0) { /* all secondary missing */
    +
    339  gref[ng] = -2;
    +
    340  gwidth[ng] = 0;
    +
    341  }
    +
    342  else if (num2 == 0) { /* all primary missing */
    +
    343  gref[ng] = -1;
    +
    344  gwidth[ng] = 0;
    +
    345  }
    +
    346  else { /* both primary and secondary */
    +
    347  gref[ng] = 0;
    +
    348  gwidth[ng] = 1;
    +
    349  }
    +
    350  }
    +
    351  else
    +
    352  { /* contains some non-missing data */
    +
    353  /* find max and min values of group */
    +
    354  gref[ng] = 2147483647;
    +
    355  imax = -2147483647;
    +
    356  j = n;
    +
    357  for (lg = 0; lg < glen[ng]; lg++)
    +
    358  {
    +
    359  if (ifldmiss[j] == 0) {
    +
    360  if (ifld[j] < gref[ng])
    +
    361  gref[ng] = ifld[j];
    +
    362  if (ifld[j] > imax)
    +
    363  imax = ifld[j];
    +
    364  }
    +
    365  j++;
    +
    366  }
    +
    367  if (missopt == 1) imax = imax+1;
    +
    368  if (missopt == 2) imax = imax+2;
    +
    369  /* calc num of bits needed to hold data */
    +
    370  if (gref[ng] != imax) {
    +
    371  temp = log((double)(imax-gref[ng]+1))/alog2;
    +
    372  gwidth[ng] = (g2int)ceil(temp);
    +
    373  }
    +
    374  else {
    +
    375  gwidth[ng] = 0;
    +
    376  }
    +
    377  }
    +
    378  /* Subtract min from data */
    +
    379  j = n;
    +
    380  mtemp = (g2int)int_power(2., gwidth[ng]);
    +
    381  for (lg = 0; lg<glen[ng]; lg++)
    +
    382  {
    +
    383  if (ifldmiss[j] == 0) /* non-missing */
    +
    384  ifld[j] = ifld[j] - gref[ng];
    +
    385  else if (ifldmiss[j] == 1) /* primary missing */
    +
    386  ifld[j] = mtemp - 1;
    +
    387  else if (ifldmiss[j] == 2) /* secondary missing */
    +
    388  ifld[j] = mtemp - 2;
    +
    389  j++;
    +
    390  }
    +
    391  /* increment fld array counter */
    +
    392  n = n + glen[ng];
    +
    393  }
    +
    394 
    +
    395  /* Find max of the group references and calc num of bits needed to
    +
    396  * pack each groups reference value, then pack up group reference
    +
    397  * values. */
    +
    398  igmax = gref[0];
    +
    399  for (j = 1; j < ngroups; j++)
    +
    400  if (gref[j] > igmax)
    +
    401  igmax = gref[j];
    +
    402  if (missopt == 1)
    +
    403  igmax = igmax + 1;
    +
    404  if (missopt == 2)
    +
    405  igmax = igmax + 2;
    +
    406  if (igmax != 0)
    +
    407  {
    +
    408  temp = log((double)(igmax + 1)) / alog2;
    +
    409  nbitsgref = (g2int)ceil(temp);
    +
    410  /* reset the ref values of any "missing only" groups. */
    +
    411  mtemp = (g2int)int_power(2., nbitsgref);
    +
    412  for (j = 0; j < ngroups; j++)
    +
    413  {
    +
    414  if (gref[j] == -1)
    +
    415  gref[j] = mtemp-1;
    +
    416  if (gref[j] == -2)
    +
    417  gref[j] = mtemp-2;
    +
    418  }
    +
    419  sbits(cpack, gref, iofst, nbitsgref, 0, ngroups);
    +
    420  itemp = nbitsgref * ngroups;
    +
    421  iofst = iofst + itemp;
    +
    422  /* Pad last octet with Zeros, if necessary. */
    +
    423  if ((itemp % 8) != 0)
    +
    424  {
    +
    425  left = 8 - (itemp % 8);
    +
    426  sbit(cpack, &zero, iofst, left);
    +
    427  iofst = iofst + left;
    +
    428  }
    +
    429  }
    +
    430  else
    +
    431  {
    +
    432  nbitsgref = 0;
    +
    433  }
    +
    434 
    +
    435  /* Find max/min of the group widths and calc num of bits needed to
    +
    436  * pack each groups width value, then pack up group width
    +
    437  * values. */
    +
    438  iwmax = gwidth[0];
    +
    439  ngwidthref = gwidth[0];
    +
    440  for (j = 1; j < ngroups; j++)
    +
    441  {
    +
    442  if (gwidth[j] > iwmax)
    +
    443  iwmax = gwidth[j];
    +
    444  if (gwidth[j] < ngwidthref)
    +
    445  ngwidthref = gwidth[j];
    +
    446  }
    +
    447  if (iwmax != ngwidthref)
    +
    448  {
    +
    449  temp = log((double)(iwmax - ngwidthref + 1)) / alog2;
    +
    450  nbitsgwidth = (g2int)ceil(temp);
    +
    451  for (i = 0; i<ngroups; i++)
    +
    452  gwidth[i] = gwidth[i]-ngwidthref;
    +
    453  sbits(cpack, gwidth, iofst, nbitsgwidth, 0, ngroups);
    +
    454  itemp = nbitsgwidth * ngroups;
    +
    455  iofst = iofst + itemp;
    +
    456  /* Pad last octet with Zeros, if necessary. */
    +
    457  if ((itemp %8) != 0)
    +
    458  {
    +
    459  left = 8 - (itemp % 8);
    +
    460  sbit(cpack, &zero, iofst, left);
    +
    461  iofst = iofst + left;
    +
    462  }
    +
    463  }
    +
    464  else
    +
    465  {
    +
    466  nbitsgwidth = 0;
    +
    467  for (i = 0; i < ngroups; i++)
    +
    468  gwidth[i] = 0;
    +
    469  }
    +
    470 
    +
    471  /* Find max/min of the group lengths and calc num of bits needed
    +
    472  * to pack each groups length value, then pack up group length
    +
    473  * values. */
    +
    474  ilmax = glen[0];
    +
    475  nglenref = glen[0];
    +
    476  for (j = 1; j < ngroups - 1; j++)
    +
    477  {
    +
    478  if (glen[j] > ilmax)
    +
    479  ilmax = glen[j];
    +
    480  if (glen[j] < nglenref)
    +
    481  nglenref = glen[j];
    +
    482  }
    +
    483  nglenlast = glen[ngroups - 1];
    +
    484  if (ilmax != nglenref)
    +
    485  {
    +
    486  temp = log((double)(ilmax - nglenref + 1)) / alog2;
    +
    487  nbitsglen = (g2int)ceil(temp);
    +
    488  for (i = 0; i < ngroups - 1; i++)
    +
    489  glen[i] = glen[i] - nglenref;
    +
    490  sbits(cpack, glen, iofst, nbitsglen, 0, ngroups);
    +
    491  itemp = nbitsglen * ngroups;
    +
    492  iofst = iofst + itemp;
    +
    493  /* Pad last octet with Zeros, if necessary. */
    +
    494  if ((itemp % 8) != 0)
    +
    495  {
    +
    496  left = 8 - (itemp % 8);
    +
    497  sbit(cpack, &zero, iofst, left);
    +
    498  iofst = iofst + left;
    +
    499  }
    +
    500  }
    +
    501  else {
    +
    502  nbitsglen = 0;
    +
    503  for (i = 0; i < ngroups; i++)
    +
    504  glen[i] = 0;
    +
    505  }
    +
    506 
    +
    507  /* For each group, pack data values. */
    +
    508  n = 0;
    +
    509  for (ng = 0; ng < ngroups; ng++)
    +
    510  {
    +
    511  glength = glen[ng] + nglenref;
    +
    512  if (ng == (ngroups - 1))
    +
    513  glength = nglenlast;
    +
    514  grpwidth = gwidth[ng] + ngwidthref;
    +
    515  if (grpwidth != 0)
    +
    516  {
    +
    517  sbits(cpack, ifld + n, iofst, grpwidth, 0, glength);
    +
    518  iofst = iofst + (grpwidth * glength);
    +
    519  }
    +
    520  n = n + glength;
    +
    521  }
    +
    522 
    +
    523  /* Pad last octet with Zeros, if necessary, */
    +
    524  if ((iofst % 8) != 0)
    +
    525  {
    +
    526  left = 8 - (iofst % 8);
    +
    527  sbit(cpack, &zero, iofst, left);
    +
    528  iofst = iofst + left;
    +
    529  }
    +
    530  *lcpack = iofst / 8;
    +
    531 
    +
    532  if (ifld)
    +
    533  free(ifld);
    +
    534  if (jfld)
    +
    535  free(jfld);
    +
    536  if (ifldmiss)
    +
    537  free(ifldmiss);
    +
    538  if (gref)
    +
    539  free(gref);
    +
    540  if (gwidth)
    +
    541  free(gwidth);
    +
    542  if (glen)
    +
    543  free(glen);
    +
    544 
    +
    545  /* Fill in ref value and number of bits in Template 5.2. */
    +
    546  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format */
    +
    547  idrstmpl[3] = nbitsgref;
    +
    548  idrstmpl[4] = 0; /* original data were reals */
    +
    549  idrstmpl[5] = 1; /* general group splitting */
    +
    550  idrstmpl[9] = ngroups; /* Number of groups */
    +
    551  idrstmpl[10] = ngwidthref; /* reference for group widths */
    +
    552  idrstmpl[11] = nbitsgwidth; /* num bits used for group widths */
    +
    553  idrstmpl[12] = nglenref; /* Reference for group lengths */
    +
    554  idrstmpl[13] = 1; /* length increment for group lengths */
    +
    555  idrstmpl[14] = nglenlast; /* True length of last group */
    +
    556  idrstmpl[15] = nbitsglen; /* num bits used for group lengths */
    +
    557  if (idrsnum == 3)
    +
    558  {
    +
    559  idrstmpl[17] = nbitsd / 8; /* num bits used for extra spatial differencing values */
    +
    560  }
    +
    561 
    +
    562 }
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void misspack(g2float *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...
    Definition: misspack.c:43
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    int pack_gp(integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *ier)
    Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
    Definition: pack_gp.c:256
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/mkieee_8c.html b/ver-1.7.0/ver-1.6.4/mkieee_8c.html new file mode 100644 index 00000000..9ca92c68 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/mkieee_8c.html @@ -0,0 +1,171 @@ + + + + + + + +NCEPLIBS-g2c: mkieee.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    mkieee.c File Reference
    +
    +
    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void mkieee (g2float *a, g2int *rieee, g2int num)
     This subroutine stores a list of real values in 32-bit IEEE floating point format. More...
     
    +

    Detailed Description

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file mkieee.c.

    +

    Function Documentation

    + +

    ◆ mkieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void mkieee (g2floata,
    g2intrieee,
    g2int num 
    )
    +
    + +

    This subroutine stores a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    aInput array of floating point values.
    numNumber of floating point values to convert.
    rieeeOutput 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 21 of file mkieee.c.

    + +

    References int_power().

    + +

    Referenced by compack(), g2_addfield(), jpcpack(), misspack(), pngpack(), simpack(), and specpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/mkieee_8c.js b/ver-1.7.0/ver-1.6.4/mkieee_8c.js new file mode 100644 index 00000000..ac66bbcd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/mkieee_8c.js @@ -0,0 +1,4 @@ +var mkieee_8c = +[ + [ "mkieee", "mkieee_8c.html#ac81ff0ca19f32422c5667e1bca5aae27", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/mkieee_8c_source.html b/ver-1.7.0/ver-1.6.4/mkieee_8c_source.html new file mode 100644 index 00000000..af9c9d62 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/mkieee_8c_source.html @@ -0,0 +1,196 @@ + + + + + + + +NCEPLIBS-g2c: mkieee.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    mkieee.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    4 #include <stdlib.h>
    +
    5 #include <math.h>
    +
    6 #include "grib2.h"
    +
    7 
    +
    8 
    +
    21 void mkieee(g2float *a,g2int *rieee,g2int num)
    +
    22 {
    +
    23 
    +
    24  g2int j,n,ieee,iexp,imant;
    +
    25  double atemp;
    +
    26 
    +
    27  static double two23,two126;
    +
    28  static g2int test=0;
    +
    29  //g2intu msk1=0x80000000; // 10000000000000000000000000000000 binary
    +
    30  //g2int msk2=0x7F800000; // 01111111100000000000000000000000 binary
    +
    31  //g2int msk3=0x007FFFFF; // 00000000011111111111111111111111 binary
    +
    32 
    +
    33  if ( test == 0 ) {
    +
    34  two23=(double)int_power(2.0,23);
    +
    35  two126=(double)int_power(2.0,126);
    +
    36  test=1;
    +
    37  }
    +
    38 
    +
    39  for (j=0;j<num;j++) {
    +
    40 
    +
    41  ieee=0;
    +
    42 
    +
    43  if (a[j] == 0.0) {
    +
    44  rieee[j]=ieee;
    +
    45  continue;
    +
    46  }
    +
    47 
    +
    48 //
    +
    49 // Set Sign bit (bit 31 - leftmost bit)
    +
    50 //
    +
    51  if (a[j] < 0.0) {
    +
    52  ieee= 1 << 31;
    +
    53  atemp=-1.0*a[j];
    +
    54  }
    +
    55  else {
    +
    56  ieee= 0 << 31;
    +
    57  atemp=a[j];
    +
    58  }
    +
    59  //printf("sign %ld %x \n",ieee,ieee);
    +
    60 //
    +
    61 // Determine exponent n with base 2
    +
    62 //
    +
    63  if ( atemp >= 1.0 ) {
    +
    64  n = 0;
    +
    65  while ( int_power(2.0,n+1) <= atemp ) {
    +
    66  n++;
    +
    67  }
    +
    68  }
    +
    69  else {
    +
    70  n = -1;
    +
    71  while ( int_power(2.0,n) > atemp ) {
    +
    72  n--;
    +
    73  }
    +
    74  }
    +
    75  iexp=n+127;
    +
    76  if (n > 127) iexp=255; // overflow
    +
    77  if (n < -127) iexp=0;
    +
    78  //printf("exp %ld %ld \n",iexp,n);
    +
    79  // set exponent bits ( bits 30-23 )
    +
    80  ieee = ieee | ( iexp << 23 );
    +
    81 //
    +
    82 // Determine Mantissa
    +
    83 //
    +
    84  if (iexp != 255) {
    +
    85  if (iexp != 0)
    +
    86  atemp=(atemp/int_power(2.0,n))-1.0;
    +
    87  else
    +
    88  atemp=atemp*two126;
    +
    89  imant=(g2int)rint(atemp*two23);
    +
    90  }
    +
    91  else {
    +
    92  imant=0;
    +
    93  }
    +
    94  //printf("mant %ld %x \n",imant,imant);
    +
    95  // set mantissa bits ( bits 22-0 )
    +
    96  ieee = ieee | imant;
    +
    97 //
    +
    98 // Transfer IEEE bit string to rieee array
    +
    99 //
    +
    100  rieee[j]=ieee;
    +
    101 
    +
    102  }
    +
    103 
    +
    104  return;
    +
    105 
    +
    106 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/nav_f.png b/ver-1.7.0/ver-1.6.4/nav_f.png new file mode 100644 index 00000000..72a58a52 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/nav_f.png differ diff --git a/ver-1.7.0/ver-1.6.4/nav_g.png b/ver-1.7.0/ver-1.6.4/nav_g.png new file mode 100644 index 00000000..2093a237 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/nav_g.png differ diff --git a/ver-1.7.0/ver-1.6.4/nav_h.png b/ver-1.7.0/ver-1.6.4/nav_h.png new file mode 100644 index 00000000..33389b10 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/nav_h.png differ diff --git a/ver-1.7.0/ver-1.6.4/navtree.css b/ver-1.7.0/ver-1.6.4/navtree.css new file mode 100644 index 00000000..33341a67 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/navtree.css @@ -0,0 +1,146 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:#fff; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + background-color: #FAFAFF; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: 250px; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:url("splitbar.png"); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/ver-1.7.0/ver-1.6.4/navtree.js b/ver-1.7.0/ver-1.6.4/navtree.js new file mode 100644 index 00000000..1e272d31 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/navtree.js @@ -0,0 +1,546 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func,show) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, false); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, showRoot) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, showRoot); + }, showRoot); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + $('#nav-sync').css('top','30px'); + } else { + $('#nav-sync').css('top','5px'); + } + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + },true); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + },true); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +NCEPLIBS-g2c: pack_gp.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pack_gp.c File Reference
    +
    +
    +
    #include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define FALSE_   (0)
     False. More...
     
    #define TRUE_   (1)
     True. More...
     
    + + + + + + + +

    +Typedefs

    typedef g2int integer
     Integer type. More...
     
    typedef g2int logical
     Logical type. More...
     
    + + + + +

    +Functions

    int pack_gp (integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *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...
     
    +

    Detailed Description

    +
    Author
    Glahn
    +
    Date
    february 1994
    + +

    Definition in file pack_gp.c.

    +

    Macro Definition Documentation

    + +

    ◆ FALSE_

    + +
    +
    + + + + +
    #define FALSE_   (0)
    +
    + +

    False.

    + +

    Definition at line 11 of file pack_gp.c.

    + +
    +
    + +

    ◆ TRUE_

    + +
    +
    + + + + +
    #define TRUE_   (1)
    +
    + +

    True.

    + +

    Definition at line 10 of file pack_gp.c.

    + +
    +
    +

    Typedef Documentation

    + +

    ◆ integer

    + +
    +
    + + + + +
    typedef g2int integer
    +
    + +

    Integer type.

    + +

    Definition at line 8 of file pack_gp.c.

    + +
    +
    + +

    ◆ logical

    + +
    +
    + + + + +
    typedef g2int logical
    +
    + +

    Logical type.

    + +

    Definition at line 9 of file pack_gp.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ pack_gp()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int pack_gp (integerkfildo,
    integeric,
    integernxy,
    integeris523,
    integerminpk,
    integerinc,
    integermissp,
    integermisss,
    integerjmin,
    integerjmax,
    integerlbit,
    integernov,
    integerndg,
    integerlx,
    integeribit,
    integerjbit,
    integerkbit,
    integernovref,
    integerlbitref,
    integerier 
    )
    +
    + +

    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 integer. 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
    + + + + + + + + + + + + + + + + + + + + + +
    kfildounit number for output (print) file. (input)
    icarray 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 integer values will be retained exactly through packing and unpacking. (input)
    nxynumber of values in ic( ). also treated as its dimension. (input)
    is523missing value management 0=data contains no missing values 1=data contains primary missing values 2=data contains primary and secondary missing values (input)
    minpkthe minimum size of each group, except possibly the last one. (input)
    incthe 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)
    misspwhen 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)
    missssecondary missing value indicator (see missp). (input)
    jminthe minimum of each group (j=1,lx). (output)
    jmaxthe 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)
    lbitthe 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)
    novthe number of values in each group (j=1,lx). (output)
    ndgthe dimension of jmin, jmax, lbit, and nov. (input)
    lxthe number of groups determined. (output)
    ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (output)
    jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (output)
    kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. (output)
    novrefreference value for nov( ). (output)
    lbitrefreference value for lbit( ). (output)
    ierError 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 integer 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 integer 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.
    +                      (logical)
    +             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 256 of file pack_gp.c.

    + +

    References FALSE_, reduce(), and TRUE_.

    + +

    Referenced by compack(), and misspack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pack__gp_8c.js b/ver-1.7.0/ver-1.6.4/pack__gp_8c.js new file mode 100644 index 00000000..418b6a23 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pack__gp_8c.js @@ -0,0 +1,8 @@ +var pack__gp_8c = +[ + [ "FALSE_", "pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d", null ], + [ "TRUE_", "pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5", null ], + [ "integer", "pack__gp_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0", null ], + [ "logical", "pack__gp_8c.html#a724e291eda62f097ed85e2c4960d80c0", null ], + [ "pack_gp", "pack__gp_8c.html#a0fcfc080fae3b3dfe82feda3dd304a78", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pack__gp_8c_source.html b/ver-1.7.0/ver-1.6.4/pack__gp_8c_source.html new file mode 100644 index 00000000..c54ba4ad --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pack__gp_8c_source.html @@ -0,0 +1,1264 @@ + + + + + + + +NCEPLIBS-g2c: pack_gp.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pack_gp.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 /*#include "f2c.h"*/
    +
    6 #include <stdlib.h>
    +
    7 #include "grib2.h"
    +
    8 typedef g2int integer;
    +
    9 typedef g2int logical;
    +
    10 #define TRUE_ (1)
    +
    11 #define FALSE_ (0)
    +
    255 int
    +
    256 pack_gp(integer *kfildo, integer *ic, integer *nxy,
    +
    257  integer *is523, integer *minpk, integer *inc, integer *missp, integer
    +
    258  *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov,
    +
    259  integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *
    +
    260  kbit, integer *novref, integer *lbitref, integer *ier)
    +
    261 {
    +
    262  /* Initialized data */
    +
    263 
    +
    264  const integer mallow = 1073741825; /* MALLOW=2**30+1 */
    +
    265  static integer ifeed = 12;
    +
    266  static integer ifirst = 0;
    +
    267 
    +
    268  /* System generated locals */
    +
    269  integer i__1, i__2, i__3;
    +
    270 
    +
    271  /* Local variables */
    +
    272  static integer j, k, l;
    +
    273  static logical adda;
    +
    274  static integer ired, kinc, mina, maxa, minb, maxb, minc, maxc, ibxx2[31];
    +
    275  static char cfeed[1];
    +
    276  static integer nenda, nendb, ibita, ibitb, minak, minbk, maxak, maxbk,
    +
    277  minck, maxck, nouta, lmiss, itest, nount;
    +
    278  extern /* Subroutine */ int reduce(integer *, integer *, integer *,
    +
    279  integer *, integer *, integer *, integer *, integer *, integer *,
    +
    280  integer *, integer *, integer *, integer *);
    +
    281  static integer ibitbs, mislla, misllb, misllc, iersav, lminpk, ktotal,
    +
    282  kounta, kountb, kstart, mstart, mintst, maxtst,
    +
    283  kounts, mintstk, maxtstk;
    +
    284  integer *misslx;
    +
    285 
    +
    286 
    +
    287 
    +
    288 /* NON SYSTEM SUBROUTINES CALLED */
    +
    289 /* NONE */
    +
    290 
    +
    291 
    +
    292 
    +
    293 /* MISSLX( ) was AN AUTOMATIC ARRAY. */
    +
    294  misslx = (integer *)calloc(*ndg,sizeof(integer));
    +
    295 
    +
    296 
    +
    297  /* Parameter adjustments */
    +
    298  --ic;
    +
    299  --nov;
    +
    300  --lbit;
    +
    301  --jmax;
    +
    302  --jmin;
    +
    303 
    +
    304  /* Function Body */
    +
    305 
    +
    306  *ier = 0;
    +
    307  iersav = 0;
    +
    308 /* CALL TIMPR(KFILDO,KFILDO,'START PACK_GP ') */
    +
    309  *(unsigned char *)cfeed = (char) ifeed;
    +
    310 
    +
    311  ired = 0;
    +
    312 /* IRED IS A FLAG. WHEN ZERO, REDUCE WILL BE CALLED. */
    +
    313 /* IF REDUCE ABORTS, IRED = 1 AND IS NOT CALLED. IN */
    +
    314 /* THIS CASE PACK_GP EXECUTES AGAIN EXCEPT FOR REDUCE. */
    +
    315 
    +
    316  if (*inc <= 0) {
    +
    317  iersav = 717;
    +
    318 /* WRITE(KFILDO,101)INC */
    +
    319 /* 101 FORMAT(/' ****INC ='I8,' NOT CORRECT IN PACK_GP. 1 IS USED.') */
    +
    320  }
    +
    321 
    +
    322 /* THERE WILL BE A RESTART OF PACK_GP IF SUBROUTINE REDUCE */
    +
    323 /* ABORTS. THIS SHOULD NOT HAPPEN, BUT IF IT DOES, PACK_GP */
    +
    324 /* WILL COMPLETE WITHOUT SUBROUTINE REDUCE. A NON FATAL */
    +
    325 /* DIAGNOSTIC RETURN IS PROVIDED. */
    +
    326 
    +
    327 L102:
    +
    328  /*kinc = max(*inc,1);*/
    +
    329  kinc = (*inc > 1) ? *inc : 1;
    +
    330  lminpk = *minpk;
    +
    331 
    +
    332 /* CALCULATE THE POWERS OF 2 THE FIRST TIME ENTERED. */
    +
    333 
    +
    334  if (ifirst == 0) {
    +
    335  ifirst = 1;
    +
    336  ibxx2[0] = 1;
    +
    337 
    +
    338  for (j = 1; j <= 30; ++j) {
    +
    339  ibxx2[j] = ibxx2[j - 1] << 1;
    +
    340 /* L104: */
    +
    341  }
    +
    342 
    +
    343  }
    +
    344 
    +
    345 /* THERE WILL BE A RESTART AT 105 IS NDG IS NOT LARGE ENOUGH. */
    +
    346 /* A NON FATAL DIAGNOSTIC RETURN IS PROVIDED. */
    +
    347 
    +
    348 L105:
    +
    349  kstart = 1;
    +
    350  ktotal = 0;
    +
    351  *lx = 0;
    +
    352  adda = FALSE_;
    +
    353  lmiss = 0;
    +
    354  if (*is523 == 1) {
    +
    355  lmiss = 1;
    +
    356  }
    +
    357  if (*is523 == 2) {
    +
    358  lmiss = 2;
    +
    359  }
    +
    360 
    +
    361 /* ************************************* */
    +
    362 
    +
    363 /* THIS SECTION COMPUTES STATISTICS FOR GROUP A. GROUP A IS */
    +
    364 /* A GROUP OF SIZE LMINPK. */
    +
    365 
    +
    366 /* ************************************* */
    +
    367 
    +
    368  ibita = 0;
    +
    369  mina = mallow;
    +
    370  maxa = -mallow;
    +
    371  minak = mallow;
    +
    372  maxak = -mallow;
    +
    373 
    +
    374 /* FIND THE MIN AND MAX OF GROUP A. THIS WILL INITIALLY BE OF */
    +
    375 /* SIZE LMINPK (IF THERE ARE STILL LMINPK VALUES IN IC( )), BUT */
    +
    376 /* WILL INCREASE IN SIZE IN INCREMENTS OF INC UNTIL A NEW */
    +
    377 /* GROUP IS STARTED. THE DEFINITION OF GROUP A IS DONE HERE */
    +
    378 /* ONLY ONCE (UPON INITIAL ENTRY), BECAUSE A GROUP B CAN ALWAYS */
    +
    379 /* BECOME A NEW GROUP A AFTER A IS PACKED, EXCEPT IF LMINPK */
    +
    380 /* HAS TO BE INCREASED BECAUSE NDG IS TOO SMALL. THEREFORE, */
    +
    381 /* THE SEPARATE LOOPS FOR MISSING AND NON-MISSING HERE BUYS */
    +
    382 /* ALMOST NOTHING. */
    +
    383 
    +
    384 /* Computing MIN */
    +
    385  i__1 = kstart + lminpk - 1;
    +
    386  /*nenda = min(i__1,*nxy);*/
    +
    387  nenda = (i__1 < *nxy) ? i__1 : *nxy;
    +
    388  if (*nxy - nenda <= lminpk / 2) {
    +
    389  nenda = *nxy;
    +
    390  }
    +
    391 /* ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
    +
    392 /* MAKING THE ACTUAL GROUP LARGER. IF A PROVISION LIKE THIS IS */
    +
    393 /* NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
    +
    394 /* AT THE END. USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
    +
    395 /* VALUES FOR EFFICIENCY. */
    +
    396 
    +
    397 /* DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE */
    +
    398 /* UNLESS NENDA = NXY. THIS MAY ALLOW A LARGE GROUP A TO */
    +
    399 /* START WITH, AS WITH MISSING VALUES. SEPARATE LOOPS FOR */
    +
    400 /* MISSING OPTIONS. THIS SECTION IS ONLY EXECUTED ONCE, */
    +
    401 /* IN DETERMINING THE FIRST GROUP. IT HELPS FOR AN ARRAY */
    +
    402 /* OF MOSTLY MISSING VALUES OR OF ONE VALUE, SUCH AS */
    +
    403 /* RADAR OR PRECIP DATA. */
    +
    404 
    +
    405  if (nenda != *nxy && ic[kstart] == ic[kstart + 1]) {
    +
    406 /* NO NEED TO EXECUTE IF FIRST TWO VALUES ARE NOT EQUAL. */
    +
    407 
    +
    408  if (*is523 == 0) {
    +
    409 /* THIS LOOP IS FOR NO MISSING VALUES. */
    +
    410 
    +
    411  i__1 = *nxy;
    +
    412  for (k = kstart + 1; k <= i__1; ++k) {
    +
    413 
    +
    414  if (ic[k] != ic[kstart]) {
    +
    415 /* Computing MAX */
    +
    416  i__2 = nenda, i__3 = k - 1;
    +
    417  /*nenda = max(i__2,i__3);*/
    +
    418  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    419  goto L114;
    +
    420  }
    +
    421 
    +
    422 /* L111: */
    +
    423  }
    +
    424 
    +
    425  nenda = *nxy;
    +
    426 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    427 
    +
    428  } else if (*is523 == 1) {
    +
    429 /* THIS LOOP IS FOR PRIMARY MISSING VALUES ONLY. */
    +
    430 
    +
    431  i__1 = *nxy;
    +
    432  for (k = kstart + 1; k <= i__1; ++k) {
    +
    433 
    +
    434  if (ic[k] != *missp) {
    +
    435 
    +
    436  if (ic[k] != ic[kstart]) {
    +
    437 /* Computing MAX */
    +
    438  i__2 = nenda, i__3 = k - 1;
    +
    439  /*nenda = max(i__2,i__3);*/
    +
    440  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    441  goto L114;
    +
    442  }
    +
    443 
    +
    444  }
    +
    445 
    +
    446 /* L112: */
    +
    447  }
    +
    448 
    +
    449  nenda = *nxy;
    +
    450 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    451 
    +
    452  } else {
    +
    453 /* THIS LOOP IS FOR PRIMARY AND SECONDARY MISSING VALUES. */
    +
    454 
    +
    455  i__1 = *nxy;
    +
    456  for (k = kstart + 1; k <= i__1; ++k) {
    +
    457 
    +
    458  if (ic[k] != *missp && ic[k] != *misss) {
    +
    459 
    +
    460  if (ic[k] != ic[kstart]) {
    +
    461 /* Computing MAX */
    +
    462  i__2 = nenda, i__3 = k - 1;
    +
    463  /*nenda = max(i__2,i__3);*/
    +
    464  nenda = (i__2 > i__3) ? i__2 : i__3;
    +
    465  goto L114;
    +
    466  }
    +
    467 
    +
    468  }
    +
    469 
    +
    470 /* L113: */
    +
    471  }
    +
    472 
    +
    473  nenda = *nxy;
    +
    474 /* FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
    +
    475  }
    +
    476 
    +
    477  }
    +
    478 
    +
    479 L114:
    +
    480  if (*is523 == 0) {
    +
    481 
    +
    482  i__1 = nenda;
    +
    483  for (k = kstart; k <= i__1; ++k) {
    +
    484  if (ic[k] < mina) {
    +
    485  mina = ic[k];
    +
    486  minak = k;
    +
    487  }
    +
    488  if (ic[k] > maxa) {
    +
    489  maxa = ic[k];
    +
    490  maxak = k;
    +
    491  }
    +
    492 /* L115: */
    +
    493  }
    +
    494 
    +
    495  } else if (*is523 == 1) {
    +
    496 
    +
    497  i__1 = nenda;
    +
    498  for (k = kstart; k <= i__1; ++k) {
    +
    499  if (ic[k] == *missp) {
    +
    500  goto L117;
    +
    501  }
    +
    502  if (ic[k] < mina) {
    +
    503  mina = ic[k];
    +
    504  minak = k;
    +
    505  }
    +
    506  if (ic[k] > maxa) {
    +
    507  maxa = ic[k];
    +
    508  maxak = k;
    +
    509  }
    +
    510  L117:
    +
    511  ;
    +
    512  }
    +
    513 
    +
    514  } else {
    +
    515 
    +
    516  i__1 = nenda;
    +
    517  for (k = kstart; k <= i__1; ++k) {
    +
    518  if (ic[k] == *missp || ic[k] == *misss) {
    +
    519  goto L120;
    +
    520  }
    +
    521  if (ic[k] < mina) {
    +
    522  mina = ic[k];
    +
    523  minak = k;
    +
    524  }
    +
    525  if (ic[k] > maxa) {
    +
    526  maxa = ic[k];
    +
    527  maxak = k;
    +
    528  }
    +
    529  L120:
    +
    530  ;
    +
    531  }
    +
    532 
    +
    533  }
    +
    534 
    +
    535  kounta = nenda - kstart + 1;
    +
    536 
    +
    537 /* INCREMENT KTOTAL AND FIND THE BITS NEEDED TO PACK THE A GROUP. */
    +
    538 
    +
    539  ktotal += kounta;
    +
    540  mislla = 0;
    +
    541  if (mina != mallow) {
    +
    542  goto L125;
    +
    543  }
    +
    544 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    545  mina = 0;
    +
    546  maxa = 0;
    +
    547  mislla = 1;
    +
    548  ibitb = 0;
    +
    549  if (*is523 != 2) {
    +
    550  goto L130;
    +
    551  }
    +
    552 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO */
    +
    553 /* SECONDARY MISSING VALUES, IBITA = 0. */
    +
    554 /* OTHERWISE, IBITA MUST BE CALCULATED. */
    +
    555 
    +
    556 L125:
    +
    557  itest = maxa - mina + lmiss;
    +
    558 
    +
    559  for (ibita = 0; ibita <= 30; ++ibita) {
    +
    560  if (itest < ibxx2[ibita]) {
    +
    561  goto L130;
    +
    562  }
    +
    563 /* *** THIS TEST IS THE SAME AS: */
    +
    564 /* *** IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 130 */
    +
    565 /* L126: */
    +
    566  }
    +
    567 
    +
    568 /* WRITE(KFILDO,127)MAXA,MINA */
    +
    569 /* 127 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    570 /* 1 ' MAXA ='I13,' MINA ='I13,'. ERROR AT 127.') */
    +
    571  *ier = 706;
    +
    572  goto L900;
    +
    573 
    +
    574 L130:
    +
    575 
    +
    576 /* ***D WRITE(KFILDO,131)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA */
    +
    577 /* ***D131 FORMAT(' AT 130, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    578 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3) */
    +
    579 
    +
    580 L133:
    +
    581  if (ktotal >= *nxy) {
    +
    582  goto L200;
    +
    583  }
    +
    584 
    +
    585 /* ************************************* */
    +
    586 
    +
    587 /* THIS SECTION COMPUTES STATISTICS FOR GROUP B. GROUP B IS A */
    +
    588 /* GROUP OF SIZE LMINPK IMMEDIATELY FOLLOWING GROUP A. */
    +
    589 
    +
    590 /* ************************************* */
    +
    591 
    +
    592 L140:
    +
    593  minb = mallow;
    +
    594  maxb = -mallow;
    +
    595  minbk = mallow;
    +
    596  maxbk = -mallow;
    +
    597  ibitbs = 0;
    +
    598  mstart = ktotal + 1;
    +
    599 
    +
    600 /* DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE. */
    +
    601 /* THIS WORKS WHEN THERE ARE NO MISSING VALUES. */
    +
    602 
    +
    603  nendb = 1;
    +
    604 
    +
    605  if (mstart < *nxy) {
    +
    606 
    +
    607  if (*is523 == 0) {
    +
    608 /* THIS LOOP IS FOR NO MISSING VALUES. */
    +
    609 
    +
    610  i__1 = *nxy;
    +
    611  for (k = mstart + 1; k <= i__1; ++k) {
    +
    612 
    +
    613  if (ic[k] != ic[mstart]) {
    +
    614  nendb = k - 1;
    +
    615  goto L150;
    +
    616  }
    +
    617 
    +
    618 /* L145: */
    +
    619  }
    +
    620 
    +
    621  nendb = *nxy;
    +
    622 /* FALL THROUGH THE LOOP MEANS ALL REMAINING VALUES */
    +
    623 /* ARE THE SAME. */
    +
    624  }
    +
    625 
    +
    626  }
    +
    627 
    +
    628 L150:
    +
    629 /* Computing MAX */
    +
    630 /* Computing MIN */
    +
    631  i__3 = ktotal + lminpk;
    +
    632  /*i__1 = nendb, i__2 = min(i__3,*nxy);*/
    +
    633  i__1 = nendb, i__2 = (i__3 < *nxy) ? i__3 : *nxy;
    +
    634  /*nendb = max(i__1,i__2);*/
    +
    635  nendb = (i__1 > i__2) ? i__1 : i__2;
    +
    636 /* **** 150 NENDB=MIN(KTOTAL+LMINPK,NXY) */
    +
    637 
    +
    638  if (*nxy - nendb <= lminpk / 2) {
    +
    639  nendb = *nxy;
    +
    640  }
    +
    641 /* ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
    +
    642 /* MAKING THE ACTUAL GROUP LARGER. IF A PROVISION LIKE THIS IS */
    +
    643 /* NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
    +
    644 /* AT THE END. USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
    +
    645 
    +
    646 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    647 /* FOR EFFICIENCY. */
    +
    648 
    +
    649  if (*is523 == 0) {
    +
    650 
    +
    651  i__1 = nendb;
    +
    652  for (k = mstart; k <= i__1; ++k) {
    +
    653  if (ic[k] <= minb) {
    +
    654  minb = ic[k];
    +
    655 /* NOTE LE, NOT LT. LT COULD BE USED BUT THEN A */
    +
    656 /* RECOMPUTE OVER THE WHOLE GROUP WOULD BE NEEDED */
    +
    657 /* MORE OFTEN. SAME REASONING FOR GE AND OTHER */
    +
    658 /* LOOPS BELOW. */
    +
    659  minbk = k;
    +
    660  }
    +
    661  if (ic[k] >= maxb) {
    +
    662  maxb = ic[k];
    +
    663  maxbk = k;
    +
    664  }
    +
    665 /* L155: */
    +
    666  }
    +
    667 
    +
    668  } else if (*is523 == 1) {
    +
    669 
    +
    670  i__1 = nendb;
    +
    671  for (k = mstart; k <= i__1; ++k) {
    +
    672  if (ic[k] == *missp) {
    +
    673  goto L157;
    +
    674  }
    +
    675  if (ic[k] <= minb) {
    +
    676  minb = ic[k];
    +
    677  minbk = k;
    +
    678  }
    +
    679  if (ic[k] >= maxb) {
    +
    680  maxb = ic[k];
    +
    681  maxbk = k;
    +
    682  }
    +
    683  L157:
    +
    684  ;
    +
    685  }
    +
    686 
    +
    687  } else {
    +
    688 
    +
    689  i__1 = nendb;
    +
    690  for (k = mstart; k <= i__1; ++k) {
    +
    691  if (ic[k] == *missp || ic[k] == *misss) {
    +
    692  goto L160;
    +
    693  }
    +
    694  if (ic[k] <= minb) {
    +
    695  minb = ic[k];
    +
    696  minbk = k;
    +
    697  }
    +
    698  if (ic[k] >= maxb) {
    +
    699  maxb = ic[k];
    +
    700  maxbk = k;
    +
    701  }
    +
    702  L160:
    +
    703  ;
    +
    704  }
    +
    705 
    +
    706  }
    +
    707 
    +
    708  kountb = nendb - ktotal;
    +
    709  misllb = 0;
    +
    710  if (minb != mallow) {
    +
    711  goto L165;
    +
    712  }
    +
    713 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    714  minb = 0;
    +
    715  maxb = 0;
    +
    716  misllb = 1;
    +
    717  ibitb = 0;
    +
    718 
    +
    719  if (*is523 != 2) {
    +
    720  goto L170;
    +
    721  }
    +
    722 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
    +
    723 /* MISSING VALUES, IBITB = 0. OTHERWISE, IBITB MUST BE */
    +
    724 /* CALCULATED. */
    +
    725 
    +
    726 L165:
    +
    727  for (ibitb = ibitbs; ibitb <= 30; ++ibitb) {
    +
    728  if (maxb - minb < ibxx2[ibitb] - lmiss) {
    +
    729  goto L170;
    +
    730  }
    +
    731 /* L166: */
    +
    732  }
    +
    733 
    +
    734 /* WRITE(KFILDO,167)MAXB,MINB */
    +
    735 /* 167 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    736 /* 1 ' MAXB ='I13,' MINB ='I13,'. ERROR AT 167.') */
    +
    737  *ier = 706;
    +
    738  goto L900;
    +
    739 
    +
    740 /* COMPARE THE BITS NEEDED TO PACK GROUP B WITH THOSE NEEDED */
    +
    741 /* TO PACK GROUP A. IF IBITB GE IBITA, TRY TO ADD TO GROUP A. */
    +
    742 /* IF NOT, TRY TO ADD A'S POINTS TO B, UNLESS ADDITION TO A */
    +
    743 /* HAS BEEN DONE. THIS LATTER IS CONTROLLED WITH ADDA. */
    +
    744 
    +
    745 L170:
    +
    746 
    +
    747 /* ***D WRITE(KFILDO,171)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
    +
    748 /* ***D 1 MINB,MAXB,IBITB,MISLLB */
    +
    749 /* ***D171 FORMAT(' AT 171, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    750 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3, */
    +
    751 /* ***D 2 ' MINB ='I8,' MAXB ='I8,' IBITB ='I3,' MISLLB ='I3) */
    +
    752 
    +
    753  if (ibitb >= ibita) {
    +
    754  goto L180;
    +
    755  }
    +
    756  if (adda) {
    +
    757  goto L200;
    +
    758  }
    +
    759 
    +
    760 /* ************************************* */
    +
    761 
    +
    762 /* GROUP B REQUIRES LESS BITS THAN GROUP A. PUT AS MANY OF A'S */
    +
    763 /* POINTS INTO B AS POSSIBLE WITHOUT EXCEEDING THE NUMBER OF */
    +
    764 /* BITS NECESSARY TO PACK GROUP B. */
    +
    765 
    +
    766 /* ************************************* */
    +
    767 
    +
    768  kounts = kounta;
    +
    769 /* KOUNTA REFERS TO THE PRESENT GROUP A. */
    +
    770  mintst = minb;
    +
    771  maxtst = maxb;
    +
    772  mintstk = minbk;
    +
    773  maxtstk = maxbk;
    +
    774 
    +
    775 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    776 /* FOR EFFICIENCY. */
    +
    777 
    +
    778  if (*is523 == 0) {
    +
    779 
    +
    780  i__1 = kstart;
    +
    781  for (k = ktotal; k >= i__1; --k) {
    +
    782 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    783  if (ic[k] < minb) {
    +
    784  mintst = ic[k];
    +
    785  mintstk = k;
    +
    786  } else if (ic[k] > maxb) {
    +
    787  maxtst = ic[k];
    +
    788  maxtstk = k;
    +
    789  }
    +
    790  if (maxtst - mintst >= ibxx2[ibitb]) {
    +
    791  goto L174;
    +
    792  }
    +
    793 /* NOTE THAT FOR THIS LOOP, LMISS = 0. */
    +
    794  minb = mintst;
    +
    795  maxb = maxtst;
    +
    796  minbk = mintstk;
    +
    797  maxbk = maxtstk;
    +
    798  --kounta;
    +
    799 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    800 /* L1715: */
    +
    801  }
    +
    802 
    +
    803  } else if (*is523 == 1) {
    +
    804 
    +
    805  i__1 = kstart;
    +
    806  for (k = ktotal; k >= i__1; --k) {
    +
    807 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    808  if (ic[k] == *missp) {
    +
    809  goto L1718;
    +
    810  }
    +
    811  if (ic[k] < minb) {
    +
    812  mintst = ic[k];
    +
    813  mintstk = k;
    +
    814  } else if (ic[k] > maxb) {
    +
    815  maxtst = ic[k];
    +
    816  maxtstk = k;
    +
    817  }
    +
    818  if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
    +
    819  goto L174;
    +
    820  }
    +
    821 /* FOR THIS LOOP, LMISS = 1. */
    +
    822  minb = mintst;
    +
    823  maxb = maxtst;
    +
    824  minbk = mintstk;
    +
    825  maxbk = maxtstk;
    +
    826  misllb = 0;
    +
    827 /* WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
    +
    828  L1718:
    +
    829  --kounta;
    +
    830 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    831 /* L1719: */
    +
    832  }
    +
    833 
    +
    834  } else {
    +
    835 
    +
    836  i__1 = kstart;
    +
    837  for (k = ktotal; k >= i__1; --k) {
    +
    838 /* START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
    +
    839  if (ic[k] == *missp || ic[k] == *misss) {
    +
    840  goto L1729;
    +
    841  }
    +
    842  if (ic[k] < minb) {
    +
    843  mintst = ic[k];
    +
    844  mintstk = k;
    +
    845  } else if (ic[k] > maxb) {
    +
    846  maxtst = ic[k];
    +
    847  maxtstk = k;
    +
    848  }
    +
    849  if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
    +
    850  goto L174;
    +
    851  }
    +
    852 /* FOR THIS LOOP, LMISS = 2. */
    +
    853  minb = mintst;
    +
    854  maxb = maxtst;
    +
    855  minbk = mintstk;
    +
    856  maxbk = maxtstk;
    +
    857  misllb = 0;
    +
    858 /* WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
    +
    859  L1729:
    +
    860  --kounta;
    +
    861 /* THERE IS ONE LESS POINT NOW IN A. */
    +
    862 /* L173: */
    +
    863  }
    +
    864 
    +
    865  }
    +
    866 
    +
    867 /* AT THIS POINT, KOUNTA CONTAINS THE NUMBER OF POINTS TO CLOSE */
    +
    868 /* OUT GROUP A WITH. GROUP B NOW STARTS WITH KSTART+KOUNTA AND */
    +
    869 /* ENDS WITH NENDB. MINB AND MAXB HAVE BEEN ADJUSTED AS */
    +
    870 /* NECESSARY TO REFLECT GROUP B (EVEN THOUGH THE NUMBER OF BITS */
    +
    871 /* NEEDED TO PACK GROUP B HAVE NOT INCREASED, THE END POINTS */
    +
    872 /* OF THE RANGE MAY HAVE). */
    +
    873 
    +
    874 L174:
    +
    875  if (kounta == kounts) {
    +
    876  goto L200;
    +
    877  }
    +
    878 /* ON TRANSFER, GROUP A WAS NOT CHANGED. CLOSE IT OUT. */
    +
    879 
    +
    880 /* ONE OR MORE POINTS WERE TAKEN OUT OF A. RANGE AND IBITA */
    +
    881 /* MAY HAVE TO BE RECOMPUTED; IBITA COULD BE LESS THAN */
    +
    882 /* ORIGINALLY COMPUTED. IN FACT, GROUP A CAN NOW CONTAIN */
    +
    883 /* ONLY ONE POINT AND BE PACKED WITH ZERO BITS */
    +
    884 /* (UNLESS MISSS NE 0). */
    +
    885 
    +
    886  nouta = kounts - kounta;
    +
    887  ktotal -= nouta;
    +
    888  kountb += nouta;
    +
    889  if (nenda - nouta > minak && nenda - nouta > maxak) {
    +
    890  goto L200;
    +
    891  }
    +
    892 /* WHEN THE ABOVE TEST IS MET, THE MIN AND MAX OF THE */
    +
    893 /* CURRENT GROUP A WERE WITHIN THE OLD GROUP A, SO THE */
    +
    894 /* RANGE AND IBITA DO NOT NEED TO BE RECOMPUTED. */
    +
    895 /* NOTE THAT MINAK AND MAXAK ARE NO LONGER NEEDED. */
    +
    896  ibita = 0;
    +
    897  mina = mallow;
    +
    898  maxa = -mallow;
    +
    899 
    +
    900 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    901 /* FOR EFFICIENCY. */
    +
    902 
    +
    903  if (*is523 == 0) {
    +
    904 
    +
    905  i__1 = nenda - nouta;
    +
    906  for (k = kstart; k <= i__1; ++k) {
    +
    907  if (ic[k] < mina) {
    +
    908  mina = ic[k];
    +
    909  }
    +
    910  if (ic[k] > maxa) {
    +
    911  maxa = ic[k];
    +
    912  }
    +
    913 /* L1742: */
    +
    914  }
    +
    915 
    +
    916  } else if (*is523 == 1) {
    +
    917 
    +
    918  i__1 = nenda - nouta;
    +
    919  for (k = kstart; k <= i__1; ++k) {
    +
    920  if (ic[k] == *missp) {
    +
    921  goto L1744;
    +
    922  }
    +
    923  if (ic[k] < mina) {
    +
    924  mina = ic[k];
    +
    925  }
    +
    926  if (ic[k] > maxa) {
    +
    927  maxa = ic[k];
    +
    928  }
    +
    929  L1744:
    +
    930  ;
    +
    931  }
    +
    932 
    +
    933  } else {
    +
    934 
    +
    935  i__1 = nenda - nouta;
    +
    936  for (k = kstart; k <= i__1; ++k) {
    +
    937  if (ic[k] == *missp || ic[k] == *misss) {
    +
    938  goto L175;
    +
    939  }
    +
    940  if (ic[k] < mina) {
    +
    941  mina = ic[k];
    +
    942  }
    +
    943  if (ic[k] > maxa) {
    +
    944  maxa = ic[k];
    +
    945  }
    +
    946  L175:
    +
    947  ;
    +
    948  }
    +
    949 
    +
    950  }
    +
    951 
    +
    952  mislla = 0;
    +
    953  if (mina != mallow) {
    +
    954  goto L1750;
    +
    955  }
    +
    956 /* ALL MISSING VALUES MUST BE ACCOMMODATED. */
    +
    957  mina = 0;
    +
    958  maxa = 0;
    +
    959  mislla = 1;
    +
    960  if (*is523 != 2) {
    +
    961  goto L177;
    +
    962  }
    +
    963 /* WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
    +
    964 /* MISSING VALUES IBITA = 0 AS ORIGINALLY SET. OTHERWISE, */
    +
    965 /* IBITA MUST BE CALCULATED. */
    +
    966 
    +
    967 L1750:
    +
    968  itest = maxa - mina + lmiss;
    +
    969 
    +
    970  for (ibita = 0; ibita <= 30; ++ibita) {
    +
    971  if (itest < ibxx2[ibita]) {
    +
    972  goto L177;
    +
    973  }
    +
    974 /* *** THIS TEST IS THE SAME AS: */
    +
    975 /* *** IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 177 */
    +
    976 /* L176: */
    +
    977  }
    +
    978 
    +
    979 /* WRITE(KFILDO,1760)MAXA,MINA */
    +
    980 /* 1760 FORMAT(' ****ERROR IN PACK_GP. VALUE WILL NOT PACK IN 30 BITS.', */
    +
    981 /* 1 ' MAXA ='I13,' MINA ='I13,'. ERROR AT 1760.') */
    +
    982  *ier = 706;
    +
    983  goto L900;
    +
    984 
    +
    985 L177:
    +
    986  goto L200;
    +
    987 
    +
    988 /* ************************************* */
    +
    989 
    +
    990 /* AT THIS POINT, GROUP B REQUIRES AS MANY BITS TO PACK AS GROUPA. */
    +
    991 /* THEREFORE, TRY TO ADD INC POINTS TO GROUP A WITHOUT INCREASING */
    +
    992 /* IBITA. THIS AUGMENTED GROUP IS CALLED GROUP C. */
    +
    993 
    +
    994 /* ************************************* */
    +
    995 
    +
    996 L180:
    +
    997  if (mislla == 1) {
    +
    998  minc = mallow;
    +
    999  minck = mallow;
    +
    1000  maxc = -mallow;
    +
    1001  maxck = -mallow;
    +
    1002  } else {
    +
    1003  minc = mina;
    +
    1004  maxc = maxa;
    +
    1005  minck = minak;
    +
    1006  maxck = minak;
    +
    1007  }
    +
    1008 
    +
    1009  nount = 0;
    +
    1010  if (*nxy - (ktotal + kinc) <= lminpk / 2) {
    +
    1011  kinc = *nxy - ktotal;
    +
    1012  }
    +
    1013 /* ABOVE STATEMENT CONSTRAINS THE LAST GROUP TO BE NOT LESS THAN */
    +
    1014 /* LMINPK/2 IN SIZE. IF A PROVISION LIKE THIS IS NOT INCLUDED, */
    +
    1015 /* THERE WILL MANY TIMES BE A VERY SMALL GROUP AT THE END. */
    +
    1016 
    +
    1017 /* USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
    +
    1018 /* FOR EFFICIENCY. SINCE KINC IS USUALLY 1, USING SEPARATE */
    +
    1019 /* LOOPS HERE DOESN'T BUY MUCH. A MISSING VALUE WILL ALWAYS */
    +
    1020 /* TRANSFER BACK TO GROUP A. */
    +
    1021 
    +
    1022  if (*is523 == 0) {
    +
    1023 
    +
    1024 /* Computing MIN */
    +
    1025  i__2 = ktotal + kinc;
    +
    1026  /*i__1 = min(i__2,*nxy);*/
    +
    1027  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1028  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1029  if (ic[k] < minc) {
    +
    1030  minc = ic[k];
    +
    1031  minck = k;
    +
    1032  }
    +
    1033  if (ic[k] > maxc) {
    +
    1034  maxc = ic[k];
    +
    1035  maxck = k;
    +
    1036  }
    +
    1037  ++nount;
    +
    1038 /* L185: */
    +
    1039  }
    +
    1040 
    +
    1041  } else if (*is523 == 1) {
    +
    1042 
    +
    1043 /* Computing MIN */
    +
    1044  i__2 = ktotal + kinc;
    +
    1045  /*i__1 = min(i__2,*nxy);*/
    +
    1046  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1047  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1048  if (ic[k] == *missp) {
    +
    1049  goto L186;
    +
    1050  }
    +
    1051  if (ic[k] < minc) {
    +
    1052  minc = ic[k];
    +
    1053  minck = k;
    +
    1054  }
    +
    1055  if (ic[k] > maxc) {
    +
    1056  maxc = ic[k];
    +
    1057  maxck = k;
    +
    1058  }
    +
    1059  L186:
    +
    1060  ++nount;
    +
    1061 /* L187: */
    +
    1062  }
    +
    1063 
    +
    1064  } else {
    +
    1065 
    +
    1066 /* Computing MIN */
    +
    1067  i__2 = ktotal + kinc;
    +
    1068  /*i__1 = min(i__2,*nxy);*/
    +
    1069  i__1 = (i__2 < *nxy) ? i__2 : *nxy;
    +
    1070  for (k = ktotal + 1; k <= i__1; ++k) {
    +
    1071  if (ic[k] == *missp || ic[k] == *misss) {
    +
    1072  goto L189;
    +
    1073  }
    +
    1074  if (ic[k] < minc) {
    +
    1075  minc = ic[k];
    +
    1076  minck = k;
    +
    1077  }
    +
    1078  if (ic[k] > maxc) {
    +
    1079  maxc = ic[k];
    +
    1080  maxck = k;
    +
    1081  }
    +
    1082  L189:
    +
    1083  ++nount;
    +
    1084 /* L190: */
    +
    1085  }
    +
    1086 
    +
    1087  }
    +
    1088 
    +
    1089 /* ***D WRITE(KFILDO,191)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
    +
    1090 /* ***D 1 MINC,MAXC,NOUNT,IC(KTOTAL),IC(KTOTAL+1) */
    +
    1091 /* ***D191 FORMAT(' AT 191, KOUNTA ='I8,' KTOTAL ='I8,' MINA ='I8, */
    +
    1092 /* ***D 1 ' MAXA ='I8,' IBITA ='I3,' MISLLA ='I3, */
    +
    1093 /* ***D 2 ' MINC ='I8,' MAXC ='I8, */
    +
    1094 /* ***D 3 ' NOUNT ='I5,' IC(KTOTAL) ='I9,' IC(KTOTAL+1) =',I9) */
    +
    1095 
    +
    1096 /* IF THE NUMBER OF BITS NEEDED FOR GROUP C IS GT IBITA, */
    +
    1097 /* THEN THIS GROUP A IS A GROUP TO PACK. */
    +
    1098 
    +
    1099  if (minc == mallow) {
    +
    1100  minc = mina;
    +
    1101  maxc = maxa;
    +
    1102  minck = minak;
    +
    1103  maxck = maxak;
    +
    1104  misllc = 1;
    +
    1105  goto L195;
    +
    1106 /* WHEN THE NEW VALUE(S) ARE MISSING, THEY CAN ALWAYS */
    +
    1107 /* BE ADDED. */
    +
    1108 
    +
    1109  } else {
    +
    1110  misllc = 0;
    +
    1111  }
    +
    1112 
    +
    1113  if (maxc - minc >= ibxx2[ibita] - lmiss) {
    +
    1114  goto L200;
    +
    1115  }
    +
    1116 
    +
    1117 /* THE BITS NECESSARY FOR GROUP C HAS NOT INCREASED FROM THE */
    +
    1118 /* BITS NECESSARY FOR GROUP A. ADD THIS POINT(S) TO GROUP A. */
    +
    1119 /* COMPUTE THE NEXT GROUP B, ETC., UNLESS ALL POINTS HAVE BEEN */
    +
    1120 /* USED. */
    +
    1121 
    +
    1122 L195:
    +
    1123  ktotal += nount;
    +
    1124  kounta += nount;
    +
    1125  mina = minc;
    +
    1126  maxa = maxc;
    +
    1127  minak = minck;
    +
    1128  maxak = maxck;
    +
    1129  mislla = misllc;
    +
    1130  adda = TRUE_;
    +
    1131  if (ktotal >= *nxy) {
    +
    1132  goto L200;
    +
    1133  }
    +
    1134 
    +
    1135  if (minbk > ktotal && maxbk > ktotal) {
    +
    1136  mstart = nendb + 1;
    +
    1137 /* THE MAX AND MIN OF GROUP B WERE NOT FROM THE POINTS */
    +
    1138 /* REMOVED, SO THE WHOLE GROUP DOES NOT HAVE TO BE LOOKED */
    +
    1139 /* AT TO DETERMINE THE NEW MAX AND MIN. RATHER START */
    +
    1140 /* JUST BEYOND THE OLD NENDB. */
    +
    1141  ibitbs = ibitb;
    +
    1142  nendb = 1;
    +
    1143  goto L150;
    +
    1144  } else {
    +
    1145  goto L140;
    +
    1146  }
    +
    1147 
    +
    1148 /* ************************************* */
    +
    1149 
    +
    1150 /* GROUP A IS TO BE PACKED. STORE VALUES IN JMIN( ), JMAX( ), */
    +
    1151 /* LBIT( ), AND NOV( ). */
    +
    1152 
    +
    1153 /* ************************************* */
    +
    1154 
    +
    1155 L200:
    +
    1156  ++(*lx);
    +
    1157  if (*lx <= *ndg) {
    +
    1158  goto L205;
    +
    1159  }
    +
    1160  lminpk += lminpk / 2;
    +
    1161 /* WRITE(KFILDO,201)NDG,LMINPK,LX */
    +
    1162 /* 201 FORMAT(' ****NDG ='I5,' NOT LARGE ENOUGH.', */
    +
    1163 /* 1 ' LMINPK IS INCREASED TO 'I3,' FOR THIS FIELD.'/ */
    +
    1164 /* 2 ' LX = 'I10) */
    +
    1165  iersav = 716;
    +
    1166  goto L105;
    +
    1167 
    +
    1168 L205:
    +
    1169  jmin[*lx] = mina;
    +
    1170  jmax[*lx] = maxa;
    +
    1171  lbit[*lx] = ibita;
    +
    1172  nov[*lx] = kounta;
    +
    1173  kstart = ktotal + 1;
    +
    1174 
    +
    1175  if (mislla == 0) {
    +
    1176  misslx[*lx - 1] = mallow;
    +
    1177  } else {
    +
    1178  misslx[*lx - 1] = ic[ktotal];
    +
    1179 /* IC(KTOTAL) WAS THE LAST VALUE PROCESSED. IF MISLLA NE 0, */
    +
    1180 /* THIS MUST BE THE MISSING VALUE FOR THIS GROUP. */
    +
    1181  }
    +
    1182 
    +
    1183 /* ***D WRITE(KFILDO,206)MISLLA,IC(KTOTAL),KTOTAL,LX,JMIN(LX),JMAX(LX), */
    +
    1184 /* ***D 1 LBIT(LX),NOV(LX),MISSLX(LX) */
    +
    1185 /* ***D206 FORMAT(' AT 206, MISLLA ='I2,' IC(KTOTAL) ='I5,' KTOTAL ='I8, */
    +
    1186 /* ***D 1 ' LX ='I6,' JMIN(LX) ='I8,' JMAX(LX) ='I8, */
    +
    1187 /* ***D 2 ' LBIT(LX) ='I5,' NOV(LX) ='I8,' MISSLX(LX) =',I7) */
    +
    1188 
    +
    1189  if (ktotal >= *nxy) {
    +
    1190  goto L209;
    +
    1191  }
    +
    1192 
    +
    1193 /* THE NEW GROUP A WILL BE THE PREVIOUS GROUP B. SET LIMITS, ETC. */
    +
    1194 
    +
    1195  ibita = ibitb;
    +
    1196  mina = minb;
    +
    1197  maxa = maxb;
    +
    1198  minak = minbk;
    +
    1199  maxak = maxbk;
    +
    1200  mislla = misllb;
    +
    1201  nenda = nendb;
    +
    1202  kounta = kountb;
    +
    1203  ktotal += kounta;
    +
    1204  adda = FALSE_;
    +
    1205  goto L133;
    +
    1206 
    +
    1207 /* ************************************* */
    +
    1208 
    +
    1209 /* CALCULATE IBIT, THE NUMBER OF BITS NEEDED TO HOLD THE GROUP */
    +
    1210 /* MINIMUM VALUES. */
    +
    1211 
    +
    1212 /* ************************************* */
    +
    1213 
    +
    1214 L209:
    +
    1215  *ibit = 0;
    +
    1216 
    +
    1217  i__1 = *lx;
    +
    1218  for (l = 1; l <= i__1; ++l) {
    +
    1219  L210:
    +
    1220  if (jmin[l] < ibxx2[*ibit]) {
    +
    1221  goto L220;
    +
    1222  }
    +
    1223  ++(*ibit);
    +
    1224  goto L210;
    +
    1225  L220:
    +
    1226  ;
    +
    1227  }
    +
    1228 
    +
    1229 /* INSERT THE VALUE IN JMIN( ) TO BE USED FOR ALL MISSING */
    +
    1230 /* VALUES WHEN LBIT( ) = 0. WHEN SECONDARY MISSING */
    +
    1231 /* VALUES CAN BE PRESENT, LBIT(L) WILL NOT = 0. */
    +
    1232 
    +
    1233  if (*is523 == 1) {
    +
    1234 
    +
    1235  i__1 = *lx;
    +
    1236  for (l = 1; l <= i__1; ++l) {
    +
    1237 
    +
    1238  if (lbit[l] == 0) {
    +
    1239 
    +
    1240  if (misslx[l - 1] == *missp) {
    +
    1241  jmin[l] = ibxx2[*ibit] - 1;
    +
    1242  }
    +
    1243 
    +
    1244  }
    +
    1245 
    +
    1246 /* L226: */
    +
    1247  }
    +
    1248 
    +
    1249  }
    +
    1250 
    +
    1251 /* ************************************* */
    +
    1252 
    +
    1253 /* CALCULATE JBIT, THE NUMBER OF BITS NEEDED TO HOLD THE BITS */
    +
    1254 /* NEEDED TO PACK THE VALUES IN THE GROUPS. BUT FIND AND */
    +
    1255 /* REMOVE THE REFERENCE VALUE FIRST. */
    +
    1256 
    +
    1257 /* ************************************* */
    +
    1258 
    +
    1259 /* WRITE(KFILDO,228)CFEED,LX */
    +
    1260 /* 228 FORMAT(A1,/' *****************************************' */
    +
    1261 /* 1 /' THE GROUP WIDTHS LBIT( ) FOR ',I8,' GROUPS' */
    +
    1262 /* 2 /' *****************************************') */
    +
    1263 /* WRITE(KFILDO,229) (LBIT(J),J=1,MIN(LX,100)) */
    +
    1264 /* 229 FORMAT(/' '20I6) */
    +
    1265 
    +
    1266  *lbitref = lbit[1];
    +
    1267 
    +
    1268  i__1 = *lx;
    +
    1269  for (k = 1; k <= i__1; ++k) {
    +
    1270  if (lbit[k] < *lbitref) {
    +
    1271  *lbitref = lbit[k];
    +
    1272  }
    +
    1273 /* L230: */
    +
    1274  }
    +
    1275 
    +
    1276  if (*lbitref != 0) {
    +
    1277 
    +
    1278  i__1 = *lx;
    +
    1279  for (k = 1; k <= i__1; ++k) {
    +
    1280  lbit[k] -= *lbitref;
    +
    1281 /* L240: */
    +
    1282  }
    +
    1283 
    +
    1284  }
    +
    1285 
    +
    1286 /* WRITE(KFILDO,241)CFEED,LBITREF */
    +
    1287 /* 241 FORMAT(A1,/' *****************************************' */
    +
    1288 /* 1 /' THE GROUP WIDTHS LBIT( ) AFTER REMOVING REFERENCE ', */
    +
    1289 /* 2 I8, */
    +
    1290 /* 3 /' *****************************************') */
    +
    1291 /* WRITE(KFILDO,242) (LBIT(J),J=1,MIN(LX,100)) */
    +
    1292 /* 242 FORMAT(/' '20I6) */
    +
    1293 
    +
    1294  *jbit = 0;
    +
    1295 
    +
    1296  i__1 = *lx;
    +
    1297  for (k = 1; k <= i__1; ++k) {
    +
    1298  L310:
    +
    1299  if (lbit[k] < ibxx2[*jbit]) {
    +
    1300  goto L320;
    +
    1301  }
    +
    1302  ++(*jbit);
    +
    1303  goto L310;
    +
    1304  L320:
    +
    1305  ;
    +
    1306  }
    +
    1307 
    +
    1308 /* ************************************* */
    +
    1309 
    +
    1310 /* CALCULATE KBIT, THE NUMBER OF BITS NEEDED TO HOLD THE NUMBER */
    +
    1311 /* OF VALUES IN THE GROUPS. BUT FIND AND REMOVE THE */
    +
    1312 /* REFERENCE FIRST. */
    +
    1313 
    +
    1314 /* ************************************* */
    +
    1315 
    +
    1316 /* WRITE(KFILDO,321)CFEED,LX */
    +
    1317 /* 321 FORMAT(A1,/' *****************************************' */
    +
    1318 /* 1 /' THE GROUP SIZES NOV( ) FOR ',I8,' GROUPS' */
    +
    1319 /* 2 /' *****************************************') */
    +
    1320 /* WRITE(KFILDO,322) (NOV(J),J=1,MIN(LX,100)) */
    +
    1321 /* 322 FORMAT(/' '20I6) */
    +
    1322 
    +
    1323  *novref = nov[1];
    +
    1324 
    +
    1325  i__1 = *lx;
    +
    1326  for (k = 1; k <= i__1; ++k) {
    +
    1327  if (nov[k] < *novref) {
    +
    1328  *novref = nov[k];
    +
    1329  }
    +
    1330 /* L400: */
    +
    1331  }
    +
    1332 
    +
    1333  if (*novref > 0) {
    +
    1334 
    +
    1335  i__1 = *lx;
    +
    1336  for (k = 1; k <= i__1; ++k) {
    +
    1337  nov[k] -= *novref;
    +
    1338 /* L405: */
    +
    1339  }
    +
    1340 
    +
    1341  }
    +
    1342 
    +
    1343 /* WRITE(KFILDO,406)CFEED,NOVREF */
    +
    1344 /* 406 FORMAT(A1,/' *****************************************' */
    +
    1345 /* 1 /' THE GROUP SIZES NOV( ) AFTER REMOVING REFERENCE ',I8, */
    +
    1346 /* 2 /' *****************************************') */
    +
    1347 /* WRITE(KFILDO,407) (NOV(J),J=1,MIN(LX,100)) */
    +
    1348 /* 407 FORMAT(/' '20I6) */
    +
    1349 /* WRITE(KFILDO,408)CFEED */
    +
    1350 /* 408 FORMAT(A1,/' *****************************************' */
    +
    1351 /* 1 /' THE GROUP REFERENCES JMIN( )' */
    +
    1352 /* 2 /' *****************************************') */
    +
    1353 /* WRITE(KFILDO,409) (JMIN(J),J=1,MIN(LX,100)) */
    +
    1354 /* 409 FORMAT(/' '20I6) */
    +
    1355 
    +
    1356  *kbit = 0;
    +
    1357 
    +
    1358  i__1 = *lx;
    +
    1359  for (k = 1; k <= i__1; ++k) {
    +
    1360  L410:
    +
    1361  if (nov[k] < ibxx2[*kbit]) {
    +
    1362  goto L420;
    +
    1363  }
    +
    1364  ++(*kbit);
    +
    1365  goto L410;
    +
    1366  L420:
    +
    1367  ;
    +
    1368  }
    +
    1369 
    +
    1370 /* DETERMINE WHETHER THE GROUP SIZES SHOULD BE REDUCED */
    +
    1371 /* FOR SPACE EFFICIENCY. */
    +
    1372 
    +
    1373  if (ired == 0) {
    +
    1374  reduce(kfildo, &jmin[1], &jmax[1], &lbit[1], &nov[1], lx, ndg, ibit,
    +
    1375  jbit, kbit, novref, ibxx2, ier);
    +
    1376 
    +
    1377  if (*ier == 714 || *ier == 715) {
    +
    1378 /* REDUCE HAS ABORTED. REEXECUTE PACK_GP WITHOUT REDUCE. */
    +
    1379 /* PROVIDE FOR A NON FATAL RETURN FROM REDUCE. */
    +
    1380  iersav = *ier;
    +
    1381  ired = 1;
    +
    1382  *ier = 0;
    +
    1383  goto L102;
    +
    1384  }
    +
    1385 
    +
    1386  }
    +
    1387 
    +
    1388  if ( misslx != 0 ) {
    +
    1389  free(misslx);
    +
    1390  misslx=0;
    +
    1391  }
    +
    1392 /* CALL TIMPR(KFILDO,KFILDO,'END PACK_GP ') */
    +
    1393  if (iersav != 0) {
    +
    1394  *ier = iersav;
    +
    1395  return 0;
    +
    1396  }
    +
    1397 
    +
    1398 /* 900 IF(IER.NE.0)RETURN1 */
    +
    1399 
    +
    1400 L900:
    +
    1401  if ( misslx != 0 ) free(misslx);
    +
    1402  return 0;
    +
    1403 } /* pack_gp__ */
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    int pack_gp(integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *ier)
    Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
    Definition: pack_gp.c:256
    +
    g2int integer
    Integer type.
    Definition: pack_gp.c:8
    +
    g2int logical
    Logical type.
    Definition: pack_gp.c:9
    +
    #define TRUE_
    True.
    Definition: pack_gp.c:10
    +
    #define FALSE_
    False.
    Definition: pack_gp.c:11
    +
    int reduce(integer *kfildo, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *ibxx2, integer *ier)
    Determines whether the number of groups should be increased in order to reduce the size of the large ...
    Definition: reduce.c:91
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8c.html b/ver-1.7.0/ver-1.6.4/pdstemplates_8c.html new file mode 100644 index 00000000..69256703 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8c.html @@ -0,0 +1,271 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pdstemplates.c File Reference
    +
    +
    + +

    Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS). +More...

    +
    #include <stdlib.h>
    +#include "grib2.h"
    +#include "pdstemplates.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    gtemplateextpdstemplate (g2int number, g2int *list)
     This subroutine generates the remaining octet map for a given Product Definition Template, if required. More...
     
    g2int getpdsindex (g2int number)
     This function returns the index of specified Product Definition Template in array templates. More...
     
    gtemplategetpdstemplate (g2int number)
     This subroutine returns PDS template information for a specified Product Definition Template. More...
     
    +

    Detailed Description

    +

    Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS).

    +

    +Program History Log

    + + + + + + + + + + + + + + + + + + + +
    Date Programmer Comments
    2001-06-28 Gilbert Initial
    2009-01-14 Vuong Changed structure name template to gtemplate
    2009-12-15 Vuong Added Product Definition Templates 4.31, 4.15
    2010-08-03 Vuong Added Product Definition Template 4.42 and 4.43
    2010-12-08 Vuong Corrected Product Definition Template 4.42 and 4.43
    2012-03-29 Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50, 4.51,4.91,4.32 and 4.52
    2013-08-05 Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
    2015-10-07 Vuong Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition in file pdstemplates.c.

    +

    Function Documentation

    + +

    ◆ extpdstemplate()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    gtemplate* extpdstemplate (g2int number,
    g2intlist 
    )
    +
    + +

    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
    + + + +
    numbernumber of the Product Definition Template 4.NN that is being requested.
    listThe 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 121 of file pdstemplates.c.

    + +

    References getpdsindex(), and getpdstemplate().

    + +

    Referenced by g2_addfield(), and g2_unpack4().

    + +
    +
    + +

    ◆ getpdsindex()

    + +
    +
    + + + + + + + + +
    g2int getpdsindex (g2int number)
    +
    + +

    This function returns the index of specified Product Definition Template in array templates.

    +
    Parameters
    + + +
    numberThe number of the Product Definition Template that is being requested.
    +
    +
    +
    Returns
    Index of PDT in array templates, if template exists. -1, otherwise.
    +
    Author
    Stephen Gilbert
    +
    Date
    2001-06-28
    + +

    Definition at line 38 of file pdstemplates.c.

    + +

    References MAXPDSTEMP, and templatespds.

    + +

    Referenced by extpdstemplate(), and getpdstemplate().

    + +
    +
    + +

    ◆ getpdstemplate()

    + +
    +
    + + + + + + + + +
    gtemplate* getpdstemplate (g2int number)
    +
    + +

    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
    + + +
    numberthe 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 73 of file pdstemplates.c.

    + +

    References getpdsindex(), pdstemplate::mappdslen, pdstemplate::needext, pdstemplate::template_num, and templatespds.

    + +

    Referenced by extpdstemplate(), g2_addfield(), and g2_unpack4().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8c.js b/ver-1.7.0/ver-1.6.4/pdstemplates_8c.js new file mode 100644 index 00000000..ff330399 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8c.js @@ -0,0 +1,6 @@ +var pdstemplates_8c = +[ + [ "extpdstemplate", "pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb", null ], + [ "getpdsindex", "pdstemplates_8c.html#a68d2553a1ef915bd21a491f4105ab0f2", null ], + [ "getpdstemplate", "pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8c_source.html b/ver-1.7.0/ver-1.6.4/pdstemplates_8c_source.html new file mode 100644 index 00000000..4c476904 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8c_source.html @@ -0,0 +1,559 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pdstemplates.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    21 #include <stdlib.h>
    +
    22 #include "grib2.h"
    +
    23 #include "pdstemplates.h"
    +
    24 
    +
    37 g2int
    + +
    39 {
    +
    40  g2int j, getpdsindex = -1;
    +
    41 
    +
    42  for (j = 0; j < MAXPDSTEMP; j++)
    +
    43  {
    +
    44  if (number == templatespds[j].template_num)
    +
    45  {
    +
    46  getpdsindex = j;
    +
    47  return(getpdsindex);
    +
    48  }
    +
    49  }
    +
    50 
    +
    51  return(getpdsindex);
    +
    52 }
    +
    53 
    +
    72 gtemplate *
    + +
    74 {
    +
    75  g2int index;
    +
    76  gtemplate *new;
    +
    77 
    +
    78  index = getpdsindex(number);
    +
    79 
    +
    80  if (index != -1)
    +
    81  {
    +
    82  new = malloc(sizeof(gtemplate));
    +
    83  new->type = 4;
    +
    84  new->num = templatespds[index].template_num;
    +
    85  new->maplen = templatespds[index].mappdslen;
    +
    86  new->needext = templatespds[index].needext;
    +
    87  new->map = (g2int *)templatespds[index].mappds;
    +
    88  new->extlen = 0;
    +
    89  new->ext = NULL;
    +
    90  return(new);
    +
    91  }
    +
    92  else {
    +
    93  printf("getpdstemplate: PDS Template 4.%d not defined.\n", (int)number);
    +
    94  return(NULL);
    +
    95  }
    +
    96 
    +
    97  return(NULL);
    +
    98 }
    +
    99 
    +
    120 gtemplate *
    +
    121 extpdstemplate(g2int number, g2int *list)
    +
    122 {
    +
    123  gtemplate *new;
    +
    124  g2int index, i, j, k, l;
    +
    125 
    +
    126  index = getpdsindex(number);
    +
    127  if (index == -1)
    +
    128  return(0);
    +
    129 
    +
    130  new = getpdstemplate(number);
    +
    131 
    +
    132  if (!new->needext)
    +
    133  return(new);
    +
    134 
    +
    135  if (number == 3)
    +
    136  {
    +
    137  new->extlen = list[26];
    +
    138  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    139  for (i = 0; i < new->extlen; i++)
    +
    140  {
    +
    141  new->ext[i] = 1;
    +
    142  }
    +
    143  }
    +
    144  else if (number == 4)
    +
    145  {
    +
    146  new->extlen = list[25];
    +
    147  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    148  for (i = 0; i < new->extlen; i++)
    +
    149  {
    +
    150  new->ext[i] = 1;
    +
    151  }
    +
    152  }
    +
    153  else if (number == 8)
    +
    154  {
    +
    155  if (list[21] > 1)
    +
    156  {
    +
    157  new->extlen = (list[21] - 1) * 6;
    +
    158  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    159  for (j = 2; j <= list[21]; j++)
    +
    160  {
    +
    161  l = (j - 2) * 6;
    +
    162  for (k = 0; k < 6; k++)
    +
    163  {
    +
    164  new->ext[l+k] = new->map[23 + k];
    +
    165  }
    +
    166  }
    +
    167  }
    +
    168  }
    +
    169  else if (number == 9)
    +
    170  {
    +
    171  if (list[28] > 1)
    +
    172  {
    +
    173  new->extlen = (list[28] - 1) * 6;
    +
    174  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    175  for (j = 2; j <= list[28]; j++)
    +
    176  {
    +
    177  l = (j - 2) * 6;
    +
    178  for (k = 0; k < 6; k++)
    +
    179  {
    +
    180  new->ext[l + k] = new->map[30 + k];
    +
    181  }
    +
    182  }
    +
    183  }
    +
    184  }
    +
    185  else if (number == 10)
    +
    186  {
    +
    187  if (list[22] > 1)
    +
    188  {
    +
    189  new->extlen = (list[22] - 1) * 6;
    +
    190  new->ext = (g2int *)malloc(sizeof(g2int)*new->extlen);
    +
    191  for (j = 2; j <= list[22]; j++)
    +
    192  {
    +
    193  l = (j - 2) * 6;
    +
    194  for (k = 0; k < 6; k++)
    +
    195  {
    +
    196  new->ext[l + k] = new->map[24 + k];
    +
    197  }
    +
    198  }
    +
    199  }
    +
    200  }
    +
    201  else if (number == 11)
    +
    202  {
    +
    203  if (list[24] > 1)
    +
    204  {
    +
    205  new->extlen = (list[24] - 1) * 6;
    +
    206  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    207  for (j = 2; j <= list[24]; j++)
    +
    208  {
    +
    209  l = (j - 2) * 6;
    +
    210  for (k = 0; k < 6; k++)
    +
    211  {
    +
    212  new->ext[l + k] = new->map[26 + k];
    +
    213  }
    +
    214  }
    +
    215  }
    +
    216  }
    +
    217  else if (number == 12)
    +
    218  {
    +
    219  if (list[23] > 1)
    +
    220  {
    +
    221  new->extlen = (list[23] - 1) * 6;
    +
    222  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    223  for (j = 2; j <= list[23]; j++)
    +
    224  {
    +
    225  l = (j - 2) * 6;
    +
    226  for (k = 0; k < 6; k++)
    +
    227  {
    +
    228  new->ext[l + k] = new->map[25 + k];
    +
    229  }
    +
    230  }
    +
    231  }
    +
    232  }
    +
    233  else if (number == 13)
    +
    234  {
    +
    235  new->extlen = ((list[37] - 1) * 6) + list[26];
    +
    236  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    237  if (list[37] > 1)
    +
    238  {
    +
    239  for (j = 2; j <= list[37]; j++)
    +
    240  {
    +
    241  l = (j - 2) * 6;
    +
    242  for (k = 0; k < 6; k++)
    +
    243  {
    +
    244  new->ext[l + k] = new->map[39 + k];
    +
    245  }
    +
    246  }
    +
    247  }
    +
    248  l = (list[37] - 1) * 6;
    +
    249  if (l < 0)
    +
    250  l = 0;
    +
    251  for (i = 0; i < list[26]; i++)
    +
    252  {
    +
    253  new->ext[l+i] = 1;
    +
    254  }
    +
    255  }
    +
    256  else if (number == 14)
    +
    257  {
    +
    258  new->extlen = ((list[36] - 1) * 6) + list[25];
    +
    259  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    260  if (list[36] > 1)
    +
    261  {
    +
    262  for (j = 2; j <= list[36]; j++)
    +
    263  {
    +
    264  l = (j - 2) * 6;
    +
    265  for (k = 0; k < 6; k++)
    +
    266  {
    +
    267  new->ext[l + k] = new->map[38 + k];
    +
    268  }
    +
    269  }
    +
    270  }
    +
    271  l = (list[36] - 1) * 6;
    +
    272  if (l < 0)
    +
    273  l = 0;
    +
    274  for (i = 0; i < list[25]; i++)
    +
    275  {
    +
    276  new->ext[l + i] = 1;
    +
    277  }
    +
    278  }
    +
    279  else if (number == 30)
    +
    280  {
    +
    281  new->extlen = list[4] * 5;
    +
    282  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    283  for (i = 0;i < list[4]; i++)
    +
    284  {
    +
    285  l = i * 5;
    +
    286  new->ext[l] = 2;
    +
    287  new->ext[l + 1] = 2;
    +
    288  new->ext[l + 2] = 1;
    +
    289  new->ext[l + 3] = 1;
    +
    290  new->ext[l + 4] = 4;
    +
    291  }
    +
    292  }
    +
    293  else if (number == 31)
    +
    294  {
    +
    295  new->extlen = list[4] * 5;
    +
    296  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    297  for (i = 0; i < list[4]; i++)
    +
    298  {
    +
    299  l = i*5;
    +
    300  new->ext[l] = 2;
    +
    301  new->ext[l + 1] = 2;
    +
    302  new->ext[l + 2] = 2;
    +
    303  new->ext[l + 3] = 1;
    +
    304  new->ext[l + 4] = 4;
    +
    305  }
    +
    306  }
    +
    307  else if (number == 42)
    +
    308  {
    +
    309  if (list[22] > 1)
    +
    310  {
    +
    311  new->extlen = (list[22] - 1) * 6;
    +
    312  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    313  for (j = 2; j <= list[22]; j++)
    +
    314  {
    +
    315  l = (j - 2) * 6;
    +
    316  for (k = 0; k < 6; k++)
    +
    317  {
    +
    318  new->ext[l + k] = new->map[24 + k];
    +
    319  }
    +
    320  }
    +
    321  }
    +
    322  }
    +
    323  else if (number == 43)
    +
    324  {
    +
    325  if (list[25] > 1)
    +
    326  {
    +
    327  new->extlen = (list[25] - 1) * 6;
    +
    328  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    329  for (j = 2; j <= list[25]; j++)
    +
    330  {
    +
    331  l = (j - 2) * 6;
    +
    332  for (k = 0; k < 6; k++)
    +
    333  {
    +
    334  new->ext[l + k] = new->map[27 + k];
    +
    335  }
    +
    336  }
    +
    337  }
    +
    338  }
    +
    339  else if (number == 32)
    +
    340  {
    +
    341  new->extlen = list[9] * 10;
    +
    342  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    343  for (i = 0; i < list[9]; i++)
    +
    344  {
    +
    345  l = i * 5;
    +
    346  new->ext[l] = 2;
    +
    347  new->ext[l + 1] = 2;
    +
    348  new->ext[l + 2] = 2;
    +
    349  new->ext[l + 3] = -1;
    +
    350  new->ext[l + 4] = -4;
    +
    351  }
    +
    352  }
    +
    353  else if (number == 46)
    +
    354  {
    +
    355  if (list[27] > 1)
    +
    356  {
    +
    357  new->extlen = (list[27] - 1) * 6;
    +
    358  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    359  for (j = 2; j <= list[27]; j++)
    +
    360  {
    +
    361  l = (j - 2) * 6;
    +
    362  for (k = 0; k < 6; k++)
    +
    363  {
    +
    364  new->ext[l + k] = new->map[29 + k];
    +
    365  }
    +
    366  }
    +
    367  }
    +
    368  }
    +
    369  else if (number == 47)
    +
    370  {
    +
    371  if (list[30] > 1)
    +
    372  {
    +
    373  new->extlen = (list[30] - 1) * 6;
    +
    374  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    375  for (j = 2; j <= list[30]; j++)
    +
    376  {
    +
    377  l = (j - 2) * 6;
    +
    378  for (k = 0; k < 6; k++)
    +
    379  {
    +
    380  new->ext[l + k] = new->map[32 + k];
    +
    381  }
    +
    382  }
    +
    383  }
    +
    384  else if (number == 51)
    +
    385  {
    +
    386  new->extlen = list[15]*11;
    +
    387  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    388  for (i = 0; i < list[15]; i++)
    +
    389  {
    +
    390  l = i * 6;
    +
    391  new->ext[l] = 1;
    +
    392  new->ext[l+1] = 1;
    +
    393  new->ext[l+2] = -1;
    +
    394  new->ext[l+3] = -4;
    +
    395  new->ext[l+4] = -1;
    +
    396  new->ext[l+5] = -4;
    +
    397  }
    +
    398  }
    +
    399  else if (number == 33)
    +
    400  {
    +
    401  new->extlen = list[9];
    +
    402  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    403  for (i = 0; i < new->extlen; i++)
    +
    404  {
    +
    405  new->ext[i] = 1;
    +
    406  }
    +
    407  }
    +
    408  else if (number == 34)
    +
    409  {
    +
    410  new->extlen = ((list[24] - 1) * 6)+list[9];
    +
    411  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    412  if (list[24] > 1)
    +
    413  {
    +
    414  for (j = 2; j <= list[24]; j++)
    +
    415  {
    +
    416  l = (j - 2) * 6;
    +
    417  for (k = 0; k < 6; k++)
    +
    418  {
    +
    419  new->ext[l + k] = new->map[26 + k];
    +
    420  }
    +
    421  }
    +
    422  }
    +
    423  l = (list[24] - 1) * 6;
    +
    424  if (l < 0)
    +
    425  l = 0;
    +
    426  for (i = 0; i < list[9]; i++)
    +
    427  {
    +
    428  new->ext[l + i] = 1;
    +
    429  }
    +
    430  }
    +
    431  else if (number == 53)
    +
    432  {
    +
    433  new->extlen = list[3];
    +
    434  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    435  for (i = 0; i < new->extlen; i++)
    +
    436  {
    +
    437  new->ext[i] = 1;
    +
    438  }
    +
    439  }
    +
    440  else if (number == 54)
    +
    441  {
    +
    442  new->extlen = list[3];
    +
    443  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    444  for (i = 0;i<new->extlen;i++)
    +
    445  {
    +
    446  new->ext[i] = 1;
    +
    447  }
    +
    448  }
    +
    449  else if (number == 91)
    +
    450  {
    +
    451  new->extlen = ((list[28] - 1) * 6)+list[15];
    +
    452  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    453  if (list[28] > 1)
    +
    454  {
    +
    455  for (j = 2; j <= list[28]; j++)
    +
    456  {
    +
    457  l = (j - 2) * 6;
    +
    458  for (k = 0; k < 6; k++)
    +
    459  {
    +
    460  new->ext[l + k] = new->map[30 + k];
    +
    461  }
    +
    462  }
    +
    463  }
    +
    464  l = (list[29] - 1) * 6;
    +
    465  if (l < 0)
    +
    466  l = 0;
    +
    467  for (i = 0; i < list[15]; i++)
    +
    468  {
    +
    469  new->ext[l + i] = 1;
    +
    470  }
    +
    471  }
    +
    472  /* PDT 4.57 (10/07/2015) */
    +
    473  else if (number == 57)
    +
    474  {
    +
    475  new->extlen = list[6] * 15;
    +
    476  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    477  for (i = 0; i < list[6]; i++)
    +
    478  {
    +
    479  l = i*15;
    +
    480  new->ext[l] = 1;
    +
    481  new->ext[l+1] = -4;
    +
    482  new->ext[l+2] = 1;
    +
    483  new->ext[l+3] = 1;
    +
    484  new->ext[l+4] = 1;
    +
    485  new->ext[l+5] = 2;
    +
    486  new->ext[l+6] = 1;
    +
    487  new->ext[l+7] = 1;
    +
    488  new->ext[l+8] = -4;
    +
    489  new->ext[l+9] = 1;
    +
    490  new->ext[l+10] = -1;
    +
    491  new->ext[l+11] = -4;
    +
    492  new->ext[l+12] = 1;
    +
    493  new->ext[l+13] = -1;
    +
    494  new->ext[l+14] = -4;
    +
    495  }
    +
    496  }
    +
    497  /* PDT 4.61 (10/07/2015) */
    +
    498  else if (number == 61)
    +
    499  {
    +
    500  if (list[30] > 1)
    +
    501  {
    +
    502  new->extlen = (list[30] - 1) * 6;
    +
    503  new->ext = malloc(sizeof(g2int) * new->extlen);
    +
    504  for (j = 2; j <= list[30]; j++)
    +
    505  {
    +
    506  l = (j - 2) * 6;
    +
    507  for (k = 0; k < 6; k++)
    +
    508  {
    +
    509  new->ext[l + k] = new->map[32 + k];
    +
    510  }
    +
    511  }
    +
    512  }
    +
    513  }
    +
    514  }
    +
    515 
    +
    516  return(new);
    +
    517 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    Struct for GRIB template.
    Definition: grib2.h:28
    +
    gtemplate * extpdstemplate(g2int number, g2int *list)
    This subroutine generates the remaining octet map for a given Product Definition Template,...
    Definition: pdstemplates.c:121
    +
    g2int getpdsindex(g2int number)
    This function returns the index of specified Product Definition Template in array templates.
    Definition: pdstemplates.c:38
    +
    gtemplate * getpdstemplate(g2int number)
    This subroutine returns PDS template information for a specified Product Definition Template.
    Definition: pdstemplates.c:73
    +
    This include file contains info on all the available GRIB2 Product Definition Templates used in [Sect...
    +
    #define MAXPDSTEMP
    Maximum number of templates.
    Definition: pdstemplates.h:47
    +
    g2int needext
    Does template need extension?
    Definition: pdstemplates.h:57
    +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    Date for struct for PDS template.
    Definition: pdstemplates.h:64
    +
    g2int template_num
    Template number.
    Definition: pdstemplates.h:55
    +
    g2int mappdslen
    The number of entries in the template.
    Definition: pdstemplates.h:56
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8h.html b/ver-1.7.0/ver-1.6.4/pdstemplates_8h.html new file mode 100644 index 00000000..3337bcd7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8h.html @@ -0,0 +1,268 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.h File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pdstemplates.h File Reference
    +
    +
    + +

    This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml). +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Data Structures

    struct  pdstemplate
     Struct for PDS template. More...
     
    + + + + + + + +

    +Macros

    #define MAXPDSMAPLEN   200
     Maximum template map length. More...
     
    #define MAXPDSTEMP   47
     Maximum number of templates. More...
     
    + + + + +

    +Variables

    const struct pdstemplate templatespds [MAXPDSTEMP]
     Date for struct for PDS template. More...
     
    +

    Detailed Description

    +

    This include file contains info on all the available GRIB2 Product Definition Templates used in [Section 4 - the Product Definition Section (PDS)](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml).

    +

    Each Template has three parts:

      +
    1. The number of entries in the template (mappdslen).
    2. +
    3. A map of the template (mappds), which contains the number of octets in which to pack each of the template values.
    4. +
    5. 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 4.3 as an example).
    6. +
    +
    Note
    Array mappds contains the number of octets in which the corresponding template values will be stored. A negative value in mappds 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 mappds[] 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 mappds.
    +

    +Program History Log

    + + + + + + + + + + + + + + + + + + + +
    Date Programmer Comments
    2005-12-08 Gilbert Allow negative scale factors, limits for 4.5 and 4.9
    2009-12-15 Vuong Added Product Definition Templates 4.31, 4.15
    2010-08-03 Vuong Added Product Definition Template 4.40,4.41,4.42,4.43
    2010-12-08 Vuong Corrected Definition Template 4.42,4.43
    2010-12-08 Vuong Corrected Definition Template 4.42,4.43
    2012-03-29 Vuong Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,4.51,4.91,4.32 and 4.52
    2013-08-05 Vuong Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
    2015-10-07 Vuong Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative
    +
    Author
    Stephen Gilbert
    +
    Date
    2005-12-08
    + +

    Definition in file pdstemplates.h.

    +

    Data Type Documentation

    + +

    ◆ pdstemplate

    + +
    +
    + + + + +
    struct pdstemplate
    +
    +

    Struct for PDS template.

    + +

    Definition at line 53 of file pdstemplates.h.

    +
    + + + + + + + + + + + + + +
    Data Fields
    +g2int +mappds[MAXPDSMAPLEN] +Number of bytes for each template value.
    +g2int +mappdslen +The number of entries in the template.
    +g2int +needext +Does template need extension?
    +g2int +template_num +Template number.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ MAXPDSMAPLEN

    + +
    +
    + + + + +
    #define MAXPDSMAPLEN   200
    +
    + +

    Maximum template map length.

    + +

    Definition at line 48 of file pdstemplates.h.

    + +
    +
    + +

    ◆ MAXPDSTEMP

    + +
    +
    + + + + +
    #define MAXPDSTEMP   47
    +
    + +

    Maximum number of templates.

    + +

    Definition at line 47 of file pdstemplates.h.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ templatespds

    + +
    +
    + + + + +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    +
    + +

    Date for struct for PDS template.

    + +

    Definition at line 1 of file pdstemplates.h.

    + +

    Referenced by getpdsindex(), and getpdstemplate().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8h.js b/ver-1.7.0/ver-1.6.4/pdstemplates_8h.js new file mode 100644 index 00000000..6797a29e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8h.js @@ -0,0 +1,12 @@ +var pdstemplates_8h = +[ + [ "pdstemplate", "pdstemplates_8h.html#structpdstemplate", [ + [ "mappds", "pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b", null ], + [ "mappdslen", "pdstemplates_8h.html#ad086e08141828302359fbd2584e15931", null ], + [ "needext", "pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4", null ], + [ "template_num", "pdstemplates_8h.html#aa220825f05131b888bc234444067d22d", null ] + ] ], + [ "MAXPDSMAPLEN", "pdstemplates_8h.html#aa0bb590f8c48ad21d17f6cf7a72d8f53", null ], + [ "MAXPDSTEMP", "pdstemplates_8h.html#a11c588e7671155abba68b92678fc2071", null ], + [ "templatespds", "pdstemplates_8h.html#a87d5723cb60a9b598bc574cd31673a26", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8h_source.html b/ver-1.7.0/ver-1.6.4/pdstemplates_8h_source.html new file mode 100644 index 00000000..d964fae2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8h_source.html @@ -0,0 +1,181 @@ + + + + + + + +NCEPLIBS-g2c: pdstemplates.h Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pdstemplates.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    43 #ifndef _pdstemplates_H
    +
    44 #define _pdstemplates_H
    +
    45 #include "grib2.h"
    +
    46 
    +
    47 #define MAXPDSTEMP 47
    +
    48 #define MAXPDSMAPLEN 200
    + +
    54 {
    + + + + +
    59 };
    +
    60 
    +
    64 const struct pdstemplate templatespds[MAXPDSTEMP] =
    +
    65 {
    +
    68  {0,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    71  {1,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    74  {2,17,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1} },
    +
    77  {3,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4} },
    +
    80  {4,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4} },
    +
    83  {5,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4} },
    +
    86  {6,16,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    89  {7,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    92  {8,29,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    95  {9,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    98  {10,30,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    101  {11,32,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    104  {12,31,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    107  {13,45,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    110  {14,44,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    113  {15,18,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    115  {20,19,0, {1,1,1,1,1,-4,4,2,4,2,1,1,1,1,1,2,1,3,2} },
    +
    117  {30,5,1, {1,1,1,1,1} },
    +
    119  {31,5,1, {1,1,1,1,1} },
    +
    122  {40,16,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    125  {41,19,0, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    129  {42,30,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    133  {43,33,1, {1,1,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    135  {254,3,0, {1,1,4} },
    +
    138  {1000,9,0, {1,1,1,1,1,2,1,1,-4} },
    +
    141  {1001,16,0, {1,1,1,1,1,2,1,1,4,4,1,1,1,4,1,4} },
    +
    144  {1002,15,0, {1,1,1,1,1,2,1,1,-4,1,1,1,4,4,2} },
    +
    147  {1100,15,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    150  {1101,22,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,4,1,1,1,4,1,4} },
    +
    152  {32,10,1, {1,1,1,1,1,2,1,1,-2,1} },
    +
    155  {44,21,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-2,1,-1,-4,1,-1,-4} },
    +
    159  {45,24,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    163  {46,35,1, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    167  {47,38,1, {1,1,1,2,1,-1,-4,-1,-4,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    171  {48,26,0, {1,1,2,1,-1,-4,-1,-4,1,-1,-4,-1,-4,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    172 
    +
    176  {50,21,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,4,4,4,4} },
    +
    177 
    +
    181  {52,15,0, {1,1,1,1,1,1,1,1,2,1,1,-4,1,-1,-4} },
    +
    182 
    +
    185  {51,16,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1} },
    +
    186 
    +
    190  {91,36,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    195  {33,18,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1} },
    +
    200  {34,32,1, {1,1,1,1,1,2,1,1,-4,1,2,2,2,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    205  {53,19,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4} },
    +
    210  {54,22,1, {1,1,1,1,4,2,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1} },
    +
    216  {57,7,1, {1,1,2,2,2,2,1} },
    +
    221  {60,24,0, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1} },
    +
    226  {61,38,1, {1,1,1,1,1,2,1,1,-4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
    +
    232  {35,6,1, {1,1,1,1,1,1} }
    +
    233 
    +
    234 } ;
    +
    235 
    +
    236 #endif /* _pdstemplates_H */
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    #define MAXPDSTEMP
    Maximum number of templates.
    Definition: pdstemplates.h:47
    +
    g2int mappds[MAXPDSMAPLEN]
    Number of bytes for each template value.
    Definition: pdstemplates.h:58
    +
    g2int needext
    Does template need extension?
    Definition: pdstemplates.h:57
    +
    const struct pdstemplate templatespds[MAXPDSTEMP]
    Date for struct for PDS template.
    Definition: pdstemplates.h:64
    +
    #define MAXPDSMAPLEN
    Maximum template map length.
    Definition: pdstemplates.h:48
    +
    g2int template_num
    Template number.
    Definition: pdstemplates.h:55
    +
    g2int mappdslen
    The number of entries in the template.
    Definition: pdstemplates.h:56
    +
    Struct for PDS template.
    Definition: pdstemplates.h:54
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pdstemplates_8h_structpdstemplate.js b/ver-1.7.0/ver-1.6.4/pdstemplates_8h_structpdstemplate.js new file mode 100644 index 00000000..9d3866b7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pdstemplates_8h_structpdstemplate.js @@ -0,0 +1,7 @@ +var pdstemplates_8h_structpdstemplate = +[ + [ "mappds", "pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b", null ], + [ "mappdslen", "pdstemplates_8h.html#ad086e08141828302359fbd2584e15931", null ], + [ "needext", "pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4", null ], + [ "template_num", "pdstemplates_8h.html#aa220825f05131b888bc234444067d22d", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pngpack_8c.html b/ver-1.7.0/ver-1.6.4/pngpack_8c.html new file mode 100644 index 00000000..4cbbff5c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngpack_8c.html @@ -0,0 +1,273 @@ + + + + + + + +NCEPLIBS-g2c: pngpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pngpack.c File Reference
    +
    +
    + +

    Function to pack data with PNG compression. +More...

    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    int enc_png (char *, g2int, g2int, g2int, char *)
     Encode PNG. More...
     
    void pngpack (g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
     This subroutine packs up a data field into PNG image format. More...
     
    +

    Detailed Description

    +

    Function to pack data with PNG compression.

    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition in file pngpack.c.

    +

    Function Documentation

    + +

    ◆ enc_png()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int enc_png (char * data,
    g2int width,
    g2int height,
    g2int nbits,
    char * pngbuf 
    )
    +
    + +

    Encode PNG.

    +
    Parameters
    + + + + + + +
    datadata.
    widthwidth.
    heightheight.
    nbitsnumber of bits.
    pngbufPNG buffer.
    +
    +
    +
    Returns
    PNG length, or negative number for error.
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 81 of file enc_png.c.

    + +

    References user_flush_data(), and user_write_data().

    + +

    Referenced by pngpack().

    + +
    +
    + +

    ◆ pngpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void pngpack (g2floatfld,
    g2int width,
    g2int height,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    This subroutine packs up a 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
    + + + + + + + +
    fldContains the data values to pack.
    widthnumber of points in the x direction.
    heightnumber of points in the y direction.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field.
    lcpacklength of packed field cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 38 of file pngpack.c.

    + +

    References enc_png(), int_power(), mkieee(), and sbits().

    + +

    Referenced by g2_addfield().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pngpack_8c.js b/ver-1.7.0/ver-1.6.4/pngpack_8c.js new file mode 100644 index 00000000..d11fec66 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngpack_8c.js @@ -0,0 +1,5 @@ +var pngpack_8c = +[ + [ "enc_png", "pngpack_8c.html#acc060bdd051b1ac2419e8573098e67e3", null ], + [ "pngpack", "pngpack_8c.html#aead12707dbe31153a792ec922eb2fec7", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pngpack_8c_source.html b/ver-1.7.0/ver-1.6.4/pngpack_8c_source.html new file mode 100644 index 00000000..f90a241b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngpack_8c_source.html @@ -0,0 +1,212 @@ + + + + + + + +NCEPLIBS-g2c: pngpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pngpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdlib.h>
    +
    6 #include <math.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    9 int enc_png(char *, g2int, g2int, g2int, char *);
    +
    10 
    +
    37 void
    +
    38 pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl,
    +
    39  unsigned char *cpack, g2int *lcpack)
    +
    40 {
    +
    41  g2int *ifld;
    +
    42  static g2float alog2 = 0.69314718; /* ln(2.0) */
    +
    43  g2int j, nbits, imin, imax, maxdif;
    +
    44  g2int ndpts, nbytes;
    +
    45  g2float bscale, dscale, rmax, rmin, temp;
    +
    46  unsigned char *ctemp;
    +
    47 
    +
    48  ifld = 0;
    +
    49  ndpts = width * height;
    +
    50  bscale = int_power(2.0, -idrstmpl[1]);
    +
    51  dscale = int_power(10.0, idrstmpl[2]);
    +
    52 
    +
    53  /* Find max and min values in the data. */
    +
    54  rmax = fld[0];
    +
    55  rmin = fld[0];
    +
    56  for (j = 1; j < ndpts; j++)
    +
    57  {
    +
    58  if (fld[j] > rmax)
    +
    59  rmax = fld[j];
    +
    60  if (fld[j] < rmin)
    +
    61  rmin = fld[j];
    +
    62  }
    +
    63  maxdif = (g2int)rint((rmax-rmin) * dscale * bscale);
    +
    64 
    +
    65  /* If max and min values are not equal, pack up field. If they are
    +
    66  * equal, we have a constant field, and the reference value (rmin)
    +
    67  * is the value for each point in the field and set nbits to 0. */
    +
    68  if (rmin != rmax && maxdif != 0)
    +
    69  {
    +
    70  ifld = malloc(ndpts * sizeof(g2int));
    +
    71 
    +
    72  /* Determine which algorithm to use based on user-supplied
    +
    73  * binary scale factor and number of bits. */
    +
    74  if (idrstmpl[1] == 0)
    +
    75  {
    +
    76  /* No binary scaling and calculate minumum number of bits
    +
    77  * in which the data will fit. */
    +
    78  imin = (g2int)rint(rmin * dscale);
    +
    79  imax = (g2int)rint(rmax * dscale);
    +
    80  maxdif = imax - imin;
    +
    81  temp = log((double)(maxdif + 1)) / alog2;
    +
    82  nbits = (g2int)ceil(temp);
    +
    83  rmin = (g2float)imin;
    +
    84  /* scale data */
    +
    85  for(j = 0; j < ndpts; j++)
    +
    86  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
    +
    87  }
    +
    88  else
    +
    89  {
    +
    90  /* Use binary scaling factor and calculate minumum number
    +
    91  * of bits in which the data will fit. */
    +
    92  rmin = rmin * dscale;
    +
    93  rmax = rmax * dscale;
    +
    94  maxdif = (g2int)rint((rmax - rmin) * bscale);
    +
    95  temp = log((double)(maxdif + 1)) / alog2;
    +
    96  nbits = (g2int)ceil(temp);
    +
    97  /* scale data */
    +
    98  for (j = 0; j < ndpts; j++)
    +
    99  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    100  }
    +
    101 
    +
    102  /* Pack data into full octets, then do PNG encode and
    +
    103  * calculate the length of the packed data in bytes. */
    +
    104  if (nbits <= 8)
    +
    105  nbits = 8;
    +
    106  else if (nbits <= 16)
    +
    107  nbits = 16;
    +
    108  else if (nbits <= 24)
    +
    109  nbits = 24;
    +
    110  else
    +
    111  nbits = 32;
    +
    112 
    +
    113  nbytes = (nbits / 8) * ndpts;
    +
    114  ctemp = calloc(nbytes, 1);
    +
    115  sbits(ctemp, ifld, 0, nbits, 0, ndpts);
    +
    116 
    +
    117  /* Encode data into PNG Format. */
    +
    118  if ((*lcpack = (g2int)enc_png((char *)ctemp, width, height, nbits, (char *)cpack)) <= 0)
    +
    119  printf("pngpack: ERROR Packing PNG = %d\n", (int)*lcpack);
    +
    120  free(ctemp);
    +
    121  }
    +
    122  else
    +
    123  {
    +
    124  nbits = 0;
    +
    125  *lcpack = 0;
    +
    126  }
    +
    127 
    +
    128  /* Fill in ref value and number of bits in Template 5.0. */
    +
    129  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format */
    +
    130  idrstmpl[3] = nbits;
    +
    131  idrstmpl[4] = 0; /* original data were reals */
    +
    132  if (ifld)
    +
    133  free(ifld);
    +
    134 }
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    int enc_png(char *, g2int, g2int, g2int, char *)
    Encode PNG.
    Definition: enc_png.c:81
    +
    void pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
    This subroutine packs up a data field into PNG image format.
    Definition: pngpack.c:38
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pngunpack_8c.html b/ver-1.7.0/ver-1.6.4/pngunpack_8c.html new file mode 100644 index 00000000..da402051 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngunpack_8c.html @@ -0,0 +1,252 @@ + + + + + + + +NCEPLIBS-g2c: pngunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    pngunpack.c File Reference
    +
    +
    + +

    Contains a function to unpack data packed with PNG compression. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    int dec_png (unsigned char *, g2int *, g2int *, char *)
     Decode PNG. More...
     
    g2int pngunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *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...
     
    +

    Detailed Description

    +

    Contains a function to unpack data packed with PNG compression.

    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition in file pngunpack.c.

    +

    Function Documentation

    + +

    ◆ dec_png()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dec_png (unsigned char * pngbuf,
    g2intwidth,
    g2intheight,
    char * cout 
    )
    +
    + +

    Decode PNG.

    +
    Parameters
    + + + + + +
    pngbufPointer to PNG buffer.
    widthPointer to width.
    heightPointer to height.
    coutOutput buffer.
    +
    +
    +
    Returns
    0 for success, error code otherwise.
    +
    Author
    Stephen Gilbert
    + +

    Definition at line 71 of file dec_png.c.

    + +

    References user_read_data().

    + +

    Referenced by pngunpack().

    + +
    +
    + +

    ◆ pngunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int pngunpack (unsigned char * cpack,
    g2int len,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + +
    cpackThe packed data field (character*1 array).
    lenlength of packed field cpack().
    idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values.
    +
    +
    +
    Returns
    0 for success, 1 for memory allocation error.
    +
    Author
    Stephen Gilbert
    +
    Date
    2003-08-27
    + +

    Definition at line 30 of file pngunpack.c.

    + +

    References dec_png(), gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/pngunpack_8c.js b/ver-1.7.0/ver-1.6.4/pngunpack_8c.js new file mode 100644 index 00000000..d417fb3c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngunpack_8c.js @@ -0,0 +1,5 @@ +var pngunpack_8c = +[ + [ "dec_png", "pngunpack_8c.html#a40ac90d38dd9b8d7a28df5f35c1230de", null ], + [ "pngunpack", "pngunpack_8c.html#acd726669156a52a640744423669e9397", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/pngunpack_8c_source.html b/ver-1.7.0/ver-1.6.4/pngunpack_8c_source.html new file mode 100644 index 00000000..511e2112 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/pngunpack_8c_source.html @@ -0,0 +1,154 @@ + + + + + + + +NCEPLIBS-g2c: pngunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    pngunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    11 int dec_png(unsigned char *, g2int *, g2int *, char *);
    +
    12 
    +
    29 g2int
    +
    30 pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
    +
    31  g2float *fld)
    +
    32 {
    +
    33  g2int *ifld;
    +
    34  g2int j, nbits, width, height;
    +
    35  g2float ref, bscale, dscale;
    +
    36  unsigned char *ctemp;
    +
    37 
    +
    38  rdieee(idrstmpl, &ref, 1);
    +
    39  bscale = int_power(2.0, idrstmpl[1]);
    +
    40  dscale = int_power(10.0, -idrstmpl[2]);
    +
    41  nbits = idrstmpl[3];
    +
    42 
    +
    43  /* If nbits equals 0, we have a constant field where the reference
    +
    44  * value is the data value at each gridpoint. */
    +
    45  if (nbits != 0)
    +
    46  {
    +
    47  ifld = calloc(ndpts, sizeof(g2int));
    +
    48  ctemp = calloc(ndpts * 4, 1);
    +
    49  if (!ifld || !ctemp)
    +
    50  {
    +
    51  fprintf(stderr,"Could not allocate space in jpcunpack.\n Data field NOT upacked.\n");
    +
    52  return(1);
    +
    53  }
    +
    54  dec_png(cpack, &width, &height, ctemp);
    +
    55  gbits(ctemp, ifld, 0, nbits, 0, ndpts);
    +
    56  for (j = 0; j < ndpts; j++)
    +
    57  fld[j] = (((g2float)ifld[j] * bscale) + ref) * dscale;
    +
    58  free(ctemp);
    +
    59  free(ifld);
    +
    60  }
    +
    61  else
    +
    62  {
    +
    63  for (j = 0; j < ndpts; j++)
    +
    64  fld[j] = ref;
    +
    65  }
    +
    66 
    +
    67  return(0);
    +
    68 }
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    int dec_png(unsigned char *, g2int *, g2int *, char *)
    Decode PNG.
    Definition: dec_png.c:71
    +
    g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld)
    This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
    Definition: pngunpack.c:30
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/rdieee_8c.html b/ver-1.7.0/ver-1.6.4/rdieee_8c.html new file mode 100644 index 00000000..7775b910 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/rdieee_8c.html @@ -0,0 +1,173 @@ + + + + + + + +NCEPLIBS-g2c: rdieee.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    rdieee.c File Reference
    +
    +
    + +

    Read a list of real values in 32-bit IEEE floating point format. +More...

    +
    #include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void rdieee (g2int *rieee, g2float *a, g2int num)
     This subroutine reads a list of real values in 32-bit IEEE floating point format. More...
     
    +

    Detailed Description

    +

    Read a list of real values in 32-bit IEEE floating point format.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition in file rdieee.c.

    +

    Function Documentation

    + +

    ◆ rdieee()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void rdieee (g2intrieee,
    g2floata,
    g2int num 
    )
    +
    + +

    This subroutine reads a list of real values in 32-bit IEEE floating point format.

    +
    Parameters
    + + + + +
    rieeeg2int array of floating point values in 32-bit IEEE format.
    numNumber of floating point values to convert.
    afloat array of real values. a must be allocated with at least 4*num bytes of memory before calling this function.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-25
    + +

    Definition at line 20 of file rdieee.c.

    + +

    References int_power().

    + +

    Referenced by comunpack(), g2_miss(), g2_unpack4(), g2_unpack7(), jpcunpack(), misspack(), pngunpack(), simunpack(), and specunpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/rdieee_8c.js b/ver-1.7.0/ver-1.6.4/rdieee_8c.js new file mode 100644 index 00000000..ddc8c4e5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/rdieee_8c.js @@ -0,0 +1,4 @@ +var rdieee_8c = +[ + [ "rdieee", "rdieee_8c.html#a765d8cfa0519cce8a36953120263ba51", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/rdieee_8c_source.html b/ver-1.7.0/ver-1.6.4/rdieee_8c_source.html new file mode 100644 index 00000000..53ae9bdc --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/rdieee_8c_source.html @@ -0,0 +1,157 @@ + + + + + + + +NCEPLIBS-g2c: rdieee.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    rdieee.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include "grib2.h"
    +
    7 
    +
    20 void rdieee(g2int *rieee,g2float *a,g2int num)
    +
    21 {
    +
    22 
    +
    23  g2int j;
    +
    24  g2int isign,iexp,imant;
    +
    25 
    +
    26  g2float sign,temp;
    +
    27  static g2float two23,two126;
    +
    28  static g2int test=0;
    +
    29  g2intu msk1=0x80000000; // 10000000000000000000000000000000 binary
    +
    30  g2int msk2=0x7F800000; // 01111111100000000000000000000000 binary
    +
    31  g2int msk3=0x007FFFFF; // 00000000011111111111111111111111 binary
    +
    32 
    +
    33  if ( test == 0 ) {
    +
    34  two23=(g2float)int_power(2.0,-23);
    +
    35  two126=(g2float)int_power(2.0,-126);
    +
    36  test=1;
    +
    37  }
    +
    38 
    +
    39  for (j=0;j<num;j++) {
    +
    40 //
    +
    41 // Extract sign bit, exponent, and mantissa
    +
    42 //
    +
    43  isign=(rieee[j]&msk1)>>31;
    +
    44  iexp=(rieee[j]&msk2)>>23;
    +
    45  imant=(rieee[j]&msk3);
    +
    46  //printf("SAGieee= %ld %ld %ld\n",isign,iexp,imant);
    +
    47 
    +
    48  sign=1.0;
    +
    49  if (isign == 1) sign=-1.0;
    +
    50 
    +
    51  if ( (iexp > 0) && (iexp < 255) ) {
    +
    52  temp=(g2float)int_power(2.0,(iexp-127));
    +
    53  a[j]=sign*temp*(1.0+(two23*(g2float)imant));
    +
    54  }
    +
    55  else if ( iexp == 0 ) {
    +
    56  if ( imant != 0 )
    +
    57  a[j]=sign*two126*two23*(g2float)imant;
    +
    58  else
    +
    59  a[j]=sign*0.0;
    +
    60 
    +
    61  }
    +
    62  else if ( iexp == 255 )
    +
    63  a[j]=sign*(1E+37);
    +
    64 
    +
    65 
    +
    66  }
    +
    67 
    +
    68 }
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    uint64_t g2intu
    Unsigned long integer type.
    Definition: grib2.h:21
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/reduce_8c.html b/ver-1.7.0/ver-1.6.4/reduce_8c.html new file mode 100644 index 00000000..67d8ba78 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/reduce_8c.html @@ -0,0 +1,322 @@ + + + + + + + +NCEPLIBS-g2c: reduce.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    reduce.c File Reference
    +
    +
    + +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment. +More...

    +
    #include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Typedefs

    typedef g2int integer
     Integer type. More...
     
    typedef g2float real
     Float type. More...
     
    + + + + +

    +Functions

    int reduce (integer *kfildo, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *ibxx2, integer *ier)
     Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment. More...
     
    +

    Detailed Description

    +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.

    +
    Author
    Harry Glahn, The Meteorological Development Lab (MDL)
    +
    Date
    November 2001
    + +

    Definition in file reduce.c.

    +

    Typedef Documentation

    + +

    ◆ integer

    + +
    +
    + + + + +
    typedef g2int integer
    +
    + +

    Integer type.

    + +

    Definition at line 14 of file reduce.c.

    + +
    +
    + +

    ◆ real

    + +
    +
    + + + + +
    typedef g2float real
    +
    + +

    Float type.

    + +

    Definition at line 15 of file reduce.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ reduce()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int reduce (integerkfildo,
    integerjmin,
    integerjmax,
    integerlbit,
    integernov,
    integerlx,
    integerndg,
    integeribit,
    integerjbit,
    integerkbit,
    integernovref,
    integeribxx2,
    integerier 
    )
    +
    + +

    Determines whether the number of groups should be increased in order to reduce the size of the large groups, and to make that adjustment.

    +

    By reducing the size of the large groups, less bits may be necessary for packing the group sizes and all the information about the groups.

    +

    The reference for nov was removed in the calling routine so that kbit could be determined. This furnishes a starting point for the iterations in reduce. However, the reference must be considered.

    +

    PROGRAM HISTORY LOG

      +
    • November 2001 Harry Glahn, The Meteorological Development Lab (MDL) tdl grib2
    • +
    • March 2002 Harry Glahn, The Meteorological Development Lab (MDL) comment ier = 715
    • +
    • March 2002 Harry Glahn, The Meteorological Development Lab (MDL) modified to accommodate lx=1 on entry
    • +
    +

    DATA SET USE

      +
    • kfildo - unit number for output (print) file. (output)
    • +
    +
    Parameters
    + + + + + + + + + + + + + + +
    kfildounit number for output (print) file. (input)
    jminthe minimum of each group (j=1,lx). it is possible after splitting the groups, jmin( ) will not be the minimum of the new group. this doesn't matter; jmin( ) is really the group reference and doesn't have to be the smallest value. (input/output)
    jmaxthe maximum of each group (j=1,lx). (input/output)
    lbitthe number of bits necessary to pack each group (j=1,lx). (input/output)
    novthe number of values in each group (j=1,lx). (input/output)
    lxthe number of groups. this will be increased if groups are split. (input/output)
    ndgthe dimension of jmin( ), jmax( ), lbit( ), and nov( ). (input)
    ibitthe number of bits necessary to pack the jmin(j) values, j=1,lx. (input)
    jbitthe number of bits necessary to pack the lbit(j) values, j=1,lx. (input)
    kbitthe number of bits necessary to pack the nov(j) values, j=1,lx. if the groups are split, kbit is reduced. (input/output)
    novrefreference value for nov( ). (input)
    ibxx22**j (j=0,30). (input)
    iererror return. (output)
      +
    • 0 = good return.
    • +
    • 714 = problem in algorithm. reduce aborted.
    • +
    • 715 = ngp not large enough. reduce aborted.
    • +
    +
    +
    +
    +
    Returns
    always returns 0, see parameter ier for error code.
    +
    +ntotbt(j) = the total bits used for the packing bits j
    +                      (j=1,30). (internal)
    + nboxj(j) = new boxes needed for the packing bits j
    +                      (j=1,30). (internal)
    +          newbox(l) = number of new boxes (groups) for each original
    +                      group (l=1,lx) for the current j. (automatic)
    +                      (internal)
    +         newboxp(l) = same as newbox( ) but for the previous j.
    +                      this eliminates recomputation. (automatic)
    +                      (internal)
    +              cfeed = contains the character representation
    +                      of a printer form feed. (character) (internal)
    +              ifeed = contains the integer value of a printer
    +                      form feed. (internal)
    +             iorigb = the original number of bits necessary
    +                      for the group values. (internal)
    +
    Author
    Harry Glahn, The Meteorological Development Lab (MDL)
    +
    Date
    November 2001
    + +

    Definition at line 91 of file reduce.c.

    + +

    Referenced by pack_gp().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/reduce_8c.js b/ver-1.7.0/ver-1.6.4/reduce_8c.js new file mode 100644 index 00000000..42f6515e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/reduce_8c.js @@ -0,0 +1,6 @@ +var reduce_8c = +[ + [ "integer", "reduce_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0", null ], + [ "real", "reduce_8c.html#a89da8542e27ccdbb1a823eaa5af3c1f2", null ], + [ "reduce", "reduce_8c.html#af04821cf86c45e835953c94f4d9db177", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/reduce_8c_source.html b/ver-1.7.0/ver-1.6.4/reduce_8c_source.html new file mode 100644 index 00000000..6cdb77b1 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/reduce_8c_source.html @@ -0,0 +1,430 @@ + + + + + + + +NCEPLIBS-g2c: reduce.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    reduce.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    11 /*#include "f2c.h"*/
    +
    12 #include <stdlib.h>
    +
    13 #include "grib2.h"
    +
    14 typedef g2int integer;
    +
    15 typedef g2float real;
    +
    90 int
    +
    91 reduce(integer *kfildo, integer *jmin, integer *jmax,
    +
    92  integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit,
    +
    93  integer *jbit, integer *kbit, integer *novref, integer *ibxx2,
    +
    94  integer *ier)
    +
    95 {
    +
    96  /* Initialized data */
    +
    97 
    +
    98  static integer ifeed = 12;
    +
    99 
    +
    100  /* System generated locals */
    +
    101  integer i__1, i__2;
    +
    102 
    +
    103  /* Local variables */
    +
    104  static integer newboxtp, j, l, m, jj, lxn, left;
    +
    105  static real pimp;
    +
    106  static integer move, novl;
    +
    107  static char cfeed[1];
    +
    108  static integer nboxj[31], lxnkp, iorigb, ibxx2m1, movmin,
    +
    109  ntotbt[31], ntotpr, newboxt;
    +
    110  integer *newbox, *newboxp;
    +
    111 
    +
    112 /* NEWBOX( ) AND NEWBOXP( ) were AUTOMATIC ARRAYS. */
    +
    113  newbox = (integer *)calloc(*ndg,sizeof(integer));
    +
    114  newboxp = (integer *)calloc(*ndg,sizeof(integer));
    +
    115 
    +
    116  /* Parameter adjustments */
    +
    117  --nov;
    +
    118  --lbit;
    +
    119  --jmax;
    +
    120  --jmin;
    +
    121 
    +
    122  /* Function Body */
    +
    123 
    +
    124  *ier = 0;
    +
    125  if (*lx == 1) {
    +
    126  goto L410;
    +
    127  }
    +
    128 /* IF THERE IS ONLY ONE GROUP, RETURN. */
    +
    129 
    +
    130  *(unsigned char *)cfeed = (char) ifeed;
    +
    131 
    +
    132 /* INITIALIZE NUMBER OF NEW BOXES PER GROUP TO ZERO. */
    +
    133 
    +
    134  i__1 = *lx;
    +
    135  for (l = 1; l <= i__1; ++l) {
    +
    136  newbox[l - 1] = 0;
    +
    137 /* L110: */
    +
    138  }
    +
    139 
    +
    140 /* INITIALIZE NUMBER OF TOTAL NEW BOXES PER J TO ZERO. */
    +
    141 
    +
    142  for (j = 1; j <= 31; ++j) {
    +
    143  ntotbt[j - 1] = 999999999;
    +
    144  nboxj[j - 1] = 0;
    +
    145 /* L112: */
    +
    146  }
    +
    147 
    +
    148  iorigb = (*ibit + *jbit + *kbit) * *lx;
    +
    149 /* IBIT = BITS TO PACK THE JMIN( ). */
    +
    150 /* JBIT = BITS TO PACK THE LBIT( ). */
    +
    151 /* KBIT = BITS TO PACK THE NOV( ). */
    +
    152 /* LX = NUMBER OF GROUPS. */
    +
    153  ntotbt[*kbit - 1] = iorigb;
    +
    154 /* THIS IS THE VALUE OF TOTAL BITS FOR THE ORIGINAL LX */
    +
    155 /* GROUPS, WHICH REQUIRES KBITS TO PACK THE GROUP */
    +
    156 /* LENGHTS. SETTING THIS HERE MAKES ONE LESS LOOPS */
    +
    157 /* NECESSARY BELOW. */
    +
    158 
    +
    159 /* COMPUTE BITS NOW USED FOR THE PARAMETERS DEFINED. */
    +
    160 
    +
    161 /* DETERMINE OTHER POSSIBILITES BY INCREASING LX AND DECREASING */
    +
    162 /* NOV( ) WITH VALUES GREATER THAN THRESHOLDS. ASSUME A GROUP IS */
    +
    163 /* SPLIT INTO 2 OR MORE GROUPS SO THAT KBIT IS REDUCED WITHOUT */
    +
    164 /* CHANGING IBIT OR JBIT. */
    +
    165 
    +
    166  jj = 0;
    +
    167 
    +
    168 /* Computing MIN */
    +
    169  i__1 = 30, i__2 = *kbit - 1;
    +
    170  /*for (j = min(i__1,i__2); j >= 2; --j) {*/
    +
    171  for (j = (i__1 < i__2) ? i__1 : i__2; j >= 2; --j) {
    +
    172 /* VALUES GE KBIT WILL NOT REQUIRE SPLITS. ONCE THE TOTAL */
    +
    173 /* BITS START INCREASING WITH DECREASING J, STOP. ALSO, THE */
    +
    174 /* NUMBER OF BITS REQUIRED IS KNOWN FOR KBITS = NTOTBT(KBIT). */
    +
    175 
    +
    176  newboxt = 0;
    +
    177 
    +
    178  i__1 = *lx;
    +
    179  for (l = 1; l <= i__1; ++l) {
    +
    180 
    +
    181  if (nov[l] < ibxx2[j]) {
    +
    182  newbox[l - 1] = 0;
    +
    183 /* NO SPLITS OR NEW BOXES. */
    +
    184  goto L190;
    +
    185  } else {
    +
    186  novl = nov[l];
    +
    187 
    +
    188  m = (nov[l] - 1) / (ibxx2[j] - 1) + 1;
    +
    189 /* M IS FOUND BY SOLVING THE EQUATION BELOW FOR M: */
    +
    190 /* (NOV(L)+M-1)/M LT IBXX2(J) */
    +
    191 /* M GT (NOV(L)-1)/(IBXX2(J)-1) */
    +
    192 /* SET M = (NOV(L)-1)/(IBXX2(J)-1)+1 */
    +
    193  L130:
    +
    194  novl = (nov[l] + m - 1) / m;
    +
    195 /* THE +M-1 IS NECESSARY. FOR INSTANCE, 15 WILL FIT */
    +
    196 /* INTO A BOX 4 BITS WIDE, BUT WON'T DIVIDE INTO */
    +
    197 /* TWO BOXES 3 BITS WIDE EACH. */
    +
    198 
    +
    199  if (novl < ibxx2[j]) {
    +
    200  goto L185;
    +
    201  } else {
    +
    202  ++m;
    +
    203 /* *** WRITE(KFILDO,135)L,NOV(L),NOVL,M,J,IBXX2(J) */
    +
    204 /* *** 135 FORMAT(/' AT 135--L,NOV(L),NOVL,M,J,IBXX2(J)',6I10) */
    +
    205  goto L130;
    +
    206  }
    +
    207 
    +
    208 /* THE ABOVE DO LOOP WILL NEVER COMPLETE. */
    +
    209  }
    +
    210 
    +
    211  L185:
    +
    212  newbox[l - 1] = m - 1;
    +
    213  newboxt = newboxt + m - 1;
    +
    214  L190:
    +
    215  ;
    +
    216  }
    +
    217 
    +
    218  nboxj[j - 1] = newboxt;
    +
    219  ntotpr = ntotbt[j];
    +
    220  ntotbt[j - 1] = (*ibit + *jbit) * (*lx + newboxt) + j * (*lx +
    +
    221  newboxt);
    +
    222 
    +
    223  if (ntotbt[j - 1] >= ntotpr) {
    +
    224  jj = j + 1;
    +
    225 /* THE PLUS IS USED BECAUSE J DECREASES PER ITERATION. */
    +
    226  goto L250;
    +
    227  } else {
    +
    228 
    +
    229 /* SAVE THE TOTAL NEW BOXES AND NEWBOX( ) IN CASE THIS */
    +
    230 /* IS THE J TO USE. */
    +
    231 
    +
    232  newboxtp = newboxt;
    +
    233 
    +
    234  i__1 = *lx;
    +
    235  for (l = 1; l <= i__1; ++l) {
    +
    236  newboxp[l - 1] = newbox[l - 1];
    +
    237 /* L195: */
    +
    238  }
    +
    239 
    +
    240 /* WRITE(KFILDO,197)NEWBOXT,IBXX2(J) */
    +
    241 /* 197 FORMAT(/' *****************************************' */
    +
    242 /* 1 /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
    +
    243 /* 2 I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
    +
    244 /* 3 /' *****************************************') */
    +
    245 /* WRITE(KFILDO,198) (NEWBOX(L),L=1,LX) */
    +
    246 /* 198 FORMAT(/' '20I6/(' '20I6)) */
    +
    247  }
    +
    248 
    +
    249 /* 205 WRITE(KFILDO,209)KBIT,IORIGB */
    +
    250 /* 209 FORMAT(/' ORIGINAL BITS WITH KBIT OF',I5,' =',I10) */
    +
    251 /* WRITE(KFILDO,210)(N,N=2,10),(IBXX2(N),N=2,10), */
    +
    252 /* 1 (NTOTBT(N),N=2,10),(NBOXJ(N),N=2,10), */
    +
    253 /* 2 (N,N=11,20),(IBXX2(N),N=11,20), */
    +
    254 /* 3 (NTOTBT(N),N=11,20),(NBOXJ(N),N=11,20), */
    +
    255 /* 4 (N,N=21,30),(IBXX2(N),N=11,20), */
    +
    256 /* 5 (NTOTBT(N),N=21,30),(NBOXJ(N),N=21,30) */
    +
    257 /* 210 FORMAT(/' THE TOTAL BYTES FOR MAXIMUM GROUP LENGTHS BY ROW'// */
    +
    258 /* 1 ' J = THE NUMBER OF BITS PER GROUP LENGTH'/ */
    +
    259 /* 2 ' IBXX2(J) = THE MAXIMUM GROUP LENGTH PLUS 1 FOR THIS J'/ */
    +
    260 /* 3 ' NTOTBT(J) = THE TOTAL BITS FOR THIS J'/ */
    +
    261 /* 4 ' NBOXJ(J) = THE NEW GROUPS FOR THIS J'/ */
    +
    262 /* 5 4(/10X,9I10)/4(/10I10)/4(/10I10)) */
    +
    263 
    +
    264 /* L200: */
    +
    265  }
    +
    266 
    +
    267 L250:
    +
    268  pimp = (iorigb - ntotbt[jj - 1]) / (real) iorigb * 100.f;
    +
    269 /* WRITE(KFILDO,252)PIMP,KBIT,JJ */
    +
    270 /* 252 FORMAT(/' PERCENT IMPROVEMENT =',F6.1, */
    +
    271 /* 1 ' BY DECREASING GROUP LENGTHS FROM',I4,' TO',I4,' BITS') */
    +
    272  if (pimp >= 2.f) {
    +
    273 
    +
    274 /* WRITE(KFILDO,255)CFEED,NEWBOXTP,IBXX2(JJ) */
    +
    275 /* 255 FORMAT(A1,/' *****************************************' */
    +
    276 /* 1 /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
    +
    277 /* 2 I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
    +
    278 /* 2 /' *****************************************') */
    +
    279 /* WRITE(KFILDO,256) (NEWBOXP(L),L=1,LX) */
    +
    280 /* 256 FORMAT(/' '20I6) */
    +
    281 
    +
    282 /* ADJUST GROUP LENGTHS FOR MAXIMUM LENGTH OF JJ BITS. */
    +
    283 /* THE MIN PER GROUP AND THE NUMBER OF BITS REQUIRED */
    +
    284 /* PER GROUP ARE NOT CHANGED. THIS MAY MEAN THAT A */
    +
    285 /* GROUP HAS A MIN (OR REFERENCE) THAT IS NOT ZERO. */
    +
    286 /* THIS SHOULD NOT MATTER TO THE UNPACKER. */
    +
    287 
    +
    288  lxnkp = *lx + newboxtp;
    +
    289 /* LXNKP = THE NEW NUMBER OF BOXES */
    +
    290 
    +
    291  if (lxnkp > *ndg) {
    +
    292 /* DIMENSIONS NOT LARGE ENOUGH. PROBABLY AN ERROR */
    +
    293 /* OF SOME SORT. ABORT. */
    +
    294 /* WRITE(KFILDO,257)NDG,LXNPK */
    +
    295 /* 1 2 3 4 5 6 7 X */
    +
    296 /* 257 FORMAT(/' DIMENSIONS OF JMIN, ETC. IN REDUCE =',I8, */
    +
    297 /* 1 ' NOT LARGE ENOUGH FOR THE EXPANDED NUMBER OF', */
    +
    298 /* 2 ' GROUPS =',I8,'. ABORT REDUCE.') */
    +
    299  *ier = 715;
    +
    300  goto L410;
    +
    301 /* AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
    +
    302 /* WITHOUT CALLING REDUCE. */
    +
    303  }
    +
    304 
    +
    305  lxn = lxnkp;
    +
    306 /* LXN IS THE NUMBER OF THE BOX IN THE NEW SERIES BEING */
    +
    307 /* FILLED. IT DECREASES PER ITERATION. */
    +
    308  ibxx2m1 = ibxx2[jj] - 1;
    +
    309 /* IBXX2M1 IS THE MAXIMUM NUMBER OF VALUES PER GROUP. */
    +
    310 
    +
    311  for (l = *lx; l >= 1; --l) {
    +
    312 
    +
    313 /* THE VALUES IS NOV( ) REPRESENT THOSE VALUES + NOVREF. */
    +
    314 /* WHEN VALUES ARE MOVED TO ANOTHER BOX, EACH VALUE */
    +
    315 /* MOVED TO A NEW BOX REPRESENTS THAT VALUE + NOVREF. */
    +
    316 /* THIS HAS TO BE CONSIDERED IN MOVING VALUES. */
    +
    317 
    +
    318  if (newboxp[l - 1] * (ibxx2m1 + *novref) + *novref > nov[l] + *
    +
    319  novref) {
    +
    320 /* IF THE ABOVE TEST IS MET, THEN MOVING IBXX2M1 VALUES */
    +
    321 /* FOR ALL NEW BOXES WILL LEAVE A NEGATIVE NUMBER FOR */
    +
    322 /* THE LAST BOX. NOT A TOLERABLE SITUATION. */
    +
    323  movmin = (nov[l] - newboxp[l - 1] * *novref) / newboxp[l - 1];
    +
    324  left = nov[l];
    +
    325 /* LEFT = THE NUMBER OF VALUES TO MOVE FROM THE ORIGINAL */
    +
    326 /* BOX TO EACH NEW BOX EXCEPT THE LAST. LEFT IS THE */
    +
    327 /* NUMBER LEFT TO MOVE. */
    +
    328  } else {
    +
    329  movmin = ibxx2m1;
    +
    330 /* MOVMIN VALUES CAN BE MOVED FOR EACH NEW BOX. */
    +
    331  left = nov[l];
    +
    332 /* LEFT IS THE NUMBER OF VALUES LEFT TO MOVE. */
    +
    333  }
    +
    334 
    +
    335  if (newboxp[l - 1] > 0) {
    +
    336  if ((movmin + *novref) * newboxp[l - 1] + *novref <= nov[l] +
    +
    337  *novref && (movmin + *novref) * (newboxp[l - 1] + 1)
    +
    338  >= nov[l] + *novref) {
    +
    339  goto L288;
    +
    340  } else {
    +
    341 /* ***D WRITE(KFILDO,287)L,MOVMIN,NOVREF,NEWBOXP(L),NOV(L) */
    +
    342 /* ***D287 FORMAT(/' AT 287 IN REDUCE--L,MOVMIN,NOVREF,', */
    +
    343 /* ***D 1 'NEWBOXP(L),NOV(L)',5I12 */
    +
    344 /* ***D 2 ' REDUCE ABORTED.') */
    +
    345 /* WRITE(KFILDO,2870) */
    +
    346 /* 2870 FORMAT(/' AN ERROR IN REDUCE ALGORITHM. ABORT REDUCE.') */
    +
    347  *ier = 714;
    +
    348  goto L410;
    +
    349 /* AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
    +
    350 /* WITHOUT CALLING REDUCE. */
    +
    351  }
    +
    352 
    +
    353  }
    +
    354 
    +
    355  L288:
    +
    356  i__1 = newboxp[l - 1] + 1;
    +
    357  for (j = 1; j <= i__1; ++j) {
    +
    358  /*move = min(movmin,left);*/
    +
    359  move = (movmin < left) ? movmin : left;
    +
    360  jmin[lxn] = jmin[l];
    +
    361  jmax[lxn] = jmax[l];
    +
    362  lbit[lxn] = lbit[l];
    +
    363  nov[lxn] = move;
    +
    364  --lxn;
    +
    365  left -= move + *novref;
    +
    366 /* THE MOVE OF MOVE VALUES REALLY REPRESENTS A MOVE OF */
    +
    367 /* MOVE + NOVREF VALUES. */
    +
    368 /* L290: */
    +
    369  }
    +
    370 
    +
    371  if (left != -(*novref)) {
    +
    372 /* *** WRITE(KFILDO,292)L,LXN,MOVE,LXNKP,IBXX2(JJ),LEFT,NOV(L), */
    +
    373 /* *** 1 MOVMIN */
    +
    374 /* *** 292 FORMAT(' AT 292 IN REDUCE--L,LXN,MOVE,LXNKP,', */
    +
    375 /* *** 1 'IBXX2(JJ),LEFT,NOV(L),MOVMIN'/8I12) */
    +
    376  }
    +
    377 
    +
    378 /* L300: */
    +
    379  }
    +
    380 
    +
    381  *lx = lxnkp;
    +
    382 /* LX IS NOW THE NEW NUMBER OF GROUPS. */
    +
    383  *kbit = jj;
    +
    384 /* KBIT IS NOW THE NEW NUMBER OF BITS REQUIRED FOR PACKING */
    +
    385 /* GROUP LENGHTS. */
    +
    386  }
    +
    387 
    +
    388 /* WRITE(KFILDO,406)CFEED,LX */
    +
    389 /* 406 FORMAT(A1,/' *****************************************' */
    +
    390 /* 1 /' THE GROUP SIZES NOV( ) AFTER REDUCTION IN SIZE', */
    +
    391 /* 2 ' FOR'I10,' GROUPS', */
    +
    392 /* 3 /' *****************************************') */
    +
    393 /* WRITE(KFILDO,407) (NOV(J),J=1,LX) */
    +
    394 /* 407 FORMAT(/' '20I6) */
    +
    395 /* WRITE(KFILDO,408)CFEED,LX */
    +
    396 /* 408 FORMAT(A1,/' *****************************************' */
    +
    397 /* 1 /' THE GROUP MINIMA JMIN( ) AFTER REDUCTION IN SIZE', */
    +
    398 /* 2 ' FOR'I10,' GROUPS', */
    +
    399 /* 3 /' *****************************************') */
    +
    400 /* WRITE(KFILDO,409) (JMIN(J),J=1,LX) */
    +
    401 /* 409 FORMAT(/' '20I6) */
    +
    402 
    +
    403 L410:
    +
    404  if ( newbox != 0 ) free(newbox);
    +
    405  if ( newboxp != 0 ) free(newboxp);
    +
    406  return 0;
    +
    407 } /* reduce_ */
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    g2int integer
    Integer type.
    Definition: pack_gp.c:8
    +
    g2int integer
    Integer type.
    Definition: reduce.c:14
    +
    g2float real
    Float type.
    Definition: reduce.c:15
    +
    int reduce(integer *kfildo, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *ibxx2, integer *ier)
    Determines whether the number of groups should be increased in order to reduce the size of the large ...
    Definition: reduce.c:91
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/resize.js b/ver-1.7.0/ver-1.6.4/resize.js new file mode 100644 index 00000000..e1ad0fe3 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/resize.js @@ -0,0 +1,140 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initResizable() +{ + var cookie_namespace = 'doxygen'; + var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight; + + function readCookie(cookie) + { + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) { + var index = document.cookie.indexOf(myCookie); + if (index != -1) { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + return 0; + } + + function writeCookie(cookie, val, expiration) + { + if (val==undefined) return; + if (expiration == null) { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + } + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; + } + + function resizeWidth() + { + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + writeCookie('width',sidenavWidth-barWidth, null); + } + + function restoreWidth(navWidth) + { + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight() + { + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + content.css({height:windowHeight + "px"}); + navtree.css({height:windowHeight + "px"}); + sidenav.css({height:windowHeight + "px"}); + var width=$(window).width(); + if (width!=collapsedWidth) { + if (width=desktop_vp) { + if (!collapsed) { + collapseExpand(); + } + } else if (width>desktop_vp && collapsedWidth0) { + restoreWidth(0); + collapsed=true; + } + else { + var width = readCookie('width'); + if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } + collapsed=false; + } + } + + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + $(window).resize(function() { resizeHeight(); }); + var device = navigator.userAgent.toLowerCase(); + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + var width = readCookie('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/ver-1.7.0/ver-1.6.4/search/all_0.html b/ver-1.7.0/ver-1.6.4/search/all_0.html new file mode 100644 index 00000000..1ec5b2d5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_0.js b/ver-1.7.0/ver-1.6.4/search/all_0.js new file mode 100644 index 00000000..8708ca87 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bmap_0',['bmap',['../grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_1.html b/ver-1.7.0/ver-1.6.4/search/all_1.html new file mode 100644 index 00000000..9f80e904 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_1.js b/ver-1.7.0/ver-1.6.4/search/all_1.js new file mode 100644 index 00000000..378cc951 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_1.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['cmplxpack_1',['cmplxpack',['../cmplxpack_8c.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c'],['../g2__addfield_8c.html#a65f21910802e4f976ca833f1eca18dfe',1,'cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): cmplxpack.c']]], + ['cmplxpack_2ec_2',['cmplxpack.c',['../cmplxpack_8c.html',1,'']]], + ['compack_3',['compack',['../compack_8c.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c'],['../grib2_8h.html#af29cd0a48b10eb36018a46cee9d3b51b',1,'compack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): compack.c']]], + ['compack_2ec_4',['compack.c',['../compack_8c.html',1,'']]], + ['comunpack_5',['comunpack',['../comunpack_8c.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c'],['../g2__unpack7_8c.html#a425a343ae39d48b54346b391c5af90f0',1,'comunpack(unsigned char *, g2int, g2int, g2int *, g2int, g2float *): comunpack.c']]], + ['comunpack_2ec_6',['comunpack.c',['../comunpack_8c.html',1,'']]], + ['coord_5flist_7',['coord_list',['../grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_10.html b/ver-1.7.0/ver-1.6.4/search/all_10.html new file mode 100644 index 00000000..3bf11961 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_10.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_10.js b/ver-1.7.0/ver-1.6.4/search/all_10.js new file mode 100644 index 00000000..06f67675 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['version_176',['version',['../grib2_8h.html#ac1a18226d7790431bad8b065f85befa5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_2.html b/ver-1.7.0/ver-1.6.4/search/all_2.html new file mode 100644 index 00000000..02cfffc2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_2.js b/ver-1.7.0/ver-1.6.4/search/all_2.js new file mode 100644 index 00000000..2761f9a0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_2.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['dec_5fjpeg2000_8',['dec_jpeg2000',['../dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c'],['../jpcunpack_8c.html#ab5842a1a8efddeee4661a9cd4607750d',1,'dec_jpeg2000(char *, g2int, g2int *): dec_jpeg2000.c']]], + ['dec_5fjpeg2000_2ec_9',['dec_jpeg2000.c',['../dec__jpeg2000_8c.html',1,'']]], + ['dec_5fpng_10',['dec_png',['../dec__png_8c.html#a2d370c4ca9daeca099b249a1ed3e4500',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, char *cout): dec_png.c'],['../pngunpack_8c.html#a40ac90d38dd9b8d7a28df5f35c1230de',1,'dec_png(unsigned char *, g2int *, g2int *, char *): dec_png.c']]], + ['dec_5fpng_2ec_11',['dec_png.c',['../dec__png_8c.html',1,'']]], + ['decenc_5fopenjpeg_2ec_12',['decenc_openjpeg.c',['../decenc__openjpeg_8c.html',1,'']]], + ['discipline_13',['discipline',['../grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574',1,'gribfield']]], + ['drstemplate_14',['drstemplate',['../drstemplates_8h.html#structdrstemplate',1,'']]], + ['drstemplates_2ec_15',['drstemplates.c',['../drstemplates_8c.html',1,'']]], + ['drstemplates_2eh_16',['drstemplates.h',['../drstemplates_8h.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_3.html b/ver-1.7.0/ver-1.6.4/search/all_3.html new file mode 100644 index 00000000..39767b85 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_3.js b/ver-1.7.0/ver-1.6.4/search/all_3.js new file mode 100644 index 00000000..de5235f7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_3.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['enc_5fjpeg2000_17',['enc_jpeg2000',['../enc__jpeg2000_8c.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c'],['../jpcpack_8c.html#a8a415bdd3beda56d05a706a614608a7c',1,'enc_jpeg2000(unsigned char *, g2int, g2int, g2int, g2int, g2int, g2int, char *, g2int): enc_jpeg2000.c']]], + ['enc_5fjpeg2000_2ec_18',['enc_jpeg2000.c',['../enc__jpeg2000_8c.html',1,'']]], + ['enc_5fpng_19',['enc_png',['../enc__png_8c.html#a0f4eb9634c16b9a7d55002bddcaa9449',1,'enc_png(char *data, g2int width, g2int height, g2int nbits, char *pngbuf): enc_png.c'],['../pngpack_8c.html#acc060bdd051b1ac2419e8573098e67e3',1,'enc_png(char *, g2int, g2int, g2int, char *): enc_png.c']]], + ['enc_5fpng_2ec_20',['enc_png.c',['../enc__png_8c.html',1,'']]], + ['expanded_21',['expanded',['../grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20',1,'gribfield']]], + ['ext_22',['ext',['../grib2_8h.html#a312a417c8e6f68bea7bfe86268c16594',1,'gtemplate']]], + ['extdrstemplate_23',['extdrstemplate',['../drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c'],['../grib2_8h.html#a3f9e059d95b70f538f9c2c8991e32cd4',1,'extdrstemplate(g2int, g2int *): drstemplates.c']]], + ['extgridtemplate_24',['extgridtemplate',['../gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c'],['../grib2_8h.html#ae9558def8f621d909934341dae971e4d',1,'extgridtemplate(g2int, g2int *): gridtemplates.c']]], + ['extlen_25',['extlen',['../grib2_8h.html#a743151a1bde2a21603926e1541baa5de',1,'gtemplate']]], + ['extpdstemplate_26',['extpdstemplate',['../pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c'],['../grib2_8h.html#abfcda5b8de694e1e37e1343f8dae0980',1,'extpdstemplate(g2int, g2int *): pdstemplates.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_4.html b/ver-1.7.0/ver-1.6.4/search/all_4.html new file mode 100644 index 00000000..fc40463c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_4.js b/ver-1.7.0/ver-1.6.4/search/all_4.js new file mode 100644 index 00000000..567be8ed --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['false_5f_27',['FALSE_',['../pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d',1,'pack_gp.c']]], + ['fld_28',['fld',['../grib2_8h.html#ade69d8c093b2aa18c720c833def6198f',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_5.html b/ver-1.7.0/ver-1.6.4/search/all_5.html new file mode 100644 index 00000000..9dd9344b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_5.js b/ver-1.7.0/ver-1.6.4/search/all_5.js new file mode 100644 index 00000000..05df4d70 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_5.js @@ -0,0 +1,59 @@ +var searchData= +[ + ['g2_5faddfield_29',['g2_addfield',['../g2__addfield_8c.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c'],['../grib2_8h.html#ad246d411efa50751af412bb9c79fa2af',1,'g2_addfield(unsigned char *, g2int, g2int *, g2float *, g2int, g2int, g2int *, g2float *, g2int, g2int, g2int *): g2_addfield.c']]], + ['g2_5faddfield_2ec_30',['g2_addfield.c',['../g2__addfield_8c.html',1,'']]], + ['g2_5faddgrid_31',['g2_addgrid',['../grib2_8h.html#a232f92335d98c2b6eb4f0d831691817e',1,'g2_addgrid(unsigned char *, g2int *, g2int *, g2int *, g2int): g2_addgrid.c'],['../g2__addgrid_8c.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c']]], + ['g2_5faddgrid_2ec_32',['g2_addgrid.c',['../g2__addgrid_8c.html',1,'']]], + ['g2_5faddlocal_33',['g2_addlocal',['../g2__addlocal_8c.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c'],['../grib2_8h.html#ab4f951ffae2dfca49cd53ef71985d721',1,'g2_addlocal(unsigned char *, unsigned char *, g2int): g2_addlocal.c']]], + ['g2_5faddlocal_2ec_34',['g2_addlocal.c',['../g2__addlocal_8c.html',1,'']]], + ['g2_5fcreate_35',['g2_create',['../g2__create_8c.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c'],['../grib2_8h.html#aac286696ed3f69ac01d472c43a5b5d02',1,'g2_create(unsigned char *, g2int *, g2int *): g2_create.c']]], + ['g2_5fcreate_2ec_36',['g2_create.c',['../g2__create_8c.html',1,'']]], + ['g2_5ffree_37',['g2_free',['../g2__free_8c.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c'],['../grib2_8h.html#ad99dd0bc820e765764b331384ad9a5d9',1,'g2_free(gribfield *): g2_free.c']]], + ['g2_5ffree_2ec_38',['g2_free.c',['../g2__free_8c.html',1,'']]], + ['g2_5fgetfld_39',['g2_getfld',['../grib2_8h.html#a4c569e4ca36f7027411b10331386459c',1,'g2_getfld(unsigned char *, g2int, g2int, g2int, gribfield **): g2_getfld.c'],['../g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c']]], + ['g2_5fgetfld_2ec_40',['g2_getfld.c',['../g2__getfld_8c.html',1,'']]], + ['g2_5fgribend_41',['g2_gribend',['../g2__gribend_8c.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c'],['../grib2_8h.html#a5879573202b0fed6eca832fabb9ebb4a',1,'g2_gribend(unsigned char *): g2_gribend.c']]], + ['g2_5fgribend_2ec_42',['g2_gribend.c',['../g2__gribend_8c.html',1,'']]], + ['g2_5finfo_43',['g2_info',['../g2__info_8c.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c'],['../grib2_8h.html#a8bd1cfb013499982dea5eee69bc95a6e',1,'g2_info(unsigned char *, g2int *, g2int *, g2int *, g2int *): g2_info.c']]], + ['g2_5finfo_2ec_44',['g2_info.c',['../g2__info_8c.html',1,'']]], + ['g2_5fmiss_45',['g2_miss',['../g2__miss_8c.html#a5ededd2735de5cd446ee17c2415592e6',1,'g2_miss.c']]], + ['g2_5fmiss_2ec_46',['g2_miss.c',['../g2__miss_8c.html',1,'']]], + ['g2_5funpack1_47',['g2_unpack1',['../grib2_8h.html#a3796bb89e5b8aba66fc624bc8b377a3b',1,'g2_unpack1(unsigned char *, g2int *, g2int **, g2int *): g2_unpack1.c'],['../g2__unpack1_8c.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c'],['../g2__getfld_8c.html#a3796bb89e5b8aba66fc624bc8b377a3b',1,'g2_unpack1(unsigned char *, g2int *, g2int **, g2int *): g2_unpack1.c']]], + ['g2_5funpack1_2ec_48',['g2_unpack1.c',['../g2__unpack1_8c.html',1,'']]], + ['g2_5funpack2_49',['g2_unpack2',['../g2__unpack2_8c.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c'],['../g2__getfld_8c.html#a44c84dc7f9ca05a7901013cd5051000d',1,'g2_unpack2(unsigned char *, g2int *, g2int *, unsigned char **): g2_unpack2.c']]], + ['g2_5funpack2_2ec_50',['g2_unpack2.c',['../g2__unpack2_8c.html',1,'']]], + ['g2_5funpack3_51',['g2_unpack3',['../g2__getfld_8c.html#a7f3d062f236f46e6835f689a149ef88a',1,'g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *): g2_unpack3.c'],['../g2__unpack3_8c.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c'],['../grib2_8h.html#a7f3d062f236f46e6835f689a149ef88a',1,'g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *): g2_unpack3.c']]], + ['g2_5funpack3_2ec_52',['g2_unpack3.c',['../g2__unpack3_8c.html',1,'']]], + ['g2_5funpack4_53',['g2_unpack4',['../g2__getfld_8c.html#a91d98f7e471cce705c43b039b7d87533',1,'g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *): g2_unpack4.c'],['../g2__unpack4_8c.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c'],['../grib2_8h.html#a91d98f7e471cce705c43b039b7d87533',1,'g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *): g2_unpack4.c']]], + ['g2_5funpack4_2ec_54',['g2_unpack4.c',['../g2__unpack4_8c.html',1,'']]], + ['g2_5funpack5_55',['g2_unpack5',['../g2__unpack5_8c.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c'],['../g2__getfld_8c.html#a37ec4c9e3f74008a74bd11828152df5c',1,'g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *): g2_unpack5.c'],['../grib2_8h.html#a37ec4c9e3f74008a74bd11828152df5c',1,'g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *): g2_unpack5.c']]], + ['g2_5funpack5_2ec_56',['g2_unpack5.c',['../g2__unpack5_8c.html',1,'']]], + ['g2_5funpack6_57',['g2_unpack6',['../g2__getfld_8c.html#a27a12127e9cfe2155056e19b035f9256',1,'g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **): g2_unpack6.c'],['../g2__unpack6_8c.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c'],['../grib2_8h.html#a27a12127e9cfe2155056e19b035f9256',1,'g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **): g2_unpack6.c']]], + ['g2_5funpack6_2ec_58',['g2_unpack6.c',['../g2__unpack6_8c.html',1,'']]], + ['g2_5funpack7_59',['g2_unpack7',['../g2__getfld_8c.html#a1783305479f24e498089dd59309215f6',1,'g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **): g2_unpack7.c'],['../g2__unpack7_8c.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c'],['../grib2_8h.html#a1783305479f24e498089dd59309215f6',1,'g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **): g2_unpack7.c']]], + ['g2_5funpack7_2ec_60',['g2_unpack7.c',['../g2__unpack7_8c.html',1,'']]], + ['g2_5fversion_61',['G2_VERSION',['../grib2_8h.html#abdcadc6336632657f0b90b4cff01709f',1,'grib2.h']]], + ['g2float_62',['g2float',['../grib2_8h.html#a2e615ee29fc8d17a681017e4384847c2',1,'grib2.h']]], + ['g2int_63',['g2int',['../grib2_8h.html#af0b63b0e0f41f07f562a4367e2a60838',1,'grib2.h']]], + ['g2intu_64',['g2intu',['../grib2_8h.html#a95bb698b6bd148aae1b3b841fb0da83b',1,'grib2.h']]], + ['gbit_65',['gbit',['../gbits_8c.html#a5d36ba9d46c32188872d0e9ab86f3e47',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte): gbits.c'],['../grib2_8h.html#aceafa00632b779e830443ef1869f7bb9',1,'gbit(unsigned char *, g2int *, g2int, g2int): gbits.c']]], + ['gbits_66',['gbits',['../gbits_8c.html#ab3ebb34ac18fa0ad9baa48eb894689e7',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n): gbits.c'],['../grib2_8h.html#a43257e455b339d9ec75d1959f280224c',1,'gbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int): gbits.c']]], + ['gbits_2ec_67',['gbits.c',['../gbits_8c.html',1,'']]], + ['getdim_68',['getdim',['../g2__addfield_8c.html#a082494772d42da82adfd50c68d77971a',1,'getdim(unsigned char *, g2int *, g2int *, g2int *): getdim.c'],['../getdim_8c.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c']]], + ['getdim_2ec_69',['getdim.c',['../getdim_8c.html',1,'']]], + ['getdrsindex_70',['getdrsindex',['../drstemplates_8c.html#a6a9ca8f896b19b546743be48393c8330',1,'drstemplates.c']]], + ['getdrstemplate_71',['getdrstemplate',['../drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c'],['../grib2_8h.html#a7f643c0f52bd4f76a0fa0e9e713ac489',1,'getdrstemplate(g2int): drstemplates.c']]], + ['getgridindex_72',['getgridindex',['../gridtemplates_8c.html#a87376e69f794ea1c07c762e7d359715e',1,'gridtemplates.c']]], + ['getgridtemplate_73',['getgridtemplate',['../gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c'],['../grib2_8h.html#a92118ff293a94c42b11d1a39f4994392',1,'getgridtemplate(g2int): gridtemplates.c']]], + ['getpdsindex_74',['getpdsindex',['../pdstemplates_8c.html#a68d2553a1ef915bd21a491f4105ab0f2',1,'pdstemplates.c']]], + ['getpdstemplate_75',['getpdstemplate',['../pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c'],['../grib2_8h.html#a19df3971bf764abc547d897f841cef61',1,'getpdstemplate(g2int): pdstemplates.c']]], + ['getpoly_76',['getpoly',['../g2__addfield_8c.html#a0532897a31a122af171633b075a150c6',1,'getpoly(unsigned char *, g2int *, g2int *, g2int *): getpoly.c'],['../getpoly_8c.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c']]], + ['getpoly_2ec_77',['getpoly.c',['../getpoly_8c.html',1,'']]], + ['grib2_2eh_78',['grib2.h',['../grib2_8h.html',1,'']]], + ['gribfield_79',['gribfield',['../grib2_8h.html#afd3ef3eb9f8b9a64a7b749a892de46c5',1,'gribfield(): grib2.h'],['../grib2_8h.html#structgribfield',1,'gribfield']]], + ['griddef_80',['griddef',['../grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138',1,'gribfield']]], + ['gridtemplate_81',['gridtemplate',['../gridtemplates_8h.html#structgridtemplate',1,'']]], + ['gridtemplates_2ec_82',['gridtemplates.c',['../gridtemplates_8c.html',1,'']]], + ['gridtemplates_2eh_83',['gridtemplates.h',['../gridtemplates_8h.html',1,'']]], + ['gtemplate_84',['gtemplate',['../grib2_8h.html#structgtemplate',1,'gtemplate'],['../grib2_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63',1,'gtemplate(): grib2.h']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_6.html b/ver-1.7.0/ver-1.6.4/search/all_6.html new file mode 100644 index 00000000..f1e516d7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_6.js b/ver-1.7.0/ver-1.6.4/search/all_6.js new file mode 100644 index 00000000..2efebcc5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_6.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['ibmap_85',['ibmap',['../grib2_8h.html#a10a46b6a25d615784dced13e914d0726',1,'gribfield']]], + ['idrtlen_86',['idrtlen',['../grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc',1,'gribfield']]], + ['idrtmpl_87',['idrtmpl',['../grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457',1,'gribfield']]], + ['idrtnum_88',['idrtnum',['../grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f',1,'gribfield']]], + ['idsect_89',['idsect',['../grib2_8h.html#ad81615f4a659f2454762301e0e810793',1,'gribfield']]], + ['idsectlen_90',['idsectlen',['../grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826',1,'gribfield']]], + ['ifldnum_91',['ifldnum',['../grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454',1,'gribfield']]], + ['igdtlen_92',['igdtlen',['../grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e',1,'gribfield']]], + ['igdtmpl_93',['igdtmpl',['../grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53',1,'gribfield']]], + ['igdtnum_94',['igdtnum',['../grib2_8h.html#a065d206f38d552c49af642e3cf6056b3',1,'gribfield']]], + ['int_5fpower_95',['int_power',['../int__power_8c.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c'],['../grib2_8h.html#a3681c8c54464e3e97b3f48de09a5ed92',1,'int_power(double, g2int): int_power.c']]], + ['int_5fpower_2ec_96',['int_power.c',['../int__power_8c.html',1,'']]], + ['integer_97',['integer',['../pack__gp_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0',1,'integer(): pack_gp.c'],['../reduce_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0',1,'integer(): reduce.c']]], + ['interp_5fopt_98',['interp_opt',['../grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940',1,'gribfield']]], + ['ipdtlen_99',['ipdtlen',['../grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e',1,'gribfield']]], + ['ipdtmpl_100',['ipdtmpl',['../grib2_8h.html#a49b9e8c090596e02abc193b1974b8022',1,'gribfield']]], + ['ipdtnum_101',['ipdtnum',['../grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_7.html b/ver-1.7.0/ver-1.6.4/search/all_7.html new file mode 100644 index 00000000..8ddbf6c8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_7.js b/ver-1.7.0/ver-1.6.4/search/all_7.js new file mode 100644 index 00000000..76fa7b0a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_7.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['jas_5f1_5f700_5f2_102',['JAS_1_700_2',['../enc__jpeg2000_8c.html#a61429602b0de9ba46b443e66a2c1d8cb',1,'enc_jpeg2000.c']]], + ['jpcpack_103',['jpcpack',['../g2__addfield_8c.html#ae9c19967000623138e0d9218f6c949ab',1,'jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): jpcpack.c'],['../jpcpack_8c.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c']]], + ['jpcpack_2ec_104',['jpcpack.c',['../jpcpack_8c.html',1,'']]], + ['jpcunpack_105',['jpcunpack',['../g2__unpack7_8c.html#a0ec40c3c58c9648a08b9198de8e82bc1',1,'jpcunpack(unsigned char *, g2int, g2int *, g2int, g2float *): jpcunpack.c'],['../jpcunpack_8c.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c']]], + ['jpcunpack_2ec_106',['jpcunpack.c',['../jpcunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_8.html b/ver-1.7.0/ver-1.6.4/search/all_8.html new file mode 100644 index 00000000..83c55ae2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_8.js b/ver-1.7.0/ver-1.6.4/search/all_8.js new file mode 100644 index 00000000..d0ee9f6f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_8.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['lensec0_107',['LENSEC0',['../g2__create_8c.html#a509c8614b4771ae9b3d2a96a6f3bdc15',1,'g2_create.c']]], + ['list_5fopt_108',['list_opt',['../grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d',1,'gribfield']]], + ['local_109',['local',['../grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1',1,'gribfield']]], + ['locallen_110',['locallen',['../grib2_8h.html#a0e2cadad47b161868b97e60f00409982',1,'gribfield']]], + ['logical_111',['logical',['../pack__gp_8c.html#a724e291eda62f097ed85e2c4960d80c0',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_9.html b/ver-1.7.0/ver-1.6.4/search/all_9.html new file mode 100644 index 00000000..1e263c13 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_9.js b/ver-1.7.0/ver-1.6.4/search/all_9.js new file mode 100644 index 00000000..c1c936f9 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_9.js @@ -0,0 +1,23 @@ +var searchData= +[ + ['map_112',['map',['../grib2_8h.html#a88e12020d460546cafcef9c445c3df20',1,'gtemplate']]], + ['mapdrs_113',['mapdrs',['../drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4',1,'drstemplate']]], + ['mapdrslen_114',['mapdrslen',['../drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9',1,'drstemplate']]], + ['mapgrid_115',['mapgrid',['../gridtemplates_8h.html#aec242883534f9f01fba9c21f4c6178a6',1,'gridtemplate']]], + ['mapgridlen_116',['mapgridlen',['../gridtemplates_8h.html#aa83afad572393d4193125436f9f33e55',1,'gridtemplate']]], + ['maplen_117',['maplen',['../grib2_8h.html#aea3cb225770444c7e40855ee401a5b29',1,'gtemplate']]], + ['mappds_118',['mappds',['../pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b',1,'pdstemplate']]], + ['mappdslen_119',['mappdslen',['../pdstemplates_8h.html#ad086e08141828302359fbd2584e15931',1,'pdstemplate']]], + ['mapsec1len_120',['MAPSEC1LEN',['../g2__create_8c.html#a7ea6e1ded57657a0b75c46636e6dbb89',1,'g2_create.c']]], + ['maxdrsmaplen_121',['MAXDRSMAPLEN',['../drstemplates_8h.html#ade593949cef71416060205db106c2828',1,'drstemplates.h']]], + ['maxdrstemp_122',['MAXDRSTEMP',['../drstemplates_8h.html#a94872ea1f11e8ea068177a6506e0a3e4',1,'drstemplates.h']]], + ['maxgridmaplen_123',['MAXGRIDMAPLEN',['../gridtemplates_8h.html#ab19500a13d07a421b89afd9d011ae058',1,'gridtemplates.h']]], + ['maxgridtemp_124',['MAXGRIDTEMP',['../gridtemplates_8h.html#a4d1ba1f89b11d332fb06d9624d5156c9',1,'gridtemplates.h']]], + ['maxoptssize_125',['MAXOPTSSIZE',['../enc__jpeg2000_8c.html#a9855b4e8c40619aab0092ba284943a67',1,'enc_jpeg2000.c']]], + ['maxpdsmaplen_126',['MAXPDSMAPLEN',['../pdstemplates_8h.html#aa0bb590f8c48ad21d17f6cf7a72d8f53',1,'pdstemplates.h']]], + ['maxpdstemp_127',['MAXPDSTEMP',['../pdstemplates_8h.html#a11c588e7671155abba68b92678fc2071',1,'pdstemplates.h']]], + ['misspack_128',['misspack',['../misspack_8c.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c'],['../grib2_8h.html#a5ed56e006562c2783cbce1ddb811b5c5',1,'misspack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): misspack.c']]], + ['misspack_2ec_129',['misspack.c',['../misspack_8c.html',1,'']]], + ['mkieee_130',['mkieee',['../grib2_8h.html#a06ba2196366d23a6a06feb820c1456b0',1,'mkieee(g2float *, g2int *, g2int): mkieee.c'],['../mkieee_8c.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c']]], + ['mkieee_2ec_131',['mkieee.c',['../mkieee_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_a.html b/ver-1.7.0/ver-1.6.4/search/all_a.html new file mode 100644 index 00000000..3a6cac10 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_a.js b/ver-1.7.0/ver-1.6.4/search/all_a.js new file mode 100644 index 00000000..fb925fb2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_a.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['ndpts_132',['ndpts',['../grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c',1,'gribfield']]], + ['needext_133',['needext',['../drstemplates_8h.html#a6f2f478357352200fbac1f72091de752',1,'drstemplate::needext()'],['../gridtemplates_8h.html#aa3d5a179a13f0991613f4c21d65e0080',1,'gridtemplate::needext()'],['../pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4',1,'pdstemplate::needext()'],['../grib2_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf',1,'gtemplate::needext()']]], + ['ngrdpts_134',['ngrdpts',['../grib2_8h.html#a1fd25a21842b45215676696fcddb2a09',1,'gribfield']]], + ['num_135',['num',['../grib2_8h.html#a973b6764b40aed427d419046b63d75b3',1,'gtemplate']]], + ['num_5fcoord_136',['num_coord',['../grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce',1,'gribfield']]], + ['num_5fopt_137',['num_opt',['../grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b',1,'gribfield']]], + ['numoct_5fopt_138',['numoct_opt',['../grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_b.html b/ver-1.7.0/ver-1.6.4/search/all_b.html new file mode 100644 index 00000000..130deb4e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_b.js b/ver-1.7.0/ver-1.6.4/search/all_b.js new file mode 100644 index 00000000..5518e19b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_b.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['pack_5fgp_139',['pack_gp',['../pack__gp_8c.html#a0fcfc080fae3b3dfe82feda3dd304a78',1,'pack_gp(integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *ier): pack_gp.c'],['../grib2_8h.html#a82727fba138c096a0efbf936803d892a',1,'pack_gp(g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *): pack_gp.c']]], + ['pack_5fgp_2ec_140',['pack_gp.c',['../pack__gp_8c.html',1,'']]], + ['pdstemplate_141',['pdstemplate',['../pdstemplates_8h.html#structpdstemplate',1,'']]], + ['pdstemplates_2ec_142',['pdstemplates.c',['../pdstemplates_8c.html',1,'']]], + ['pdstemplates_2eh_143',['pdstemplates.h',['../pdstemplates_8h.html',1,'']]], + ['png_5fstream_144',['png_stream',['../dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): dec_png.c'],['../enc__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): enc_png.c']]], + ['pngpack_145',['pngpack',['../g2__addfield_8c.html#aa19673a03d5b0df2730903c39b9e5002',1,'pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): pngpack.c'],['../pngpack_8c.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c']]], + ['pngpack_2ec_146',['pngpack.c',['../pngpack_8c.html',1,'']]], + ['pngunpack_147',['pngunpack',['../g2__unpack7_8c.html#a188b50820544141523fc0c67dbb3ed42',1,'pngunpack(unsigned char *, g2int, g2int *, g2int, g2float *): pngunpack.c'],['../pngunpack_8c.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c']]], + ['pngunpack_2ec_148',['pngunpack.c',['../pngunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_c.html b/ver-1.7.0/ver-1.6.4/search/all_c.html new file mode 100644 index 00000000..3dd5af06 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_c.js b/ver-1.7.0/ver-1.6.4/search/all_c.js new file mode 100644 index 00000000..e972abfa --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_c.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['rdieee_149',['rdieee',['../rdieee_8c.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c'],['../grib2_8h.html#afdcb02bbf4c7f835fb19f5501d27cf57',1,'rdieee(g2int *, g2float *, g2int): rdieee.c']]], + ['rdieee_2ec_150',['rdieee.c',['../rdieee_8c.html',1,'']]], + ['real_151',['real',['../reduce_8c.html#a89da8542e27ccdbb1a823eaa5af3c1f2',1,'reduce.c']]], + ['reduce_152',['reduce',['../reduce_8c.html#af04821cf86c45e835953c94f4d9db177',1,'reduce.c']]], + ['reduce_2ec_153',['reduce.c',['../reduce_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_d.html b/ver-1.7.0/ver-1.6.4/search/all_d.html new file mode 100644 index 00000000..af7f2f0f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_d.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_d.js b/ver-1.7.0/ver-1.6.4/search/all_d.js new file mode 100644 index 00000000..35232b4a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_d.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['sbit_154',['sbit',['../gbits_8c.html#a7f475eed9a6d6f6d3d8fc26b38572950',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte): gbits.c'],['../grib2_8h.html#a52d2f723b1a656b67fac76d59442a5ac',1,'sbit(unsigned char *, g2int *, g2int, g2int): gbits.c']]], + ['sbits_155',['sbits',['../gbits_8c.html#ad5a2832a80724dc38d71de38d0a9d6e8',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n): gbits.c'],['../grib2_8h.html#af1a424b880c33be2d0c3c20939a2567b',1,'sbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int): gbits.c']]], + ['seekgb_156',['seekgb',['../seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c'],['../grib2_8h.html#ae0ccb44cd5adec3a64d997b7a21bf828',1,'seekgb(FILE *, g2int, g2int, g2int *, g2int *): seekgb.c']]], + ['seekgb_2ec_157',['seekgb.c',['../seekgb_8c.html',1,'']]], + ['simpack_158',['simpack',['../grib2_8h.html#ad6296345c25609fc7443aba106dc0cb2',1,'simpack(g2float *, g2int, g2int *, unsigned char *, g2int *): simpack.c'],['../simpack_8c.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c'],['../g2__addfield_8c.html#ad6296345c25609fc7443aba106dc0cb2',1,'simpack(g2float *, g2int, g2int *, unsigned char *, g2int *): simpack.c']]], + ['simpack_2ec_159',['simpack.c',['../simpack_8c.html',1,'']]], + ['simunpack_160',['simunpack',['../g2__unpack7_8c.html#a044c5f7ba4057129fc06a0b7946eff94',1,'simunpack(unsigned char *, g2int *, g2int, g2float *): simunpack.c'],['../simunpack_8c.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c']]], + ['simunpack_2ec_161',['simunpack.c',['../simunpack_8c.html',1,'']]], + ['specpack_162',['specpack',['../g2__addfield_8c.html#aa8873944e9960b8fcf6e200cdb71b64b',1,'specpack(g2float *, g2int, g2int, g2int, g2int, g2int *, unsigned char *, g2int *): specpack.c'],['../specpack_8c.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c']]], + ['specpack_2ec_163',['specpack.c',['../specpack_8c.html',1,'']]], + ['specunpack_164',['specunpack',['../g2__unpack7_8c.html#ac00f233927a3a6eb64e741089953284d',1,'specunpack(unsigned char *, g2int *, g2int, g2int, g2int, g2int, g2float *): specunpack.c'],['../specunpack_8c.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c']]], + ['specunpack_2ec_165',['specunpack.c',['../specunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_e.html b/ver-1.7.0/ver-1.6.4/search/all_e.html new file mode 100644 index 00000000..e25df423 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_e.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_e.js b/ver-1.7.0/ver-1.6.4/search/all_e.js new file mode 100644 index 00000000..040e8bb1 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_e.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['template_5fnum_166',['template_num',['../drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4',1,'drstemplate::template_num()'],['../gridtemplates_8h.html#a46be4feeeff8e2ea52782da990217632',1,'gridtemplate::template_num()'],['../pdstemplates_8h.html#aa220825f05131b888bc234444067d22d',1,'pdstemplate::template_num()']]], + ['templatesdrs_167',['templatesdrs',['../drstemplates_8h.html#a08f7c019317d1e6235a863ee8ce6e9e2',1,'drstemplates.h']]], + ['templatesgrid_168',['templatesgrid',['../gridtemplates_8h.html#af8316127b8fcf96fb4d3ab2c5411cde9',1,'gridtemplates.h']]], + ['templatespds_169',['templatespds',['../pdstemplates_8h.html#a87d5723cb60a9b598bc574cd31673a26',1,'pdstemplates.h']]], + ['true_5f_170',['TRUE_',['../pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5',1,'pack_gp.c']]], + ['type_171',['type',['../grib2_8h.html#ad28b4af0030473208605c2cf2c5e3f36',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/all_f.html b/ver-1.7.0/ver-1.6.4/search/all_f.html new file mode 100644 index 00000000..b23da6ce --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_f.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/all_f.js b/ver-1.7.0/ver-1.6.4/search/all_f.js new file mode 100644 index 00000000..b4009387 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/all_f.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['unpacked_172',['unpacked',['../grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47',1,'gribfield']]], + ['user_5fflush_5fdata_173',['user_flush_data',['../enc__png_8c.html#a97f27ca60f363a8a91319d3adee16b0e',1,'enc_png.c']]], + ['user_5fread_5fdata_174',['user_read_data',['../dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7',1,'dec_png.c']]], + ['user_5fwrite_5fdata_175',['user_write_data',['../enc__png_8c.html#ac84301dcabbe4c2893799955c50c38a5',1,'enc_png.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/classes_0.html b/ver-1.7.0/ver-1.6.4/search/classes_0.html new file mode 100644 index 00000000..af8159ee --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/classes_0.js b/ver-1.7.0/ver-1.6.4/search/classes_0.js new file mode 100644 index 00000000..cf96963c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['drstemplate_177',['drstemplate',['../drstemplates_8h.html#structdrstemplate',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/classes_1.html b/ver-1.7.0/ver-1.6.4/search/classes_1.html new file mode 100644 index 00000000..576e9168 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/classes_1.js b/ver-1.7.0/ver-1.6.4/search/classes_1.js new file mode 100644 index 00000000..ef9077b6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_1.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['gribfield_178',['gribfield',['../grib2_8h.html#structgribfield',1,'']]], + ['gridtemplate_179',['gridtemplate',['../gridtemplates_8h.html#structgridtemplate',1,'']]], + ['gtemplate_180',['gtemplate',['../grib2_8h.html#structgtemplate',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/classes_2.html b/ver-1.7.0/ver-1.6.4/search/classes_2.html new file mode 100644 index 00000000..956405e5 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/classes_2.js b/ver-1.7.0/ver-1.6.4/search/classes_2.js new file mode 100644 index 00000000..afdb6f03 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/classes_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['pdstemplate_181',['pdstemplate',['../pdstemplates_8h.html#structpdstemplate',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/close.svg b/ver-1.7.0/ver-1.6.4/search/close.svg new file mode 100644 index 00000000..a933eea1 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_0.html b/ver-1.7.0/ver-1.6.4/search/defines_0.html new file mode 100644 index 00000000..15cc3de3 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_0.js b/ver-1.7.0/ver-1.6.4/search/defines_0.js new file mode 100644 index 00000000..d2010161 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['false_5f_343',['FALSE_',['../pack__gp_8c.html#ad4986ecbba005b963f63a85f7c8c281d',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/defines_1.html b/ver-1.7.0/ver-1.6.4/search/defines_1.html new file mode 100644 index 00000000..c49009c7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_1.js b/ver-1.7.0/ver-1.6.4/search/defines_1.js new file mode 100644 index 00000000..e9135d0c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['g2_5fversion_344',['G2_VERSION',['../grib2_8h.html#abdcadc6336632657f0b90b4cff01709f',1,'grib2.h']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/defines_2.html b/ver-1.7.0/ver-1.6.4/search/defines_2.html new file mode 100644 index 00000000..c5510111 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_2.js b/ver-1.7.0/ver-1.6.4/search/defines_2.js new file mode 100644 index 00000000..cda9d9bf --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['jas_5f1_5f700_5f2_345',['JAS_1_700_2',['../enc__jpeg2000_8c.html#a61429602b0de9ba46b443e66a2c1d8cb',1,'enc_jpeg2000.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/defines_3.html b/ver-1.7.0/ver-1.6.4/search/defines_3.html new file mode 100644 index 00000000..8c6d2153 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_3.js b/ver-1.7.0/ver-1.6.4/search/defines_3.js new file mode 100644 index 00000000..15b38a1f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['lensec0_346',['LENSEC0',['../g2__create_8c.html#a509c8614b4771ae9b3d2a96a6f3bdc15',1,'g2_create.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/defines_4.html b/ver-1.7.0/ver-1.6.4/search/defines_4.html new file mode 100644 index 00000000..f4afac12 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_4.js b/ver-1.7.0/ver-1.6.4/search/defines_4.js new file mode 100644 index 00000000..1df1a731 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_4.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['mapsec1len_347',['MAPSEC1LEN',['../g2__create_8c.html#a7ea6e1ded57657a0b75c46636e6dbb89',1,'g2_create.c']]], + ['maxdrsmaplen_348',['MAXDRSMAPLEN',['../drstemplates_8h.html#ade593949cef71416060205db106c2828',1,'drstemplates.h']]], + ['maxdrstemp_349',['MAXDRSTEMP',['../drstemplates_8h.html#a94872ea1f11e8ea068177a6506e0a3e4',1,'drstemplates.h']]], + ['maxgridmaplen_350',['MAXGRIDMAPLEN',['../gridtemplates_8h.html#ab19500a13d07a421b89afd9d011ae058',1,'gridtemplates.h']]], + ['maxgridtemp_351',['MAXGRIDTEMP',['../gridtemplates_8h.html#a4d1ba1f89b11d332fb06d9624d5156c9',1,'gridtemplates.h']]], + ['maxoptssize_352',['MAXOPTSSIZE',['../enc__jpeg2000_8c.html#a9855b4e8c40619aab0092ba284943a67',1,'enc_jpeg2000.c']]], + ['maxpdsmaplen_353',['MAXPDSMAPLEN',['../pdstemplates_8h.html#aa0bb590f8c48ad21d17f6cf7a72d8f53',1,'pdstemplates.h']]], + ['maxpdstemp_354',['MAXPDSTEMP',['../pdstemplates_8h.html#a11c588e7671155abba68b92678fc2071',1,'pdstemplates.h']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/defines_5.html b/ver-1.7.0/ver-1.6.4/search/defines_5.html new file mode 100644 index 00000000..8c40d123 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/defines_5.js b/ver-1.7.0/ver-1.6.4/search/defines_5.js new file mode 100644 index 00000000..9a6018d2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/defines_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['true_5f_355',['TRUE_',['../pack__gp_8c.html#aca1e6c3771fa0306e1dad2b11d22a8e5',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_0.html b/ver-1.7.0/ver-1.6.4/search/files_0.html new file mode 100644 index 00000000..9498842a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_0.js b/ver-1.7.0/ver-1.6.4/search/files_0.js new file mode 100644 index 00000000..4ed9cffd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['cmplxpack_2ec_182',['cmplxpack.c',['../cmplxpack_8c.html',1,'']]], + ['compack_2ec_183',['compack.c',['../compack_8c.html',1,'']]], + ['comunpack_2ec_184',['comunpack.c',['../comunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_1.html b/ver-1.7.0/ver-1.6.4/search/files_1.html new file mode 100644 index 00000000..7050ef48 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_1.js b/ver-1.7.0/ver-1.6.4/search/files_1.js new file mode 100644 index 00000000..952c1b4d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['dec_5fjpeg2000_2ec_185',['dec_jpeg2000.c',['../dec__jpeg2000_8c.html',1,'']]], + ['dec_5fpng_2ec_186',['dec_png.c',['../dec__png_8c.html',1,'']]], + ['decenc_5fopenjpeg_2ec_187',['decenc_openjpeg.c',['../decenc__openjpeg_8c.html',1,'']]], + ['drstemplates_2ec_188',['drstemplates.c',['../drstemplates_8c.html',1,'']]], + ['drstemplates_2eh_189',['drstemplates.h',['../drstemplates_8h.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_2.html b/ver-1.7.0/ver-1.6.4/search/files_2.html new file mode 100644 index 00000000..497cdf5c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_2.js b/ver-1.7.0/ver-1.6.4/search/files_2.js new file mode 100644 index 00000000..29d03c44 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['enc_5fjpeg2000_2ec_190',['enc_jpeg2000.c',['../enc__jpeg2000_8c.html',1,'']]], + ['enc_5fpng_2ec_191',['enc_png.c',['../enc__png_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_3.html b/ver-1.7.0/ver-1.6.4/search/files_3.html new file mode 100644 index 00000000..1ba106b2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_3.js b/ver-1.7.0/ver-1.6.4/search/files_3.js new file mode 100644 index 00000000..0bb7ef0a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_3.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['g2_5faddfield_2ec_192',['g2_addfield.c',['../g2__addfield_8c.html',1,'']]], + ['g2_5faddgrid_2ec_193',['g2_addgrid.c',['../g2__addgrid_8c.html',1,'']]], + ['g2_5faddlocal_2ec_194',['g2_addlocal.c',['../g2__addlocal_8c.html',1,'']]], + ['g2_5fcreate_2ec_195',['g2_create.c',['../g2__create_8c.html',1,'']]], + ['g2_5ffree_2ec_196',['g2_free.c',['../g2__free_8c.html',1,'']]], + ['g2_5fgetfld_2ec_197',['g2_getfld.c',['../g2__getfld_8c.html',1,'']]], + ['g2_5fgribend_2ec_198',['g2_gribend.c',['../g2__gribend_8c.html',1,'']]], + ['g2_5finfo_2ec_199',['g2_info.c',['../g2__info_8c.html',1,'']]], + ['g2_5fmiss_2ec_200',['g2_miss.c',['../g2__miss_8c.html',1,'']]], + ['g2_5funpack1_2ec_201',['g2_unpack1.c',['../g2__unpack1_8c.html',1,'']]], + ['g2_5funpack2_2ec_202',['g2_unpack2.c',['../g2__unpack2_8c.html',1,'']]], + ['g2_5funpack3_2ec_203',['g2_unpack3.c',['../g2__unpack3_8c.html',1,'']]], + ['g2_5funpack4_2ec_204',['g2_unpack4.c',['../g2__unpack4_8c.html',1,'']]], + ['g2_5funpack5_2ec_205',['g2_unpack5.c',['../g2__unpack5_8c.html',1,'']]], + ['g2_5funpack6_2ec_206',['g2_unpack6.c',['../g2__unpack6_8c.html',1,'']]], + ['g2_5funpack7_2ec_207',['g2_unpack7.c',['../g2__unpack7_8c.html',1,'']]], + ['gbits_2ec_208',['gbits.c',['../gbits_8c.html',1,'']]], + ['getdim_2ec_209',['getdim.c',['../getdim_8c.html',1,'']]], + ['getpoly_2ec_210',['getpoly.c',['../getpoly_8c.html',1,'']]], + ['grib2_2eh_211',['grib2.h',['../grib2_8h.html',1,'']]], + ['gridtemplates_2ec_212',['gridtemplates.c',['../gridtemplates_8c.html',1,'']]], + ['gridtemplates_2eh_213',['gridtemplates.h',['../gridtemplates_8h.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_4.html b/ver-1.7.0/ver-1.6.4/search/files_4.html new file mode 100644 index 00000000..753b7b10 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_4.js b/ver-1.7.0/ver-1.6.4/search/files_4.js new file mode 100644 index 00000000..2690de56 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['int_5fpower_2ec_214',['int_power.c',['../int__power_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_5.html b/ver-1.7.0/ver-1.6.4/search/files_5.html new file mode 100644 index 00000000..7b6affd7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_5.js b/ver-1.7.0/ver-1.6.4/search/files_5.js new file mode 100644 index 00000000..e632268c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['jpcpack_2ec_215',['jpcpack.c',['../jpcpack_8c.html',1,'']]], + ['jpcunpack_2ec_216',['jpcunpack.c',['../jpcunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_6.html b/ver-1.7.0/ver-1.6.4/search/files_6.html new file mode 100644 index 00000000..802ebf71 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_6.js b/ver-1.7.0/ver-1.6.4/search/files_6.js new file mode 100644 index 00000000..79e1b403 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['misspack_2ec_217',['misspack.c',['../misspack_8c.html',1,'']]], + ['mkieee_2ec_218',['mkieee.c',['../mkieee_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_7.html b/ver-1.7.0/ver-1.6.4/search/files_7.html new file mode 100644 index 00000000..365e6484 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_7.js b/ver-1.7.0/ver-1.6.4/search/files_7.js new file mode 100644 index 00000000..28c41eec --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_7.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['pack_5fgp_2ec_219',['pack_gp.c',['../pack__gp_8c.html',1,'']]], + ['pdstemplates_2ec_220',['pdstemplates.c',['../pdstemplates_8c.html',1,'']]], + ['pdstemplates_2eh_221',['pdstemplates.h',['../pdstemplates_8h.html',1,'']]], + ['pngpack_2ec_222',['pngpack.c',['../pngpack_8c.html',1,'']]], + ['pngunpack_2ec_223',['pngunpack.c',['../pngunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_8.html b/ver-1.7.0/ver-1.6.4/search/files_8.html new file mode 100644 index 00000000..3df0f2fa --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_8.js b/ver-1.7.0/ver-1.6.4/search/files_8.js new file mode 100644 index 00000000..7699cd10 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['rdieee_2ec_224',['rdieee.c',['../rdieee_8c.html',1,'']]], + ['reduce_2ec_225',['reduce.c',['../reduce_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/files_9.html b/ver-1.7.0/ver-1.6.4/search/files_9.html new file mode 100644 index 00000000..52f8b6c0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/files_9.js b/ver-1.7.0/ver-1.6.4/search/files_9.js new file mode 100644 index 00000000..f4f67fdb --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/files_9.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['seekgb_2ec_226',['seekgb.c',['../seekgb_8c.html',1,'']]], + ['simpack_2ec_227',['simpack.c',['../simpack_8c.html',1,'']]], + ['simunpack_2ec_228',['simunpack.c',['../simunpack_8c.html',1,'']]], + ['specpack_2ec_229',['specpack.c',['../specpack_8c.html',1,'']]], + ['specunpack_2ec_230',['specunpack.c',['../specunpack_8c.html',1,'']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_0.html b/ver-1.7.0/ver-1.6.4/search/functions_0.html new file mode 100644 index 00000000..eb4c5014 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_0.js b/ver-1.7.0/ver-1.6.4/search/functions_0.js new file mode 100644 index 00000000..abbb8202 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['cmplxpack_231',['cmplxpack',['../cmplxpack_8c.html#a1866293a23a4f417804e829d30817054',1,'cmplxpack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): cmplxpack.c'],['../g2__addfield_8c.html#a65f21910802e4f976ca833f1eca18dfe',1,'cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): cmplxpack.c']]], + ['compack_232',['compack',['../compack_8c.html#a1e3bc6eb03df58e192ded1b429f172e0',1,'compack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): compack.c'],['../grib2_8h.html#af29cd0a48b10eb36018a46cee9d3b51b',1,'compack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): compack.c']]], + ['comunpack_233',['comunpack',['../comunpack_8c.html#a7c04fe1475985ae33214a65398cd1d94',1,'comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld): comunpack.c'],['../g2__unpack7_8c.html#a425a343ae39d48b54346b391c5af90f0',1,'comunpack(unsigned char *, g2int, g2int, g2int *, g2int, g2float *): comunpack.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_1.html b/ver-1.7.0/ver-1.6.4/search/functions_1.html new file mode 100644 index 00000000..ef4088b8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_1.js b/ver-1.7.0/ver-1.6.4/search/functions_1.js new file mode 100644 index 00000000..e9e40c7e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dec_5fjpeg2000_234',['dec_jpeg2000',['../dec__jpeg2000_8c.html#aecc47ef133bb090df718275d41098613',1,'dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld): dec_jpeg2000.c'],['../jpcunpack_8c.html#ab5842a1a8efddeee4661a9cd4607750d',1,'dec_jpeg2000(char *, g2int, g2int *): dec_jpeg2000.c']]], + ['dec_5fpng_235',['dec_png',['../dec__png_8c.html#a2d370c4ca9daeca099b249a1ed3e4500',1,'dec_png(unsigned char *pngbuf, g2int *width, g2int *height, char *cout): dec_png.c'],['../pngunpack_8c.html#a40ac90d38dd9b8d7a28df5f35c1230de',1,'dec_png(unsigned char *, g2int *, g2int *, char *): dec_png.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_2.html b/ver-1.7.0/ver-1.6.4/search/functions_2.html new file mode 100644 index 00000000..ca5aa10e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_2.js b/ver-1.7.0/ver-1.6.4/search/functions_2.js new file mode 100644 index 00000000..9f73c160 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_2.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['enc_5fjpeg2000_236',['enc_jpeg2000',['../enc__jpeg2000_8c.html#af4af6d586d2f9ca5da713d025dccf781',1,'enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits, g2int ltype, g2int ratio, g2int retry, char *outjpc, g2int jpclen): enc_jpeg2000.c'],['../jpcpack_8c.html#a8a415bdd3beda56d05a706a614608a7c',1,'enc_jpeg2000(unsigned char *, g2int, g2int, g2int, g2int, g2int, g2int, char *, g2int): enc_jpeg2000.c']]], + ['enc_5fpng_237',['enc_png',['../enc__png_8c.html#a0f4eb9634c16b9a7d55002bddcaa9449',1,'enc_png(char *data, g2int width, g2int height, g2int nbits, char *pngbuf): enc_png.c'],['../pngpack_8c.html#acc060bdd051b1ac2419e8573098e67e3',1,'enc_png(char *, g2int, g2int, g2int, char *): enc_png.c']]], + ['extdrstemplate_238',['extdrstemplate',['../drstemplates_8c.html#a29eb8a2ca16e15e491d7115725ff907c',1,'extdrstemplate(g2int number, g2int *list): drstemplates.c'],['../grib2_8h.html#a3f9e059d95b70f538f9c2c8991e32cd4',1,'extdrstemplate(g2int, g2int *): drstemplates.c']]], + ['extgridtemplate_239',['extgridtemplate',['../gridtemplates_8c.html#a0d65c7c29a06c12ebee26746476d49c9',1,'extgridtemplate(g2int number, g2int *list): gridtemplates.c'],['../grib2_8h.html#ae9558def8f621d909934341dae971e4d',1,'extgridtemplate(g2int, g2int *): gridtemplates.c']]], + ['extpdstemplate_240',['extpdstemplate',['../pdstemplates_8c.html#a64e5f115f7c4ec0b1b7d8af8376d12eb',1,'extpdstemplate(g2int number, g2int *list): pdstemplates.c'],['../grib2_8h.html#abfcda5b8de694e1e37e1343f8dae0980',1,'extpdstemplate(g2int, g2int *): pdstemplates.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_3.html b/ver-1.7.0/ver-1.6.4/search/functions_3.html new file mode 100644 index 00000000..d79f55b8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_3.js b/ver-1.7.0/ver-1.6.4/search/functions_3.js new file mode 100644 index 00000000..cf924c15 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_3.js @@ -0,0 +1,29 @@ +var searchData= +[ + ['g2_5faddfield_241',['g2_addfield',['../grib2_8h.html#ad246d411efa50751af412bb9c79fa2af',1,'g2_addfield(unsigned char *, g2int, g2int *, g2float *, g2int, g2int, g2int *, g2float *, g2int, g2int, g2int *): g2_addfield.c'],['../g2__addfield_8c.html#afdf096f036ed768ec874389f5389ee26',1,'g2_addfield(unsigned char *cgrib, g2int ipdsnum, g2int *ipdstmpl, g2float *coordlist, g2int numcoord, g2int idrsnum, g2int *idrstmpl, g2float *fld, g2int ngrdpts, g2int ibmap, g2int *bmap): g2_addfield.c']]], + ['g2_5faddgrid_242',['g2_addgrid',['../grib2_8h.html#a232f92335d98c2b6eb4f0d831691817e',1,'g2_addgrid(unsigned char *, g2int *, g2int *, g2int *, g2int): g2_addgrid.c'],['../g2__addgrid_8c.html#a14908ea75d83021b0ec10ae8c084567c',1,'g2_addgrid(unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum): g2_addgrid.c']]], + ['g2_5faddlocal_243',['g2_addlocal',['../g2__addlocal_8c.html#aa9490d67c089f6a15fd9941f273752c3',1,'g2_addlocal(unsigned char *cgrib, unsigned char *csec2, g2int lcsec2): g2_addlocal.c'],['../grib2_8h.html#ab4f951ffae2dfca49cd53ef71985d721',1,'g2_addlocal(unsigned char *, unsigned char *, g2int): g2_addlocal.c']]], + ['g2_5fcreate_244',['g2_create',['../g2__create_8c.html#a0e8970973e1cefc142240f961a796108',1,'g2_create(unsigned char *cgrib, g2int *listsec0, g2int *listsec1): g2_create.c'],['../grib2_8h.html#aac286696ed3f69ac01d472c43a5b5d02',1,'g2_create(unsigned char *, g2int *, g2int *): g2_create.c']]], + ['g2_5ffree_245',['g2_free',['../g2__free_8c.html#a084c47c8f83bb5a5c7799753ac7b6f02',1,'g2_free(gribfield *gfld): g2_free.c'],['../grib2_8h.html#ad99dd0bc820e765764b331384ad9a5d9',1,'g2_free(gribfield *): g2_free.c']]], + ['g2_5fgetfld_246',['g2_getfld',['../g2__getfld_8c.html#abad9d3ba0ee798acd442850573fc6b8e',1,'g2_getfld(unsigned char *cgrib, g2int ifldnum, g2int unpack, g2int expand, gribfield **gfld): g2_getfld.c'],['../grib2_8h.html#a4c569e4ca36f7027411b10331386459c',1,'g2_getfld(unsigned char *, g2int, g2int, g2int, gribfield **): g2_getfld.c']]], + ['g2_5fgribend_247',['g2_gribend',['../g2__gribend_8c.html#a84081fb5d32251234409b9ec2d72a0e8',1,'g2_gribend(unsigned char *cgrib): g2_gribend.c'],['../grib2_8h.html#a5879573202b0fed6eca832fabb9ebb4a',1,'g2_gribend(unsigned char *): g2_gribend.c']]], + ['g2_5finfo_248',['g2_info',['../g2__info_8c.html#abf8ecb0fe00805abfce20115357b4fa3',1,'g2_info(unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal): g2_info.c'],['../grib2_8h.html#a8bd1cfb013499982dea5eee69bc95a6e',1,'g2_info(unsigned char *, g2int *, g2int *, g2int *, g2int *): g2_info.c']]], + ['g2_5fmiss_249',['g2_miss',['../g2__miss_8c.html#a5ededd2735de5cd446ee17c2415592e6',1,'g2_miss.c']]], + ['g2_5funpack1_250',['g2_unpack1',['../g2__getfld_8c.html#a3796bb89e5b8aba66fc624bc8b377a3b',1,'g2_unpack1(unsigned char *, g2int *, g2int **, g2int *): g2_unpack1.c'],['../g2__unpack1_8c.html#a5a9f3222320afe0f957406b53ad36223',1,'g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen): g2_unpack1.c'],['../grib2_8h.html#a3796bb89e5b8aba66fc624bc8b377a3b',1,'g2_unpack1(unsigned char *, g2int *, g2int **, g2int *): g2_unpack1.c']]], + ['g2_5funpack2_251',['g2_unpack2',['../g2__getfld_8c.html#a44c84dc7f9ca05a7901013cd5051000d',1,'g2_unpack2(unsigned char *, g2int *, g2int *, unsigned char **): g2_unpack2.c'],['../g2__unpack2_8c.html#a4b190a45b5223fa43746cf16c80bef47',1,'g2_unpack2(unsigned char *cgrib, g2int *iofst, g2int *lencsec2, unsigned char **csec2): g2_unpack2.c']]], + ['g2_5funpack3_252',['g2_unpack3',['../g2__getfld_8c.html#a7f3d062f236f46e6835f689a149ef88a',1,'g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *): g2_unpack3.c'],['../g2__unpack3_8c.html#ae0f9483c798b7819852b21fa0ae51590',1,'g2_unpack3(unsigned char *cgrib, g2int *iofst, g2int **igds, g2int **igdstmpl, g2int *mapgridlen, g2int **ideflist, g2int *idefnum): g2_unpack3.c'],['../grib2_8h.html#a7f3d062f236f46e6835f689a149ef88a',1,'g2_unpack3(unsigned char *, g2int *, g2int **, g2int **, g2int *, g2int **, g2int *): g2_unpack3.c']]], + ['g2_5funpack4_253',['g2_unpack4',['../grib2_8h.html#a91d98f7e471cce705c43b039b7d87533',1,'g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *): g2_unpack4.c'],['../g2__getfld_8c.html#a91d98f7e471cce705c43b039b7d87533',1,'g2_unpack4(unsigned char *, g2int *, g2int *, g2int **, g2int *, g2float **, g2int *): g2_unpack4.c'],['../g2__unpack4_8c.html#a16eaee8c9cd73c1589475d7af259f950',1,'g2_unpack4(unsigned char *cgrib, g2int *iofst, g2int *ipdsnum, g2int **ipdstmpl, g2int *mappdslen, g2float **coordlist, g2int *numcoord): g2_unpack4.c']]], + ['g2_5funpack5_254',['g2_unpack5',['../g2__getfld_8c.html#a37ec4c9e3f74008a74bd11828152df5c',1,'g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *): g2_unpack5.c'],['../g2__unpack5_8c.html#a0127b9d6f3a258a9d0dd87f986d86b93',1,'g2_unpack5(unsigned char *cgrib, g2int *iofst, g2int *ndpts, g2int *idrsnum, g2int **idrstmpl, g2int *mapdrslen): g2_unpack5.c'],['../grib2_8h.html#a37ec4c9e3f74008a74bd11828152df5c',1,'g2_unpack5(unsigned char *, g2int *, g2int *, g2int *, g2int **, g2int *): g2_unpack5.c']]], + ['g2_5funpack6_255',['g2_unpack6',['../g2__getfld_8c.html#a27a12127e9cfe2155056e19b035f9256',1,'g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **): g2_unpack6.c'],['../g2__unpack6_8c.html#a83638f96ee10ef44c4dddcebf41d8ee6',1,'g2_unpack6(unsigned char *cgrib, g2int *iofst, g2int ngpts, g2int *ibmap, g2int **bmap): g2_unpack6.c'],['../grib2_8h.html#a27a12127e9cfe2155056e19b035f9256',1,'g2_unpack6(unsigned char *, g2int *, g2int, g2int *, g2int **): g2_unpack6.c']]], + ['g2_5funpack7_256',['g2_unpack7',['../g2__getfld_8c.html#a1783305479f24e498089dd59309215f6',1,'g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **): g2_unpack7.c'],['../g2__unpack7_8c.html#a9f18066e6b00b576ff8472bc364af3e6',1,'g2_unpack7(unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld): g2_unpack7.c'],['../grib2_8h.html#a1783305479f24e498089dd59309215f6',1,'g2_unpack7(unsigned char *, g2int *, g2int, g2int *, g2int, g2int *, g2int, g2float **): g2_unpack7.c']]], + ['gbit_257',['gbit',['../gbits_8c.html#a5d36ba9d46c32188872d0e9ab86f3e47',1,'gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte): gbits.c'],['../grib2_8h.html#aceafa00632b779e830443ef1869f7bb9',1,'gbit(unsigned char *, g2int *, g2int, g2int): gbits.c']]], + ['gbits_258',['gbits',['../grib2_8h.html#a43257e455b339d9ec75d1959f280224c',1,'gbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int): gbits.c'],['../gbits_8c.html#ab3ebb34ac18fa0ad9baa48eb894689e7',1,'gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n): gbits.c']]], + ['getdim_259',['getdim',['../g2__addfield_8c.html#a082494772d42da82adfd50c68d77971a',1,'getdim(unsigned char *, g2int *, g2int *, g2int *): getdim.c'],['../getdim_8c.html#aabc49a338fae74f6dfc9e98b6cb59de7',1,'getdim(unsigned char *csec3, g2int *width, g2int *height, g2int *iscan): getdim.c']]], + ['getdrsindex_260',['getdrsindex',['../drstemplates_8c.html#a6a9ca8f896b19b546743be48393c8330',1,'drstemplates.c']]], + ['getdrstemplate_261',['getdrstemplate',['../drstemplates_8c.html#acf3195b5cecc028727faa8a921eba03e',1,'getdrstemplate(g2int number): drstemplates.c'],['../grib2_8h.html#a7f643c0f52bd4f76a0fa0e9e713ac489',1,'getdrstemplate(g2int): drstemplates.c']]], + ['getgridindex_262',['getgridindex',['../gridtemplates_8c.html#a87376e69f794ea1c07c762e7d359715e',1,'gridtemplates.c']]], + ['getgridtemplate_263',['getgridtemplate',['../gridtemplates_8c.html#af67f9624982c81a36531989254a9b98a',1,'getgridtemplate(g2int number): gridtemplates.c'],['../grib2_8h.html#a92118ff293a94c42b11d1a39f4994392',1,'getgridtemplate(g2int): gridtemplates.c']]], + ['getpdsindex_264',['getpdsindex',['../pdstemplates_8c.html#a68d2553a1ef915bd21a491f4105ab0f2',1,'pdstemplates.c']]], + ['getpdstemplate_265',['getpdstemplate',['../pdstemplates_8c.html#ad08ad7c4bee0466cd8ccafc1c1e76520',1,'getpdstemplate(g2int number): pdstemplates.c'],['../grib2_8h.html#a19df3971bf764abc547d897f841cef61',1,'getpdstemplate(g2int): pdstemplates.c']]], + ['getpoly_266',['getpoly',['../g2__addfield_8c.html#a0532897a31a122af171633b075a150c6',1,'getpoly(unsigned char *, g2int *, g2int *, g2int *): getpoly.c'],['../getpoly_8c.html#aa8f99915cc3bf0efa7544cf3c2e1b552',1,'getpoly(unsigned char *csec3, g2int *jj, g2int *kk, g2int *mm): getpoly.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_4.html b/ver-1.7.0/ver-1.6.4/search/functions_4.html new file mode 100644 index 00000000..1657cad0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_4.js b/ver-1.7.0/ver-1.6.4/search/functions_4.js new file mode 100644 index 00000000..e5e440d2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['int_5fpower_267',['int_power',['../int__power_8c.html#a6b284a64a4b42cd86db872ae7e1eeaa8',1,'int_power(double x, g2int y): int_power.c'],['../grib2_8h.html#a3681c8c54464e3e97b3f48de09a5ed92',1,'int_power(double, g2int): int_power.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_5.html b/ver-1.7.0/ver-1.6.4/search/functions_5.html new file mode 100644 index 00000000..9301d6b9 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_5.js b/ver-1.7.0/ver-1.6.4/search/functions_5.js new file mode 100644 index 00000000..53f31b3d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['jpcpack_268',['jpcpack',['../g2__addfield_8c.html#ae9c19967000623138e0d9218f6c949ab',1,'jpcpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): jpcpack.c'],['../jpcpack_8c.html#a9342b7e883d454cc9c9c5051e40cf557',1,'jpcpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): jpcpack.c']]], + ['jpcunpack_269',['jpcunpack',['../g2__unpack7_8c.html#a0ec40c3c58c9648a08b9198de8e82bc1',1,'jpcunpack(unsigned char *, g2int, g2int *, g2int, g2float *): jpcunpack.c'],['../jpcunpack_8c.html#adcf25467e143e6705a2108caaad9fd88',1,'jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): jpcunpack.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_6.html b/ver-1.7.0/ver-1.6.4/search/functions_6.html new file mode 100644 index 00000000..9c4f5fc6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_6.js b/ver-1.7.0/ver-1.6.4/search/functions_6.js new file mode 100644 index 00000000..6860b2d0 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['misspack_270',['misspack',['../misspack_8c.html#a33440a1e301c24cf2996122f63ee3cae',1,'misspack(g2float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): misspack.c'],['../grib2_8h.html#a5ed56e006562c2783cbce1ddb811b5c5',1,'misspack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): misspack.c']]], + ['mkieee_271',['mkieee',['../mkieee_8c.html#ac81ff0ca19f32422c5667e1bca5aae27',1,'mkieee(g2float *a, g2int *rieee, g2int num): mkieee.c'],['../grib2_8h.html#a06ba2196366d23a6a06feb820c1456b0',1,'mkieee(g2float *, g2int *, g2int): mkieee.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_7.html b/ver-1.7.0/ver-1.6.4/search/functions_7.html new file mode 100644 index 00000000..46b5c0f6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_7.js b/ver-1.7.0/ver-1.6.4/search/functions_7.js new file mode 100644 index 00000000..cdb084eb --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['pack_5fgp_272',['pack_gp',['../pack__gp_8c.html#a0fcfc080fae3b3dfe82feda3dd304a78',1,'pack_gp(integer *kfildo, integer *ic, integer *nxy, integer *is523, integer *minpk, integer *inc, integer *missp, integer *misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *kbit, integer *novref, integer *lbitref, integer *ier): pack_gp.c'],['../grib2_8h.html#a82727fba138c096a0efbf936803d892a',1,'pack_gp(g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *): pack_gp.c']]], + ['pngpack_273',['pngpack',['../g2__addfield_8c.html#aa19673a03d5b0df2730903c39b9e5002',1,'pngpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *): pngpack.c'],['../pngpack_8c.html#aead12707dbe31153a792ec922eb2fec7',1,'pngpack(g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): pngpack.c']]], + ['pngunpack_274',['pngunpack',['../g2__unpack7_8c.html#a188b50820544141523fc0c67dbb3ed42',1,'pngunpack(unsigned char *, g2int, g2int *, g2int, g2float *): pngunpack.c'],['../pngunpack_8c.html#acd726669156a52a640744423669e9397',1,'pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld): pngunpack.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_8.html b/ver-1.7.0/ver-1.6.4/search/functions_8.html new file mode 100644 index 00000000..31a1d950 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_8.js b/ver-1.7.0/ver-1.6.4/search/functions_8.js new file mode 100644 index 00000000..fb37dbff --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['rdieee_275',['rdieee',['../rdieee_8c.html#a765d8cfa0519cce8a36953120263ba51',1,'rdieee(g2int *rieee, g2float *a, g2int num): rdieee.c'],['../grib2_8h.html#afdcb02bbf4c7f835fb19f5501d27cf57',1,'rdieee(g2int *, g2float *, g2int): rdieee.c']]], + ['reduce_276',['reduce',['../reduce_8c.html#af04821cf86c45e835953c94f4d9db177',1,'reduce.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_9.html b/ver-1.7.0/ver-1.6.4/search/functions_9.html new file mode 100644 index 00000000..9a8e4290 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_9.js b/ver-1.7.0/ver-1.6.4/search/functions_9.js new file mode 100644 index 00000000..f5c63c4c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_9.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['sbit_277',['sbit',['../gbits_8c.html#a7f475eed9a6d6f6d3d8fc26b38572950',1,'sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte): gbits.c'],['../grib2_8h.html#a52d2f723b1a656b67fac76d59442a5ac',1,'sbit(unsigned char *, g2int *, g2int, g2int): gbits.c']]], + ['sbits_278',['sbits',['../gbits_8c.html#ad5a2832a80724dc38d71de38d0a9d6e8',1,'sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n): gbits.c'],['../grib2_8h.html#af1a424b880c33be2d0c3c20939a2567b',1,'sbits(unsigned char *, g2int *, g2int, g2int, g2int, g2int): gbits.c']]], + ['seekgb_279',['seekgb',['../seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c',1,'seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib): seekgb.c'],['../grib2_8h.html#ae0ccb44cd5adec3a64d997b7a21bf828',1,'seekgb(FILE *, g2int, g2int, g2int *, g2int *): seekgb.c']]], + ['simpack_280',['simpack',['../g2__addfield_8c.html#ad6296345c25609fc7443aba106dc0cb2',1,'simpack(g2float *, g2int, g2int *, unsigned char *, g2int *): simpack.c'],['../simpack_8c.html#a1044c3047067228a30d93a351a079bab',1,'simpack(g2float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): simpack.c'],['../grib2_8h.html#ad6296345c25609fc7443aba106dc0cb2',1,'simpack(g2float *, g2int, g2int *, unsigned char *, g2int *): simpack.c']]], + ['simunpack_281',['simunpack',['../g2__unpack7_8c.html#a044c5f7ba4057129fc06a0b7946eff94',1,'simunpack(unsigned char *, g2int *, g2int, g2float *): simunpack.c'],['../simunpack_8c.html#aee9904f7aa97792022274de23107ba09',1,'simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld): simunpack.c']]], + ['specpack_282',['specpack',['../g2__addfield_8c.html#aa8873944e9960b8fcf6e200cdb71b64b',1,'specpack(g2float *, g2int, g2int, g2int, g2int, g2int *, unsigned char *, g2int *): specpack.c'],['../specpack_8c.html#a4464faa396c6e14a740e0ff4b4a0c9a1',1,'specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack): specpack.c']]], + ['specunpack_283',['specunpack',['../g2__unpack7_8c.html#ac00f233927a3a6eb64e741089953284d',1,'specunpack(unsigned char *, g2int *, g2int, g2int, g2int, g2int, g2float *): specunpack.c'],['../specunpack_8c.html#aeb5b149867887c46a6eca7737531d3a5',1,'specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld): specunpack.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/functions_a.html b/ver-1.7.0/ver-1.6.4/search/functions_a.html new file mode 100644 index 00000000..5ecc152c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/functions_a.js b/ver-1.7.0/ver-1.6.4/search/functions_a.js new file mode 100644 index 00000000..f4cbbd20 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/functions_a.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['user_5fflush_5fdata_284',['user_flush_data',['../enc__png_8c.html#a97f27ca60f363a8a91319d3adee16b0e',1,'enc_png.c']]], + ['user_5fread_5fdata_285',['user_read_data',['../dec__png_8c.html#abe576ea8faea4144cac413a8d2cc6ec7',1,'dec_png.c']]], + ['user_5fwrite_5fdata_286',['user_write_data',['../enc__png_8c.html#ac84301dcabbe4c2893799955c50c38a5',1,'enc_png.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/mag_sel.svg b/ver-1.7.0/ver-1.6.4/search/mag_sel.svg new file mode 100644 index 00000000..03626f64 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/ver-1.7.0/ver-1.6.4/search/nomatches.html b/ver-1.7.0/ver-1.6.4/search/nomatches.html new file mode 100644 index 00000000..2b9360b6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/nomatches.html @@ -0,0 +1,13 @@ + + + + + + + + +
    +
    No Matches
    +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/search.css b/ver-1.7.0/ver-1.6.4/search/search.css new file mode 100644 index 00000000..9074198f --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/search.css @@ -0,0 +1,257 @@ +/*---------------- Search Box */ + +#MSearchBox { + white-space : nowrap; + background: white; + border-radius: 0.65em; + box-shadow: inset 0.5px 0.5px 3px 0px #555; + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + height: 1.4em; + padding: 0 0 0 0.3em; + margin: 0; +} + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 1.1em; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: #909090; + outline: none; + font-family: Arial, Verdana, sans-serif; + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + height: 1.4em; + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; + z-index:10000; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: Arial, Verdana, sans-serif; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: Arial, Verdana, sans-serif; +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/ver-1.7.0/ver-1.6.4/search/search.js b/ver-1.7.0/ver-1.6.4/search/search.js new file mode 100644 index 00000000..fb226f73 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/search.js @@ -0,0 +1,816 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + this.extension; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches' + this.extension; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline-block'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_0.js b/ver-1.7.0/ver-1.6.4/search/typedefs_0.js new file mode 100644 index 00000000..f2e8cd5e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_0.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['g2float_334',['g2float',['../grib2_8h.html#a2e615ee29fc8d17a681017e4384847c2',1,'grib2.h']]], + ['g2int_335',['g2int',['../grib2_8h.html#af0b63b0e0f41f07f562a4367e2a60838',1,'grib2.h']]], + ['g2intu_336',['g2intu',['../grib2_8h.html#a95bb698b6bd148aae1b3b841fb0da83b',1,'grib2.h']]], + ['gribfield_337',['gribfield',['../grib2_8h.html#afd3ef3eb9f8b9a64a7b749a892de46c5',1,'grib2.h']]], + ['gtemplate_338',['gtemplate',['../grib2_8h.html#a1f770e683f8b4e9c16c3d4d9d1e4fb63',1,'grib2.h']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_1.html b/ver-1.7.0/ver-1.6.4/search/typedefs_1.html new file mode 100644 index 00000000..46cf01e6 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_1.js b/ver-1.7.0/ver-1.6.4/search/typedefs_1.js new file mode 100644 index 00000000..274e8d77 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['integer_339',['integer',['../pack__gp_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0',1,'integer(): pack_gp.c'],['../reduce_8c.html#a5b2fbd5d7580a5996cdbbb3785b16db0',1,'integer(): reduce.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_2.html b/ver-1.7.0/ver-1.6.4/search/typedefs_2.html new file mode 100644 index 00000000..6835ee65 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_2.js b/ver-1.7.0/ver-1.6.4/search/typedefs_2.js new file mode 100644 index 00000000..12e56bee --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['logical_340',['logical',['../pack__gp_8c.html#a724e291eda62f097ed85e2c4960d80c0',1,'pack_gp.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_3.html b/ver-1.7.0/ver-1.6.4/search/typedefs_3.html new file mode 100644 index 00000000..01700476 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_3.js b/ver-1.7.0/ver-1.6.4/search/typedefs_3.js new file mode 100644 index 00000000..b6506596 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['png_5fstream_341',['png_stream',['../dec__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): dec_png.c'],['../enc__png_8c.html#a51736c0c137626d13b71ea12021c10f3',1,'png_stream(): enc_png.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_4.html b/ver-1.7.0/ver-1.6.4/search/typedefs_4.html new file mode 100644 index 00000000..81466a5d --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/typedefs_4.js b/ver-1.7.0/ver-1.6.4/search/typedefs_4.js new file mode 100644 index 00000000..2768b9e8 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/typedefs_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['real_342',['real',['../reduce_8c.html#a89da8542e27ccdbb1a823eaa5af3c1f2',1,'reduce.c']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_0.html b/ver-1.7.0/ver-1.6.4/search/variables_0.html new file mode 100644 index 00000000..1e477c08 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_0.js b/ver-1.7.0/ver-1.6.4/search/variables_0.js new file mode 100644 index 00000000..20cb86b3 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bmap_287',['bmap',['../grib2_8h.html#aeedbfa7bd7399aaed4554245d182b369',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_1.html b/ver-1.7.0/ver-1.6.4/search/variables_1.html new file mode 100644 index 00000000..ea73d9a4 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_1.js b/ver-1.7.0/ver-1.6.4/search/variables_1.js new file mode 100644 index 00000000..6e79c030 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['coord_5flist_288',['coord_list',['../grib2_8h.html#a2c1e929174fda138d1e5214e0286b7a5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_2.html b/ver-1.7.0/ver-1.6.4/search/variables_2.html new file mode 100644 index 00000000..0580462e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_2.js b/ver-1.7.0/ver-1.6.4/search/variables_2.js new file mode 100644 index 00000000..b3732c7e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['discipline_289',['discipline',['../grib2_8h.html#a4af2c3dfeb1cba7be35cd63ea9c51574',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_3.html b/ver-1.7.0/ver-1.6.4/search/variables_3.html new file mode 100644 index 00000000..0d69e761 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_3.js b/ver-1.7.0/ver-1.6.4/search/variables_3.js new file mode 100644 index 00000000..ff3d7fc2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_3.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['expanded_290',['expanded',['../grib2_8h.html#ae5b5e6f9849720b476555b4b32096f20',1,'gribfield']]], + ['ext_291',['ext',['../grib2_8h.html#a312a417c8e6f68bea7bfe86268c16594',1,'gtemplate']]], + ['extlen_292',['extlen',['../grib2_8h.html#a743151a1bde2a21603926e1541baa5de',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_4.html b/ver-1.7.0/ver-1.6.4/search/variables_4.html new file mode 100644 index 00000000..a4b6506b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_4.js b/ver-1.7.0/ver-1.6.4/search/variables_4.js new file mode 100644 index 00000000..5f3c8b6a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['fld_293',['fld',['../grib2_8h.html#ade69d8c093b2aa18c720c833def6198f',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_5.html b/ver-1.7.0/ver-1.6.4/search/variables_5.html new file mode 100644 index 00000000..7e345d16 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_5.js b/ver-1.7.0/ver-1.6.4/search/variables_5.js new file mode 100644 index 00000000..a4aab5ad --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['griddef_294',['griddef',['../grib2_8h.html#a3fcb1e8bf12cf5921c2993f0460d8138',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_6.html b/ver-1.7.0/ver-1.6.4/search/variables_6.html new file mode 100644 index 00000000..7d48e75e --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_6.js b/ver-1.7.0/ver-1.6.4/search/variables_6.js new file mode 100644 index 00000000..facd76d2 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_6.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['ibmap_295',['ibmap',['../grib2_8h.html#a10a46b6a25d615784dced13e914d0726',1,'gribfield']]], + ['idrtlen_296',['idrtlen',['../grib2_8h.html#a63afadbf31fb6307011a983afbf9a5bc',1,'gribfield']]], + ['idrtmpl_297',['idrtmpl',['../grib2_8h.html#aadea4d0f1c3d8f4a40087f3b20ddf457',1,'gribfield']]], + ['idrtnum_298',['idrtnum',['../grib2_8h.html#a9e82319d51b43e564aa3b5199cb9f15f',1,'gribfield']]], + ['idsect_299',['idsect',['../grib2_8h.html#ad81615f4a659f2454762301e0e810793',1,'gribfield']]], + ['idsectlen_300',['idsectlen',['../grib2_8h.html#a8b46586925aaf77c69f38ad7bc72b826',1,'gribfield']]], + ['ifldnum_301',['ifldnum',['../grib2_8h.html#a2a4eaa3208d40466f647ae53a4b19454',1,'gribfield']]], + ['igdtlen_302',['igdtlen',['../grib2_8h.html#ae8f44c108ad9fd344937abc845511e2e',1,'gribfield']]], + ['igdtmpl_303',['igdtmpl',['../grib2_8h.html#a9c94d15723e5a2d175d96f8c6fa2fd53',1,'gribfield']]], + ['igdtnum_304',['igdtnum',['../grib2_8h.html#a065d206f38d552c49af642e3cf6056b3',1,'gribfield']]], + ['interp_5fopt_305',['interp_opt',['../grib2_8h.html#a1ddf29fe5e55bee98b5d5990d674a940',1,'gribfield']]], + ['ipdtlen_306',['ipdtlen',['../grib2_8h.html#a8bf35419f98181f5550a3fee8c4a201e',1,'gribfield']]], + ['ipdtmpl_307',['ipdtmpl',['../grib2_8h.html#a49b9e8c090596e02abc193b1974b8022',1,'gribfield']]], + ['ipdtnum_308',['ipdtnum',['../grib2_8h.html#a44eee21c0fddc82fb5829f8b56675911',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_7.html b/ver-1.7.0/ver-1.6.4/search/variables_7.html new file mode 100644 index 00000000..5c263409 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_7.js b/ver-1.7.0/ver-1.6.4/search/variables_7.js new file mode 100644 index 00000000..df26a0ac --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['list_5fopt_309',['list_opt',['../grib2_8h.html#ab50dde08eec9a69f5d063a25e863897d',1,'gribfield']]], + ['local_310',['local',['../grib2_8h.html#ae1772f6e7ca41ab7ff0b5eb9ad0980c1',1,'gribfield']]], + ['locallen_311',['locallen',['../grib2_8h.html#a0e2cadad47b161868b97e60f00409982',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_8.html b/ver-1.7.0/ver-1.6.4/search/variables_8.html new file mode 100644 index 00000000..dc9ec54a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_8.js b/ver-1.7.0/ver-1.6.4/search/variables_8.js new file mode 100644 index 00000000..e734309c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_8.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['map_312',['map',['../grib2_8h.html#a88e12020d460546cafcef9c445c3df20',1,'gtemplate']]], + ['mapdrs_313',['mapdrs',['../drstemplates_8h.html#ad79047835a028c9b316a2113810e39f4',1,'drstemplate']]], + ['mapdrslen_314',['mapdrslen',['../drstemplates_8h.html#a7a876b1351a8767a42bbaa625d70bfa9',1,'drstemplate']]], + ['mapgrid_315',['mapgrid',['../gridtemplates_8h.html#aec242883534f9f01fba9c21f4c6178a6',1,'gridtemplate']]], + ['mapgridlen_316',['mapgridlen',['../gridtemplates_8h.html#aa83afad572393d4193125436f9f33e55',1,'gridtemplate']]], + ['maplen_317',['maplen',['../grib2_8h.html#aea3cb225770444c7e40855ee401a5b29',1,'gtemplate']]], + ['mappds_318',['mappds',['../pdstemplates_8h.html#a2dd21fe68411f2a1e9381d7189e3ad6b',1,'pdstemplate']]], + ['mappdslen_319',['mappdslen',['../pdstemplates_8h.html#ad086e08141828302359fbd2584e15931',1,'pdstemplate']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_9.html b/ver-1.7.0/ver-1.6.4/search/variables_9.html new file mode 100644 index 00000000..7b014750 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_9.js b/ver-1.7.0/ver-1.6.4/search/variables_9.js new file mode 100644 index 00000000..43c5eacf --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_9.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['ndpts_320',['ndpts',['../grib2_8h.html#aa97ba6b54e9c91fb231708048d54156c',1,'gribfield']]], + ['needext_321',['needext',['../drstemplates_8h.html#a6f2f478357352200fbac1f72091de752',1,'drstemplate::needext()'],['../gridtemplates_8h.html#aa3d5a179a13f0991613f4c21d65e0080',1,'gridtemplate::needext()'],['../pdstemplates_8h.html#a46932263ca8c7a5449af3bed1d6058b4',1,'pdstemplate::needext()'],['../grib2_8h.html#a8e1ecd4e873a86a10a76d264c55ae7bf',1,'gtemplate::needext()']]], + ['ngrdpts_322',['ngrdpts',['../grib2_8h.html#a1fd25a21842b45215676696fcddb2a09',1,'gribfield']]], + ['num_323',['num',['../grib2_8h.html#a973b6764b40aed427d419046b63d75b3',1,'gtemplate']]], + ['num_5fcoord_324',['num_coord',['../grib2_8h.html#aded2ca1c14ca96b2bdc7138945a2f4ce',1,'gribfield']]], + ['num_5fopt_325',['num_opt',['../grib2_8h.html#ae6ac361f230f89a9461e260d72c1d60b',1,'gribfield']]], + ['numoct_5fopt_326',['numoct_opt',['../grib2_8h.html#a4f9284ebe7fabba1cc092fbea1a5b7e0',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_a.html b/ver-1.7.0/ver-1.6.4/search/variables_a.html new file mode 100644 index 00000000..52a724d1 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_a.js b/ver-1.7.0/ver-1.6.4/search/variables_a.js new file mode 100644 index 00000000..405a4937 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_a.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['template_5fnum_327',['template_num',['../drstemplates_8h.html#acf6e54b0abd369ce78b0d59411863df4',1,'drstemplate::template_num()'],['../gridtemplates_8h.html#a46be4feeeff8e2ea52782da990217632',1,'gridtemplate::template_num()'],['../pdstemplates_8h.html#aa220825f05131b888bc234444067d22d',1,'pdstemplate::template_num()']]], + ['templatesdrs_328',['templatesdrs',['../drstemplates_8h.html#a08f7c019317d1e6235a863ee8ce6e9e2',1,'drstemplates.h']]], + ['templatesgrid_329',['templatesgrid',['../gridtemplates_8h.html#af8316127b8fcf96fb4d3ab2c5411cde9',1,'gridtemplates.h']]], + ['templatespds_330',['templatespds',['../pdstemplates_8h.html#a87d5723cb60a9b598bc574cd31673a26',1,'pdstemplates.h']]], + ['type_331',['type',['../grib2_8h.html#ad28b4af0030473208605c2cf2c5e3f36',1,'gtemplate']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_b.html b/ver-1.7.0/ver-1.6.4/search/variables_b.html new file mode 100644 index 00000000..f376b27a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_b.js b/ver-1.7.0/ver-1.6.4/search/variables_b.js new file mode 100644 index 00000000..bb72f817 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['unpacked_332',['unpacked',['../grib2_8h.html#a79acbc94d3f1a0299369b95dae0f5a47',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/search/variables_c.html b/ver-1.7.0/ver-1.6.4/search/variables_c.html new file mode 100644 index 00000000..6019eba9 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/ver-1.7.0/ver-1.6.4/search/variables_c.js b/ver-1.7.0/ver-1.6.4/search/variables_c.js new file mode 100644 index 00000000..de8848a7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/search/variables_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['version_333',['version',['../grib2_8h.html#ac1a18226d7790431bad8b065f85befa5',1,'gribfield']]] +]; diff --git a/ver-1.7.0/ver-1.6.4/seekgb_8c.html b/ver-1.7.0/ver-1.6.4/seekgb_8c.html new file mode 100644 index 00000000..c8413230 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/seekgb_8c.html @@ -0,0 +1,192 @@ + + + + + + + +NCEPLIBS-g2c: seekgb.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    seekgb.c File Reference
    +
    +
    + +

    Searches a file for the next GRIB message. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void seekgb (FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
     This subprogram searches a file for the next GRIB Message. More...
     
    +

    Detailed Description

    +

    Searches a file for the next GRIB message.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-28
    + +

    Definition in file seekgb.c.

    +

    Function Documentation

    + +

    ◆ seekgb()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void seekgb (FILE * lugb,
    g2int iseek,
    g2int mseek,
    g2intlskip,
    g2intlgrib 
    )
    +
    + +

    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:

      +
    • 2002-10-28 GILBERT Modified from Iredell's skgb subroutine
    • +
    • 2009-01-16 VUONG Changed lskip to 4 instead of sizof(g2int)
    • +
    +
    Parameters
    + + + + + + +
    lugbFILE pointer for the file to search. File must be opened before this routine is called.
    iseeknumber of bytes in the file to skip before search.
    mseeknumber of bytes to search at a time.
    lskipnumber of bytes to skip from the beggining of the file to where the GRIB message starts.
    lgribnumber of bytes in message (set to 0, if no message found).
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-28
    + +

    Definition at line 32 of file seekgb.c.

    + +

    References gbit().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/seekgb_8c.js b/ver-1.7.0/ver-1.6.4/seekgb_8c.js new file mode 100644 index 00000000..e4e1489a --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/seekgb_8c.js @@ -0,0 +1,4 @@ +var seekgb_8c = +[ + [ "seekgb", "seekgb_8c.html#a27edb1018106a2e02743be31afc5ea0c", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/seekgb_8c_source.html b/ver-1.7.0/ver-1.6.4/seekgb_8c_source.html new file mode 100644 index 00000000..66923bc9 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/seekgb_8c_source.html @@ -0,0 +1,155 @@ + + + + + + + +NCEPLIBS-g2c: seekgb.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    seekgb.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    5 #include <stdio.h>
    +
    6 #include <stdlib.h>
    +
    7 #include "grib2.h"
    +
    8 
    +
    32 void seekgb(FILE *lugb,g2int iseek,g2int mseek,g2int *lskip,g2int *lgrib)
    +
    33 {
    +
    34  g2int k,k4,ipos,nread,lim,start,vers,lengrib;
    +
    35  int end;
    +
    36  unsigned char *cbuf;
    +
    37 
    +
    38 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +
    39  *lgrib=0;
    +
    40  cbuf=(unsigned char *)malloc(mseek);
    +
    41  nread=mseek;
    +
    42  ipos=iseek;
    +
    43 
    +
    44 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +
    45 // LOOP UNTIL GRIB MESSAGE IS FOUND
    +
    46 
    +
    47  while (*lgrib==0 && nread==mseek) {
    +
    48 
    +
    49 // READ PARTIAL SECTION
    +
    50 
    +
    51  fseek(lugb,ipos,SEEK_SET);
    +
    52  nread=fread(cbuf,sizeof(unsigned char),mseek,lugb);
    +
    53  lim=nread-8;
    +
    54 
    +
    55 // LOOK FOR 'GRIB...' IN PARTIAL SECTION
    +
    56 
    +
    57  for (k=0;k<lim;k++) {
    +
    58  gbit(cbuf,&start,(k+0)*8,4*8);
    +
    59  gbit(cbuf,&vers,(k+7)*8,1*8);
    +
    60  if (start==1196575042 && (vers==1 || vers==2)) {
    +
    61 // LOOK FOR '7777' AT END OF GRIB MESSAGE
    +
    62  if (vers == 1) gbit(cbuf,&lengrib,(k+4)*8,3*8);
    +
    63  if (vers == 2) gbit(cbuf,&lengrib,(k+12)*8,4*8);
    +
    64  fseek(lugb,ipos+k+lengrib-4,SEEK_SET);
    +
    65 // Hard code to 4 instead of sizeof(g2int)
    +
    66  k4=fread(&end,4,1,lugb);
    +
    67  if (k4 == 1 && end == 926365495) { //GRIB message found
    +
    68  *lskip=ipos+k;
    +
    69  *lgrib=lengrib;
    +
    70  break;
    +
    71  }
    +
    72  }
    +
    73  }
    +
    74  ipos=ipos+lim;
    +
    75  }
    +
    76 
    +
    77  free(cbuf);
    +
    78 }
    +
    void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:20
    +
    Header file for NCEPLIBS-g2c library.
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    void seekgb(FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
    This subprogram searches a file for the next GRIB Message.
    Definition: seekgb.c:32
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/simpack_8c.html b/ver-1.7.0/ver-1.6.4/simpack_8c.html new file mode 100644 index 00000000..93013325 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simpack_8c.html @@ -0,0 +1,197 @@ + + + + + + + +NCEPLIBS-g2c: simpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    simpack.c File Reference
    +
    +
    + +

    Pack up a data field using the simple packing algorithm. +More...

    +
    #include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void simpack (g2float *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...
     
    +

    Detailed Description

    +

    Pack up a data field using the simple packing algorithm.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-06
    + +

    Definition in file simpack.c.

    +

    Function Documentation

    + +

    ◆ simpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void simpack (g2floatfld,
    g2int ndpts,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + +
    fldContains the data values to pack.
    ndptsThe number of data values in array fld.
    idrstmplContains 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.
    • +
    +
    cpackThe packed data field
    lcpacklength of packed field starting at cpack.
    +
    +
    +
    Author
    Stephen Gilbert
    +
    Date
    2002-11-06
    + +

    Definition at line 34 of file simpack.c.

    + +

    References int_power(), mkieee(), sbit(), and sbits().

    + +

    Referenced by g2_addfield(), and specpack().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/simpack_8c.js b/ver-1.7.0/ver-1.6.4/simpack_8c.js new file mode 100644 index 00000000..21a09096 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simpack_8c.js @@ -0,0 +1,4 @@ +var simpack_8c = +[ + [ "simpack", "simpack_8c.html#a1044c3047067228a30d93a351a079bab", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/simpack_8c_source.html b/ver-1.7.0/ver-1.6.4/simpack_8c_source.html new file mode 100644 index 00000000..679b263b --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simpack_8c_source.html @@ -0,0 +1,225 @@ + + + + + + + +NCEPLIBS-g2c: simpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    simpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdlib.h>
    +
    7 #include <math.h>
    +
    8 #include "grib2.h"
    +
    9 
    +
    33 void
    +
    34 simpack(g2float *fld, g2int ndpts, g2int *idrstmpl,
    +
    35  unsigned char *cpack, g2int *lcpack)
    +
    36 {
    +
    37  static g2int zero = 0;
    +
    38  g2int *ifld;
    +
    39  g2int j, nbits, imin, imax, maxdif, nbittot, left;
    +
    40  g2float bscale, dscale, rmax, rmin, temp;
    +
    41  double maxnum;
    +
    42  static g2float alog2 = 0.69314718; /* ln(2.0) */
    +
    43 
    +
    44  bscale = int_power(2.0, -idrstmpl[1]);
    +
    45  dscale = int_power(10.0, idrstmpl[2]);
    +
    46  if (idrstmpl[3] <= 0 || idrstmpl[3] > 31)
    +
    47  nbits = 0;
    +
    48  else
    +
    49  nbits = idrstmpl[3];
    +
    50 
    +
    51  /* Find max and min values in the data. */
    +
    52  rmax = fld[0];
    +
    53  rmin = fld[0];
    +
    54  for (j = 1; j < ndpts; j++) {
    +
    55  if (fld[j] > rmax)
    +
    56  rmax = fld[j];
    +
    57  if (fld[j] < rmin)
    +
    58  rmin = fld[j];
    +
    59  }
    +
    60 
    +
    61  ifld = calloc(ndpts, sizeof(g2int));
    +
    62 
    +
    63  /* If max and min values are not equal, pack up field. If they are
    +
    64  * equal, we have a constant field, and the reference value (rmin)
    +
    65  * is the value for each point in the field and set nbits to 0. */
    +
    66  if (rmin != rmax) {
    +
    67 
    +
    68  /* Determine which algorithm to use based on user-supplied
    +
    69  * binary scale factor and number of bits. */
    +
    70  if (nbits == 0 && idrstmpl[1] == 0) {
    +
    71 
    +
    72  /* No binary scaling and calculate minumum number of bits
    +
    73  * in which the data will fit. */
    +
    74  imin = (g2int)rint(rmin * dscale);
    +
    75  imax = (g2int)rint(rmax * dscale);
    +
    76  maxdif = imax - imin;
    +
    77  temp = log((double)(maxdif + 1)) / alog2;
    +
    78  nbits = (g2int)ceil(temp);
    +
    79  rmin = (g2float)imin;
    +
    80  /* scale data */
    +
    81  for(j = 0; j < ndpts; j++)
    +
    82  ifld[j] = (g2int)rint(fld[j] * dscale) - imin;
    +
    83  }
    +
    84  else if (nbits != 0 && idrstmpl[1] == 0) {
    +
    85 
    +
    86  /* Use minimum number of bits specified by user and adjust
    +
    87  * binary scaling factor to accomodate data. */
    +
    88  rmin = rmin * dscale;
    +
    89  rmax = rmax * dscale;
    +
    90  maxnum = int_power(2.0, nbits) - 1;
    +
    91  temp = log(maxnum / (rmax - rmin)) / alog2;
    +
    92  idrstmpl[1] = (g2int)ceil(-1.0 * temp);
    +
    93  bscale = int_power(2.0, -idrstmpl[1]);
    +
    94  /* scale data */
    +
    95  for (j = 0; j < ndpts; j++)
    +
    96  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    97  }
    +
    98  else if (nbits == 0 && idrstmpl[1] != 0) {
    +
    99 
    +
    100  /* Use binary scaling factor and calculate minumum number
    +
    101  * of bits in which the data will fit. */
    +
    102  rmin = rmin * dscale;
    +
    103  rmax = rmax * dscale;
    +
    104  maxdif = (g2int)rint((rmax - rmin) * bscale);
    +
    105  temp = log((double)(maxdif + 1)) / alog2;
    +
    106  nbits = (g2int)ceil(temp);
    +
    107  /* scale data */
    +
    108  for (j = 0; j < ndpts; j++)
    +
    109  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    110  }
    +
    111  else if (nbits != 0 && idrstmpl[1] != 0) {
    +
    112 
    +
    113  /* Use binary scaling factor and use minumum number of
    +
    114  * bits specified by user. Dangerous - may loose
    +
    115  * information if binary scale factor and nbits not set
    +
    116  * properly by user. */
    +
    117  rmin = rmin * dscale;
    +
    118  /* scale data */
    +
    119  for (j = 0; j < ndpts; j++)
    +
    120  ifld[j] = (g2int)rint(((fld[j] * dscale) - rmin) * bscale);
    +
    121  }
    +
    122 
    +
    123  /* Pack data, Pad last octet with Zeros, if necessary, and
    +
    124  * calculate the length of the packed data in bytes. */
    +
    125  sbits(cpack, ifld, 0, nbits, 0, ndpts);
    +
    126  nbittot = nbits * ndpts;
    +
    127  left = 8 - (nbittot % 8);
    +
    128  if (left != 8) {
    +
    129  sbit(cpack, &zero, nbittot, left); /* Pad with zeros to fill Octet. */
    +
    130  nbittot = nbittot + left;
    +
    131  }
    +
    132  *lcpack = nbittot / 8;
    +
    133  }
    +
    134  else {
    +
    135  nbits = 0;
    +
    136  *lcpack = 0;
    +
    137  }
    +
    138 
    +
    139  /* Fill in ref value and number of bits in Template 5.0. */
    +
    140  mkieee(&rmin, idrstmpl, 1); /* ensure reference value is IEEE format. */
    +
    141  idrstmpl[3] = nbits;
    +
    142  idrstmpl[4] = 0; /* original data were reals. */
    +
    143 
    +
    144  free(ifld);
    +
    145 }
    +
    void sbit(unsigned char *out, g2int *in, g2int iskip, g2int nbyte)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:38
    +
    void sbits(unsigned char *out, g2int *in, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Store bits - put arbitrary size values into a packed bit string, taking the low order bits from each ...
    Definition: gbits.c:114
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    void simpack(g2float *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...
    Definition: simpack.c:34
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/simunpack_8c.html b/ver-1.7.0/ver-1.6.4/simunpack_8c.html new file mode 100644 index 00000000..44279da7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simunpack_8c.html @@ -0,0 +1,179 @@ + + + + + + + +NCEPLIBS-g2c: simunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    simunpack.c File Reference
    +
    +
    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    g2int simunpack (unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *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...
     
    +

    Detailed Description

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-10-29
    + +

    Definition in file simunpack.c.

    +

    Function Documentation

    + +

    ◆ simunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int simunpack (unsigned char * cpack,
    g2intidrstmpl,
    g2int ndpts,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.0.
    ndptsThe number of data values to unpack.
    fldContains the unpacked data values. fld must be `* allocated with at least ndpts * sizeof(g2float) 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 gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/simunpack_8c.js b/ver-1.7.0/ver-1.6.4/simunpack_8c.js new file mode 100644 index 00000000..8f4baafd --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simunpack_8c.js @@ -0,0 +1,4 @@ +var simunpack_8c = +[ + [ "simunpack", "simunpack_8c.html#aee9904f7aa97792022274de23107ba09", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/simunpack_8c_source.html b/ver-1.7.0/ver-1.6.4/simunpack_8c_source.html new file mode 100644 index 00000000..03d49058 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/simunpack_8c_source.html @@ -0,0 +1,148 @@ + + + + + + + +NCEPLIBS-g2c: simunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    simunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    4 #include <stdio.h>
    +
    5 #include <stdlib.h>
    +
    6 #include "grib2.h"
    +
    7 
    +
    25 g2int
    +
    26 simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts,
    +
    27  g2float *fld)
    +
    28 {
    +
    29  g2int *ifld;
    +
    30  g2int j, nbits;
    +
    31  g2float ref, bscale, dscale;
    +
    32 
    +
    33  rdieee(idrstmpl, &ref, 1);
    +
    34  bscale = int_power(2.0, idrstmpl[1]);
    +
    35  dscale = int_power(10.0, -idrstmpl[2]);
    +
    36  nbits = idrstmpl[3];
    +
    37 
    +
    38  if (!(ifld = calloc(ndpts, sizeof(g2int))))
    +
    39  {
    +
    40  fprintf(stderr, "Could not allocate space in simunpack.\n "
    +
    41  "Data field NOT upacked.\n");
    +
    42  return(1);
    +
    43  }
    +
    44 
    +
    45  /* If nbits equals 0, we have a constant field where the reference
    +
    46  * value is the data value at each gridpoint. */
    +
    47  if (nbits != 0)
    +
    48  {
    +
    49  gbits(cpack, ifld, 0, nbits, 0, ndpts);
    +
    50  for (j = 0; j < ndpts; j++)
    +
    51  fld[j] = (((g2float)ifld[j] * bscale) + ref) * dscale;
    +
    52  }
    +
    53  else
    +
    54  {
    +
    55  for (j = 0; j < ndpts; j++)
    +
    56  fld[j] = ref;
    +
    57  }
    +
    58 
    +
    59  free(ifld);
    +
    60  return(0);
    +
    61 }
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    g2int simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2float *fld)
    This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
    Definition: simunpack.c:26
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/specpack_8c.html b/ver-1.7.0/ver-1.6.4/specpack_8c.html new file mode 100644 index 00000000..3e020dcf --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specpack_8c.html @@ -0,0 +1,211 @@ + + + + + + + +NCEPLIBS-g2c: specpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    specpack.c File Reference
    +
    +
    + +

    Pack a spectral data field using the complex packing algorithm for spherical harmonic data. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    void specpack (g2float *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...
     
    +

    Detailed Description

    +

    Pack a spectral data field using the complex packing algorithm for spherical harmonic data.

    +
    Author
    Stephen Gilbert
    +
    Date
    2002-12-19
    + +

    Definition in file specpack.c.

    +

    Function Documentation

    + +

    ◆ specpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void specpack (g2floatfld,
    g2int ndpts,
    g2int JJ,
    g2int KK,
    g2int MM,
    g2intidrstmpl,
    unsigned char * cpack,
    g2intlcpack 
    )
    +
    + +

    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
    + + + + + + + + + +
    fldContains the data values to be packed.
    ndptsThe number of data values to pack.
    JJJ - pentagonal resolution parameter.
    KKK - pentagonal resolution parameter.
    MMM - pentagonal resolution parameter.
    idrstmplContains 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).
    cpackPointer that gets the packed data field. Must be allocated by caller.
    lcpacklength 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().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/specpack_8c.js b/ver-1.7.0/ver-1.6.4/specpack_8c.js new file mode 100644 index 00000000..e6aa3f04 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specpack_8c.js @@ -0,0 +1,4 @@ +var specpack_8c = +[ + [ "specpack", "specpack_8c.html#a4464faa396c6e14a740e0ff4b4a0c9a1", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/specpack_8c_source.html b/ver-1.7.0/ver-1.6.4/specpack_8c_source.html new file mode 100644 index 00000000..7a39ff95 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specpack_8c_source.html @@ -0,0 +1,199 @@ + + + + + + + +NCEPLIBS-g2c: specpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    specpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    7 #include <stdio.h>
    +
    8 #include <stdlib.h>
    +
    9 #include <math.h>
    +
    10 #include "grib2.h"
    +
    11 
    +
    32 void
    +
    33 specpack(g2float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM,
    +
    34  g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
    +
    35 {
    +
    36 
    +
    37  g2int *ifld, tmplsim[5];
    +
    38  g2float *unpk, *tfld;
    +
    39  g2float *pscale, tscale;
    +
    40  g2int Js, Ks, Ms, Ts, Ns, inc, incu, incp, n, Nm, m, ipos;
    +
    41 
    +
    42  Js = idrstmpl[5];
    +
    43  Ks = idrstmpl[6];
    +
    44  Ms = idrstmpl[7];
    +
    45  Ts = idrstmpl[8];
    +
    46 
    +
    47  /* Calculate Laplacian scaling factors for each possible wave
    +
    48  * number. */
    +
    49  pscale = malloc((JJ + MM + 1) * sizeof(g2float));
    +
    50  tscale = (g2float)idrstmpl[4] * 1E-6;
    +
    51  for (n = Js; n <= JJ + MM; n++)
    +
    52  pscale[n] = pow((g2float)(n * (n + 1)), tscale);
    +
    53 
    +
    54  /* Separate spectral coeffs into two lists; one to contain
    +
    55  * unpacked values within the sub-spectrum Js, Ks, Ms, and the
    +
    56  * other with values outside of the sub-spectrum to be packed. */
    +
    57  tfld = malloc(ndpts * sizeof(g2float));
    +
    58  unpk = malloc(ndpts * sizeof(g2float));
    +
    59  ifld = malloc(ndpts * sizeof(g2int));
    +
    60  inc = 0;
    +
    61  incu = 0;
    +
    62  incp = 0;
    +
    63  for (m = 0; m <= MM; m++)
    +
    64  {
    +
    65  Nm = JJ; /* triangular or trapezoidal */
    +
    66  if (KK == JJ + MM)
    +
    67  Nm = JJ + m; /* rhombodial */
    +
    68  Ns = Js; /* triangular or trapezoidal */
    +
    69  if (Ks == Js + Ms)
    +
    70  Ns = Js + m; /* rhombodial */
    +
    71  for (n = m; n <= Nm; n++)
    +
    72  {
    +
    73  if (n <= Ns && m <= Ms)
    +
    74  { /* save unpacked value */
    +
    75  unpk[incu++] = fld[inc++]; /* real part */
    +
    76  unpk[incu++] = fld[inc++]; /* imaginary part */
    +
    77  }
    +
    78  else
    +
    79  { /* Save value to be packed and scale Laplacian scale factor. */
    +
    80  tfld[incp++] = fld[inc++] * pscale[n]; /* real part */
    +
    81  tfld[incp++] = fld[inc++] * pscale[n]; /* imaginary part */
    +
    82  }
    +
    83  }
    +
    84  }
    +
    85  free(pscale);
    +
    86 
    +
    87  if (incu != Ts)
    +
    88  {
    +
    89  printf("specpack: Incorrect number of unpacked values %d given:\n", (int)Ts);
    +
    90  printf("specpack: Resetting idrstmpl[8] to %d\n", (int)incu);
    +
    91  Ts = incu;
    +
    92  }
    +
    93 
    +
    94  /* Add unpacked values to the packed data array in 32-bit IEEE
    +
    95  * format. */
    +
    96  mkieee(unpk, (g2int *)cpack, Ts);
    +
    97  ipos = 4 * Ts;
    +
    98 
    +
    99  /* Scale and pack the rest of the coefficients. */
    +
    100  tmplsim[1] = idrstmpl[1];
    +
    101  tmplsim[2] = idrstmpl[2];
    +
    102  tmplsim[3] = idrstmpl[3];
    +
    103  simpack(tfld, ndpts - Ts, tmplsim, cpack + ipos, lcpack);
    +
    104  *lcpack = (*lcpack) + ipos;
    +
    105 
    +
    106  /* Fill in Template 5.51. */
    +
    107  idrstmpl[0] = tmplsim[0];
    +
    108  idrstmpl[1] = tmplsim[1];
    +
    109  idrstmpl[2] = tmplsim[2];
    +
    110  idrstmpl[3] = tmplsim[3];
    +
    111  idrstmpl[8] = Ts;
    +
    112  idrstmpl[9] = 1; /* Unpacked spectral data is 32-bit IEEE */
    +
    113 
    +
    114  free(tfld);
    +
    115  free(unpk);
    +
    116  free(ifld);
    +
    117 
    +
    118  return;
    +
    119 }
    +
    void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *)
    This subroutine packs up a data field using the simple packing algorithm as defined in the GRIB2 docu...
    Definition: simpack.c:34
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    void mkieee(g2float *a, g2int *rieee, g2int num)
    This subroutine stores a list of real values in 32-bit IEEE floating point format.
    Definition: mkieee.c:21
    +
    void specpack(g2float *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...
    Definition: specpack.c:33
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/specunpack_8c.html b/ver-1.7.0/ver-1.6.4/specunpack_8c.html new file mode 100644 index 00000000..ad8a1dd7 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specunpack_8c.html @@ -0,0 +1,205 @@ + + + + + + + +NCEPLIBS-g2c: specunpack.c File Reference + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    specunpack.c File Reference
    +
    +
    + +

    Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data. +More...

    +
    #include <stdio.h>
    +#include <stdlib.h>
    +#include <math.h>
    +#include "grib2.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Functions

    g2int specunpack (unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *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...
     
    +

    Detailed Description

    +

    Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data.

    +
    Author
    Stephen Gilbert
    +
    Date
    2000-06-21
    + +

    Definition in file specunpack.c.

    +

    Function Documentation

    + +

    ◆ specunpack()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    g2int specunpack (unsigned char * cpack,
    g2intidrstmpl,
    g2int ndpts,
    g2int JJ,
    g2int KK,
    g2int MM,
    g2floatfld 
    )
    +
    + +

    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
    + + + + + + + + +
    cpackpointer to the packed data field.
    idrstmplpointer to the array of values for Data Representation Template 5.51.
    ndptsThe number of data values to unpack (real and imaginary parts).
    JJpentagonal resolution parameter.
    KKpentagonal resolution parameter.
    MMpentagonal resolution parameter.
    fldContains the unpacked data values. fld must be allocated with at least ndpts * sizeof(g2float) 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 gbits(), int_power(), and rdieee().

    + +

    Referenced by g2_unpack7().

    + +
    +
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/specunpack_8c.js b/ver-1.7.0/ver-1.6.4/specunpack_8c.js new file mode 100644 index 00000000..b30365bb --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specunpack_8c.js @@ -0,0 +1,4 @@ +var specunpack_8c = +[ + [ "specunpack", "specunpack_8c.html#aeb5b149867887c46a6eca7737531d3a5", null ] +]; \ No newline at end of file diff --git a/ver-1.7.0/ver-1.6.4/specunpack_8c_source.html b/ver-1.7.0/ver-1.6.4/specunpack_8c_source.html new file mode 100644 index 00000000..7b8753b9 --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/specunpack_8c_source.html @@ -0,0 +1,192 @@ + + + + + + + +NCEPLIBS-g2c: specunpack.c Source File + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    NCEPLIBS-g2c +  1.6.4 +
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    specunpack.c
    +
    +
    +Go to the documentation of this file.
    1 
    +
    6 #include <stdio.h>
    +
    7 #include <stdlib.h>
    +
    8 #include <math.h>
    +
    9 #include "grib2.h"
    +
    10 
    +
    34 g2int
    +
    35 specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ,
    +
    36  g2int KK, g2int MM, g2float *fld)
    +
    37 {
    +
    38  g2int *ifld, j, iofst, nbits;
    +
    39  g2float ref, bscale, dscale, *unpk;
    +
    40  g2float *pscale, tscale;
    +
    41  g2int Js, Ks, Ms, Ts, Ns, Nm, n, m;
    +
    42  g2int inc, incu, incp;
    +
    43 
    +
    44  rdieee(idrstmpl+0, &ref, 1);
    +
    45  bscale = int_power(2.0, idrstmpl[1]);
    +
    46  dscale = int_power(10.0, -idrstmpl[2]);
    +
    47  nbits = idrstmpl[3];
    +
    48  Js = idrstmpl[5];
    +
    49  Ks = idrstmpl[6];
    +
    50  Ms = idrstmpl[7];
    +
    51  Ts = idrstmpl[8];
    +
    52 
    +
    53  if (idrstmpl[9] == 1)
    +
    54  { /* unpacked floats are 32-bit IEEE */
    +
    55 
    +
    56  unpk = malloc(ndpts * sizeof(g2float));
    +
    57  ifld = malloc(ndpts * sizeof(g2int));
    +
    58 
    +
    59  gbits(cpack, ifld, 0, 32, 0, Ts);
    +
    60  iofst = 32 * Ts;
    +
    61  rdieee(ifld, unpk, Ts); /* read IEEE unpacked floats */
    +
    62  gbits(cpack, ifld, iofst, nbits, 0, ndpts - Ts); /* unpack scaled data */
    +
    63 
    +
    64  /* Calculate Laplacian scaling factors for each possible wave
    +
    65  * number. */
    +
    66  pscale = malloc((JJ + MM + 1) * sizeof(g2float));
    +
    67  tscale = idrstmpl[4] * 1E-6;
    +
    68  for (n = Js; n <= JJ + MM; n++)
    +
    69  pscale[n] = pow((g2float)(n * (n+1)), -tscale);
    +
    70 
    +
    71  /* Assemble spectral coeffs back to original order. */
    +
    72  inc = 0;
    +
    73  incu = 0;
    +
    74  incp = 0;
    +
    75  for (m = 0; m <= MM; m++)
    +
    76  {
    +
    77  Nm = JJ; /* triangular or trapezoidal */
    +
    78  if (KK == JJ+MM)
    +
    79  Nm = JJ + m; /* rhombodial */
    +
    80  Ns = Js; /* triangular or trapezoidal */
    +
    81  if (Ks == Js + Ms)
    +
    82  Ns = Js + m; /* rhombodial */
    +
    83  for (n = m; n <= Nm; n++)
    +
    84  {
    +
    85  if (n <= Ns && m <= Ms)
    +
    86  { /* grab unpacked value */
    +
    87  fld[inc++] = unpk[incu++]; /* real part */
    +
    88  fld[inc++] = unpk[incu++]; /* imaginary part */
    +
    89  }
    +
    90  else
    +
    91  { /* Calc coeff from packed value */
    +
    92  fld[inc++] = (((g2float)ifld[incp++] * bscale) + ref) *
    +
    93  dscale * pscale[n]; /* real part */
    +
    94  fld[inc++] = (((g2float)ifld[incp++] * bscale) + ref) *
    +
    95  dscale * pscale[n]; /* imaginary part */
    +
    96  }
    +
    97  }
    +
    98  }
    +
    99 
    +
    100  free(pscale);
    +
    101  free(unpk);
    +
    102  free(ifld);
    +
    103  }
    +
    104  else
    +
    105  {
    +
    106  printf("specunpack: Cannot handle 64 or 128-bit floats.\n");
    +
    107  for (j = 0; j < ndpts; j++)
    +
    108  fld[j] = 0.0;
    +
    109  return -3;
    +
    110  }
    +
    111 
    +
    112  return 0;
    +
    113 }
    +
    void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte, g2int nskip, g2int n)
    Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
    Definition: gbits.c:57
    +
    Header file for NCEPLIBS-g2c library.
    +
    float g2float
    Float type.
    Definition: grib2.h:22
    +
    int64_t g2int
    Long integer type.
    Definition: grib2.h:20
    +
    double int_power(double x, g2int y)
    Function similar to C pow() power function.
    Definition: int_power.c:17
    +
    void rdieee(g2int *rieee, g2float *a, g2int num)
    This subroutine reads a list of real values in 32-bit IEEE floating point format.
    Definition: rdieee.c:20
    +
    g2int specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2float *fld)
    This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...
    Definition: specunpack.c:35
    +
    +
    + + + + diff --git a/ver-1.7.0/ver-1.6.4/splitbar.png b/ver-1.7.0/ver-1.6.4/splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/splitbar.png differ diff --git a/ver-1.7.0/ver-1.6.4/sync_off.png b/ver-1.7.0/ver-1.6.4/sync_off.png new file mode 100644 index 00000000..3b443fc6 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/sync_off.png differ diff --git a/ver-1.7.0/ver-1.6.4/sync_on.png b/ver-1.7.0/ver-1.6.4/sync_on.png new file mode 100644 index 00000000..e08320fb Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/sync_on.png differ diff --git a/ver-1.7.0/ver-1.6.4/tab_a.png b/ver-1.7.0/ver-1.6.4/tab_a.png new file mode 100644 index 00000000..3b725c41 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/tab_a.png differ diff --git a/ver-1.7.0/ver-1.6.4/tab_b.png b/ver-1.7.0/ver-1.6.4/tab_b.png new file mode 100644 index 00000000..e2b4a863 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/tab_b.png differ diff --git a/ver-1.7.0/ver-1.6.4/tab_h.png b/ver-1.7.0/ver-1.6.4/tab_h.png new file mode 100644 index 00000000..fd5cb705 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/tab_h.png differ diff --git a/ver-1.7.0/ver-1.6.4/tab_s.png b/ver-1.7.0/ver-1.6.4/tab_s.png new file mode 100644 index 00000000..ab478c95 Binary files /dev/null and b/ver-1.7.0/ver-1.6.4/tab_s.png differ diff --git a/ver-1.7.0/ver-1.6.4/tabs.css b/ver-1.7.0/ver-1.6.4/tabs.css new file mode 100644 index 00000000..7d45d36c --- /dev/null +++ b/ver-1.7.0/ver-1.6.4/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}}