From 5e120e84ce32551c25c85caa4c70d6b4489d6f5d Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Thu, 16 May 2024 12:59:58 -0600 Subject: [PATCH] attempting to fix file comparison issue --- tests/run_wgrib2_rpn_tests.sh | 8 ++++---- tests/run_wgrib2_tests.sh | 36 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/run_wgrib2_rpn_tests.sh b/tests/run_wgrib2_rpn_tests.sh index dec7b31d..7d73733d 100644 --- a/tests/run_wgrib2_rpn_tests.sh +++ b/tests/run_wgrib2_rpn_tests.sh @@ -10,18 +10,18 @@ echo "*** Running wgrib2 rpn tests" echo "*** Converting temperatures from K to C" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -match ":TMP:0.01" -rpn "273.15:-" -text celsius.txt touch celsius.txt -cmp celsius.txt data/ref_celsius.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt +diff celsius.txt data/ref_celsius.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** Converting temperatures from K to F" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -match ":TMP:0.01" -rpn "273.15:-:9:*:5:/:32:+" -text fahrenheit.txt touch fahrenheit.txt -cmp fahrenheit.txt data/ref_fahrenheit.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt +diff fahrenheit.txt data/ref_fahrenheit.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** Takes relative humidity values, limits them to 100 and outputs to grib file" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -match ":RH:" -if ":RH:" -rpn "100:min" -fi -grib_out rh.grb -not_if ":RH:" -grib rh.grb ../wgrib2/wgrib2 rh.grb > rh.txt touch rh.txt -cmp rh.txt data/ref_rh.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt +diff rh.txt data/ref_rh.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** Calculates wind speed for records 1-25, then returns the average, min, and max values" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -for 1:25 -match ":(UGRD|VGRD):" \ @@ -34,7 +34,7 @@ echo "*** Calculates wind speed for records 1-25, then returns the average, min, ../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 -cmp min_max_ave_windspeed.txt data/ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt +diff min_max_ave_windspeed.txt data/ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** SUCCESS!" exit 0 diff --git a/tests/run_wgrib2_tests.sh b/tests/run_wgrib2_tests.sh index 7d7a9327..8c046caa 100755 --- a/tests/run_wgrib2_tests.sh +++ b/tests/run_wgrib2_tests.sh @@ -15,51 +15,51 @@ ls -l ../wgrib2 echo "*** testing inventory of gdaswave.t00z.wcoast.0p16.f000.grib2..." ../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 > tmp.txt -cat tmp.txt -cmp tmp.txt data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2.inv +touch tmp.txt +diff tmp.txt data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2.inv echo "*** Testing calculation of number of grid points" ../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -npts > npts.txt -cat npts.txt -cmp npts.txt data/ref_npts_gdaswave.t00z.wcoast.0p16.f000.grib2.txt +touch npts.txt +diff npts.txt data/ref_npts_gdaswave.t00z.wcoast.0p16.f000.grib2.txt echo "*** Testing calculation of wind speed, direction, and UGRD & VGRD components" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -wind_dir wind.grb -wind_speed wind.grb -match "(UGRD|VGRD)" ../wgrib2/wgrib2 wind.grb > wind.txt -cat wind.txt -cmp wind.txt data/ref_wind.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv +touch wind.txt +diff wind.txt data/ref_wind.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv ../wgrib2/wgrib2 wind.grb -wind_uv uv.grb ../wgrib2/wgrib2 uv.grb > uv.txt -cat uv.txt -cmp uv.txt data/ref_uv.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv +touch uv.txt +diff uv.txt data/ref_uv.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv echo "*** Testing grid information" ../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -grid > grid_test.txt -cat grid_test.txt -cmp grid_test.txt data/ref_grid.gdaswave.t00z.wcoast.0p16.f000.grib2.txt +touch grid_test.txt +diff grid_test.txt data/ref_grid.gdaswave.t00z.wcoast.0p16.f000.grib2.txt echo "*** Testing Sec0" ../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -Sec0 -grib_out sec0.grb ../wgrib2/wgrib2 sec0.grb > sec0.txt -cat sec0.txt -cmp sec0.txt data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt +touch sec0.txt +diff sec0.txt data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** Testing checksum on section 0" ../wgrib2/wgrib2 sec0.grb -checksum 0 > chksum1.txt ../wgrib2/wgrib2 data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2 -checksum 0 > chksum2.txt touch chksum1.txt touch chksum2.txt -cmp chksum1.txt chksum2.txt +diff chksum1.txt chksum2.txt echo "*** Testing sec_len" ../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -Sec_len > sec_len.txt -cat sec_len.txt -cmp sec_len.txt data/ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt +touch sec_len.txt +diff sec_len.txt data/ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt echo "*** Testing sec_len on a small file" ../wgrib2/wgrib2 data/ref_simple_packing.grib2 -Sec_len > sec_len_small.txt -cat sec_len_small.txt -cmp sec_len_small.txt data/ref_sec_len.simple_packing.grib2.txt +touch sec_len_small.txt +diff sec_len_small.txt data/ref_sec_len.simple_packing.grib2.txt echo "*** Testing separating grib messages into separate files then recombining into single file" # creating comparison file using match @@ -104,7 +104,7 @@ fi echo "*** Testing spread output" ../wgrib2/wgrib2 data/ref_simple_packing.grib2 -v2 -spread spread.txt touch spread.txt -cmp data/ref_simple_packing.grib2.spread.txt spread.txt +diff data/ref_simple_packing.grib2.spread.txt spread.txt echo "*** Testing write/read section" ../wgrib2/wgrib2 data/ref_simple_packing.grib2 -write_sec 0 sec0.dat -write_sec 1 sec1.dat \