Merge feature/tigge_check_update

This commit is contained in:
Shahram Najm 2021-03-12 15:04:16 +00:00
commit 1fbf48444f
4 changed files with 593 additions and 19 deletions

View File

@ -51,8 +51,8 @@ use Time::localtime;
$ARGV[0] or die "USAGE: $0 input.tsv\n";
my $WRITE_TO_FILES = 0;
my $WRITE_TO_PARAMDB = 1; # Be careful. Fill in $contactId before proceeding
my $WRITE_TO_FILES = 1;
my $WRITE_TO_PARAMDB = 0; # Be careful. Fill in $contactId before proceeding
my ($paramId, $shortName, $name, $units, $cfVarName);
my ($discipline, $pcategory, $pnumber, $type1, $type2, $scaledValue1, $scaleFactor1, $scaledValue2, $scaleFactor2);

View File

@ -3,7 +3,12 @@
TEST_DIR=`dirname $0`
if [ $# -ne 1 ]; then
echo "Usage: $0 title > $TEST_DIR/title.sh"
echo "Usage: $0 title > $TEST_DIR/title.sh" 1>&2
echo 1>&2
echo "Example:" 1>&2
echo " $0 ECC-6666 > tests/grib_ecc-6666.sh" 1>&2
echo " $0 ECC-9999 > tests/bufr_ecc-9999.sh" 1>&2
echo 1>&2
exit 1
fi
@ -31,7 +36,7 @@ cat <<EOF
. ./include.sh
set -u
REDIRECT=/dev/null
label="$TEST_TITLE"
label="prod_${TEST_TITLE}-test"
temp=temp.\$label
sample_grib1=\$ECCODES_SAMPLES_PATH/GRIB1.tmpl
sample_grib2=\$ECCODES_SAMPLES_PATH/GRIB2.tmpl

View File

@ -652,7 +652,6 @@ s2s/ammc: warning: s2s.mx2t6_20151224_26.grib2, field 47 [surface_air_maximum_te
-1e+8,
1e+8,
{
{"model", GRIB_TYPE_STRING, 0, "glob"},
{"paramId", GRIB_TYPE_LONG, 179},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 5},
@ -671,7 +670,6 @@ s2s/ammc: warning: s2s.mx2t6_20151224_26.grib2, field 47 [surface_air_maximum_te
-1e+8,
1e+8,
{
{"model", GRIB_TYPE_STRING, 0, "glob"},
{"paramId", GRIB_TYPE_LONG, 147},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 0},
@ -693,7 +691,6 @@ s2s/ammc: warning: s2s.mx2t6_20151224_26.grib2, field 47 [surface_air_maximum_te
1e+05,
1e+07,
{
{"model", GRIB_TYPE_STRING, 0, "glob"},
{"paramId", GRIB_TYPE_LONG, 176},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 4},
@ -3487,7 +3484,6 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100]
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 6},
{"parameterNumber", GRIB_TYPE_LONG, 11},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level},
@ -3505,7 +3501,6 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100]
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 6},
{"parameterNumber", GRIB_TYPE_LONG, 12},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level},
@ -3561,9 +3556,6 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100]
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 19},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
@ -3626,10 +3618,581 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100]
},
{&point_in_time, &given_level, &height_level},
},
{
"2_metre_specific_humidity_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 174096},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 0},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 103},
{NULL, },
},
{&point_in_time, &given_level},
},
{
"time_integral_of_rain_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235015},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 65},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"total_column_cloud_liquid_water_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 78},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 69},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8},
{NULL, },
},
{&point_in_time, &predefined_thickness},
},
{
"total_column_cloud_ice_water_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 79},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 70},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8},
{NULL, },
},
{&point_in_time, &predefined_thickness},
},
{
"total_column_graupel_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260001},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 74},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8},
{NULL, },
},
{&point_in_time, &predefined_thickness},
},
{
"direct_solar_radiation_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 47},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 4},
{"parameterNumber", GRIB_TYPE_LONG, 54},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_top_net_solar_radiation_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 178},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 4},
{"parameterNumber", GRIB_TYPE_LONG, 1},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 8},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_surface_latent_heat_evaporation_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235019},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 0},
{"parameterNumber", GRIB_TYPE_LONG, 30},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_surface_latent_heat_sublimation_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235071},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 0},
{"parameterNumber", GRIB_TYPE_LONG, 31},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_surface_eastward_momentum_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235017},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 17},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_surface_northward_momentum_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235018},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 18},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_total_solid_precipitation_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260645},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 128},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level},
},
{
"time_integral_of_snow_evaporation_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235072},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 192},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level, &has_bitmap},
},
{
"10_metre_eastward_wind_gust_since_pp_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260646},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 23},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 2},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 103},
{"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0},
{"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 10},
{NULL, },
},
{&since_prev_pp, &given_level},
},
{
"10_metre_northward_wind_gust_since_pp_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260647},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 24},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 2},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 103},
{"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0},
{"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 10},
{NULL, },
},
{&since_prev_pp, &given_level},
},
{
"fog_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260648},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 6},
{"parameterNumber", GRIB_TYPE_LONG, 50},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level},
},
{
"snow_on_ice_total_depth_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260650},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 11},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 174},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"fraction_of_snow_cover_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260289},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 121},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"snow_albedo_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228032},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 19},
{"parameterNumber", GRIB_TYPE_LONG, 19},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"temperature_of_snow_layer_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 238},
{"discipline", GRIB_TYPE_LONG, 2},
{"parameterCategory", GRIB_TYPE_LONG, 3},
{"parameterNumber", GRIB_TYPE_LONG, 28},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"sea_ice_thickness_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 174098},
{"discipline", GRIB_TYPE_LONG, 10},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 160},
{"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0},
{"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 0},
{NULL, },
},
{&point_in_time, &given_level, &has_bitmap},
},
{
"sea_ice_surface_temperature_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260649},
{"discipline", GRIB_TYPE_LONG, 10},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 8},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 174},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"roughness_length_for_heat",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260457},
{"discipline", GRIB_TYPE_LONG, 2},
{"parameterCategory", GRIB_TYPE_LONG, 0},
{"parameterNumber", GRIB_TYPE_LONG, 216},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level},
},
{
"volumetric_soil_ice_layer",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 260644},
{"discipline", GRIB_TYPE_LONG, 2},
{"parameterCategory", GRIB_TYPE_LONG, 0},
{"parameterNumber", GRIB_TYPE_LONG, 38},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 151},
{"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 151},
{"scaleFactorOfSecondFixedSurface", GRIB_TYPE_LONG, 0},
{NULL, },
},
{&point_in_time, &given_thickness, &has_bitmap, &has_soil_layer},
},
/*
cerra
*/
{
"time_integral_of_evapotranspiration_flux_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 235073},
{"discipline", GRIB_TYPE_LONG, 2},
{"parameterCategory", GRIB_TYPE_LONG, 0},
{"parameterNumber", GRIB_TYPE_LONG, 39},
{"typeOfStatisticalProcessing", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&from_start, &predefined_level, &has_bitmap},
},
{
"snow_melt_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 3099},
{"discipline", GRIB_TYPE_LONG, 0},
{"parameterCategory", GRIB_TYPE_LONG, 1},
{"parameterNumber", GRIB_TYPE_LONG, 16},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_total_layer_temperature_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228011},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 162},
{NULL, },
},
{&point_in_time, &predefined_thickness, &has_bitmap},
},
{
"lake_mix_layer_temperature_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228008},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 166},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_mix_layer_depth_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228009},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 0},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 166},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_bottom_temperature_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228010},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 1},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 162},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_shape_factor_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228012},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 10},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_ice_surface_temperature_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228013},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 6},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 174},
{NULL, },
},
{&point_in_time, &predefined_level, &has_bitmap},
},
{
"lake_ice_total_depth_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228014},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 5},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 174},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 176},
{NULL, },
},
{&point_in_time, &predefined_thickness, &has_bitmap},
},
{
"lake_total_depth_sfc",
-1e+8,
1e+8,
-1e+8,
1e+8,
{
{"paramId", GRIB_TYPE_LONG, 228007},
{"discipline", GRIB_TYPE_LONG, 1},
{"parameterCategory", GRIB_TYPE_LONG, 2},
{"parameterNumber", GRIB_TYPE_LONG, 0},
{"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1},
{"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 162},
{NULL, },
},
{&point_in_time, &predefined_thickness, &has_bitmap},
},
{
"momentum_flux_u_component_sfc",
-1e+8,

View File

@ -917,7 +917,8 @@ static int is_valid_JSON_number(const char* input)
return 1;
}
static void get_value_for_key(grib_handle* h, const char* key_name, int key_type, char* value_str, const char* format)
static void get_value_for_key(grib_handle* h, const char* key_name, int key_type, char* value_str,
const char* format, int fix_lsdate, int fix_lstime)
{
int ret = 0, type = key_type;
double dvalue = 0;
@ -942,7 +943,11 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type
}
if (type == GRIB_TYPE_STRING) {
ret = grib_get_string(h, key_name, value_str, &len);
const char* pName = key_name;
/* ECC-707 */
if (fix_lsdate && strcmp(pName, "date") == 0) pName = "ls.date";
if (fix_lstime && strcmp(pName, "time") == 0) pName = "ls.time";
ret = grib_get_string(h, pName, value_str, &len);
}
else if (type == GRIB_TYPE_DOUBLE) {
ret = grib_get_double(h, key_name, &dvalue);
@ -1063,12 +1068,16 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h)
if (!options->verbose)
return;
fix_lsdate = (options->name_space && strcmp(options->name_space, "ls") == 0 && fix_for_lsdate_needed(h));
fix_lstime = (options->name_space && strcmp(options->name_space, "ls") == 0 && fix_for_lstime_needed(h));
if (options->json_output && !options->latlon) {
/* fprintf(dump_file, "\"message %d\" : {\n", options->handle_count); */
fprintf(dump_file, " {\n");
for (i = 0; i < options->print_keys_count; i++) {
fprintf(dump_file, " \"%s\": ", options->print_keys[i].name);
get_value_for_key(h, options->print_keys[i].name, options->print_keys[i].type, value, options->format);
get_value_for_key(h, options->print_keys[i].name, options->print_keys[i].type, value,
options->format, fix_lsdate, fix_lstime);
if (is_valid_JSON_number(value))
fprintf(dump_file, "%s", value);
else
@ -1082,9 +1091,6 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h)
return;
}
fix_lsdate = (options->name_space && strcmp(options->name_space, "ls") == 0 && fix_for_lsdate_needed(h));
fix_lstime = (options->name_space && strcmp(options->name_space, "ls") == 0 && fix_for_lstime_needed(h));
for (i = 0; i < options->print_keys_count; i++) {
size_t len = MAX_STRING_LEN;
ret = GRIB_SUCCESS;