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