diff --git a/memfs.py b/memfs.py index 36a07e0db..9146144bf 100755 --- a/memfs.py +++ b/memfs.py @@ -53,9 +53,6 @@ output_file_base = sys.argv[-1] buffer = None fcount = -1 - - - for directory in dirs: # print("MEMFS: directory=", directory) @@ -70,14 +67,12 @@ for directory in dirs: dirnames[:] = [dirname for dirname in dirnames if dirname not in EXCLUDED] for name in files: - if buffer is None: fcount += 1 opath = get_outfile_name(output_file_base, fcount) print("MEMFS: Generating output:", opath) buffer = open(opath, 'wb') - full = "%s/%s" % (dirpath, name) _, ext = os.path.splitext(full) if ext not in [".def", ".table", ".tmpl", ".list", ".txt"]: @@ -119,7 +114,6 @@ for directory in dirs: buffer.close() buffer = None - if buffer is not None: buffer.close() @@ -323,3 +317,4 @@ FILE* codes_memfs_open(const char* path) { print("Finished") print("MEMFS: done", time.time() - start) + diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index fade0feb8..d392d4e18 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -672,6 +672,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_INTERNAL_ERROR; } + /* Data Quality checks */ + if (a->context->grib_data_quality_checks) { + /* First value is the field's average */ + double min_val = val[0]; + double max_val = min_val; + if ((ret = grib_util_grib_data_quality_check(gh, min_val, max_val)) != GRIB_SUCCESS) + return ret; + } + if (pen_j == sub_j) { double* values; d = grib_power(decimal_scale_factor, 10); @@ -819,7 +828,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } else { /* _test(val[i]*d,0); */ - grib_encode_unsigned_long(hres, encode_float(val[i++]), &hpos, 8 * bytes); /* _test(val[i]*d,0); */ grib_encode_unsigned_long(hres, encode_float(val[i++]), &hpos, 8 * bytes); diff --git a/tests/bufr_extract_headers.sh b/tests/bufr_extract_headers.sh index 80d2d9b6e..908f9ba29 100755 --- a/tests/bufr_extract_headers.sh +++ b/tests/bufr_extract_headers.sh @@ -62,7 +62,7 @@ r=`${test_dir}/bufr_extract_headers centre ${data_dir}/bufr/israel_observations_ # Check all centres with an abbreviation centre_table=${ECCODES_DEFINITION_PATH}/common/c-11.table -centres=`awk 'NR > 1 && $2 ~ /^[A-z]/ {print $2}' < $centre_table` +centres=`awk 'NR > 1 {print $2}' < $centre_table` for c in $centres; do ${tools_dir}/bufr_set -s centre=$c $ECCODES_SAMPLES_PATH/BUFR4.tmpl $temp1 r=`${test_dir}/bufr_extract_headers centre $temp1` diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index 45c725f7b..65fad1ede 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -140,24 +140,34 @@ echo "Override the defaults..." tempDir=tempdir.$label rm -rf $tempDir mkdir -p $tempDir -# Set a large limit for temperature +# Change limits for 2m temperature (grid-point) and Temperature (spectral) cat > $tempDir/param_limits.def <