From 686bd82b46db221dff20029470320a2cf87e0793 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 20 Aug 2021 16:10:55 +0100 Subject: [PATCH] Testing: experimental feature grib_fieldset_apply_where --- tests/grib_nearest_test.c | 6 ++++++ tests/grib_nearest_test.sh | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tests/grib_nearest_test.c b/tests/grib_nearest_test.c index f5b1df4fb..4dd6d29d7 100644 --- a/tests/grib_nearest_test.c +++ b/tests/grib_nearest_test.c @@ -21,6 +21,8 @@ #include "eccodes.h" +int grib_fieldset_apply_where(grib_fieldset* set, const char* where_string); /*experimental*/ + static void usage(const char* prog) { printf("Usage: %s [-n] grib_file grib_file ...\n", prog); @@ -72,6 +74,10 @@ int main(int argc, char** argv) set = codes_fieldset_new_from_files(0, filenames, nfiles, 0, 0, 0, order_by, &err); CODES_CHECK(err, 0); + /* grib_fieldset_apply_where not fully implemented*/ + err=grib_fieldset_apply_where(set, "(centre=='ecmf') && number==1 || step==6"); + CODES_CHECK(err, 0); + printf("ordering by %s\n", order_by); printf("%d fields in the fieldset\n", codes_fieldset_count(set)); printf("n,step,param\n"); diff --git a/tests/grib_nearest_test.sh b/tests/grib_nearest_test.sh index 57381e1b2..666e1b26e 100755 --- a/tests/grib_nearest_test.sh +++ b/tests/grib_nearest_test.sh @@ -19,6 +19,7 @@ input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 # -------------------------------------- $EXEC ${test_dir}/grib_nearest_test $input_grb > $temp cat > $tempRef < $temp cat > $tempRef <