diff --git a/definitions/add_params_from_tsv.pl b/definitions/add_params_from_tsv.pl index 52d2c8936..d724bfaf2 100755 --- a/definitions/add_params_from_tsv.pl +++ b/definitions/add_params_from_tsv.pl @@ -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); diff --git a/tests/create_test.sh b/tests/create_test.sh index fc5a3c10c..d844c1985 100755 --- a/tests/create_test.sh +++ b/tests/create_test.sh @@ -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 <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;