#include #include #include #include #include #include /* version 1.2.1 of grib headers w. ebisuzaki */ #ifndef INT2 #define INT2(a,b) ((1-(int) ((unsigned) (a & 0x80) >> 6)) * (int) (((a & 0x7f) << 8) + b)) #endif #define BDS_LEN(bds) ((int) ((bds[0]<<16)+(bds[1]<<8)+bds[2])) #define BDS_Flag(bds) (bds[3]) #define BDS_Grid(bds) ((bds[3] & 128) == 0) #define BDS_Harmonic(bds) (bds[3] & 128) #define BDS_Packing(bds) ((bds[3] & 64) != 0) #define BDS_SimplePacking(bds) ((bds[3] & 64) == 0) #define BDS_ComplexPacking(bds) ((bds[3] & 64) != 0) #define BDS_OriginalType(bds) ((bds[3] & 32) != 0) #define BDS_OriginalFloat(bds) ((bds[3] & 32) == 0) #define BDS_OriginalInt(bds) ((bds[3] & 32) != 0) #define BDS_MoreFlags(bds) ((bds[3] & 16) != 0) #define BDS_UnusedBits(bds) ((int) (bds[3] & 15)) #define BDS_BinScale(bds) INT2(bds[4],bds[5]) #define BDS_RefValue(bds) (ibm2flt(bds+6)) #define BDS_NumBits(bds) ((int) bds[10]) #define BDS_DataStart(bds) ((int) (11 + BDS_MoreFlags(bds)*3)) /* breaks if BDS_NumBits(bds) == 0 */ #define BDS_NValues(bds) (((BDS_LEN(bds) - BDS_DataStart(bds))*8 - \ BDS_UnusedBits(bds)) / BDS_NumBits(bds)) /* #define BDS_NValues(bds) ((BDS_NumBits(bds) == 0) ? 0 : \ (((BDS_LEN(bds) - BDS_DataStart(bds))*8 - \ BDS_UnusedBits(bds)) / BDS_NumBits(bds))) */ /* undefined value -- if bitmap */ #define UNDEFINED 9.999e20 /* version 1.2 of grib headers w. ebisuzaki */ #define BMS_LEN(bms) ((bms) == NULL ? 0 : (bms[0]<<16)+(bms[1]<<8)+bms[2]) #define BMS_UnusedBits(bms) ((bms) == NULL ? 0 : bms[3]) #define BMS_StdMap(bms) ((bms) == NULL ? 0 : ((bms[4]<<8) + bms[5])) #define BMS_bitmap(bms) ((bms) == NULL ? NULL : (bms)+6) #define BMS_nxny(bms) ((((bms) == NULL) || BMS_StdMap(bms)) \ ? 0 : (BMS_LEN(bms)*8 - 48 - BMS_UnusedBits(bms))) /* cnames_file.c */ /* search order for parameter names * * #define P_TABLE_FIRST * look at external parameter table first * * otherwise use builtin NCEP-2 or ECMWF-160 first */ /* #define P_TABLE_FIRST */ /* search order for external parameter table * 1) environment variable GRIBTAB * 2) environment variable gribtab * 3) the file 'gribtab' in current directory */ /* cnames.c */ /* then default values */ char *k5toa(unsigned char *pds); char *k5_comments(unsigned char *pds); int setup_user_table(int center, int subcenter, int ptable); struct ParmTable { char *name, *comment; }; /* version 1.4.1 of grib headers w. ebisuzaki */ /* this version is incomplete */ #ifndef INT3 #define INT3(a,b,c) ((1-(int) ((unsigned) (a & 0x80) >> 6)) * (int) (((a & 127) << 16)+(b<<8)+c)) #endif #ifndef INT2 #define INT2(a,b) ((1-(int) ((unsigned) (a & 0x80) >> 6)) * (int) (((a & 127) << 8) + b)) #endif #ifndef UINT3 #define UINT3(a,b,c) ((int) ((a << 16) + (b << 8) + (c))) #endif #ifndef UINT2 #define UINT2(a,b) ((int) ((a << 8) + (b))) #endif #define GDS_Len1(gds) (gds[0]) #define GDS_Len2(gds) (gds[1]) #define GDS_Len3(gds) (gds[2]) #define GDS_LEN(gds) ((int) ((gds[0]<<16)+(gds[1]<<8)+gds[2])) #define GDS_NV(gds) (gds[3]) #define GDS_DataType(gds) (gds[5]) #define GDS_LatLon(gds) (gds[5] == 0) #define GDS_Mercator(gds) (gds[5] == 1) #define GDS_Gnomonic(gds) (gds[5] == 2) #define GDS_Lambert(gds) (gds[5] == 3) #define GDS_Gaussian(gds) (gds[5] == 4) #define GDS_Polar(gds) (gds[5] == 5) #define GDS_RotLL(gds) (gds[5] == 10) #define GDS_Harmonic(gds) (gds[5] == 50) #define GDS_ssEgrid(gds) (gds[5] == 201) /* semi-staggered E grid */ #define GDS_fEgrid(gds) (gds[5] == 202) /* filled E grid */ #define GDS_LatLon_nx(gds) ((int) ((gds[6] << 8) + gds[7])) #define GDS_LatLon_ny(gds) ((int) ((gds[8] << 8) + gds[9])) #define GDS_LatLon_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_LatLon_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_LatLon_mode(gds) (gds[16]) #define GDS_LatLon_La2(gds) INT3(gds[17],gds[18],gds[19]) #define GDS_LatLon_Lo2(gds) INT3(gds[20],gds[21],gds[22]) #define GDS_LatLon_dx(gds) INT2(gds[23],gds[24]) #define GDS_LatLon_dy(gds) INT2(gds[25],gds[26]) #define GDS_Gaussian_nlat(gds) ((gds[25]<<8)+gds[26]) #define GDS_LatLon_scan(gds) (gds[27]) #define GDS_Polar_nx(gds) ((gds[6] << 8) + gds[7]) #define GDS_Polar_ny(gds) ((gds[8] << 8) + gds[9]) #define GDS_Polar_La1(gds) (INT3(gds[10],gds[11],gds[12])) #define GDS_Polar_Lo1(gds) (INT3(gds[13],gds[14],gds[15])) #define GDS_Polar_Lov(gds) (INT3(gds[17],gds[18],gds[19])) #define GDS_Polar_scan(gds) (gds[27]) #define GDS_Polar_Dx(gds) (INT3(gds[20], gds[21], gds[22])) #define GDS_Polar_Dy(gds) (INT3(gds[23], gds[24], gds[25])) #define GDS_Polar_pole(gds) ((gds[26] & 128) == 128) #define GDS_Lambert_nx(gds) ((gds[6] << 8) + gds[7]) #define GDS_Lambert_ny(gds) ((gds[8] << 8) + gds[9]) #define GDS_Lambert_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_Lambert_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_Lambert_mode(gds) (gds[16]) #define GDS_Lambert_Lov(gds) INT3(gds[17],gds[18],gds[19]) #define GDS_Lambert_dx(gds) INT3(gds[20],gds[21],gds[22]) #define GDS_Lambert_dy(gds) INT3(gds[23],gds[24],gds[25]) #define GDS_Lambert_NP(gds) ((gds[26] & 128) == 0) #define GDS_Lambert_scan(gds) (gds[27]) #define GDS_Lambert_Latin1(gds) INT3(gds[28],gds[29],gds[30]) #define GDS_Lambert_Latin2(gds) INT3(gds[31],gds[32],gds[33]) #define GDS_Lambert_LatSP(gds) INT3(gds[34],gds[35],gds[36]) #define GDS_Lambert_LonSP(gds) INT3(gds[37],gds[37],gds[37]) #define GDS_ssEgrid_n(gds) UINT2(gds[6],gds[7]) #define GDS_ssEgrid_n_dum(gds) UINT2(gds[8],gds[9]) #define GDS_ssEgrid_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_ssEgrid_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_ssEgrid_mode(gds) (gds[16]) #define GDS_ssEgrid_La2(gds) UINT3(gds[17],gds[18],gds[19]) #define GDS_ssEgrid_Lo2(gds) UINT3(gds[20],gds[21],gds[22]) #define GDS_ssEgrid_di(gds) INT2(gds[23],gds[24]) #define GDS_ssEgrid_dj(gds) INT2(gds[25],gds[26]) #define GDS_ssEgrid_scan(gds) (gds[27]) #define GDS_fEgrid_n(gds) UINT2(gds[6],gds[7]) #define GDS_fEgrid_n_dum(gds) UINT2(gds[8],gds[9]) #define GDS_fEgrid_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_fEgrid_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_fEgrid_mode(gds) (gds[16]) #define GDS_fEgrid_La2(gds) UINT3(gds[17],gds[18],gds[19]) #define GDS_fEgrid_Lo2(gds) UINT3(gds[20],gds[21],gds[22]) #define GDS_fEgrid_di(gds) INT2(gds[23],gds[24]) #define GDS_fEgrid_dj(gds) INT2(gds[25],gds[26]) #define GDS_fEgrid_scan(gds) (gds[27]) #define GDS_Merc_nx(gds) UINT2(gds[6],gds[7]) #define GDS_Merc_ny(gds) UINT2(gds[8],gds[9]) #define GDS_Merc_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_Merc_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_Merc_mode(gds) (gds[16]) #define GDS_Merc_La2(gds) INT3(gds[17],gds[18],gds[19]) #define GDS_Merc_Lo2(gds) INT3(gds[20],gds[21],gds[22]) #define GDS_Merc_Latin(gds) INT3(gds[23],gds[24],gds[25]) #define GDS_Merc_scan(gds) (gds[27]) #define GDS_Merc_dx(gds) INT3(gds[28],gds[29],gds[30]) #define GDS_Merc_dy(gds) INT3(gds[31],gds[32],gds[33]) /* rotated Lat-lon grid */ #define GDS_RotLL_nx(gds) UINT2(gds[6],gds[7]) #define GDS_RotLL_ny(gds) UINT2(gds[8],gds[9]) #define GDS_RotLL_La1(gds) INT3(gds[10],gds[11],gds[12]) #define GDS_RotLL_Lo1(gds) INT3(gds[13],gds[14],gds[15]) #define GDS_RotLL_mode(gds) (gds[16]) #define GDS_RotLL_La2(gds) INT3(gds[17],gds[18],gds[19]) #define GDS_RotLL_Lo2(gds) INT3(gds[20],gds[21],gds[22]) #define GDS_RotLL_dx(gds) INT2(gds[23],gds[24]) #define GDS_RotLL_dy(gds) INT2(gds[25],gds[26]) #define GDS_RotLL_scan(gds) (gds[27]) #define GDS_RotLL_LaSP(gds) INT3(gds[32],gds[33],gds[34]) #define GDS_RotLL_LoSP(gds) INT3(gds[35],gds[36],gds[37]) #define GDS_RotLL_RotAng(gds) ibm2flt(&(gds[38])) /* index of NV and PV */ #define GDS_PV(gds) ((gds[3] == 0) ? -1 : (int) gds[4] - 1) #define GDS_PL(gds) ((gds[4] == 255) ? -1 : (int) gds[3] * 4 + (int) gds[4] - 1) enum Def_NCEP_Table {rean, opn, rean_nowarn, opn_nowarn}; unsigned char *seek_grib(FILE *file, long *pos, long *len_grib, unsigned char *buffer, unsigned int buf_len); int read_grib(FILE *file, long pos, long len_grib, unsigned char *buffer); double ibm2flt(unsigned char *ibm); void BDS_unpack(float *flt, unsigned char *bits, unsigned char *bitmap, int n_bits, int n, double ref, double scale); double int_power(double x, int y); int flt2ieee(float x, unsigned char *ieee); int wrtieee(float *array, int n, int header, FILE *output); int wrtieee_header(unsigned int n, FILE *output); void levels(int, int); void PDStimes(int time_range, int p1, int p2, int time_unit); int missing_points(unsigned char *bitmap, int n); void EC_ext(unsigned char *pds, char *prefix, char *suffix); int GDS_grid(unsigned char *gds, int *nx, int *ny, long int *nxny); void GDS_prt_thin_lon(unsigned char *gds); int PDS_date(unsigned char *pds, int option, int verf_time); int add_time(int *year, int *month, int *day, int *hour, int dtime, int unit); int verf_time(unsigned char *pds, int *year, int *month, int *day, int *hour); void print_pds(unsigned char *pds, int print_PDS, int print_PDS10, int verbose); void print_gds(unsigned char *gds, int print_GDS, int print_GDS10, int verbose); void ensemble(unsigned char *pds, int mode); /* version 3.4 of grib headers w. ebisuzaki */ /* this version is incomplete */ #ifndef INT2 #define INT2(a,b) ((1-(int) ((unsigned) (a & 0x80) >> 6)) * (int) (((a & 0x7f) << 8) + b)) #endif #define PDS_Len1(pds) (pds[0]) #define PDS_Len2(pds) (pds[1]) #define PDS_Len3(pds) (pds[2]) #define PDS_LEN(pds) ((int) ((pds[0]<<16)+(pds[1]<<8)+pds[2])) #define PDS_Vsn(pds) (pds[3]) #define PDS_Center(pds) (pds[4]) #define PDS_Model(pds) (pds[5]) #define PDS_Grid(pds) (pds[6]) #define PDS_HAS_GDS(pds) ((pds[7] & 128) != 0) #define PDS_HAS_BMS(pds) ((pds[7] & 64) != 0) #define PDS_PARAM(pds) (pds[8]) #define PDS_L_TYPE(pds) (pds[9]) #define PDS_LEVEL1(pds) (pds[10]) #define PDS_LEVEL2(pds) (pds[11]) #define PDS_KPDS5(pds) (pds[8]) #define PDS_KPDS6(pds) (pds[9]) #define PDS_KPDS7(pds) ((int) ((pds[10]<<8) + pds[11])) /* this requires a 32-bit default integer machine */ #define PDS_Field(pds) ((pds[8]<<24)+(pds[9]<<16)+(pds[10]<<8)+pds[11]) #define PDS_Year(pds) (pds[12]) #define PDS_Month(pds) (pds[13]) #define PDS_Day(pds) (pds[14]) #define PDS_Hour(pds) (pds[15]) #define PDS_Minute(pds) (pds[16]) #define PDS_ForecastTimeUnit(pds) (pds[17]) #define PDS_P1(pds) (pds[18]) #define PDS_P2(pds) (pds[19]) #define PDS_TimeRange(pds) (pds[20]) #define PDS_NumAve(pds) ((int) ((pds[21]<<8)+pds[22])) #define PDS_NumMissing(pds) (pds[23]) #define PDS_Century(pds) (pds[24]) #define PDS_Subcenter(pds) (pds[25]) #define PDS_DecimalScale(pds) INT2(pds[26],pds[27]) /* old #define PDS_Year4(pds) (pds[12] + 100*(pds[24] - (pds[12] != 0))) */ #define PDS_Year4(pds) (pds[12] + 100*(pds[24] - 1)) /* various centers */ #define NMC 7 #define ECMWF 98 /* ECMWF Extensions */ #define PDS_EcLocalId(pds) (PDS_LEN(pds) >= 41 ? (pds[40]) : 0) #define PDS_EcClass(pds) (PDS_LEN(pds) >= 42 ? (pds[41]) : 0) #define PDS_EcType(pds) (PDS_LEN(pds) >= 43 ? (pds[42]) : 0) #define PDS_EcStream(pds) (PDS_LEN(pds) >= 45 ? (INT2(pds[43], pds[44])) : 0) #define PDS_EcENS(pds) (PDS_LEN(pds) >= 52 && pds[40] == 1 && \ pds[43] * 256 + pds[44] == 1035 && pds[50] != 0) #define PDS_EcFcstNo(pds) (pds[50]) #define PDS_EcNoFcst(pds) (pds[51]) /* NCEP Extensions */ #define PDS_NcepENS(pds) (PDS_LEN(pds) >= 44 && pds[25] == 2 && pds[40] == 1) #define PDS_NcepFcstType(pds) (pds[41]) #define PDS_NcepFcstNo(pds) (pds[42]) #define PDS_NcepFcstProd(pds) (pds[43]) /* time units */ #define MINUTE 0 #define HOUR 1 #define DAY 2 #define MONTH 3 #define YEAR 4 #define DECADE 5 #define NORMAL 6 #define CENTURY 7 #define HOURS3 10 #define HOURS6 11 #define HOURS12 12 #define SECOND 254 #define VERSION "v1.7.3.1 (8-5-99) Wesley Ebisuzaki" #define CHECK_GRIB /* * wgrib.c extract/inventory grib records * * Wesley Ebisuzaki * * 11/94 - v1.0 * 11/94 - v1.1: arbitary size grids, -i option * 11/94 - v1.2: bug fixes, ieee option, more info * 1/95 - v1.2.4: fix headers for SUN acc * 2/95 - v1.2.5: add num_ave in -s listing * 2/95 - v1.2.6: change %d to %ld * 2/95 - v1.2.7: more output, added some polar stereographic support * 2/95 - v1.2.8: max min format changed %f to %g, tidying up more info * 3/95 - v1.3.0: fix bug with bitmap, allow numbers > UNDEFINED * 3/95 - v1.3.1: print number of missing points (verbose) * 3/95 - v1.3.2: -append option added * 4/95 - v1.3.2a,b: more output, polar stereo support (-V option) * 4/95 - v1.3.3: added ECMWF parameter table (prelim) * 6/95 - v1.3.4: nxny from BDS rather than gds? * 9/95 - v1.3.4d: speedup in grib write * 11/95 - v1.3.4f: new ECMWF parameter table (from Mike Fiorino), EC logic * 2/96 - v1.3.4g-h: prelim fix for GDS-less grib files * 2/96 - v1.3.4i: faster missing(), -V: "pos n" -> "n" (field 2) * 3/96 - v1.4: fix return code (!inventory), and short records near EOF * 6/96 - v1.4.1a: faster grib->binary decode, updated ncep parameter table, mod. in clim. desc * 7/96 - v1.5.0: parameter-table aware, -v option changed, added "comments" * increased NTRY to 100 in seek_grib * 11/96 - v1.5.0b: added ECMWF parameter table 128 * 1/97 - v1.5.0b2: if nxny != nx*ny { nx = nxny; ny = 1 } * 3/97 - v1.5.0b5: added: -PDS -GDS, Lambert Conformal * 3/97 - v1.5.0b6: added: -verf * 4/97 - v1.5.0b7: added -PDS10, -GDS10 and enhanced -PDS -GDS * 4/97 - v1.5.0b8: "bitmap missing x" -> "bitmap: x undef" * 5/97 - v1.5.0b9: thinned grids meta data * 5/97 - v1.5.0b10: changed 0hr fcst to anal for TR=10 and P1=P2=0 * 5/97 - v1.5.0b10: added -H option * 6/97 - v1.5.0b12: thinned lat-long grids -V option * 6/97 - v1.5.0b13: -4yr * 6/97 - v1.5.0b14: fix century mark Y=100 not 0 * 7/97 - v1.5.0b15: add ncep opn grib table * 12/97 - v1.6.1.a: made ncep_opn the default table * 12/97 - v1.6.1.b: changed 03TOT to O3TOT in operational ncep table * 1/98 - v1.6.2: added Arakawa E grid meta-data * 1/98 - v1.6.2.1: added some mode data, Scan -> scan * 4/98 - v1.6.2.4: reanalysis id code: subcenter==0 && process==180 * 5/98 - v1.6.2.5: fix -H code to write all of GDS * 7/98 - v1.7: fix decoding bug for bitmap and no. bits > 24 (theoretical bug) * 7/98 - v1.7.0.b1: add km to Mercator meta-data * 5/99 - v1.7.2: bug with thinned grids & bitmaps (nxny != nx*ny) * 5/99 - v1.7.3: updated NCEP opn grib table * 8/99 - v1.7.3.1: updated level information * */ /* * MSEEK = I/O buffer size for seek_grib */ #define MSEEK 1024 #define BUFF_ALLOC0 40000 #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) < (b) ? (b) : (a)) #endif #ifndef DEF_T62_NCEP_TABLE #define DEF_T62_NCEP_TABLE rean #endif enum Def_NCEP_Table def_ncep_table = DEF_T62_NCEP_TABLE; int main(int argc, char **argv) { unsigned char *buffer; float *array; double temp, rmin, rmax; int i, nx, ny, file_arg; long int len_grib, pos = 0, nxny, buffer_size, n_dump, count = 1; unsigned char *msg, *pds, *gds, *bms, *bds, *pointer; FILE *input, *dump_file = NULL; char line[200]; enum {BINARY, TEXT, IEEE, GRIB, NONE} output_type = NONE; enum {DUMP_ALL, DUMP_RECORD, DUMP_POSITION, DUMP_LIST, INVENTORY} mode = INVENTORY; long int dump = -1; int verbose = 0, append = 0, v_time = 0, year_4 = 0, output_PDS_GDS = 0; int print_GDS = 0, print_GDS10 = 0, print_PDS = 0, print_PDS10 = 0; char *dump_file_name = "dump", open_parm[3]; int header = 1, return_code = 0; if (argc == 1) { fprintf(stderr, "\nPortable Grib decoder for %s etc.\n", (def_ncep_table == opn_nowarn || def_ncep_table == opn) ? "NCEP Operations" : "NCEP/NCAR Reanalysis"); fprintf(stderr, " it slices, dices %s\n", VERSION); fprintf(stderr, " usage: %s [grib file] [options]\n\n", argv[0]); fprintf(stderr, "Inventory/diagnostic-output selections\n"); fprintf(stderr, " -s/-v short/verbose inventory\n"); fprintf(stderr, " -V diagnostic output (not inventory)\n"); fprintf(stderr, " (none) regular inventory\n"); fprintf(stderr, " Options\n"); fprintf(stderr, " -PDS/-PDS10 print PDS in hex/decimal\n"); fprintf(stderr, " -GDS/-GDS10 print GDS in hex/decimal\n"); fprintf(stderr, " -verf print forecast verification time\n"); fprintf(stderr, " -ncep_opn/-ncep_rean default T62 NCEP grib table\n"); fprintf(stderr, " -4yr print year using 4 digits\n"); fprintf(stderr, "Decoding GRIB selection\n"); fprintf(stderr, " -d [record number|all] decode record number\n"); fprintf(stderr, " -p [byte position] decode record at byte position\n"); fprintf(stderr, " -i decode controlled by stdin (inventory list)\n"); fprintf(stderr, " (none) no decoding\n"); fprintf(stderr, " Options\n"); fprintf(stderr, " -text/-ieee/-grib/-bin convert to text/ieee/grib/bin (default)\n"); fprintf(stderr, " -nh/-h output will have no headers/headers (default)\n"); fprintf(stderr, " -H output will include PDS and GDS (-bin/-ieee only)\n"); fprintf(stderr, " -append append to output file\n"); fprintf(stderr, " -o [file] output file name, 'dump' is default\n"); exit(8); } file_arg = 0; for (i = 1; i < argc; i++) { if (strcmp(argv[i],"-PDS") == 0) { print_PDS = 1; continue; } if (strcmp(argv[i],"-PDS10") == 0) { print_PDS10 = 1; continue; } if (strcmp(argv[i],"-GDS") == 0) { print_GDS = 1; continue; } if (strcmp(argv[i],"-GDS10") == 0) { print_GDS10 = 1; continue; } if (strcmp(argv[i],"-v") == 0) { verbose = 1; continue; } if (strcmp(argv[i],"-V") == 0) { verbose = 2; continue; } if (strcmp(argv[i],"-s") == 0) { verbose = -1; continue; } if (strcmp(argv[i],"-text") == 0) { output_type = TEXT; continue; } if (strcmp(argv[i],"-bin") == 0) { output_type = BINARY; continue; } if (strcmp(argv[i],"-ieee") == 0) { output_type = IEEE; continue; } if (strcmp(argv[i],"-grib") == 0) { output_type = GRIB; continue; } if (strcmp(argv[i],"-nh") == 0) { header = 0; continue; } if (strcmp(argv[i],"-h") == 0) { header = 1; continue; } if (strcmp(argv[i],"-append") == 0) { append = 1; continue; } if (strcmp(argv[i],"-verf") == 0) { v_time = 1; continue; } if (strcmp(argv[i],"-d") == 0) { if (strcmp(argv[i+1],"all") == 0) { mode = DUMP_ALL; } else { dump = atol(argv[i+1]); mode = DUMP_RECORD; } i++; if (output_type == NONE) output_type = BINARY; continue; } if (strcmp(argv[i],"-p") == 0) { pos = atol(argv[i+1]); i++; dump = 1; if (output_type == NONE) output_type = BINARY; mode = DUMP_POSITION; continue; } if (strcmp(argv[i],"-i") == 0) { if (output_type == NONE) output_type = BINARY; mode = DUMP_LIST; continue; } if (strcmp(argv[i],"-H") == 0) { output_PDS_GDS = 1; continue; } if (strcmp(argv[i],"-NH") == 0) { output_PDS_GDS = 0; continue; } if (strcmp(argv[i],"-4yr") == 0) { year_4 = 1; continue; } if (strcmp(argv[i],"-ncep_opn") == 0) { def_ncep_table = opn_nowarn; continue; } if (strcmp(argv[i],"-ncep_rean") == 0) { def_ncep_table = rean_nowarn; continue; } if (strcmp(argv[i],"-o") == 0) { dump_file_name = argv[i+1]; i++; continue; } if (strcmp(argv[i],"--v") == 0) { printf("wgrib: %s\n", VERSION); exit(0); } if (file_arg == 0) { file_arg = i; } else { fprintf(stderr,"argument: %s ????\n", argv[i]); } } if ((input = fopen(argv[file_arg],"rb")) == NULL) { fprintf(stderr,"could not open file: %s\n", argv[file_arg]); exit(7); } if ((buffer = (unsigned char *) malloc(BUFF_ALLOC0)) == NULL) { fprintf(stderr,"not enough memory\n"); } buffer_size = BUFF_ALLOC0; /* open output file */ if (mode != INVENTORY) { open_parm[0] = append ? 'a' : 'w'; open_parm[1] = 'b'; open_parm[2] = '\0'; if (output_type == TEXT) open_parm[1] = '\0'; if ((dump_file = fopen(dump_file_name,open_parm)) == NULL) { fprintf(stderr,"could not open dump file\n"); exit(8); } } /* skip dump - 1 records */ for (i = 1; i < dump; i++) { msg = seek_grib(input, &pos, &len_grib, buffer, MSEEK); if (msg == NULL) { fprintf(stderr, "ran out of data or bad file\n"); exit(8); } pos += len_grib; } if (dump > 0) count += dump - 1; n_dump = 0; for (;;) { if (n_dump == 1 && (mode == DUMP_RECORD || mode == DUMP_POSITION)) break; if (mode == DUMP_LIST) { if (fgets(line,sizeof(line), stdin) == NULL) break; line[sizeof(line) - 1] = 0; if (sscanf(line,"%ld:%ld:", &count, &pos) != 2) { fprintf(stderr,"bad input from stdin\n"); exit(8); } } msg = seek_grib(input, &pos, &len_grib, buffer, MSEEK); if (msg == NULL) { if (mode == INVENTORY || mode == DUMP_ALL) break; fprintf(stderr,"missing GRIB record(s)\n"); exit(8); } /* read all whole grib record */ if (len_grib + msg - buffer > buffer_size) { buffer_size = len_grib + msg - buffer + 1000; buffer = (unsigned char *) realloc((void *) buffer, buffer_size); if (buffer == NULL) { fprintf(stderr,"ran out of memory\n"); exit(8); } } read_grib(input, pos, len_grib, buffer); /* parse grib message */ msg = buffer; pds = (msg + 8); pointer = pds + PDS_LEN(pds); #ifdef DEBUG printf("LEN_GRIB= 0x%x\n", len_grib); printf("PDS_LEN= 0x%x: at 0x%x\n", PDS_LEN(pds),pds-msg); #endif if (PDS_HAS_GDS(pds)) { gds = pointer; pointer += GDS_LEN(gds); #ifdef DEBUG printf("GDS_LEN= 0x%x: at 0x%x\n", GDS_LEN(gds), gds-msg); #endif } else { gds = NULL; } if (PDS_HAS_BMS(pds)) { bms = pointer; pointer += BMS_LEN(bms); #ifdef DEBUG printf("BMS_LEN= 0x%x: at 0x%x\n", BMS_LEN(bms),bms-msg); #endif } else { bms = NULL; } bds = pointer; pointer += BDS_LEN(bds); #ifdef DEBUG printf("BDS_LEN= 0x%x: at 0x%x\n", BDS_LEN(bds),bds-msg); #endif #ifdef DEBUG printf("END_LEN= 0x%x: at 0x%x\n", 4,pointer-msg); if (pointer-msg+4 != len_grib) { fprintf(stderr,"Len of grib message is inconsistent.\n"); } #endif /* end section - "7777" in ascii */ if (pointer[0] != 0x37 || pointer[1] != 0x37 || pointer[2] != 0x37 || pointer[3] != 0x37) { fprintf(stderr,"\n\n missing end section\n"); fprintf(stderr, "%2x %2x %2x %2x\n", pointer[0], pointer[1], pointer[2], pointer[3]); #ifdef DEBUG printf("ignoring missing end section\n"); #else exit(8); #endif } /* figure out size of array */ if (gds != NULL) { /* this doesn't work for spherical harmonics */ GDS_grid(gds, &nx, &ny, &nxny); } else if (bms != NULL) { nxny = nx = BMS_nxny(bms); ny = 1; } else { if (BDS_NumBits(bds) == 0) { nxny = nx = 1; fprintf(stderr,"Missing GDS, constant record .. cannot " "determine number of data points\n"); } else { nxny = nx = BDS_NValues(bds); } ny = 1; } #ifdef CHECK_GRIB if (BDS_NumBits(bds) != 0) { i = BDS_NValues(bds); if (bms != NULL) { i += missing_points(BMS_bitmap(bms),nxny); } if (i != nxny) { fprintf(stderr,"grib header at record %ld: two values of nxny %ld %d\n", count,nxny,i); fprintf(stderr," LEN %d DataStart %d UnusedBits %d #Bits %d nxny %ld\n", BDS_LEN(bds), BDS_DataStart(bds),BDS_UnusedBits(bds), BDS_NumBits(bds), nxny); return_code = 15; nxny = nx = i; ny = 1; } } #endif if (verbose <= 0) { printf("%ld:%ld:d=", count, pos); PDS_date(pds,year_4,v_time); printf(":%s:", k5toa(pds)); if (verbose == 0) printf("kpds5=%d:kpds6=%d:kpds7=%d:TR=%d:P1=%d:P2=%d:TimeU=%d:", PDS_PARAM(pds),PDS_KPDS6(pds),PDS_KPDS7(pds), PDS_TimeRange(pds),PDS_P1(pds),PDS_P2(pds), PDS_ForecastTimeUnit(pds)); levels(PDS_KPDS6(pds), PDS_KPDS7(pds)); printf(":"); PDStimes(PDS_TimeRange(pds),PDS_P1(pds),PDS_P2(pds), PDS_ForecastTimeUnit(pds)); if (PDS_Center(pds) == ECMWF) EC_ext(pds,"",":"); ensemble(pds, verbose); printf("NAve=%d",PDS_NumAve(pds)); if (print_PDS || print_PDS10) print_pds(pds, print_PDS, print_PDS10, verbose); if (gds && (print_GDS || print_GDS10)) print_gds(gds, print_GDS, print_GDS10, verbose); printf("\n"); } else if (verbose == 1) { printf("%ld:%ld:D=", count, pos); PDS_date(pds, 1, v_time); printf(":%s:", k5toa(pds)); levels(PDS_KPDS6(pds), PDS_KPDS7(pds)); printf(":"); printf("kpds=%d,%d,%d:", PDS_PARAM(pds),PDS_KPDS6(pds),PDS_KPDS7(pds)); PDStimes(PDS_TimeRange(pds),PDS_P1(pds),PDS_P2(pds), PDS_ForecastTimeUnit(pds)); if (PDS_Center(pds) == ECMWF) EC_ext(pds,"",":"); ensemble(pds, verbose); printf("\"%s", k5_comments(pds)); if (print_PDS || print_PDS10) print_pds(pds, print_PDS, print_PDS10, verbose); if (gds && (print_GDS || print_GDS10)) print_gds(gds, print_GDS, print_GDS10, verbose); printf("\n"); } else if (verbose == 2) { printf("rec %ld:%ld:date ", count, pos); PDS_date(pds, 1, v_time); printf(" %s kpds5=%d kpds6=%d kpds7=%d levels=(%d,%d) grid=%d ", k5toa(pds), PDS_PARAM(pds), PDS_KPDS6(pds), PDS_KPDS7(pds), PDS_LEVEL1(pds), PDS_LEVEL2(pds), PDS_Grid(pds)); levels(PDS_KPDS6(pds),PDS_KPDS7(pds)); printf(" "); if (PDS_Center(pds) == ECMWF) EC_ext(pds,""," "); ensemble(pds, verbose); PDStimes(PDS_TimeRange(pds),PDS_P1(pds),PDS_P2(pds), PDS_ForecastTimeUnit(pds)); if (bms != NULL) printf(" bitmap: %d undef", missing_points(BMS_bitmap(bms),nxny)); printf("\n %s=%s\n", k5toa(pds), k5_comments(pds)); printf(" timerange %d P1 %d P2 %d TimeU %d nx %d ny %d GDS grid %d " "num_in_ave %d missing %d\n", PDS_TimeRange(pds),PDS_P1(pds),PDS_P2(pds), PDS_ForecastTimeUnit(pds), nx, ny, gds == NULL ? -1 : GDS_DataType(gds), PDS_NumAve(pds), PDS_NumMissing(pds)); printf(" center %d subcenter %d process %d Table %d\n", PDS_Center(pds),PDS_Subcenter(pds),PDS_Model(pds), PDS_Vsn(pds)); if (gds && GDS_LatLon(gds) && nx != -1) printf(" latlon: lat %f to %f by %f nxny %ld\n" " long %f to %f by %f, (%d x %d) scan %d " "mode %d bdsgrid %d\n", 0.001*GDS_LatLon_La1(gds), 0.001*GDS_LatLon_La2(gds), 0.001*GDS_LatLon_dy(gds), nxny, 0.001*GDS_LatLon_Lo1(gds), 0.001*GDS_LatLon_Lo2(gds), 0.001*GDS_LatLon_dx(gds), nx, ny, GDS_LatLon_scan(gds), GDS_LatLon_mode(gds), BDS_Grid(bds)); else if (gds && GDS_LatLon(gds) && nx == -1) { printf(" thinned latlon: lat %f to %f by %f nxny %ld\n" " long %f to %f, %ld grid pts (%d x %d) scan %d" " mode %d bdsgrid %d\n", 0.001*GDS_LatLon_La1(gds), 0.001*GDS_LatLon_La2(gds), 0.001*GDS_LatLon_dy(gds), nxny, 0.001*GDS_LatLon_Lo1(gds), 0.001*GDS_LatLon_Lo2(gds), nxny, nx, ny, GDS_LatLon_scan(gds), GDS_LatLon_mode(gds), BDS_Grid(bds)); GDS_prt_thin_lon(gds); } else if (gds && GDS_Gaussian(gds) && nx != -1) printf(" gaussian: lat %f to %f\n" " long %f to %f by %f, (%d x %d) scan %d" " mode %d bdsgrid %d\n", 0.001*GDS_LatLon_La1(gds), 0.001*GDS_LatLon_La2(gds), 0.001*GDS_LatLon_Lo1(gds), 0.001*GDS_LatLon_Lo2(gds), 0.001*GDS_LatLon_dx(gds), nx, ny, GDS_LatLon_scan(gds), GDS_LatLon_mode(gds), BDS_Grid(bds)); else if (gds && GDS_Gaussian(gds) && nx == -1) { printf(" thinned gaussian: lat %f to %f\n" " lon %f %ld grid pts (%d x %d) scan %d" " mode %d bdsgrid %d nlat:\n", 0.001*GDS_LatLon_La1(gds), 0.001*GDS_LatLon_La2(gds), 0.001*GDS_LatLon_Lo1(gds), nxny, nx, ny, GDS_LatLon_scan(gds), GDS_LatLon_mode(gds), BDS_Grid(bds)); GDS_prt_thin_lon(gds); } else if (gds && GDS_Polar(gds)) printf(" polar stereo: Lat1 %f Long1 %f Orient %f\n" " %s pole (%d x %d) Dx %d Dy %d scan %d\n", 0.001*GDS_Polar_La1(gds),0.001*GDS_Polar_Lo1(gds), 0.001*GDS_Polar_Lov(gds), GDS_Polar_pole(gds) == 0 ? "north" : "south", nx,ny, GDS_Polar_Dx(gds),GDS_Polar_Dy(gds), GDS_Polar_scan(gds)); else if (gds && GDS_Lambert(gds)) printf(" Lambert Conf: Lat1 %f Lon1 %f Lov %f\n" " Latin1 %f Latin2 %f LatSP %f LonSP %f\n" " %s (%d x %d) Dx %f Dy %f scan %d mode %d\n", 0.001*GDS_Lambert_La1(gds),0.001*GDS_Lambert_Lo1(gds), 0.001*GDS_Lambert_Lov(gds), 0.001*GDS_Lambert_Latin1(gds), 0.001*GDS_Lambert_Latin2(gds), 0.001*GDS_Lambert_LatSP(gds), 0.001*GDS_Lambert_LonSP(gds), GDS_Lambert_NP(gds) ? "North Pole": "South Pole", GDS_Lambert_nx(gds), GDS_Lambert_ny(gds), 0.001*GDS_Lambert_dx(gds), 0.001*GDS_Lambert_dy(gds), GDS_Lambert_scan(gds), GDS_Lambert_mode(gds)); else if (gds && GDS_Mercator(gds)) printf(" Mercator: lat %f to %f by %f km nxny %ld\n" " long %f to %f by %f km, (%d x %d) scan %d" " mode %d Latin %f bdsgrid %d\n", 0.001*GDS_Merc_La1(gds), 0.001*GDS_Merc_La2(gds), 0.001*GDS_Merc_dy(gds), nxny, 0.001*GDS_Merc_Lo1(gds), 0.001*GDS_Merc_Lo2(gds), 0.001*GDS_Merc_dx(gds), nx, ny, GDS_Merc_scan(gds), GDS_Merc_mode(gds), 0.001*GDS_Merc_Latin(gds), BDS_Grid(bds)); else if (gds && GDS_ssEgrid(gds)) printf(" Semi-staggered Arakawa E-Grid: lat0 %f lon0 %f nxny %d\n" " dLat %f dLon %f (%d x %d) scan %d mode %d\n", 0.001*GDS_ssEgrid_La1(gds), 0.001*GDS_ssEgrid_Lo1(gds), GDS_ssEgrid_n(gds)*GDS_ssEgrid_n_dum(gds), 0.001*GDS_ssEgrid_dj(gds), 0.001*GDS_ssEgrid_di(gds), GDS_ssEgrid_Lo2(gds), GDS_ssEgrid_La2(gds), GDS_ssEgrid_scan(gds), GDS_ssEgrid_mode(gds)); else if (gds && GDS_fEgrid(gds)) printf(" filled Arakawa E-Grid: lat0 %f lon0 %f nxny %d\n" " dLat %f dLon %f (%d x %d) scan %d mode %d\n", 0.001*GDS_fEgrid_La1(gds), 0.001*GDS_fEgrid_Lo1(gds), GDS_fEgrid_n(gds)*GDS_fEgrid_n_dum(gds), 0.001*GDS_fEgrid_dj(gds), 0.001*GDS_fEgrid_di(gds), GDS_fEgrid_Lo2(gds), GDS_fEgrid_La2(gds), GDS_fEgrid_scan(gds), GDS_fEgrid_mode(gds)); else if (gds && GDS_RotLL(gds)) printf(" rotated LatLon grid lat %f to %f lon %f to %f\n" " nxny %ld (%d x %d) dx %d dy %d scan %d mode %d\n" " transform: south pole lat %f lon %f rot angle %f\n", 0.001*GDS_RotLL_La1(gds), 0.001*GDS_RotLL_La2(gds), 0.001*GDS_RotLL_Lo1(gds), 0.001*GDS_RotLL_Lo2(gds), nxny, GDS_RotLL_nx(gds), GDS_RotLL_ny(gds), GDS_RotLL_dx(gds), GDS_RotLL_dy(gds), GDS_RotLL_scan(gds), GDS_RotLL_mode(gds), 0.001*GDS_RotLL_LaSP(gds), 0.001*GDS_RotLL_LoSP(gds), GDS_RotLL_RotAng(gds) ); else if (gds && GDS_Gnomonic(gds)) printf(" Gnomonic grid\n"); else if (gds && GDS_Harmonic(gds)) printf(" Harmonic (spectral)\n"); if (print_PDS || print_PDS10) print_pds(pds, print_PDS, print_PDS10, verbose); if (gds && (print_GDS || print_GDS10)) print_gds(gds, print_GDS, print_GDS10, verbose); } if (mode != INVENTORY && output_type == GRIB) { fwrite((void *) msg, sizeof(char), len_grib, dump_file); n_dump++; } if ((mode != INVENTORY && output_type != GRIB) || verbose > 1) { /* decode numeric data */ if ((array = (float *) malloc(sizeof(float) * nxny)) == NULL) { fprintf(stderr,"memory problems\n"); exit(8); } temp = int_power(10.0, - PDS_DecimalScale(pds)); BDS_unpack(array, bds + 11, BMS_bitmap(bms), BDS_NumBits(bds), nxny, temp*BDS_RefValue(bds),temp*int_power(2.0, BDS_BinScale(bds))); if (verbose > 1) { rmin = FLT_MAX; rmax = -FLT_MAX; for (i = 0; i < nxny; i++) { if (fabs(array[i]-UNDEFINED) > 0.0001*UNDEFINED) { rmin = min(rmin,array[i]); rmax = max(rmax,array[i]); } } printf(" min/max data %g %g num bits %d " " BDS_Ref %g DecScale %d BinScale %d\n", rmin, rmax, BDS_NumBits(bds), BDS_RefValue(bds), PDS_DecimalScale(pds), BDS_BinScale(bds)); } if (mode != INVENTORY && output_type != GRIB) { /* dump code */ if (output_PDS_GDS == 1) { /* insert code here */ if (output_type == BINARY || output_type == IEEE) { /* write PDS */ i = PDS_LEN(pds) + 4; if (header && output_type == BINARY) fwrite((void *) &i, sizeof(int), 1, dump_file); if (header && output_type == IEEE) wrtieee_header(i, dump_file); fwrite((void *) "PDS ", 1, 4, dump_file); fwrite((void *) pds, 1, i - 4, dump_file); if (header && output_type == BINARY) fwrite((void *) &i, sizeof(int), 1, dump_file); if (header && output_type == IEEE) wrtieee_header(i, dump_file); /* write GDS */ i = (gds) ? GDS_LEN(gds) + 4 : 4; if (header && output_type == BINARY) fwrite((void *) &i, sizeof(int), 1, dump_file); if (header && output_type == IEEE) wrtieee_header(i, dump_file); fwrite((void *) "GDS ", 1, 4, dump_file); if (gds) fwrite((void *) gds, 1, i - 4, dump_file); if (header && output_type == BINARY) fwrite((void *) &i, sizeof(int), 1, dump_file); if (header && output_type == IEEE) wrtieee_header(i, dump_file); } } if (output_type == BINARY) { i = nxny * sizeof(float); if (header) fwrite((void *) &i, sizeof(int), 1, dump_file); fwrite((void *) array, sizeof(float), nxny, dump_file); if (header) fwrite((void *) &i, sizeof(int), 1, dump_file); } else if (output_type == IEEE) { wrtieee(array, nxny, header, dump_file); } else if (output_type == TEXT) { /* number of points in grid */ if (header) { if (nx <= 0 || ny <= 0 || nxny != nx*ny) { fprintf(dump_file, "%ld %d\n", nxny, 1); } else { fprintf(dump_file, "%d %d\n", nx, ny); } } for (i = 0; i < nxny; i++) { fprintf(dump_file,"%g\n", array[i]); } } n_dump++; } free(array); if (verbose > 0) printf("\n"); } pos += len_grib; count++; } if (mode != INVENTORY) { if (ferror(dump_file)) { fprintf(stderr,"error writing %s\n",dump_file_name); exit(8); } } fclose(input); return (return_code); } void print_pds(unsigned char *pds, int print_PDS, int print_PDS10, int verbose) { int i, j; j = PDS_LEN(pds); if (verbose < 2) { if (print_PDS && verbose < 2) { printf(":PDS="); for (i = 0; i < j; i++) { printf("%2.2x", (int) pds[i]); } } if (print_PDS10 && verbose < 2) { printf(":PDS10="); for (i = 0; i < j; i++) { printf(" %d", (int) pds[i]); } } } else { if (print_PDS) { printf(" PDS(1..%d)=",j); for (i = 0; i < j; i++) { if (i % 20 == 0) printf("\n %4d:",i+1); printf(" %3.2x", (int) pds[i]); } printf("\n"); } if (print_PDS10) { printf(" PDS10(1..%d)=",j); for (i = 0; i < j; i++) { if (i % 20 == 0) printf("\n %4d:",i+1); printf(" %3d", (int) pds[i]); } printf("\n"); } } } void print_gds(unsigned char *gds, int print_GDS, int print_GDS10, int verbose) { int i, j; j = GDS_LEN(gds); if (verbose < 2) { if (print_GDS && verbose < 2) { printf(":GDS="); for (i = 0; i < j; i++) { printf("%2.2x", (int) gds[i]); } } if (print_GDS10 && verbose < 2) { printf(":GDS10="); for (i = 0; i < j; i++) { printf(" %d", (int) gds[i]); } } } else { if (print_GDS) { printf(" GDS(1..%d)=",j); for (i = 0; i < j; i++) { if (i % 20 == 0) printf("\n %4d:",i+1); printf(" %3.2x", (int) gds[i]); } printf("\n"); } if (print_GDS10) { printf(" GDS10(1..%d)=",j); for (i = 0; i < j; i++) { if (i % 20 == 0) printf("\n %4d:",i+1); printf(" %3d", (int) gds[i]); } printf("\n"); } } } /* * find next grib header * * file = what do you think? * pos = initial position to start looking at ( = 0 for 1st call) * returns with position of next grib header (units=bytes) * len_grib = length of the grib record (bytes) * buffer[buf_len] = buffer for reading/writing * * returns (char *) to start of GRIB header+PDS * NULL if not found * * adapted from SKGB (Mark Iredell) * * v1.1 9/94 Wesley Ebisuzaki * v1.2 3/96 Wesley Ebisuzaki handles short records at end of file * v1.3 8/96 Wesley Ebisuzaki increase NTRY from 3 to 100 for the folks * at Automation decided a 21 byte WMO bulletin header wasn't long * enough and decided to go to an 8K header. * */ #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) #endif #define NTRY 100 /* #define LEN_HEADER_PDS (28+42+100) */ #define LEN_HEADER_PDS (28+8) unsigned char *seek_grib(FILE *file, long *pos, long *len_grib, unsigned char *buffer, unsigned int buf_len) { int i, j, len; for (j = 0; j < NTRY; j++) { if (fseek(file, *pos, SEEK_SET) == -1) { *len_grib = 0; return (unsigned char *) NULL; } i = fread(buffer, sizeof (unsigned char), buf_len, file); len = i - LEN_HEADER_PDS; for (i = 0; i < len; i++) { if (buffer[i] == 'G' && buffer[i+1] == 'R' && buffer[i+2] == 'I' && buffer[i+3] == 'B' && buffer[i+7] == 1) { *pos = i + *pos; *len_grib = (buffer[i+4] << 16) + (buffer[i+5] << 8) + buffer[i+6]; return (buffer+i); } } *pos = *pos + (buf_len - LEN_HEADER_PDS); } *len_grib = 0; return (unsigned char *) NULL; } /* ibm2flt wesley ebisuzaki * * v1.1 .. faster * v1.1 .. if mant == 0 -> quick return * */ double ibm2flt(unsigned char *ibm) { int positive, power; unsigned int abspower; long int mant; double value, exp; mant = (ibm[1] << 16) + (ibm[2] << 8) + ibm[3]; if (mant == 0) return 0.0; positive = (ibm[0] & 0x80) == 0; power = (int) (ibm[0] & 0x7f) - 64; abspower = power > 0 ? power : -power; /* calc exp */ exp = 16.0; value = 1.0; while (abspower) { if (abspower & 1) { value *= exp; } exp = exp * exp; abspower >>= 1; } if (power < 0) value = 1.0 / value; value = value * mant / 16777216.0; if (positive == 0) value = -value; return value; } /* * read_grib.c * * reads grib message * * input: pos, byte position of grib message * len_grib, length of grib message * output: *buffer, grib message * * note: call seek_grib first * * v1.0 9/94 Wesley Ebisuzaki * */ int read_grib(FILE *file, long pos, long len_grib, unsigned char *buffer) { int i; if (fseek(file, pos, SEEK_SET) == -1) { return 0; } i = fread(buffer, sizeof (unsigned char), len_grib, file); return (i == len_grib); } /* * w. ebisuzaki * * return x**y * * * input: double x * int y */ double int_power(double x, int y) { double value; if (y < 0) { y = -y; x = 1.0 / x; } value = 1.0; while (y) { if (y & 1) { value *= x; } x = x * x; y >>= 1; } return value; } /* cnames.c Wesley Ebisuzaki * * returns strings with either variable name or comment field * v1.4 4/98 * reanalysis can use process 180 and subcenter 0 */ extern struct ParmTable parm_table_ncep_opn[256]; extern struct ParmTable parm_table_ncep_reanal[256]; extern struct ParmTable parm_table_omb[256]; extern struct ParmTable parm_table_ecmwf_128[256]; extern struct ParmTable parm_table_ecmwf_129[256]; extern struct ParmTable parm_table_ecmwf_130[256]; extern struct ParmTable parm_table_ecmwf_131[256]; extern struct ParmTable parm_table_ecmwf_140[256]; extern struct ParmTable parm_table_ecmwf_150[256]; extern struct ParmTable parm_table_ecmwf_160[256]; extern struct ParmTable parm_table_ecmwf_170[256]; extern struct ParmTable parm_table_ecmwf_180[256]; extern struct ParmTable parm_table_user[256]; extern enum Def_NCEP_Table def_ncep_table; /* * returns pointer to the parameter table */ static struct ParmTable *Parm_Table(unsigned char *pds) { int i, center, subcenter, ptable, process; static int missing_count = 0, reanal_opn_count = 0; center = PDS_Center(pds); subcenter = PDS_Subcenter(pds); ptable = PDS_Vsn(pds); #ifdef P_TABLE_FIRST i = setup_user_table(center, subcenter, ptable); if (i == 1) return &parm_table_user[0]; #endif /* NCEP opn and reanal */ if (center == NMC && ptable <= 3) { if (subcenter == 1) return &parm_table_ncep_reanal[0]; process = PDS_Model(pds); if (subcenter != 0 || (process != 80 && process != 180) || (ptable != 1 && ptable != 2)) return &parm_table_ncep_opn[0]; /* at this point could be either the opn or reanalysis table */ if (def_ncep_table == opn_nowarn) return &parm_table_ncep_opn[0]; if (def_ncep_table == rean_nowarn) return &parm_table_ncep_reanal[0]; if (reanal_opn_count++ == 0) { fprintf(stderr, "Using NCEP %s table, see -ncep_opn, -ncep_rean options\n", (def_ncep_table == opn) ? "opn" : "reanalysis"); } return (def_ncep_table == opn) ? &parm_table_ncep_opn[0] : &parm_table_ncep_reanal[0]; } if (center == NMC && ptable == 128) return &parm_table_omb[0]; if (center == ECMWF) { if (ptable == 128) return &parm_table_ecmwf_128[0]; if (ptable == 129) return &parm_table_ecmwf_129[0]; if (ptable == 130) return &parm_table_ecmwf_130[0]; if (ptable == 131) return &parm_table_ecmwf_131[0]; if (ptable == 140) return &parm_table_ecmwf_140[0]; if (ptable == 150) return &parm_table_ecmwf_150[0]; if (ptable == 160) return &parm_table_ecmwf_160[0]; if (ptable == 170) return &parm_table_ecmwf_170[0]; if (ptable == 180) return &parm_table_ecmwf_180[0]; } #ifndef P_TABLE_FIRST i = setup_user_table(center, subcenter, ptable); if (i == 1) return &parm_table_user[0]; #endif if ((ptable > 3 || (PDS_PARAM(pds)) > 127) && missing_count++ == 0) { fprintf(stderr, "\nUndefined parameter table (center %d-%d table %d), using NCEP-opn\n", center, subcenter, ptable); } return &parm_table_ncep_opn[0]; } /* * return name field of PDS_PARAM(pds) */ char *k5toa(unsigned char *pds) { return (Parm_Table(pds) + PDS_PARAM(pds))->name; } /* * return comment field of the PDS_PARAM(pds) */ char *k5_comments(unsigned char *pds) { return (Parm_Table(pds) + PDS_PARAM(pds))->comment; } /* 1996 wesley ebisuzaki * * Unpack BDS section * * input: *bits, pointer to packed integer data * *bitmap, pointer to bitmap (undefined data), NULL if none * n_bits, number of bits per packed integer * n, number of data points (includes undefined data) * ref, scale: flt[] = ref + scale*packed_int * output: *flt, pointer to output array * undefined values filled with UNDEFINED * * note: code assumes an integer > 32 bits * * 7/98 v1.2.1 fix bug for bitmaps and nbit >= 25 found by Larry Brasfield */ static unsigned int mask[] = {0,1,3,7,15,31,63,127,255}; static unsigned int map_masks[8] = {128, 64, 32, 16, 8, 4, 2, 1}; void BDS_unpack(float *flt, unsigned char *bits, unsigned char *bitmap, int n_bits, int n, double ref, double scale) { int i, mask_idx, t_bits, c_bits, j_bits; unsigned int j, map_mask, tbits, jmask, bbits; long int jj; tbits = bbits = 0; /* assume integer has 32+ bits */ if (n_bits <= 25) { jmask = (1 << n_bits) - 1; t_bits = 0; if (bitmap) { for (i = 0; i < n; i++) { /* check bitmap */ mask_idx = i & 7; if (mask_idx == 0) bbits = *bitmap++; if ((bbits & map_masks[mask_idx]) == 0) { *flt++ = UNDEFINED; continue; } while (t_bits < n_bits) { tbits = (tbits * 256) + *bits++; t_bits += 8; } t_bits -= n_bits; j = (tbits >> t_bits) & jmask; *flt++ = ref + scale*j; } } else { for (i = 0; i < n; i++) { while (t_bits < n_bits) { tbits = (tbits * 256) + *bits++; t_bits += 8; } t_bits -= n_bits; flt[i] = (tbits >> t_bits) & jmask; } /* at least this vectorizes :) */ for (i = 0; i < n; i++) { flt[i] = ref + scale*flt[i]; } } } else { /* older unoptimized code, not often used */ c_bits = 8; map_mask = 128; while (n-- > 0) { if (bitmap) { j = (*bitmap & map_mask); if ((map_mask >>= 1) == 0) { map_mask = 128; bitmap++; } if (j == 0) { *flt++ = UNDEFINED; continue; } } jj = 0; j_bits = n_bits; while (c_bits <= j_bits) { if (c_bits == 8) { jj = (jj << 8) + *bits++; j_bits -= 8; } else { jj = (jj << c_bits) + (*bits & mask[c_bits]); bits++; j_bits -= c_bits; c_bits = 8; } } if (j_bits) { c_bits -= j_bits; jj = (jj << j_bits) + ((*bits >> c_bits) & mask[j_bits]); } *flt++ = ref + scale*jj; } } return; } /* * convert a float to an ieee single precision number v1.1 * (big endian) * Wesley Ebisuzaki * * bugs: doesn't handle subnormal numbers * bugs: assumes length of integer >= 25 bits */ int flt2ieee(float x, unsigned char *ieee) { int sign, exp; unsigned int umant; double mant; if (x == 0.0) { ieee[0] = ieee[1] = ieee[2] = ieee[3] = 0; return 0; } /* sign bit */ if (x < 0.0) { sign = 128; x = -x; } else sign = 0; mant = frexp((double) x, &exp); /* 2^24 = 16777216 */ umant = mant * 16777216 + 0.5; if (umant >= 16777216) { umant = umant / 2; exp++; } /* bit 24 should be a 1 .. not used in ieee format */ exp = exp - 1 + 127; if (exp < 0) { /* signed zero */ ieee[0] = sign; ieee[1] = ieee[2] = ieee[3] = 0; return 0; } if (exp > 255) { /* signed infinity */ ieee[0] = sign + 127; ieee[1] = 128; ieee[2] = ieee[3] = 0; return 0; } /* normal number */ ieee[0] = sign + (exp >> 1); ieee[3] = umant & 255; ieee[2] = (umant >> 8) & 255; ieee[1] = ((exp & 1) << 7) + ((umant >> 16) & 127); return 0; } /* wesley ebisuzaki v1.3 * * write ieee file -- big endian format * * input float *array data to be written * int n size of array * int header 1 for f77 style header 0 for none * (header is 4 byte header * FILE *output output file * * v1.2 7/97 buffered, faster * v1.3 2/99 fixed (typo) error in wrtieee_header found by * Bob Farquhar */ #define BSIZ 1024*4 int wrtieee(float *array, int n, int header, FILE *output) { unsigned long int l; int i, nbuf; unsigned char buff[BSIZ]; unsigned char h4[4]; nbuf = 0; if (header) { l = n * 4; for (i = 0; i < 4; i++) { h4[i] = l & 255; l >>= 8; } buff[nbuf++] = h4[3]; buff[nbuf++] = h4[2]; buff[nbuf++] = h4[1]; buff[nbuf++] = h4[0]; } for (i = 0; i < n; i++) { if (nbuf >= BSIZ) { fwrite(buff, 1, BSIZ, output); nbuf = 0; } flt2ieee(array[i], buff + nbuf); nbuf += 4; } if (header) { if (nbuf == BSIZ) { fwrite(buff, 1, BSIZ, output); nbuf = 0; } buff[nbuf++] = h4[3]; buff[nbuf++] = h4[2]; buff[nbuf++] = h4[1]; buff[nbuf++] = h4[0]; } if (nbuf) fwrite(buff, 1, nbuf, output); return 0; } /* write a big-endian 4 byte integer .. f77 IEEE header */ int wrtieee_header(unsigned int n, FILE *output) { unsigned h4[4]; h4[0] = n & 255; h4[1] = (n >> 8) & 255; h4[2] = (n >> 16) & 255; h4[3] = (n >> 24) & 255; putc(h4[3],output); putc(h4[2],output); putc(h4[1],output); putc(h4[0],output); return 0; } /* wesley ebisuzaki v1.0 * * levels.c * * prints out a simple description of kpds6, kpds7 * (level/layer data) * kpds6 = octet 10 of the PDS * kpds7 = octet 11 and 12 of the PDS * (kpds values are from NMC's grib routines) * * the description of the levels is * (1) incomplete * (2) include some NMC-only values (>= 200?) * * v1.1 wgrib v1.7.3.1 updated with new levels */ void levels(int kpds6, int kpds7) { int o11, o12; /* octets 11 and 12 */ o11 = kpds7 / 256; o12 = kpds7 % 256; switch (kpds6) { case 1: printf("sfc"); break; case 2: printf("cld base"); break; case 3: printf("cld top"); break; case 4: printf("0C isotherm"); break; case 5: printf("cond lev"); break; case 6: printf("max wind lev"); break; case 7: printf("tropopause"); break; case 8: printf("nom. top"); break; case 9: printf("sea bottom"); break; case 200: case 10: printf("atmos col"); break; case 12: case 212: printf("low cld bot"); break; case 13: case 213: printf("low cld top"); break; case 14: case 214: printf("low cld lay"); break; case 22: case 222: printf("mid cld bot"); break; case 23: case 223: printf("mid cld top"); break; case 24: case 224: printf("mid cld lay"); break; case 32: case 232: printf("high cld bot"); break; case 33: case 233: printf("high cld top"); break; case 34: case 234: printf("high cld lay"); break; case 201: printf("ocean column"); break; case 209: printf("bndary-layer cld bot"); break; case 210: printf("bndary-layer cld top"); break; case 211: printf("bndary-layer cld layer"); break; case 242: printf("convect-cld bot"); break; case 243: printf("convect-cld top"); break; case 244: printf("convect-cld layer"); break; case 100: printf("%d mb",kpds7); break; case 101: printf("%d-%d mb",o11*10,o12*10); break; case 102: printf("MSL"); break; case 103: printf("%d m above MSL",kpds7); break; case 104: printf("%d-%d m above msl",o11*100,o12*100); break; case 105: printf("%d m above gnd",kpds7); break; case 106: printf("%d-%d m above gnd",o11*100,o12*100); break; case 107: printf("sigma=%.4f",kpds7/10000.0); break; case 108: printf("sigma %.2f-%.2f",o11/100.0,o12/100.0); break; case 109: printf("hybrid lev %d",kpds7); break; case 110: printf("hybrid %d-%d",o11,o12); break; case 111: printf("%d cm down",kpds7); break; case 112: printf("%d-%d cm down",o11,o12); break; case 113: printf("%dK",kpds7); break; case 114: printf("%d-%dK",475-o11,475-o12); break; case 115: printf("%d mb above gnd",kpds7); break; case 116: printf("%d-%d mb above gnd",o11,o12); break; case 117: printf("%d (pv units)",kpds7); /* units are suspect */ break; case 119: printf("%.5f (ETA level)",kpds7/10000.0); break; case 120: printf("%.2f-%.2f (ETA levels)",o11/100.0,o12/100.0); break; case 121: printf("%d-%d mb",1100-o11,1100-o12); break; case 125: printf("%d cm above gnd",kpds7); break; case 128: printf("%.3f-%.3f (sigma)",1.1-o11/1000.0, 1.1-o12/1000.0); break; case 141: printf("%d-%d mb",o11,1100-o12); break; case 160: printf("%d m below sea level",kpds7); break; default: break; } } /* * PDStimes.c v1.2 wesley ebisuzaki * * prints something readable for time code in grib file * * not all cases decoded * for NCEP/NCAR Reanalysis * * v1.2.1 1/99 fixed forecast time unit table */ static char *units[] = { "min", "hr", "d", "mon", "yr", "decade", "normal", "century", "??", "??", " x3 hours", " x6 hours", " x12 hours", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", " sec"}; void PDStimes(int time_range, int p1, int p2, int time_unit) { char *unit; enum {anal, fcst, unknown} type; int fcst_len = 0; if (time_unit >= 0 && time_unit <= sizeof(units)/sizeof(char *)) unit = units[time_unit]; else unit = ""; /* change x3/x6/x12 to hours */ if (time_unit == HOURS3) { p1 *= 3; p2 *= 3; time_unit = HOUR; } else if (time_unit == HOURS6) { p1 *= 6; p2 *= 6; time_unit = HOUR; } else if (time_unit == HOURS12) { p1 *= 12; p2 *= 12; time_unit = HOUR; } if (time_unit >= 0 && time_unit <= sizeof(units)/sizeof(char *)) unit = units[time_unit]; else unit = ""; /* figure out if analysis or forecast */ /* in GRIB, there is a difference between init and uninit analyses */ /* not case at NMC .. no longer run initialization */ /* ignore diff between init an uninit analyses */ switch (time_range) { case 0: case 1: case 113: case 114: case 118: if (p1 == 0) type = anal; else { type = fcst; fcst_len = p1; } break; case 10: /* way NMC uses it, should be unknown? */ type = fcst; fcst_len = p1*256 + p2; if (fcst_len == 0) type = anal; break; case 51: case 123: case 124: type = anal; break; default: type = unknown; break; } /* ----------------------------------------------- */ if (type == anal) printf("anl:"); else if (type == fcst) printf("%d%s fcst:",fcst_len,unit); if (time_range == 123 || time_range == 124) { if (p1 != 0) printf("start@%d%s:",p1,unit); } /* print time range */ switch (time_range) { case 0: case 1: case 10: break; case 2: printf("valid %d-%d%s:",p1,p2,unit); break; case 3: printf("%d-%d%s ave:",p1,p2,unit); break; case 4: printf("%d-%d%s acc:",p1,p2,unit); break; case 5: printf("%d-%d%s diff:",p1,p2,unit); break; case 51: if (p1 == 0) { printf("clim %d%s:",p2,unit); } else if (p1 == 1) { printf("clim (diurnal) %d%s:",p2,unit); } else { printf("clim? p1=%d? %d%s?:",p1,p2,unit); } break; case 113: case 123: printf("ave@%d%s:",p2,unit); break; case 114: case 124: printf("acc@%d%s:",p2,unit); break; case 115: printf("ave of fcst:%d to %d%s:",p1,p2,unit); break; case 116: printf("acc of fcst:%d to %d%s:",p1,p2,unit); break; case 118: printf("var@%d%s:",p2,unit); break; default: printf("time?:"); } } /* * number of missing data points w. ebisuzaki * * v1.1: just faster my dear * v1.2: just faster my dear * */ static int bitsum[256] = { 8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; int missing_points(unsigned char *bitmap, int n) { int count; unsigned int tmp; if (bitmap == NULL) return 0; count = 0; while (n >= 8) { tmp = *bitmap++; n -= 8; count += bitsum[tmp]; } tmp = *bitmap | ((1 << (8 - n)) - 1); count += bitsum[tmp]; return count; } /* * parameter table for NCEP (operations) * center = 7, subcenter != 2 parameter table = 1, 2, 3 etc * note: see reanalysis parameter table for problems * updated 5/11/99 */ struct ParmTable parm_table_ncep_opn[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"PRES", "Pressure [Pa]"}, /* 2 */ {"PRMSL", "Pressure reduced to MSL [Pa]"}, /* 3 */ {"PTEND", "Pressure tendency [Pa/s]"}, /* 4 */ {"PVORT", "Pot. vorticity [km^2/kg/s]"}, /* 5 */ {"ICAHT", "ICAO Standard Atmosphere Reference Height [M]"}, /* 6 */ {"GP", "Geopotential [m^2/s^2]"}, /* 7 */ {"HGT", "Geopotential height [gpm]"}, /* 8 */ {"DIST", "Geometric height [m]"}, /* 9 */ {"HSTDV", "Std dev of height [m]"}, /* 10 */ {"TOZNE", "Total ozone [Dobson]"}, /* 11 */ {"TMP", "Temp. [K]"}, /* 12 */ {"VTMP", "Virtual temp. [K]"}, /* 13 */ {"POT", "Potential temp. [K]"}, /* 14 */ {"EPOT", "Pseudo-adiabatic pot. temp. [K]"}, /* 15 */ {"TMAX", "Max. temp. [K]"}, /* 16 */ {"TMIN", "Min. temp. [K]"}, /* 17 */ {"DPT", "Dew point temp. [K]"}, /* 18 */ {"DEPR", "Dew point depression [K]"}, /* 19 */ {"LAPR", "Lapse rate [K/m]"}, /* 20 */ {"VIS", "Visibility [m]"}, /* 21 */ {"RDSP1", "Radar spectra (1) [non-dim]"}, /* 22 */ {"RDSP2", "Radar spectra (2) [non-dim]"}, /* 23 */ {"RDSP3", "Radar spectra (3) [non-dim]"}, /* 24 */ {"PLI", "Parcel lifted index (to 500 hPa) [K]"}, /* 25 */ {"TMPA", "Temp. anomaly [K]"}, /* 26 */ {"PRESA", "Pressure anomaly [Pa]"}, /* 27 */ {"GPA", "Geopotential height anomaly [gpm]"}, /* 28 */ {"WVSP1", "Wave spectra (1) [non-dim]"}, /* 29 */ {"WVSP2", "Wave spectra (2) [non-dim]"}, /* 30 */ {"WVSP3", "Wave spectra (3) [non-dim]"}, /* 31 */ {"WDIR", "Wind direction [deg]"}, /* 32 */ {"WIND", "Wind speed [m/s]"}, /* 33 */ {"UGRD", "u wind [m/s]"}, /* 34 */ {"VGRD", "v wind [m/s]"}, /* 35 */ {"STRM", "Stream function [m^2/s]"}, /* 36 */ {"VPOT", "Velocity potential [m^2/s]"}, /* 37 */ {"MNTSF", "Montgomery stream function [m^2/s^2]"}, /* 38 */ {"SGCVV", "Sigma coord. vertical velocity [/s]"}, /* 39 */ {"VVEL", "Pressure vertical velocity [Pa/s]"}, /* 40 */ {"DZDT", "Geometric vertical velocity [m/s]"}, /* 41 */ {"ABSV", "Absolute vorticity [/s]"}, /* 42 */ {"ABSD", "Absolute divergence [/s]"}, /* 43 */ {"RELV", "Relative vorticity [/s]"}, /* 44 */ {"RELD", "Relative divergence [/s]"}, /* 45 */ {"VUCSH", "Vertical u shear [/s]"}, /* 46 */ {"VVCSH", "Vertical v shear [/s]"}, /* 47 */ {"DIRC", "Direction of current [deg]"}, /* 48 */ {"SPC", "Speed of current [m/s]"}, /* 49 */ {"UOGRD", "u of current [m/s]"}, /* 50 */ {"VOGRD", "v of current [m/s]"}, /* 51 */ {"SPFH", "Specific humidity [kg/kg]"}, /* 52 */ {"RH", "Relative humidity [%]"}, /* 53 */ {"MIXR", "Humidity mixing ratio [kg/kg]"}, /* 54 */ {"PWAT", "Precipitable water [kg/m^2]"}, /* 55 */ {"VAPP", "Vapor pressure [Pa]"}, /* 56 */ {"SATD", "Saturation deficit [Pa]"}, /* 57 */ {"EVP", "Evaporation [kg/m^2]"}, /* 58 */ {"CICE", "Cloud Ice [kg/m^2]"}, /* 59 */ {"PRATE", "Precipitation rate [kg/m^2/s]"}, /* 60 */ {"TSTM", "Thunderstorm probability [%]"}, /* 61 */ {"APCP", "Total precipitation [kg/m^2]"}, /* 62 */ {"NCPCP", "Large scale precipitation [kg/m^2]"}, /* 63 */ {"ACPCP", "Convective precipitation [kg/m^2]"}, /* 64 */ {"SRWEQ", "Snowfall rate water equiv. [kg/m^2/s]"}, /* 65 */ {"WEASD", "Accum. snow [kg/m^2]"}, /* 66 */ {"SNOD", "Snow depth [m]"}, /* 67 */ {"MIXHT", "Mixed layer depth [m]"}, /* 68 */ {"TTHDP", "Transient thermocline depth [m]"}, /* 69 */ {"MTHD", "Main thermocline depth [m]"}, /* 70 */ {"MTHA", "Main thermocline anomaly [m]"}, /* 71 */ {"TCDC", "Total cloud cover [%]"}, /* 72 */ {"CDCON", "Convective cloud cover [%]"}, /* 73 */ {"LCDC", "Low level cloud cover [%]"}, /* 74 */ {"MCDC", "Mid level cloud cover [%]"}, /* 75 */ {"HCDC", "High level cloud cover [%]"}, /* 76 */ {"CWAT", "Cloud water [kg/m^2]"}, /* 77 */ {"BLI", "Best lifted index (to 500 hPa) [K]"}, /* 78 */ {"SNOC", "Convective snow [kg/m^2]"}, /* 79 */ {"SNOL", "Large scale snow [kg/m^2]"}, /* 80 */ {"WTMP", "Water temp. [K]"}, /* 81 */ {"LAND", "Land cover (land=1;sea=0) [fraction]"}, /* 82 */ {"DSLM", "Deviation of sea level from mean [m]"}, /* 83 */ {"SFCR", "Surface roughness [m]"}, /* 84 */ {"ALBDO", "Albedo [%]"}, /* 85 */ {"TSOIL", "Soil temp. [K]"}, /* 86 */ {"SOILM", "Soil moisture content [kg/m^2]"}, /* 87 */ {"VEG", "Vegetation [%]"}, /* 88 */ {"SALTY", "Salinity [kg/kg]"}, /* 89 */ {"DEN", "Density [kg/m^3]"}, /* 90 */ {"WATR", "Water runoff [kg/m^2]"}, /* 91 */ {"ICEC", "Ice concentration (ice=1;no ice=0) [fraction]"}, /* 92 */ {"ICETK", "Ice thickness [m]"}, /* 93 */ {"DICED", "Direction of ice drift [deg]"}, /* 94 */ {"SICED", "Speed of ice drift [m/s]"}, /* 95 */ {"UICE", "u of ice drift [m/s]"}, /* 96 */ {"VICE", "v of ice drift [m/s]"}, /* 97 */ {"ICEG", "Ice growth rate [m/s]"}, /* 98 */ {"ICED", "Ice divergence [/s]"}, /* 99 */ {"SNOM", "Snow melt [kg/m^2]"}, /* 100 */ {"HTSGW", "Sig height of wind waves and swell [m]"}, /* 101 */ {"WVDIR", "Direction of wind waves [deg]"}, /* 102 */ {"WVHGT", "Sig height of wind waves [m]"}, /* 103 */ {"WVPER", "Mean period of wind waves [s]"}, /* 104 */ {"SWDIR", "Direction of swell waves [deg]"}, /* 105 */ {"SWELL", "Sig height of swell waves [m]"}, /* 106 */ {"SWPER", "Mean period of swell waves [s]"}, /* 107 */ {"DIRPW", "Primary wave direction [deg]"}, /* 108 */ {"PERPW", "Primary wave mean period [s]"}, /* 109 */ {"DIRSW", "Secondary wave direction [deg]"}, /* 110 */ {"PERSW", "Secondary wave mean period [s]"}, /* 111 */ {"NSWRS", "Net short wave (surface) [W/m^2]"}, /* 112 */ {"NLWRS", "Net long wave (surface) [W/m^2]"}, /* 113 */ {"NSWRT", "Net short wave (top) [W/m^2]"}, /* 114 */ {"NLWRT", "Net long wave (top) [W/m^2]"}, /* 115 */ {"LWAVR", "Long wave [W/m^2]"}, /* 116 */ {"SWAVR", "Short wave [W/m^2]"}, /* 117 */ {"GRAD", "Global radiation [W/m^2]"}, /* 118 */ {"BRTMP", "Brightness temperature [K]"}, /* 119 */ {"LWRAD", "Radiance with respect to wave no. [W/m/sr]"}, /* 120 */ {"SWRAD", "Radiance with respect ot wave len. [W/m^3/sr]"}, /* 121 */ {"LHTFL", "Latent heat flux [W/m^2]"}, /* 122 */ {"SHTFL", "Sensible heat flux [W/m^2]"}, /* 123 */ {"BLYDP", "Boundary layer dissipation [W/m^2]"}, /* 124 */ {"UFLX", "Zonal momentum flux [N/m^2]"}, /* 125 */ {"VFLX", "Meridional momentum flux [N/m^2]"}, /* 126 */ {"WMIXE", "Wind mixing energy [J]"}, /* 127 */ {"IMGD", "Image data []"}, /* 128 */ {"MSLSA", "Mean sea level pressure (Std Atm) [Pa]"}, /* 129 */ {"MSLMA", "Mean sea level pressure (MAPS) [Pa]"}, /* 130 */ {"MSLET", "Mean sea level pressure (ETA model) [Pa]"}, /* 131 */ {"LFTX", "Surface lifted index [K]"}, /* 132 */ {"4LFTX", "Best (4-layer) lifted index [K]"}, /* 133 */ {"KX", "K index [K]"}, /* 134 */ {"SX", "Sweat index [K]"}, /* 135 */ {"MCONV", "Horizontal moisture divergence [kg/kg/s]"}, /* 136 */ {"VWSH", "Vertical speed shear [1/s]"}, /* 137 */ {"TSLSA", "3-hr pressure tendency (Std Atmos Red) [Pa/s]"}, /* 138 */ {"BVF2", "Brunt-Vaisala frequency^2 [1/s^2]"}, /* 139 */ {"PVMW", "Potential vorticity (mass-weighted) [1/s/m]"}, /* 140 */ {"CRAIN", "Categorical rain [yes=1;no=0]"}, /* 141 */ {"CFRZR", "Categorical freezing rain [yes=1;no=0]"}, /* 142 */ {"CICEP", "Categorical ice pellets [yes=1;no=0]"}, /* 143 */ {"CSNOW", "Categorical snow [yes=1;no=0]"}, /* 144 */ {"SOILW", "Volumetric soil moisture [fraction]"}, /* 145 */ {"PEVPR", "Potential evaporation rate [W/m^2]"}, /* 146 */ {"CWORK", "Cloud work function [J/kg]"}, /* 147 */ {"U-GWD", "Zonal gravity wave stress [N/m^2]"}, /* 148 */ {"V-GWD", "Meridional gravity wave stress [N/m^2]"}, /* 149 */ {"PV", "Potential vorticity [m^2/s/kg]"}, /* 150 */ {"COVMZ", "Covariance between u and v [m^2/s^2]"}, /* 151 */ {"COVTZ", "Covariance between u and T [K*m/s]"}, /* 152 */ {"COVTM", "Covariance between v and T [K*m/s]"}, /* 153 */ {"CLWMR", "Cloud water [kg/kg]"}, /* 154 */ {"O3MR", "Ozone mixing ratio [kg/kg]"}, /* 155 */ {"GFLUX", "Ground heat flux [W/m^2]"}, /* 156 */ {"CIN", "Convective inhibition [J/kg]"}, /* 157 */ {"CAPE", "Convective Avail. Pot. Energy [J/kg]"}, /* 158 */ {"TKE", "Turbulent kinetic energy [J/kg]"}, /* 159 */ {"CONDP", "Lifted parcel condensation pressure [Pa]"}, /* 160 */ {"CSUSF", "Clear sky upward solar flux [W/m^2]"}, /* 161 */ {"CSDSF", "Clear sky downward solar flux [W/m^2]"}, /* 162 */ {"CSULF", "Clear sky upward long wave flux [W/m^2]"}, /* 163 */ {"CSDLF", "Clear sky downward long wave flux [W/m^2]"}, /* 164 */ {"CFNSF", "Cloud forcing net solar flux [W/m^2]"}, /* 165 */ {"CFNLF", "Cloud forcing net long wave flux [W/m^2]"}, /* 166 */ {"VBDSF", "Visible beam downward solar flux [W/m^2]"}, /* 167 */ {"VDDSF", "Visible diffuse downward solar flux [W/m^2]"}, /* 168 */ {"NBDSF", "Near IR beam downward solar flux [W/m^2]"}, /* 169 */ {"NDDSF", "Near IR diffuse downward solar flux [W/m^2]"}, /* 170 */ {"RWMR", "Rain water mixing ratio [kg/kg]"}, /* 171 */ {"SNMR", "Snow mixing ratio [kg/kg]"}, /* 172 */ {"MFLX", "Momentum flux [N/m^2]"}, /* 173 */ {"LMH", "Mass point model surface [non-dim]"}, /* 174 */ {"LMV", "Velocity point model surface [non-dim]"}, /* 175 */ {"MLYNO", "Model layer number (from bottom up) [non-dim]"}, /* 176 */ {"NLAT", "Latitude (-90 to +90) [deg]"}, /* 177 */ {"ELON", "East longitude (0-360) [deg]"}, /* 178 */ {"ICMR", "Ice mixing ratio [kg/kg]"}, /* 179 */ {"GRMR", "Graupel mixing ratio"}, /* 180 */ {"var180", "undefined"}, /* 181 */ {"LPSX", "x-gradient of log pressure [1/m]"}, /* 182 */ {"LPSY", "y-gradient of log pressure [1/m]"}, /* 183 */ {"HGTX", "x-gradient of height [m/m]"}, /* 184 */ {"HGTY", "y-gradient of height [m/m]"}, /* 185 */ {"TURB", "Turbulence SIGMET/AIRMET [non-dim]"}, /* 186 */ {"ICNG", "Icing SIGMET/AIRMET [non-dim]"}, /* 187 */ {"LTNG", "Lightning [non-dim]"}, /* 188 */ {"var188", "undefined"}, /* 189 */ {"VPTMP", "Virtual pot. temp. [K]"}, /* 190 */ {"HLCY", "Storm relative helicity [m^2/s^2]"}, /* 191 */ {"PROB", "Prob. from ensemble [non-dim]"}, /* 192 */ {"PROBN", "Prob. from ensemble norm. to clim. expect. [non-dim]"}, /* 193 */ {"POP", "Prob. of precipitation [%]"}, /* 194 */ {"CPOFP", "Prob. of frozen precipitation [%]"}, /* 195 */ {"CPOZP", "Prob. of freezing precipitation [%]"}, /* 196 */ {"USTM", "u-component of storm motion [m/s]"}, /* 197 */ {"VSTM", "v-component of storm motion [m/s]"}, /* 198 */ {"NCIP", "No. concen. ice particles"}, /* 199 */ {"EVBS", "Direct evaporation from bare soil [W/m^2]"}, /* 200 */ {"EVCW", "Canopy water evaporation [W/m^2]"}, /* 201 */ {"ICWAT", "Ice-free water surface [%]"}, /* 202 */ {"var202", "undefined"}, /* 203 */ {"var203", "undefined"}, /* 204 */ {"DSWRF", "Downward short wave flux [W/m^2]"}, /* 205 */ {"DLWRF", "Downward long wave flux [W/m^2]"}, /* 206 */ {"UVI", "Ultra violet index (1 hour centered at solar noon) [J/m^2]"}, /* 207 */ {"MSTAV", "Moisture availability [%]"}, /* 208 */ {"SFEXC", "Exchange coefficient [(kg/m^3)(m/s)]"}, /* 209 */ {"MIXLY", "No. of mixed layers next to surface [integer]"}, /* 210 */ {"TRANS", "Transpiration [W/m^2]"}, /* 211 */ {"USWRF", "Upward short wave flux [W/m^2]"}, /* 212 */ {"ULWRF", "Upward long wave flux [W/m^2]"}, /* 213 */ {"CDLYR", "Non-convective cloud [%]"}, /* 214 */ {"CPRAT", "Convective precip. rate [kg/m^2/s]"}, /* 215 */ {"TTDIA", "Temp. tendency by all physics [K/s]"}, /* 216 */ {"TTRAD", "Temp. tendency by all radiation [K/s]"}, /* 217 */ {"TTPHY", "Temp. tendency by non-radiation physics [K/s]"}, /* 218 */ {"PREIX", "Precip index (0.0-1.00) [fraction]"}, /* 219 */ {"TSD1D", "Std. dev. of IR T over 1x1 deg area [K]"}, /* 220 */ {"NLGSP", "Natural log of surface pressure [ln(kPa)]"}, /* 221 */ {"HPBL", "Planetary boundary layer height [m]"}, /* 222 */ {"5WAVH", "5-wave geopotential height [gpm]"}, /* 223 */ {"CNWAT", "Plant canopy surface water [kg/m^2]"}, /* 224 */ {"SOTYP", "Soil type (Zobler) [0..9]"}, /* 225 */ {"VGTYP", "Vegetation type (as in SiB) [0..13]"}, /* 226 */ {"BMIXL", "Blackadar's mixing length scale [m]"}, /* 227 */ {"AMIXL", "Asymptotic mixing length scale [m]"}, /* 228 */ {"PEVAP", "Pot. evaporation [kg/m^2]"}, /* 229 */ {"SNOHF", "Snow phase-change heat flux [W/m^2]"}, /* 230 */ {"5WAVA", "5-wave geopot. height anomaly [gpm]"}, /* 231 */ {"MFLUX", "Convective cloud mass flux [Pa/s]"}, /* 232 */ {"DTRF", "Downward total radiation flux [W/m^2]"}, /* 233 */ {"UTRF", "Upward total radiation flux [W/m^2]"}, /* 234 */ {"BGRUN", "Baseflow-groundwater runoff [kg/m^2]"}, /* 235 */ {"SSRUN", "Storm surface runoff [kg/m^2]"}, /* 236 */ {"var236", "undefined"}, /* 237 */ {"O3TOT", "Total ozone [kg/m^2]"}, /* 238 */ {"SNOWC", "Snow cover [%]"}, /* 239 */ {"SNOT", "Snow temp. [K]"}, /* 240 */ {"var240", "undefined"}, /* 241 */ {"LRGHR", "Large scale condensation heating [K/s]"}, /* 242 */ {"CNVHR", "Deep convective heating [K/s]"}, /* 243 */ {"CNVMR", "Deep convective moistening [kg/kg/s]"}, /* 244 */ {"SHAHR", "Shallow convective heating [K/s]"}, /* 245 */ {"SHAMR", "Shallow convective moistening [kg/kg/s]"}, /* 246 */ {"VDFHR", "Vertical diffusion heating [K/s]"}, /* 247 */ {"VDFUA", "Vertical diffusion zonal accel [m/s^2]"}, /* 248 */ {"VDFVA", "Vertical diffusion meridional accel [m/s^2]"}, /* 249 */ {"VDFMR", "Vertical diffusion moistening [kg/kg/s]"}, /* 250 */ {"SWHR", "Solar radiative heating [K/s]"}, /* 251 */ {"LWHR", "Longwave radiative heating [K/s]"}, /* 252 */ {"CD", "Drag coefficient [non-dim]"}, /* 253 */ {"FRICV", "Friction velocity [m/s]"}, /* 254 */ {"RI", "Richardson number [non-dim]"}, /* 255 */ {"var255", "undefined"}, }; /* * parameter table for the NCEP/NCAR Reanalysis Project * center = 7, subcenter = 0/2, parameter table = 1/2 * in a SNAFU the operational and reanalysis tables diverged * and both retained the same parameter table numbers (1,2) * * some of the Reanalysis files have subcenter=2 while others * use subcenter=0 (subcenter field is not standard (7/97)) * * Some ways to tell Reanalysis files from OPN files * Reanalysis: always generated by process 80 - T62 28 level model * Original subcenter=0 Reanalysis files had * 2.5x2.5 (144x73) lat-long grid or 192x94 Gaussian grid (PDS grid=255?) */ struct ParmTable parm_table_ncep_reanal[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"PRES", "Pressure [Pa]"}, /* 2 */ {"PRMSL", "Pressure reduced to MSL [Pa]"}, /* 3 */ {"PTEND", "Pressure tendency [Pa/s]"}, /* 4 */ {"var4", "undefined"}, /* 5 */ {"var5", "undefined"}, /* 6 */ {"GP", "Geopotential [m^2/s^2]"}, /* 7 */ {"HGT", "Geopotential height [gpm]"}, /* 8 */ {"DIST", "Geometric height [m]"}, /* 9 */ {"HSTDV", "Std dev of height [m]"}, /* 10 */ {"HVAR", "Variance of height [m^2]"}, /* 11 */ {"TMP", "Temp. [K]"}, /* 12 */ {"VTMP", "Virtual temp. [K]"}, /* 13 */ {"POT", "Potential temp. [K]"}, /* 14 */ {"EPOT", "Pseudo-adiabatic pot. temp. [K]"}, /* 15 */ {"TMAX", "Max. temp. [K]"}, /* 16 */ {"TMIN", "Min. temp. [K]"}, /* 17 */ {"DPT", "Dew point temp. [K]"}, /* 18 */ {"DEPR", "Dew point depression [K]"}, /* 19 */ {"LAPR", "Lapse rate [K/m]"}, /* 20 */ {"VISIB", "Visibility [m]"}, /* 21 */ {"RDSP1", "Radar spectra (1) [non-dim]"}, /* 22 */ {"RDSP2", "Radar spectra (2) [non-dim]"}, /* 23 */ {"RDSP3", "Radar spectra (3) [non-dim]"}, /* 24 */ {"var24", "undefined"}, /* 25 */ {"TMPA", "Temp. anomaly [K]"}, /* 26 */ {"PRESA", "Pressure anomaly [Pa]"}, /* 27 */ {"GPA", "Geopotential height anomaly [gpm]"}, /* 28 */ {"WVSP1", "Wave spectra (1) [non-dim]"}, /* 29 */ {"WVSP2", "Wave spectra (2) [non-dim]"}, /* 30 */ {"WVSP3", "Wave spectra (3) [non-dim]"}, /* 31 */ {"WDIR", "Wind direction [deg]"}, /* 32 */ {"WIND", "Wind speed [m/s]"}, /* 33 */ {"UGRD", "u wind [m/s]"}, /* 34 */ {"VGRD", "v wind [m/s]"}, /* 35 */ {"STRM", "Stream function [m^2/s]"}, /* 36 */ {"VPOT", "Velocity potential [m^2/s]"}, /* 37 */ {"MNTSF", "Montgomery stream function [m^2/s^2]"}, /* 38 */ {"SGCVV", "Sigma coord. vertical velocity [/s]"}, /* 39 */ {"VVEL", "Pressure vertical velocity [Pa/s]"}, /* 40 */ {"DZDT", "Geometric vertical velocity [m/s]"}, /* 41 */ {"ABSV", "Absolute vorticity [/s]"}, /* 42 */ {"ABSD", "Absolute divergence [/s]"}, /* 43 */ {"RELV", "Relative vorticity [/s]"}, /* 44 */ {"RELD", "Relative divergence [/s]"}, /* 45 */ {"VUCSH", "Vertical u shear [/s]"}, /* 46 */ {"VVCSH", "Vertical v shear [/s]"}, /* 47 */ {"DIRC", "Direction of current [deg]"}, /* 48 */ {"SPC", "Speed of current [m/s]"}, /* 49 */ {"UOGRD", "u of current [m/s]"}, /* 50 */ {"VOGRD", "v of current [m/s]"}, /* 51 */ {"SPFH", "Specific humidity [kg/kg]"}, /* 52 */ {"RH", "Relative humidity [%]"}, /* 53 */ {"MIXR", "Humidity mixing ratio [kg/kg]"}, /* 54 */ {"PWAT", "Precipitable water [kg/m^2]"}, /* 55 */ {"VAPP", "Vapor pressure [Pa]"}, /* 56 */ {"SATD", "Saturation deficit [Pa]"}, /* 57 */ {"EVP", "Evaporation [kg/m^2]"}, /* 58 */ {"CICE", "Cloud Ice [kg/m^2]"}, /* 59 */ {"PRATE", "Precipitation rate [kg/m^2/s]"}, /* 60 */ {"TSTM", "Thunderstorm probability [%]"}, /* 61 */ {"APCP", "Total precipitation [kg/m^2]"}, /* 62 */ {"NCPCP", "Large scale precipitation [kg/m^2]"}, /* 63 */ {"ACPCP", "Convective precipitation [kg/m^2]"}, /* 64 */ {"SRWEQ", "Snowfall rate water equiv. [kg/m^2/s]"}, /* 65 */ {"WEASD", "Accum. snow [kg/m^2]"}, /* 66 */ {"SNOD", "Snow depth [m]"}, /* 67 */ {"MIXHT", "Mixed layer depth [m]"}, /* 68 */ {"TTHDP", "Transient thermocline depth [m]"}, /* 69 */ {"MTHD", "Main thermocline depth [m]"}, /* 70 */ {"MTHA", "Main thermocline anomaly [m]"}, /* 71 */ {"TCDC", "Total cloud cover [%]"}, /* 72 */ {"CDCON", "Convective cloud cover [%]"}, /* 73 */ {"LCDC", "Low level cloud cover [%]"}, /* 74 */ {"MCDC", "Mid level cloud cover [%]"}, /* 75 */ {"HCDC", "High level cloud cover [%]"}, /* 76 */ {"CWAT", "Cloud water [kg/m^2]"}, /* 77 */ {"var77", "undefined"}, /* 78 */ {"SNOC", "Convective snow [kg/m^2]"}, /* 79 */ {"SNOL", "Large scale snow [kg/m^2]"}, /* 80 */ {"WTMP", "Water temp. [K]"}, /* 81 */ {"LAND", "Land-sea mask [1=land; 0=sea]"}, /* 82 */ {"DSLM", "Deviation of sea level from mean [m]"}, /* 83 */ {"SFCR", "Surface roughness [m]"}, /* 84 */ {"ALBDO", "Albedo [%]"}, /* 85 */ {"TSOIL", "Soil temp. [K]"}, /* 86 */ {"SOILM", "Soil moisture content [kg/m^2]"}, /* 87 */ {"VEG", "Vegetation [%]"}, /* 88 */ {"SALTY", "Salinity [kg/kg]"}, /* 89 */ {"DEN", "Density [kg/m^3]"}, /* 90 */ {"RUNOF", "Runoff [kg/m^2]"}, /* 91 */ {"ICEC", "Ice concentration [ice=1;no ice=0]"}, /* 92 */ {"ICETK", "Ice thickness [m]"}, /* 93 */ {"DICED", "Direction of ice drift [deg]"}, /* 94 */ {"SICED", "Speed of ice drift [m/s]"}, /* 95 */ {"UICE", "u of ice drift [m/s]"}, /* 96 */ {"VICE", "v of ice drift [m/s]"}, /* 97 */ {"ICEG", "Ice growth rate [m/s]"}, /* 98 */ {"ICED", "Ice divergence [/s]"}, /* 99 */ {"SNOM", "Snow melt [kg/m^2]"}, /* 100 */ {"HTSGW", "Sig height of wind waves and swell [m]"}, /* 101 */ {"WVDIR", "Direction of wind waves [deg]"}, /* 102 */ {"WVHGT", "Sig height of wind waves [m]"}, /* 103 */ {"WVPER", "Mean period of wind waves [s]"}, /* 104 */ {"SWDIR", "Direction of swell waves [deg]"}, /* 105 */ {"SWELL", "Sig height of swell waves [m]"}, /* 106 */ {"SWPER", "Mean period of swell waves [s]"}, /* 107 */ {"DIRPW", "Primary wave direction [deg]"}, /* 108 */ {"PERPW", "Primary wave mean period [s]"}, /* 109 */ {"DIRSW", "Secondary wave direction [deg]"}, /* 110 */ {"PERSW", "Secondary wave mean period [s]"}, /* 111 */ {"NSWRS", "Net short wave (surface) [W/m^2]"}, /* 112 */ {"NLWRS", "Net long wave (surface) [W/m^2]"}, /* 113 */ {"NSWRT", "Net short wave (top) [W/m^2]"}, /* 114 */ {"NLWRT", "Net long wave (top) [W/m^2]"}, /* 115 */ {"LWAVR", "Long wave [W/m^2]"}, /* 116 */ {"SWAVR", "Short wave [W/m^2]"}, /* 117 */ {"GRAD", "Global radiation [W/m^2]"}, /* 118 */ {"var118", "undefined"}, /* 119 */ {"var119", "undefined"}, /* 120 */ {"var120", "undefined"}, /* 121 */ {"LHTFL", "Latent heat flux [W/m^2]"}, /* 122 */ {"SHTFL", "Sensible heat flux [W/m^2]"}, /* 123 */ {"BLYDP", "Boundary layer dissipation [W/m^2]"}, /* 124 */ {"UFLX", "Zonal momentum flux [N/m^2]"}, /* 125 */ {"VFLX", "Meridional momentum flux [N/m^2]"}, /* 126 */ {"WMIXE", "Wind mixing energy [J]"}, /* 127 */ {"IMGD", "Image data [integer]"}, /* 128 */ {"MSLSA", "Mean sea level pressure (Std Atm) [Pa]"}, /* 129 */ {"MSLMA", "Mean sea level pressure (MAPS) [Pa]"}, /* 130 */ {"MSLET", "Mean sea level pressure (ETA model) [Pa]"}, /* 131 */ {"LFTX", "Surface lifted index [K]"}, /* 132 */ {"4LFTX", "Best (4-layer) lifted index [K]"}, /* 133 */ {"KX", "K index [K]"}, /* 134 */ {"SX", "Sweat index [K]"}, /* 135 */ {"MCONV", "Horizontal moisture divergence [kg/kg/s]"}, /* 136 */ {"VSSH", "Vertical speed shear [1/s]"}, /* 137 */ {"TSLSA", "3-hr pressure tendency [Pa/s]"}, /* 138 */ {"BVF2", "Brunt-Vaisala frequency^2 [1/s^2]"}, /* 139 */ {"PVMW", "Potential vorticity (mass-weighted) [1/s/m]"}, /* 140 */ {"CRAIN", "Categorical rain [yes=1;no=0]"}, /* 141 */ {"CFRZR", "Categorical freezing rain [yes=1;no=0]"}, /* 142 */ {"CICEP", "Categorical ice pellets [yes=1;no=0]"}, /* 143 */ {"CSNOW", "Categorical snow [yes=1;no=0]"}, /* 144 */ {"SOILW", "Volumetric soil moisture [fraction]"}, /* 145 */ {"PEVPR", "Potential evaporation rate [W/m^2]"}, /* 146 */ {"CWORK", "Cloud work function [J/kg]"}, /* 147 */ {"U-GWD", "Zonal gravity wave stress [N/m^2]"}, /* 148 */ {"V-GWD", "Meridional gravity wave stress [N/m^2]"}, /* 149 */ {"PV___", "Potential vorticity [m^2/s/kg]"}, /* 150 */ {"var150", "undefined"}, /* 151 */ {"var151", "undefined"}, /* 152 */ {"var152", "undefined"}, /* 153 */ {"MFXDV", "Moisture flux divergence [gr/gr*m/s/m]"}, /* 154 */ {"var154", "undefined"}, /* 155 */ {"GFLUX", "Ground heat flux [W/m^2]"}, /* 156 */ {"CIN", "Convective inhibition [J/kg]"}, /* 157 */ {"CAPE", "Convective Avail. Pot. Energy [J/kg]"}, /* 158 */ {"TKE", "Turbulent kinetic energy [J/kg]"}, /* 159 */ {"CONDP", "Lifted parcel condensation pressure [Pa]"}, /* 160 */ {"CSUSF", "Clear sky upward solar flux [W/m^2]"}, /* 161 */ {"CSDSF", "Clear sky downward solar flux [W/m^2]"}, /* 162 */ {"CSULF", "Clear sky upward long wave flux [W/m^2]"}, /* 163 */ {"CSDLF", "Clear sky downward long wave flux [W/m^2]"}, /* 164 */ {"CFNSF", "Cloud forcing net solar flux [W/m^2]"}, /* 165 */ {"CFNLF", "Cloud forcing net long wave flux [W/m^2]"}, /* 166 */ {"VBDSF", "Visible beam downward solar flux [W/m^2]"}, /* 167 */ {"VDDSF", "Visible diffuse downward solar flux [W/m^2]"}, /* 168 */ {"NBDSF", "Near IR beam downward solar flux [W/m^2]"}, /* 169 */ {"NDDSF", "Near IR diffuse downward solar flux [W/m^2]"}, /* 170 */ {"USTR", "U wind stress [N/m^2]"}, /* 171 */ {"VSTR", "V wind stress [N/m^2]"}, /* 172 */ {"MFLX", "Momentum flux [N/m^2]"}, /* 173 */ {"LMH", "Mass point model surface [integer]"}, /* 174 */ {"LMV", "Velocity point model surface [integer]"}, /* 175 */ {"SGLYR", "Nearby model level [integer]"}, /* 176 */ {"NLAT", "Latitude [deg]"}, /* 177 */ {"NLON", "Longitude [deg]"}, /* 178 */ {"UMAS", "Mass weighted u [gm/m*K*s]"}, /* 179 */ {"VMAS", "Mass weighted v [gm/m*K*s]"}, /* 180 */ {"XPRATE", "corrected precip [kg/m^2/s]"}, /* 181 */ {"LPSX", "x-gradient of log pressure [1/m]"}, /* 182 */ {"LPSY", "y-gradient of log pressure [1/m]"}, /* 183 */ {"HGTX", "x-gradient of height [m/m]"}, /* 184 */ {"HGTY", "y-gradient of height [m/m]"}, /* 185 */ {"STDZ", "Std dev of Geop. hgt. [m]"}, /* 186 */ {"STDU", "Std dev of zonal wind [m/s]"}, /* 187 */ {"STDV", "Std dev of meridional wind [m/s]"}, /* 188 */ {"STDQ", "Std dev of spec. hum. [gm/gm]"}, /* 189 */ {"STDT", "Std dev of temp. [K]"}, /* 190 */ {"CBUW", "Covar. u and omega [m/s*Pa/s]"}, /* 191 */ {"CBVW", "Covar. v and omega [m/s*Pa/s]"}, /* 192 */ {"CBUQ", "Covar. u and specific hum [m/s*gm/gm]"}, /* 193 */ {"CBVQ", "Covar. v and specific hum [m/s*gm/gm]"}, /* 194 */ {"CBTW", "Covar. T and omega [K*Pa/s]"}, /* 195 */ {"CBQW", "Covar. spec. hum and omega [gm/gm*Pa/s]"}, /* 196 */ {"CBMZW", "Covar. v and u [m^2/s^2]"}, /* 197 */ {"CBTZW", "Covar. u and T [K*m/s]"}, /* 198 */ {"CBTMW", "Covar. v and T [K*m/s]"}, /* 199 */ {"STDRH", "Std dev of Rel. Hum. [%]"}, /* 200 */ {"SDTZ", "Std dev of time tend of geop. hgt [m]"}, /* 201 */ {"ICWAT", "Ice-free water surface [%]"}, /* 202 */ {"SDTU", "Std dev of time tend of zonal wind [m/s]"}, /* 203 */ {"SDTV", "Std dev of time tend of merid wind [m/s]"}, /* 204 */ {"DSWRF", "Downward solar radiation flux [W/m^2]"}, /* 205 */ {"DLWRF", "Downward long wave flux [W/m^2]"}, /* 206 */ {"SDTQ", "Std dev of time tend of spec. hum [gm/gm]"}, /* 207 */ {"MSTAV", "Moisture availability [%]"}, /* 208 */ {"SFEXC", "Exchange coefficient [kg*m/m^3/s]"}, /* 209 */ {"MIXLY", "No. of mixed layers next to sfc [integer]"}, /* 210 */ {"SDTT", "Std dev of time tend of temp. [K]"}, /* 211 */ {"USWRF", "Upward solar radiation flux [W/m^2]"}, /* 212 */ {"ULWRF", "Upward long wave flux [W/m^2]"}, /* 213 */ {"CDLYR", "Non-convective cloud [%]"}, /* 214 */ {"CPRAT", "Convective precip. rate [kg/m^2/s]"}, /* 215 */ {"TTDIA", "Temp. tendency by all physics [K/s]"}, /* 216 */ {"TTRAD", "Temp. tendency by all radiation [K/s]"}, /* 217 */ {"TTPHY", "Temp. tendency by nonrad physics [K/s]"}, /* 218 */ {"PREIX", "Precipitation index [fraction]"}, /* 219 */ {"TSD1D", "Std dev of IR T over 1x1 deg area [K]"}, /* 220 */ {"NLSGP", "Natural log of surface pressure [ln(kPa)]"}, /* 221 */ {"SDTRH", "Std dev of time tend of rel hum [%]"}, /* 222 */ {"5WAVH", "5-wave geopotential height [gpm]"}, /* 223 */ {"CNWAT", "Plant canopy surface water [kg/m^2]"}, /* 224 */ {"PLTRS", "Max. stomato plant resistance [s/m]"}, /* 225 */ {"RHCLD", "RH-type cloud cover [%]"}, /* 226 */ {"BMIXL", "Blackadar's mixing length scale [m]"}, /* 227 */ {"AMIXL", "Asymptotic mixing length scale [m]"}, /* 228 */ {"PEVAP", "Pot. evaporation [kg/m^2]"}, /* 229 */ {"SNOHF", "Snow melt heat flux [W/m^2]"}, /* 230 */ {"SNOEV", "Snow sublimation heat flux [W/m^2]"}, /* 231 */ {"MFLUX", "Convective cloud mass flux [Pa/s]"}, /* 232 */ {"DTRF", "Downward total radiation flux [W/m^2]"}, /* 233 */ {"UTRF", "Upward total radiation flux [W/m^2]"}, /* 234 */ {"BGRUN", "Baseflow-groundwater runoff [kg/m^2]"}, /* 235 */ {"SSRUN", "Storm surface runoff [kg/m^2]"}, /* 236 */ {"var236", "undefined"}, /* 237 */ {"OZONE", "Total column ozone [Dobson]"}, /* 238 */ {"SNOWC", "Snow cover [%]"}, /* 239 */ {"SNOT", "Snow temp. [K]"}, /* 240 */ {"GLCR", "Permanent snow points [mask]"}, /* 241 */ {"LRGHR", "Large scale condensation heating [K/s]"}, /* 242 */ {"CNVHR", "Deep convective heating [K/s]"}, /* 243 */ {"CNVMR", "Deep convective moistening [kg/kg/s]"}, /* 244 */ {"SHAHR", "Shallow convective heating [K/s]"}, /* 245 */ {"SHAMR", "Shallow convective moistening [kg/kg/s]"}, /* 246 */ {"VDFHR", "Vertical diffusion heating [K/s]"}, /* 247 */ {"VDFUA", "Vertical diffusion zonal accel [m/s^2]"}, /* 248 */ {"VDFVA", "Vertical diffusion meridional accel [m/s^2]"}, /* 249 */ {"VDFMR", "Vertical diffusion moistening [kg/kg/s]"}, /* 250 */ {"SWHR", "Solar radiative heating [K/s]"}, /* 251 */ {"LWHR", "Longwave radiative heating [K/s]"}, /* 252 */ {"CD", "Drag coefficient [non-dim]"}, /* 253 */ {"FRICV", "Friction velocity [m/s]"}, /* 254 */ {"RI", "Richardson number [non-dim]"}, /* 255 */ {"var255", "undefined"}, }; struct ParmTable parm_table_ecmwf_128[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"None", "Stream Function m**2 s**-1"}, /* 2 */ {"None", "Velocity Potential m**2 s**-1"}, /* 3 */ {"None", "Potential Temperature K"}, /* 4 */ {"None", "Equivalent Potential Temperature K"}, /* 5 */ {"None", "Saturated Equivalent Potential Temperature K"}, /* 6 */ {"None", "RESERVED FOR METVIEW. -"}, /* 7 */ {"None", "RESERVED FOR METVIEW. -"}, /* 8 */ {"None", "RESERVED FOR METVIEW. -"}, /* 9 */ {"None", "RESERVED FOR METVIEW. -"}, /* 10 */ {"None", "RESERVED FOR METVIEW. -"}, /* 11 */ {"None", "u-component of Divergent Wind m s**-1"}, /* 12 */ {"None", "v-component of Divergent Wind m s**-1"}, /* 13 */ {"None", "u-component of Rotational Wind m s**-1"}, /* 14 */ {"None", "v-component of Rotational Wind m s**-1"}, /* 15 */ {"None", "RESERVED FOR METVIEW. -"}, /* 16 */ {"None", "RESERVED FOR METVIEW. -"}, /* 17 */ {"None", "RESERVED FOR METVIEW. -"}, /* 18 */ {"None", "RESERVED FOR METVIEW. -"}, /* 19 */ {"None", "RESERVED FOR METVIEW. -"}, /* 20 */ {"None", "RESERVED FOR METVIEW. -"}, /* 21 */ {"UCTP", "Unbalanced component of temperature K"}, /* 22 */ {"UCLN", "Unbalanced component of lnsp -"}, /* 23 */ {"UCDV", "Unbalanced component of divergence s**-1"}, /* 24 */ {"None", "Reserved for future unbalanced components -"}, /* 25 */ {"None", "Reserved for future unbalanced components -"}, /* 26 */ {"CL", "Lake cover (0-1)"}, /* 27 */ {"CVL", "Low vegetation cover (0-1)"}, /* 28 */ {"CVH", "High vegetation cover (0-1)"}, /* 29 */ {"TVL", "Type of low vegetation -"}, /* 30 */ {"TVH", "Type of high vegetation -"}, /* 31 */ {"CI", "Sea ice cover (0-1)"}, /* 32 */ {"ASN", "Snow albedo (0-1)"}, /* 33 */ {"RSN", "Snow density kg**-3"}, /* 34 */ {"SSTK", "Sea surface temperature (absolute) K"}, /* 35 */ {"ISTL1", "Ice surface temperature layer 1 K"}, /* 36 */ {"ISTL2", "Ice surface temperature layer 2 K"}, /* 37 */ {"ISTL3", "Ice surface temperature layer 3 K"}, /* 38 */ {"ISTL4", "Ice surface temperature layer 4 K"}, /* 39 */ {"SWVL1", "Volumetric soil water layer 1 m**3 m**-3"}, /* 40 */ {"SWVL2", "Volumetric soil water layer 2 m**3 m**-3"}, /* 41 */ {"SWVL3", "Volumetric soil water layer 3 m**3 m**-3"}, /* 42 */ {"SWVL4", "Volumetric soil water layer 4 m**3 m**-3"}, /* 43 */ {"SLT", "Soil Type -"}, /* 44 */ {"-", "Unused -"}, /* 45 */ {"var45", "undefined"}, /* 46 */ {"var46", "undefined"}, /* 47 */ {"var47", "undefined"}, /* 48 */ {"var48", "undefined"}, /* 49 */ {"var49", "undefined"}, /* 50 */ {"var50", "undefined"}, /* 51 */ {"var51", "undefined"}, /* 52 */ {"var52", "undefined"}, /* 53 */ {"var53", "undefined"}, /* 54 */ {"var54", "undefined"}, /* 55 */ {"var55", "undefined"}, /* 56 */ {"var56", "undefined"}, /* 57 */ {"var57", "undefined"}, /* 58 */ {"var58", "undefined"}, /* 59 */ {"var59", "undefined"}, /* 60 */ {"var60", "undefined"}, /* 61 */ {"var61", "undefined"}, /* 62 */ {"var62", "undefined"}, /* 63 */ {"var63", "undefined"}, /* 64 */ {"var64", "undefined"}, /* 65 */ {"var65", "undefined"}, /* 66 */ {"var66", "undefined"}, /* 67 */ {"var67", "undefined"}, /* 68 */ {"var68", "undefined"}, /* 69 */ {"var69", "undefined"}, /* 70 */ {"var70", "undefined"}, /* 71 */ {"var71", "undefined"}, /* 72 */ {"var72", "undefined"}, /* 73 */ {"var73", "undefined"}, /* 74 */ {"var74", "undefined"}, /* 75 */ {"var75", "undefined"}, /* 76 */ {"var76", "undefined"}, /* 77 */ {"var77", "undefined"}, /* 78 */ {"var78", "undefined"}, /* 79 */ {"var79", "undefined"}, /* 80 */ {"var80", "undefined"}, /* 81 */ {"var81", "undefined"}, /* 82 */ {"var82", "undefined"}, /* 83 */ {"var83", "undefined"}, /* 84 */ {"var84", "undefined"}, /* 85 */ {"var85", "undefined"}, /* 86 */ {"var86", "undefined"}, /* 87 */ {"var87", "undefined"}, /* 88 */ {"var88", "undefined"}, /* 89 */ {"var89", "undefined"}, /* 90 */ {"var90", "undefined"}, /* 91 */ {"var91", "undefined"}, /* 92 */ {"var92", "undefined"}, /* 93 */ {"var93", "undefined"}, /* 94 */ {"var94", "undefined"}, /* 95 */ {"var95", "undefined"}, /* 96 */ {"var96", "undefined"}, /* 97 */ {"var97", "undefined"}, /* 98 */ {"var98", "undefined"}, /* 99 */ {"var99", "undefined"}, /* 100 */ {"var100", "undefined"}, /* 101 */ {"var101", "undefined"}, /* 102 */ {"var102", "undefined"}, /* 103 */ {"var103", "undefined"}, /* 104 */ {"var104", "undefined"}, /* 105 */ {"var105", "undefined"}, /* 106 */ {"var106", "undefined"}, /* 107 */ {"var107", "undefined"}, /* 108 */ {"var108", "undefined"}, /* 109 */ {"var109", "undefined"}, /* 110 */ {"var110", "undefined"}, /* 111 */ {"var111", "undefined"}, /* 112 */ {"var112", "undefined"}, /* 113 */ {"var113", "undefined"}, /* 114 */ {"var114", "undefined"}, /* 115 */ {"var115", "undefined"}, /* 116 */ {"var116", "undefined"}, /* 117 */ {"var117", "undefined"}, /* 118 */ {"var118", "undefined"}, /* 119 */ {"var119", "undefined"}, /* 120 */ {"var120", "undefined"}, /* 121 */ {"var121", "undefined"}, /* 122 */ {"var122", "undefined"}, /* 123 */ {"var123", "undefined"}, /* 124 */ {"var124", "undefined"}, /* 125 */ {"var125", "undefined"}, /* 126 */ {"-", "Unused -"}, /* 127 */ {"AT", "Atmospheric tide -"}, /* 128 */ {"BV", "Budget values -"}, /* 129 */ {"Z", "Geopotential (at the surface = orography) m**2 s**-2"}, /* 130 */ {"T", "Temperature K"}, /* 131 */ {"U", "U-velocity m s**-1"}, /* 132 */ {"V", "V-velocity m s**-1"}, /* 133 */ {"Q", "Specific humidity kg kg**-1"}, /* 134 */ {"SP", "Surface pressure Pa"}, /* 135 */ {"W", "Vertical velocity Pa s**-1"}, /* 136 */ {"TWC", "Total column water kg m**-2"}, /* 137 */ {"PWC", "Precipitable water content kg m**-2"}, /* 138 */ {"VO", "Vorticity (relative) s**-1"}, /* 139 */ {"ST", "Surf.temp/soil temp lev 1 (from 930804) K"}, /* 140 */ {"SSW", "Surf soil wet/soil wet lev1(from 930803) m (of water)"}, /* 141 */ {"SD", "Snow depth m (of water equivalent)"}, /* 142 */ {"LSP", "Large scale precipitation m"}, /* 143 */ {"CP", "Convective precipitation m"}, /* 144 */ {"SF", "Snow fall m(of water equivalent)"}, /* 145 */ {"BLD", "Boundary layer dissipation W m**-2 s"}, /* 146 */ {"SSHF", "Surface sensible heat flux W m**-2 s"}, /* 147 */ {"SLHF", "Surface latent heat flux W m**-2 s"}, /* 148 */ {"SS/CHNK", "Surface stress/Charnock (from 980519) -"}, /* 149 */ {"SNR", "Surface net radiation -"}, /* 150 */ {"AIW", "Top net radiation -"}, /* 151 */ {"MSL", "Mean sea level pressure Pa"}, /* 152 */ {"LNSP", "Log surface pressure -"}, /* 153 */ {"SWHR", "Short wave heating rate K"}, /* 154 */ {"LWH", "Long wave heating rate K"}, /* 155 */ {"D", "Divergence s**-1"}, /* 156 */ {"GH", "Height (geopotential) m"}, /* 157 */ {"R", "Relative humidity %"}, /* 158 */ {"TSP", "Tendency of surface pressure Pa s**-1"}, /* 159 */ {"BLH", "Boundary layer height m"}, /* 160 */ {"SDOR", "Standard deviation of orography -"}, /* 161 */ {"ISOR", "Anisotropy of subgrid scale orography -"}, /* 162 */ {"ANOR", "Angle of subgrid scale orography -"}, /* 163 */ {"SLOR", "Slope of subgrid scale orography -"}, /* 164 */ {"TCC", "Total cloud cover (0 - 1)"}, /* 165 */ {"10U", "10 metre u wind component m s**-1"}, /* 166 */ {"10V", "10 metre v wind component m s**-1"}, /* 167 */ {"2T", "2 metre temperature K"}, /* 168 */ {"2D", "2 metre dewpoint temperature K"}, /* 169 */ {"SSRD", "Surface solar radiation downwards W m**-2 s"}, /* 170 */ {"DST", "Deep soil tmp/soil temp lev2(from 930804) K"}, /* 171 */ {"DSW", "Deep soil wet/soil wet lev2(from 930803) m (of water)"}, /* 172 */ {"LSM", "Land/sea mask (0"}, /* 173 */ {"SR", "Surface roughness m"}, /* 174 */ {"AL", "Albedo -"}, /* 175 */ {"STRD", "Surface thermal radiation downwards W m**-2 s"}, /* 176 */ {"SSR", "Surface solar radiation W m**-2 s"}, /* 177 */ {"STR", "Surface thermal radiation W m**-2 s"}, /* 178 */ {"TSR", "Top solar radiation W m**-2 s"}, /* 179 */ {"TTR", "Top thermal radiation W m**-2 s"}, /* 180 */ {"EWSS", "East/West surface stress N m**-2 s"}, /* 181 */ {"NSSS", "North/South surface stress N m**-2 s"}, /* 182 */ {"E", "Evaporation m (of water)"}, /* 183 */ {"CDST", "Clim deep soil tmp/soil tmp lev3(930804) K"}, /* 184 */ {"CDSW", "Clim deep soil wet/soil wet lev3(930803) m (of water)"}, /* 185 */ {"CCC", "Convective cloud cover (0 - 1)"}, /* 186 */ {"LCC", "Low cloud cover (0 - 1)"}, /* 187 */ {"MCC", "Medium cloud cover (0 - 1)"}, /* 188 */ {"HCC", "High cloud cover (0 - 1)"}, /* 189 */ {"-", "Unused -"}, /* 190 */ {"EWOV", "EW component subgrid orographic variance m**2"}, /* 191 */ {"NSOV", "NS component subgrid orographic variance m**2"}, /* 192 */ {"NWOV", "NWSE component subgrid orographic variance m**2"}, /* 193 */ {"NEOV", "NESW component subgrid orographic variance m**2"}, /* 194 */ {"BTMP", "Brightness temperature K"}, /* 195 */ {"LGWS", "Lat. component of gravity wave stress N m**-2 s"}, /* 196 */ {"MGWS", "Meridional component gravity wave stress N m**-2 s"}, /* 197 */ {"GWD", "Gravity wave dissipation W m**-2 s"}, /* 198 */ {"SRC", "Skin reservoir content m (of water)"}, /* 199 */ {"VEG", "Percentage of vegetation %"}, /* 200 */ {"VSO", "Variance of sub-grid scale orography m**2"}, /* 201 */ {"MX2T", "Max 2m temp since previous post-processing K"}, /* 202 */ {"MN2T", "Min 2m temp since previous post-processing K"}, /* 203 */ {"O3", "Ozone mass mixing ratio kg kg**-1"}, /* 204 */ {"PAW", "Precip. analysis weights -"}, /* 205 */ {"RO", "Runoff* m"}, /* 206 */ {"TCO3", "Total column ozone Dobson (kg m**-2)"}, /* 207 */ {"10SI", "10m. Windspeed (irresp of dir.) m s**-1"}, /* 208 */ {"TSRC", "Top net solar radiation clear sky W m**-2"}, /* 209 */ {"TTRC", "Top upward thermal radiation clear sky W m**-2"}, /* 210 */ {"SSRC", "Surface net solar radiation clear sky W m**-2"}, /* 211 */ {"STRC", "Surface net thermal radiation clear sky W m**-2"}, /* 212 */ {"SI", "Solar insulation W m**-2"}, /* 213 */ {"-", "Unused -"}, /* 214 */ {"DHR", "Diabatic heating by radiation* K"}, /* 215 */ {"DHVD", "Diabatic heating by vertical diffusion K"}, /* 216 */ {"DHCC", "Diabatic heating by cumulus convection K"}, /* 217 */ {"DHLC", "Diabatic heating large-scale condensation K"}, /* 218 */ {"VDZW", "Vertical diffusion of zonal wind m s**-1"}, /* 219 */ {"VDMW", "Vertical diffusion of meridional wind m s**-1"}, /* 220 */ {"EWGD", "EW gravity wave drag m s**-1"}, /* 221 */ {"NSGD", "NS gravity wave drag m s**-1"}, /* 222 */ {"CTZW", "Convective tendency of zonal wind m s**-1"}, /* 223 */ {"CTMW", "Convective tendency of meridional wind m s**-1"}, /* 224 */ {"VDH", "Vertical diffusion of humidity kg kg**-1"}, /* 225 */ {"HTCC", "Humidity tendency by cumulus convection kg kg**-1"}, /* 226 */ {"HTLC", "Humidity tendency large-scale condensation kg kg**-1"}, /* 227 */ {"CRNH", "Change from removing negative humidity kg/kg s-1"}, /* 228 */ {"TP", "Total precipitation m"}, /* 229 */ {"IEWS", "Instantaneous X surface stress N m**-2"}, /* 230 */ {"INSS", "Instantaneous Y surface stress N m**-2"}, /* 231 */ {"ISHF", "Instantaneous surface Heat Flux W m**-2"}, /* 232 */ {"IE", "Instantaneous Moisture Flux (evaporation) kg m**-2 s"}, /* 233 */ {"ASQ", "Apparent Surface Humidity kg kg**-1"}, /* 234 */ {"LSRH", "Log of surface roughness length for heat -"}, /* 235 */ {"SKT", "Skin Temperature K"}, /* 236 */ {"STL4", "Soil temperature level 4 K"}, /* 237 */ {"SWL4", "Soil wetness level 4 m"}, /* 238 */ {"TSN", "Temperature of snow layer K"}, /* 239 */ {"CSF", "Convective snow-fall m (of water equivalent)"}, /* 240 */ {"LSF", "Large scale snow-fall m (of water equivalent)"}, /* 241 */ {"ACF", "Accumulated cloud fraction tendency (-1 to 1)"}, /* 242 */ {"ALW", "Accumulated liquid water tendency (-1 to 1)"}, /* 243 */ {"FAL", "Forecast albedo -"}, /* 244 */ {"FSR", "Forecast surface roughness m"}, /* 245 */ {"FLSR", "Forecast log of surface roughness for heat -"}, /* 246 */ {"CLWC", "Cloud liquid water content kg kg**-1"}, /* 247 */ {"CIWC", "Cloud ice water content kg kg**-1"}, /* 248 */ {"CC", "Cloud cover (0 - 1)"}, /* 249 */ {"AIW", "Accumulated ice water tendency (-1 to 1)"}, /* 250 */ {"ICE", "Ice Age (0 first-year 1 multi-year)"}, /* 251 */ {"ATTE", "Adiabatic tendency of temperature K"}, /* 252 */ {"ATHE", "Adiabatic tendency of humidity kg kg**-1"}, /* 253 */ {"ATZE", "Adiabatic tendency of zonal wind m s**-1"}, /* 254 */ {"ATMW", "Adiabatic tendency of meridional wind m s**-1"}, /* 255 */ {"-", "Indicates a missing value -"}, }; struct ParmTable parm_table_ecmwf_129[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"var1", "undefined"}, /* 2 */ {"var2", "undefined"}, /* 3 */ {"var3", "undefined"}, /* 4 */ {"var4", "undefined"}, /* 5 */ {"var5", "undefined"}, /* 6 */ {"var6", "undefined"}, /* 7 */ {"var7", "undefined"}, /* 8 */ {"var8", "undefined"}, /* 9 */ {"var9", "undefined"}, /* 10 */ {"var10", "undefined"}, /* 11 */ {"var11", "undefined"}, /* 12 */ {"var12", "undefined"}, /* 13 */ {"var13", "undefined"}, /* 14 */ {"var14", "undefined"}, /* 15 */ {"var15", "undefined"}, /* 16 */ {"var16", "undefined"}, /* 17 */ {"var17", "undefined"}, /* 18 */ {"var18", "undefined"}, /* 19 */ {"var19", "undefined"}, /* 20 */ {"var20", "undefined"}, /* 21 */ {"var21", "undefined"}, /* 22 */ {"var22", "undefined"}, /* 23 */ {"var23", "undefined"}, /* 24 */ {"var24", "undefined"}, /* 25 */ {"var25", "undefined"}, /* 26 */ {"var26", "undefined"}, /* 27 */ {"var27", "undefined"}, /* 28 */ {"var28", "undefined"}, /* 29 */ {"var29", "undefined"}, /* 30 */ {"var30", "undefined"}, /* 31 */ {"var31", "undefined"}, /* 32 */ {"var32", "undefined"}, /* 33 */ {"var33", "undefined"}, /* 34 */ {"var34", "undefined"}, /* 35 */ {"var35", "undefined"}, /* 36 */ {"var36", "undefined"}, /* 37 */ {"var37", "undefined"}, /* 38 */ {"var38", "undefined"}, /* 39 */ {"var39", "undefined"}, /* 40 */ {"var40", "undefined"}, /* 41 */ {"var41", "undefined"}, /* 42 */ {"var42", "undefined"}, /* 43 */ {"var43", "undefined"}, /* 44 */ {"var44", "undefined"}, /* 45 */ {"var45", "undefined"}, /* 46 */ {"var46", "undefined"}, /* 47 */ {"var47", "undefined"}, /* 48 */ {"var48", "undefined"}, /* 49 */ {"var49", "undefined"}, /* 50 */ {"var50", "undefined"}, /* 51 */ {"var51", "undefined"}, /* 52 */ {"var52", "undefined"}, /* 53 */ {"var53", "undefined"}, /* 54 */ {"var54", "undefined"}, /* 55 */ {"var55", "undefined"}, /* 56 */ {"var56", "undefined"}, /* 57 */ {"var57", "undefined"}, /* 58 */ {"var58", "undefined"}, /* 59 */ {"var59", "undefined"}, /* 60 */ {"var60", "undefined"}, /* 61 */ {"var61", "undefined"}, /* 62 */ {"var62", "undefined"}, /* 63 */ {"var63", "undefined"}, /* 64 */ {"var64", "undefined"}, /* 65 */ {"var65", "undefined"}, /* 66 */ {"var66", "undefined"}, /* 67 */ {"var67", "undefined"}, /* 68 */ {"var68", "undefined"}, /* 69 */ {"var69", "undefined"}, /* 70 */ {"var70", "undefined"}, /* 71 */ {"var71", "undefined"}, /* 72 */ {"var72", "undefined"}, /* 73 */ {"var73", "undefined"}, /* 74 */ {"var74", "undefined"}, /* 75 */ {"var75", "undefined"}, /* 76 */ {"var76", "undefined"}, /* 77 */ {"var77", "undefined"}, /* 78 */ {"var78", "undefined"}, /* 79 */ {"var79", "undefined"}, /* 80 */ {"var80", "undefined"}, /* 81 */ {"var81", "undefined"}, /* 82 */ {"var82", "undefined"}, /* 83 */ {"var83", "undefined"}, /* 84 */ {"var84", "undefined"}, /* 85 */ {"var85", "undefined"}, /* 86 */ {"var86", "undefined"}, /* 87 */ {"var87", "undefined"}, /* 88 */ {"var88", "undefined"}, /* 89 */ {"var89", "undefined"}, /* 90 */ {"var90", "undefined"}, /* 91 */ {"var91", "undefined"}, /* 92 */ {"var92", "undefined"}, /* 93 */ {"var93", "undefined"}, /* 94 */ {"var94", "undefined"}, /* 95 */ {"var95", "undefined"}, /* 96 */ {"var96", "undefined"}, /* 97 */ {"var97", "undefined"}, /* 98 */ {"var98", "undefined"}, /* 99 */ {"var99", "undefined"}, /* 100 */ {"var100", "undefined"}, /* 101 */ {"var101", "undefined"}, /* 102 */ {"var102", "undefined"}, /* 103 */ {"var103", "undefined"}, /* 104 */ {"var104", "undefined"}, /* 105 */ {"var105", "undefined"}, /* 106 */ {"var106", "undefined"}, /* 107 */ {"var107", "undefined"}, /* 108 */ {"var108", "undefined"}, /* 109 */ {"var109", "undefined"}, /* 110 */ {"var110", "undefined"}, /* 111 */ {"var111", "undefined"}, /* 112 */ {"var112", "undefined"}, /* 113 */ {"var113", "undefined"}, /* 114 */ {"var114", "undefined"}, /* 115 */ {"var115", "undefined"}, /* 116 */ {"var116", "undefined"}, /* 117 */ {"var117", "undefined"}, /* 118 */ {"var118", "undefined"}, /* 119 */ {"var119", "undefined"}, /* 120 */ {"var120", "undefined"}, /* 121 */ {"var121", "undefined"}, /* 122 */ {"var122", "undefined"}, /* 123 */ {"var123", "undefined"}, /* 124 */ {"var124", "undefined"}, /* 125 */ {"var125", "undefined"}, /* 126 */ {"var126", "undefined"}, /* 127 */ {"AT", "Atmospheric tide+ -"}, /* 128 */ {"BV", "Budget values+ -"}, /* 129 */ {"Z", "Geopotential (at the surface=orography) m**2 s**-2"}, /* 130 */ {"T", "Temperature K"}, /* 131 */ {"U", "U-velocity m s**-1"}, /* 132 */ {"V", "V-velocity m s**-1"}, /* 133 */ {"Q", "Specific humidity kg kg**-1"}, /* 134 */ {"SP", "Surface pressure Pa"}, /* 135 */ {"W", "Vertical velocity Pa s**-1"}, /* 136 */ {"var136", "undefined"}, /* 137 */ {"PWC", "Precipitable water content kg m**-2"}, /* 138 */ {"VO", "Vorticity (relative) s**-1"}, /* 139 */ {"ST", "Surf.temp/soil temp lev 1 (from 930804) K"}, /* 140 */ {"SSW", "Surf soil wet/soil wet lev1(from 930803) m (of water)"}, /* 141 */ {"SD", "Snow depth m (of water equivalent)"}, /* 142 */ {"LSP", "Large scale precipitation* m"}, /* 143 */ {"CP", "Convective precipitation* m"}, /* 144 */ {"SF", "Snow fall* m(of water equivalent)"}, /* 145 */ {"BLD", "Boundary layer dissipation* W m**-2 s"}, /* 146 */ {"SSHF", "Surface sensible heat flux* W m**-2 s"}, /* 147 */ {"SLHF", "Surface latent heat flux* W m**-2 s"}, /* 148 */ {"var148", "undefined"}, /* 149 */ {"var149", "undefined"}, /* 150 */ {"var150", "undefined"}, /* 151 */ {"MSL", "Mean sea level pressure Pa"}, /* 152 */ {"LNSP", "Log surface pressure -"}, /* 153 */ {"var153", "undefined"}, /* 154 */ {"var154", "undefined"}, /* 155 */ {"D", "Divergence s**-1"}, /* 156 */ {"GH", "Height (geopotential) m"}, /* 157 */ {"R", "Relative humidity %"}, /* 158 */ {"TSP", "Tendency of surface pressure Pa s**-1"}, /* 159 */ {"var159", "undefined"}, /* 160 */ {"SDOR", "Standard deviation of orography -"}, /* 161 */ {"ISOR", "Anisotropy of subgrid scale orography -"}, /* 162 */ {"ANOR", "Angle of subgrid scale orography -"}, /* 163 */ {"SLOR", "Slope of subgrid scale orography -"}, /* 164 */ {"TCC", "Total cloud cover (0 - 1)"}, /* 165 */ {"10U", "10 metre u wind component m s**-1"}, /* 166 */ {"10V", "10 metre v wind component m s**-1"}, /* 167 */ {"2T", "2 metre temperature K"}, /* 168 */ {"2D", "2 metre dewpoint temperature K"}, /* 169 */ {"var169", "undefined"}, /* 170 */ {"DST", "Deep soil tmp/soil temp lev2(frm 930804) K"}, /* 171 */ {"DSW", "Deep soil wet/soil wet lev2(from 930803) m (of water)"}, /* 172 */ {"LSM", "Land/sea mask (0"}, /* 173 */ {"SR", "Surface roughness m"}, /* 174 */ {"AL", "Albedo -"}, /* 175 */ {"var175", "undefined"}, /* 176 */ {"SSR", "Surface solar radiation* W m**-2 s"}, /* 177 */ {"STR", "Surface thermal radiation* W m**-2 s"}, /* 178 */ {"TSR", "Top solar radiation* W m**-2 s"}, /* 179 */ {"TTR", "Top thermal radiation* W m**-2 s"}, /* 180 */ {"EWSS", "East/West surface stress* N m**-2 s"}, /* 181 */ {"NSSS", "North/South surface stress* N m**-2 s"}, /* 182 */ {"E", "Evaporation* m (of water)"}, /* 183 */ {"CDST", "Clim deep soil tmp/soil tmp lev3(930804) K"}, /* 184 */ {"CDSW", "Clim deep soil wet/soil wet lev3(930803) m (of water)"}, /* 185 */ {"CCC", "Convective cloud cover (0 - 1)"}, /* 186 */ {"LCC", "Low cloud cover (0 - 1)"}, /* 187 */ {"MCC", "Medium cloud cover (0 - 1)"}, /* 188 */ {"HCC", "High cloud cover (0 - 1)"}, /* 189 */ {"var189", "undefined"}, /* 190 */ {"EWOV", "EW component subgrid scale orographic variance m**2"}, /* 191 */ {"NSOV", "NS component subgrid scale orographic variance m**2"}, /* 192 */ {"NWOV", "NWSE component subgrid scale orographic variance m**2"}, /* 193 */ {"NEOV", "NESW component subgrid scale orographic variance m**2"}, /* 194 */ {"var194", "undefined"}, /* 195 */ {"LGWS", "Latitudinal component of gravity wave stress* N m**-2 s"}, /* 196 */ {"MGWS", "Meridional component of gravity wave stress* N m**-2 s"}, /* 197 */ {"GWD", "Gravity wave dissipation* W m**-2 s"}, /* 198 */ {"SRC", "Skin reservoir content m (of water)"}, /* 199 */ {"VEG", "Percentage of vegetation %"}, /* 200 */ {"VSO", "Variance of sub-grid scale orography m**2"}, /* 201 */ {"MX2T", "Max temp. at 2m since previous post-processing K"}, /* 202 */ {"MN2T", "Min temp. at 2m since previous post-processing K"}, /* 203 */ {"var203", "undefined"}, /* 204 */ {"PAW", "Precip. analysis weights -"}, /* 205 */ {"RO", "Runoff* m"}, /* 206 */ {"var206", "undefined"}, /* 207 */ {"var207", "undefined"}, /* 208 */ {"var208", "undefined"}, /* 209 */ {"var209", "undefined"}, /* 210 */ {"var210", "undefined"}, /* 211 */ {"var211", "undefined"}, /* 212 */ {"var212", "undefined"}, /* 213 */ {"var213", "undefined"}, /* 214 */ {"var214", "undefined"}, /* 215 */ {"var215", "undefined"}, /* 216 */ {"var216", "undefined"}, /* 217 */ {"var217", "undefined"}, /* 218 */ {"var218", "undefined"}, /* 219 */ {"var219", "undefined"}, /* 220 */ {"var220", "undefined"}, /* 221 */ {"var221", "undefined"}, /* 222 */ {"var222", "undefined"}, /* 223 */ {"var223", "undefined"}, /* 224 */ {"var224", "undefined"}, /* 225 */ {"var225", "undefined"}, /* 226 */ {"var226", "undefined"}, /* 227 */ {"var227", "undefined"}, /* 228 */ {"TP", "Total precipitation? m"}, /* 229 */ {"IEWS", "Instantaneous X surface stress N m**-2"}, /* 230 */ {"INSS", "Instantaneous Y surface stress N m**-2"}, /* 231 */ {"ISHF", "Instantaneous surface Heat Flux W m**-2"}, /* 232 */ {"IE", "Instantaneous Moisture Flux (evaporation) kg m**-2 s"}, /* 233 */ {"ASQ", "Apparent Surface Humidity kg kg**-1"}, /* 234 */ {"LSRH", "Logarithm of surface roughness length for heat -"}, /* 235 */ {"SKT", "Skin Temperature K"}, /* 236 */ {"STL4", "Soil temperature level 4 K"}, /* 237 */ {"SWL4", "Soil wetness level 4 m"}, /* 238 */ {"TSN", "Temperature of snow layer K"}, /* 239 */ {"CSF", "Convective snow-fall* m (of water equivalent)"}, /* 240 */ {"LSF", "Large scale snow-fall* m (of water equivalent)"}, /* 241 */ {"var241", "undefined"}, /* 242 */ {"var242", "undefined"}, /* 243 */ {"FAL", "Forecast albedo -"}, /* 244 */ {"FSR", "Forecast surface roughness m"}, /* 245 */ {"FLSR", "Forecast logarithm of surface roughness for heat -"}, /* 246 */ {"CLWC", "Cloud liquid water content kg kg**-1"}, /* 247 */ {"CIWC", "Cloud ice water content kg kg**-1"}, /* 248 */ {"CC", "Cloud cover (0 - 1)"}, /* 249 */ {"var249", "undefined"}, /* 250 */ {"", "Ice Age (0 first-year 1 multi-year)"}, /* 251 */ {"var251", "undefined"}, /* 252 */ {"var252", "undefined"}, /* 253 */ {"var253", "undefined"}, /* 254 */ {"var254", "undefined"}, /* 255 */ {"var255", "undefined"}, }; struct ParmTable parm_table_ecmwf_130[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"var1", "undefined"}, /* 2 */ {"var2", "undefined"}, /* 3 */ {"var3", "undefined"}, /* 4 */ {"var4", "undefined"}, /* 5 */ {"var5", "undefined"}, /* 6 */ {"var6", "undefined"}, /* 7 */ {"var7", "undefined"}, /* 8 */ {"var8", "undefined"}, /* 9 */ {"var9", "undefined"}, /* 10 */ {"var10", "undefined"}, /* 11 */ {"var11", "undefined"}, /* 12 */ {"var12", "undefined"}, /* 13 */ {"var13", "undefined"}, /* 14 */ {"var14", "undefined"}, /* 15 */ {"var15", "undefined"}, /* 16 */ {"var16", "undefined"}, /* 17 */ {"var17", "undefined"}, /* 18 */ {"var18", "undefined"}, /* 19 */ {"var19", "undefined"}, /* 20 */ {"var20", "undefined"}, /* 21 */ {"var21", "undefined"}, /* 22 */ {"var22", "undefined"}, /* 23 */ {"var23", "undefined"}, /* 24 */ {"var24", "undefined"}, /* 25 */ {"var25", "undefined"}, /* 26 */ {"var26", "undefined"}, /* 27 */ {"var27", "undefined"}, /* 28 */ {"var28", "undefined"}, /* 29 */ {"var29", "undefined"}, /* 30 */ {"var30", "undefined"}, /* 31 */ {"var31", "undefined"}, /* 32 */ {"var32", "undefined"}, /* 33 */ {"var33", "undefined"}, /* 34 */ {"var34", "undefined"}, /* 35 */ {"var35", "undefined"}, /* 36 */ {"var36", "undefined"}, /* 37 */ {"var37", "undefined"}, /* 38 */ {"var38", "undefined"}, /* 39 */ {"var39", "undefined"}, /* 40 */ {"var40", "undefined"}, /* 41 */ {"var41", "undefined"}, /* 42 */ {"var42", "undefined"}, /* 43 */ {"var43", "undefined"}, /* 44 */ {"var44", "undefined"}, /* 45 */ {"var45", "undefined"}, /* 46 */ {"var46", "undefined"}, /* 47 */ {"var47", "undefined"}, /* 48 */ {"var48", "undefined"}, /* 49 */ {"var49", "undefined"}, /* 50 */ {"var50", "undefined"}, /* 51 */ {"var51", "undefined"}, /* 52 */ {"var52", "undefined"}, /* 53 */ {"var53", "undefined"}, /* 54 */ {"var54", "undefined"}, /* 55 */ {"var55", "undefined"}, /* 56 */ {"var56", "undefined"}, /* 57 */ {"var57", "undefined"}, /* 58 */ {"var58", "undefined"}, /* 59 */ {"var59", "undefined"}, /* 60 */ {"var60", "undefined"}, /* 61 */ {"var61", "undefined"}, /* 62 */ {"var62", "undefined"}, /* 63 */ {"var63", "undefined"}, /* 64 */ {"var64", "undefined"}, /* 65 */ {"var65", "undefined"}, /* 66 */ {"var66", "undefined"}, /* 67 */ {"var67", "undefined"}, /* 68 */ {"var68", "undefined"}, /* 69 */ {"var69", "undefined"}, /* 70 */ {"var70", "undefined"}, /* 71 */ {"var71", "undefined"}, /* 72 */ {"var72", "undefined"}, /* 73 */ {"var73", "undefined"}, /* 74 */ {"var74", "undefined"}, /* 75 */ {"var75", "undefined"}, /* 76 */ {"var76", "undefined"}, /* 77 */ {"var77", "undefined"}, /* 78 */ {"var78", "undefined"}, /* 79 */ {"var79", "undefined"}, /* 80 */ {"var80", "undefined"}, /* 81 */ {"var81", "undefined"}, /* 82 */ {"var82", "undefined"}, /* 83 */ {"var83", "undefined"}, /* 84 */ {"var84", "undefined"}, /* 85 */ {"var85", "undefined"}, /* 86 */ {"var86", "undefined"}, /* 87 */ {"var87", "undefined"}, /* 88 */ {"var88", "undefined"}, /* 89 */ {"var89", "undefined"}, /* 90 */ {"var90", "undefined"}, /* 91 */ {"var91", "undefined"}, /* 92 */ {"var92", "undefined"}, /* 93 */ {"var93", "undefined"}, /* 94 */ {"var94", "undefined"}, /* 95 */ {"var95", "undefined"}, /* 96 */ {"var96", "undefined"}, /* 97 */ {"var97", "undefined"}, /* 98 */ {"var98", "undefined"}, /* 99 */ {"var99", "undefined"}, /* 100 */ {"var100", "undefined"}, /* 101 */ {"var101", "undefined"}, /* 102 */ {"var102", "undefined"}, /* 103 */ {"var103", "undefined"}, /* 104 */ {"var104", "undefined"}, /* 105 */ {"var105", "undefined"}, /* 106 */ {"var106", "undefined"}, /* 107 */ {"var107", "undefined"}, /* 108 */ {"var108", "undefined"}, /* 109 */ {"var109", "undefined"}, /* 110 */ {"var110", "undefined"}, /* 111 */ {"var111", "undefined"}, /* 112 */ {"var112", "undefined"}, /* 113 */ {"var113", "undefined"}, /* 114 */ {"var114", "undefined"}, /* 115 */ {"var115", "undefined"}, /* 116 */ {"var116", "undefined"}, /* 117 */ {"var117", "undefined"}, /* 118 */ {"var118", "undefined"}, /* 119 */ {"var119", "undefined"}, /* 120 */ {"var120", "undefined"}, /* 121 */ {"var121", "undefined"}, /* 122 */ {"var122", "undefined"}, /* 123 */ {"var123", "undefined"}, /* 124 */ {"var124", "undefined"}, /* 125 */ {"var125", "undefined"}, /* 126 */ {"var126", "undefined"}, /* 127 */ {"var127", "undefined"}, /* 128 */ {"var128", "undefined"}, /* 129 */ {"var129", "undefined"}, /* 130 */ {"var130", "undefined"}, /* 131 */ {"var131", "undefined"}, /* 132 */ {"var132", "undefined"}, /* 133 */ {"var133", "undefined"}, /* 134 */ {"var134", "undefined"}, /* 135 */ {"var135", "undefined"}, /* 136 */ {"var136", "undefined"}, /* 137 */ {"var137", "undefined"}, /* 138 */ {"var138", "undefined"}, /* 139 */ {"var139", "undefined"}, /* 140 */ {"var140", "undefined"}, /* 141 */ {"var141", "undefined"}, /* 142 */ {"var142", "undefined"}, /* 143 */ {"var143", "undefined"}, /* 144 */ {"var144", "undefined"}, /* 145 */ {"var145", "undefined"}, /* 146 */ {"var146", "undefined"}, /* 147 */ {"var147", "undefined"}, /* 148 */ {"var148", "undefined"}, /* 149 */ {"var149", "undefined"}, /* 150 */ {"var150", "undefined"}, /* 151 */ {"var151", "undefined"}, /* 152 */ {"var152", "undefined"}, /* 153 */ {"var153", "undefined"}, /* 154 */ {"var154", "undefined"}, /* 155 */ {"var155", "undefined"}, /* 156 */ {"var156", "undefined"}, /* 157 */ {"var157", "undefined"}, /* 158 */ {"var158", "undefined"}, /* 159 */ {"var159", "undefined"}, /* 160 */ {"var160", "undefined"}, /* 161 */ {"var161", "undefined"}, /* 162 */ {"var162", "undefined"}, /* 163 */ {"var163", "undefined"}, /* 164 */ {"var164", "undefined"}, /* 165 */ {"var165", "undefined"}, /* 166 */ {"var166", "undefined"}, /* 167 */ {"var167", "undefined"}, /* 168 */ {"var168", "undefined"}, /* 169 */ {"var169", "undefined"}, /* 170 */ {"var170", "undefined"}, /* 171 */ {"var171", "undefined"}, /* 172 */ {"var172", "undefined"}, /* 173 */ {"var173", "undefined"}, /* 174 */ {"var174", "undefined"}, /* 175 */ {"var175", "undefined"}, /* 176 */ {"var176", "undefined"}, /* 177 */ {"var177", "undefined"}, /* 178 */ {"var178", "undefined"}, /* 179 */ {"var179", "undefined"}, /* 180 */ {"var180", "undefined"}, /* 181 */ {"var181", "undefined"}, /* 182 */ {"var182", "undefined"}, /* 183 */ {"var183", "undefined"}, /* 184 */ {"var184", "undefined"}, /* 185 */ {"var185", "undefined"}, /* 186 */ {"var186", "undefined"}, /* 187 */ {"var187", "undefined"}, /* 188 */ {"var188", "undefined"}, /* 189 */ {"var189", "undefined"}, /* 190 */ {"var190", "undefined"}, /* 191 */ {"var191", "undefined"}, /* 192 */ {"var192", "undefined"}, /* 193 */ {"var193", "undefined"}, /* 194 */ {"var194", "undefined"}, /* 195 */ {"var195", "undefined"}, /* 196 */ {"var196", "undefined"}, /* 197 */ {"var197", "undefined"}, /* 198 */ {"var198", "undefined"}, /* 199 */ {"var199", "undefined"}, /* 200 */ {"var200", "undefined"}, /* 201 */ {"var201", "undefined"}, /* 202 */ {"var202", "undefined"}, /* 203 */ {"var203", "undefined"}, /* 204 */ {"var204", "undefined"}, /* 205 */ {"var205", "undefined"}, /* 206 */ {"var206", "undefined"}, /* 207 */ {"var207", "undefined"}, /* 208 */ {"TSRU", "Top solar radiation upward W m**-2"}, /* 209 */ {"TTRU", "Top thermal radiation upward W m**-2"}, /* 210 */ {"TSUC", "Top solar radiation upward clear sky W m**-2"}, /* 211 */ {"TTUC", "Top thermal radiation upward clear sky W m**-2"}, /* 212 */ {"CLW", "Cloud liquid water kg kg**-1"}, /* 213 */ {"CF", "Cloud fraction 0-1"}, /* 214 */ {"DHR", "Diabatic heating by radiation K s**-1"}, /* 215 */ {"DHVD", "Diabatic heating by vertical diffusion K s**-1"}, /* 216 */ {"DHCC", "Diabatic heating by cumulus convection K s**-1"}, /* 217 */ {"DHLC", "Diabatic heating by large-scale condensation K s**-1"}, /* 218 */ {"VDZW", "Vertical diffusion of zonal wind m**2 s**-3"}, /* 219 */ {"VDMW", "Vertical diffusion of meridional wind m**2 s**-3"}, /* 220 */ {"EWGD", "EW gravity wave drag m**2 s**-3"}, /* 221 */ {"NSGD", "NS gravity wave drag m**2 s**-3"}, /* 222 */ {"CTZW", "Convective tendency of zonal wind m**2 s**-3"}, /* 223 */ {"CTMW", "Convective tendency of meridional wind m**2 s**-3"}, /* 224 */ {"VDH", "Vertical diffusion of humidity kg kg**-1 s**-1"}, /* 225 */ {"HTCC", "Humidity tendency by cumulus convection kg kg**-1 s**-1"}, /* 226 */ {"HTLC", "Humidity tendency by large-scale condensation kg kg**-1 s**-1"}, /* 227 */ {"CRNH", "Change from removing negative humidity kg kg**-1 s**-1"}, /* 228 */ {"ATT", "Adiabatic tendency of temperature K s**-1"}, /* 229 */ {"ATH", "Adiabatic tendency of humidity kg kg**-1 s**-1"}, /* 230 */ {"ATZW", "Adiabatic tendency of zonal wind m**2 s**-3"}, /* 231 */ {"ATMW", "Adiabatic tendency of meridional wind m**2 s**-3"}, /* 232 */ {"MVV", "Mean vertical velocity Pa s**-1"}, /* 233 */ {"var233", "undefined"}, /* 234 */ {"var234", "undefined"}, /* 235 */ {"var235", "undefined"}, /* 236 */ {"var236", "undefined"}, /* 237 */ {"var237", "undefined"}, /* 238 */ {"var238", "undefined"}, /* 239 */ {"var239", "undefined"}, /* 240 */ {"var240", "undefined"}, /* 241 */ {"var241", "undefined"}, /* 242 */ {"var242", "undefined"}, /* 243 */ {"var243", "undefined"}, /* 244 */ {"var244", "undefined"}, /* 245 */ {"var245", "undefined"}, /* 246 */ {"var246", "undefined"}, /* 247 */ {"var247", "undefined"}, /* 248 */ {"var248", "undefined"}, /* 249 */ {"var249", "undefined"}, /* 250 */ {"var250", "undefined"}, /* 251 */ {"var251", "undefined"}, /* 252 */ {"var252", "undefined"}, /* 253 */ {"var253", "undefined"}, /* 254 */ {"var254", "undefined"}, /* 255 */ {"var255", "undefined"}, }; struct ParmTable parm_table_ecmwf_131[256] = { /* 0 */ {"var0", "undefined"}, /* 1 */ {"var1", "undefined"}, /* 2 */ {"var2", "undefined"}, /* 3 */ {"var3", "undefined"}, /* 4 */ {"var4", "undefined"}, /* 5 */ {"var5", "undefined"}, /* 6 */ {"var6", "undefined"}, /* 7 */ {"var7", "undefined"}, /* 8 */ {"var8", "undefined"}, /* 9 */ {"var9", "undefined"}, /* 10 */ {"var10", "undefined"}, /* 11 */ {"var11", "undefined"}, /* 12 */ {"var12", "undefined"}, /* 13 */ {"var13", "undefined"}, /* 14 */ {"var14", "undefined"}, /* 15 */ {"var15", "undefined"}, /* 16 */ {"var16", "undefined"}, /* 17 */ {"var17", "undefined"}, /* 18 */ {"var18", "undefined"}, /* 19 */ {"var19", "undefined"}, /* 20 */ {"var20", "undefined"}, /* 21 */ {"var21", "undefined"}, /* 22 */ {"var22", "undefined"}, /* 23 */ {"var23", "undefined"}, /* 24 */ {"var24", "undefined"}, /* 25 */ {"var25", "undefined"}, /* 26 */ {"var26", "undefined"}, /* 27 */ {"var27", "undefined"}, /* 28 */ {"var28", "undefined"}, /* 29 */ {"var29", "undefined"}, /* 30 */ {"var30", "undefined"}, /* 31 */ {"var31", "undefined"}, /* 32 */ {"var32", "undefined"}, /* 33 */ {"var33", "undefined"}, /* 34 */ {"var34", "undefined"}, /* 35 */ {"var35", "undefined"}, /* 36 */ {"var36", "undefined"}, /* 37 */ {"var37", "undefined"}, /* 38 */ {"var38", "undefined"}, /* 39 */ {"var39", "undefined"}, /* 40 */ {"var40", "undefined"}, /* 41 */ {"var41", "undefined"}, /* 42 */ {"var42", "undefined"}, /* 43 */ {"var43", "undefined"}, /* 44 */ {"var44", "undefined"}, /* 45 */ {"var45", "undefined"}, /* 46 */ {"var46", "undefined"}, /* 47 */ {"var47", "undefined"}, /* 48 */ {"var48", "undefined"}, /* 49 */ {"var49", "undefined"}, /* 50 */ {"var50", "undefined"}, /* 51 */ {"var51", "undefined"}, /* 52 */ {"var52", "undefined"}, /* 53 */ {"var53", "undefined"}, /* 54 */ {"var54", "undefined"}, /* 55 */ {"var55", "undefined"}, /* 56 */ {"var56", "undefined"}, /* 57 */ {"var57", "undefined"}, /* 58 */ {"var58", "undefined"}, /* 59 */ {"var59", "undefined"}, /* 60 */ {"var60", "undefined"}, /* 61 */ {"var61", "undefined"}, /* 62 */ {"var62", "undefined"}, /* 63 */ {"var63", "undefined"}, /* 64 */ {"var64", "undefined"}, /* 65 */ {"var65", "undefined"}, /* 66 */ {"var66", "undefined"}, /* 67 */ {"var67", "undefined"}, /* 68 */ {"var68", "undefined"}, /* 69 */ {"var69", "undefined"}, /* 70 */ {"var70", "undefined"}, /* 71 */ {"var71", "undefined"}, /* 72 */ {"var72", "undefined"}, /* 73 */ {"var73", "undefined"}, /* 74 */ {"var74", "undefined"}, /* 75 */ {"var75", "undefined"}, /* 76 */ {"var76", "undefined"}, /* 77 */ {"var77", "undefined"}, /* 78 */ {"var78", "undefined"}, /* 79 */ {"var79", "undefined"}, /* 80 */ {"var80", "undefined"}, /* 81 */ {"var81", "undefined"}, /* 82 */ {"var82", "undefined"}, /* 83 */ {"var83", "undefined"}, /* 84 */ {"var84", "undefined"}, /* 85 */ {"var85", "undefined"}, /* 86 */ {"var86", "undefined"}, /* 87 */ {"var87", "undefined"}, /* 88 */ {"var88", "undefined"}, /* 89 */ {"var89", "undefined"}, /* 90 */ {"var90", "undefined"}, /* 91 */ {"var91", "undefined"}, /* 92 */ {"var92", "undefined"}, /* 93 */ {"var93", "undefined"}, /* 94 */ {"var94", "undefined"}, /* 95 */ {"var95", "undefined"}, /* 96 */ {"var96", "undefined"}, /* 97 */ {"var97", "undefined"}, /* 98 */ {"var98", "undefined"}, /* 99 */ {"var99", "undefined"}, /* 100 */ {"var100", "undefined"}, /* 101 */ {"var101", "undefined"}, /* 102 */ {"var102", "undefined"}, /* 103 */ {"var103", "undefined"}, /* 104 */ {"var104", "undefined"}, /* 105 */ {"var105", "undefined"}, /* 106 */ {"var106", "undefined"}, /* 107 */ {"var107", "undefined"}, /* 108 */ {"var108", "undefined"}, /* 109 */ {"var109", "undefined"}, /* 110 */ {"var110", "undefined"}, /* 111 */ {"var111", "undefined"}, /* 112 */ {"var112", "undefined"}, /* 113 */ {"var113", "undefined"}, /* 114 */ {"var114", "undefined"}, /* 115 */ {"var115", "undefined"}, /* 116 */ {"var116", "undefined"}, /* 117 */ {"var117", "undefined"}, /* 118 */ {"var118", "undefined"}, /* 119 */ {"var119", "undefined"}, /* 120 */ {"var120", "undefined"}, /* 121 */ {"var121", "undefined"}, /* 122 */ {"var122", "undefined"}, /* 123 */ {"var123", "undefined"}, /* 124 */ {"var124", "undefined"}, /* 125 */ {"var125", "undefined"}, /* 126 */ {"var126", "undefined"}, /* 127 */ {"var127", "undefined"}, /* 128 */ {"var128", "undefined"}, /* 129 */ {"var129", "undefined"}, /* 130 */ {"TAP", "Temperature anomaly probability % K"}, /* 131 */ {"var131", "undefined"}, /* 132 */ {"var132", "undefined"}, /* 133 */ {"var133", "undefined"}, /* 134 */ {"var134", "undefined"}, /* 135 */ {"var135", "undefined"}, /* 136 */ {"var136", "undefined"}, /* 137 */ {"var137", "undefined"}, /* 138 */ {"var138", "undefined"}, /* 139 */ {"var139", "undefined"}, /* 140 */ {"var140", "undefined"}, /* 141 */ {"var141", "undefined"}, /* 142 */ {"var142", "undefined"}, /* 143 */ {"var143", "undefined"}, /* 144 */ {"var144", "undefined"}, /* 145 */ {"var145", "undefined"}, /* 146 */ {"var146", "undefined"}, /* 147 */ {"var147", "undefined"}, /* 148 */ {"var148", "undefined"}, /* 149 */ {"var149", "undefined"}, /* 150 */ {"var150", "undefined"}, /* 151 */ {"var151", "undefined"}, /* 152 */ {"var152", "undefined"}, /* 153 */ {"var153", "undefined"}, /* 154 */ {"var154", "undefined"}, /* 155 */ {"var155", "undefined"}, /* 156 */ {"var156", "undefined"}, /* 157 */ {"var157", "undefined"}, /* 158 */ {"var158", "undefined"}, /* 159 */ {"var159", "undefined"}, /* 160 */ {"var160", "undefined"}, /* 161 */ {"var161", "undefined"}, /* 162 */ {"var162", "undefined"}, /* 163 */ {"var163", "undefined"}, /* 164 */ {"var164", "undefined"}, /* 165 */ {"10SP", "10 metre speed probability % m s**-1"}, /* 166 */ {"var166", "undefined"}, /* 167 */ {"2TP", "2 metre temperature probability %"}, /* 168 */ {"var168", "undefined"}, /* 169 */ {"var169", "undefined"}, /* 170 */ {"var170", "undefined"}, /* 171 */ {"var171", "undefined"}, /* 172 */ {"var172", "undefined"}, /* 173 */ {"var173", "undefined"}, /* 174 */ {"var174", "undefined"}, /* 175 */ {"var175", "undefined"}, /* 176 */ {"var176", "undefined"}, /* 177 */ {"var177", "undefined"}, /* 178 */ {"var178", "undefined"}, /* 179 */ {"var179", "undefined"}, /* 180 */ {"var180", "undefined"}, /* 181 */ {"var181", "undefined"}, /* 182 */ {"var182", "undefined"}, /* 183 */ {"var183", "undefined"}, /* 184 */ {"var184"