NCEPLIBS-g2c 1.9.0
Loading...
Searching...
No Matches
g2_miss.c
Go to the documentation of this file.
1
8#include "grib2_int.h"
9
23void
24g2_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)
Check the Data Representation Template to see if missing value management is used,...
Definition g2_miss.c:24
g2int idrtnum
Data Representation Template Number (see Table 5.0).
Definition grib2.h:183
g2int * idrtmpl
Contains the data values for the Data Representation Template specified by idrtnum.
Definition grib2.h:190
int64_t g2int
Long integer type.
Definition grib2.h:32
Struct for GRIB2 field.
Definition grib2.h:46
Header file with internal function prototypes NCEPLIBS-g2c library.
void rdieee(g2int *rieee, float *a, g2int num)
Read a list of real values in 32-bit IEEE floating point format.
Definition rdieee.c:20