From 7c0e1a96b17cf335563e1e455870d9c9a135b26f Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:52:13 -0600 Subject: [PATCH] adding additional check to find source of potential error --- tests/CMakeLists.txt | 1 + tests/data/ref_tmp_windspeed.txt | 2 ++ tests/run_wgrib2_rpn_tests.sh | 4 ++++ 3 files changed, 7 insertions(+) create mode 100644 tests/data/ref_tmp_windspeed.txt diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a8c1b06b..eb3b5f6a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,6 +99,7 @@ copy_test_data(ref_grid.gdaswave.t00z.wcoast.0p16.f000.grib2.txt) copy_test_data(ref_celsius.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_fahrenheit.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_rh.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) +copy_test_data(ref_tmp_windspeed.txt) copy_test_data(ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2) copy_test_data(ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) diff --git a/tests/data/ref_tmp_windspeed.txt b/tests/data/ref_tmp_windspeed.txt new file mode 100644 index 00000000..18d1eb79 --- /dev/null +++ b/tests/data/ref_tmp_windspeed.txt @@ -0,0 +1,2 @@ +1:0:d=2024042612:WIND:0.01 mb:anl: +2:97919:d=2024042612:WIND:0.02 mb:anl: diff --git a/tests/run_wgrib2_rpn_tests.sh b/tests/run_wgrib2_rpn_tests.sh index d2d47b68..43621c6c 100644 --- a/tests/run_wgrib2_rpn_tests.sh +++ b/tests/run_wgrib2_rpn_tests.sh @@ -32,6 +32,10 @@ echo "*** Calculates wind speed for records 1-25, then returns the average, min, -set_var WIND \ -grib_out tmp_windspeed.grb +# Check output +../wgrib2/wgrib2 tmp_windspeed.grb > tmp_windspeed.txt +diff -w tmp_windspeed.txt data/ref_tmp_windspeed.txt + ../wgrib2/wgrib2 tmp_windspeed.grb -rpn print_min -rpn print_max -rpn print_ave > min_max_ave_windspeed.txt touch min_max_ave_windspeed.txt diff -w min_max_ave_windspeed.txt data/ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt