| 1 |
#include "grib2.h" |
| 2 |
|
| 3 |
void g2_miss( gribfield *gfld, float *rmiss, int *nmiss ) |
| 4 |
//$$$ SUBPROGRAM DOCUMENTATION BLOCK |
| 5 |
// . . . . |
| 6 |
// SUBPROGRAM: g2_miss |
| 7 |
// PRGMMR: Gilbert ORG: W/NP11 DATE: 2004-12-16 |
| 8 |
// |
| 9 |
// ABSTRACT: This routine checks the Data Representation Template to see if |
| 10 |
// missing value management is used, and returns the missing value(s) |
| 11 |
// in the data field. |
| 12 |
// |
| 13 |
// PROGRAM HISTORY LOG: |
| 14 |
// 2004-12-16 Gilbert |
| 15 |
// |
| 16 |
// USAGE: g2_miss( gribfield *gfld, float *rmiss, int *nmiss ) |
| 17 |
// |
| 18 |
// INPUT ARGUMENT LIST: |
| 19 |
// *gfld - pointer to gribfield structure (defined in include file |
| 20 |
// grib2.h) |
| 21 |
// |
| 22 |
// OUTPUT ARGUMENT LIST: |
| 23 |
// rmiss - List of the missing values used |
| 24 |
// nmiss - NUmber of the missing values included in the field |
| 25 |
// |
| 26 |
// REMARKS: rmiss must be allocated in the calling program with enough space |
| 27 |
// hold all the missing values. |
| 28 |
// |
| 29 |
// ATTRIBUTES: |
| 30 |
// LANGUAGE: C |
| 31 |
// MACHINE: IBM SP |
| 32 |
// |
| 33 |
//$$$ |
| 34 |
{ |
| 35 |
g2int itype; |
| 36 |
|
| 37 |
/* |
| 38 |
* Missing value management currently only used in |
| 39 |
* DRT's 5.2 and 5.3. |
| 40 |
*/ |
| 41 |
if ( gfld->idrtnum != 2 && gfld->idrtnum != 3 ) { |
| 42 |
*nmiss=0; |
| 43 |
return; |
| 44 |
} |
| 45 |
|
| 46 |
itype = gfld->idrtmpl[4]; |
| 47 |
if ( gfld->idrtmpl[6] == 1 ) { |
| 48 |
*nmiss=1; |
| 49 |
if (itype == 0) |
| 50 |
rdieee(gfld->idrtmpl+7,rmiss+0,1); |
| 51 |
else |
| 52 |
rmiss[0]=(float)gfld->idrtmpl[7]; |
| 53 |
} |
| 54 |
else if ( gfld->idrtmpl[6] == 2 ) { |
| 55 |
*nmiss=2; |
| 56 |
if (itype == 0) { |
| 57 |
rdieee(gfld->idrtmpl+7,rmiss+0,1); |
| 58 |
rdieee(gfld->idrtmpl+8,rmiss+1,1); |
| 59 |
} |
| 60 |
else { |
| 61 |
rmiss[0]=(float)gfld->idrtmpl[7]; |
| 62 |
rmiss[1]=(float)gfld->idrtmpl[8]; |
| 63 |
} |
| 64 |
} |
| 65 |
else { |
| 66 |
*nmiss=0; |
| 67 |
} |
| 68 |
|
| 69 |
} |