Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found more tests that pass inconsistently #175

Open
AlysonStahl-NOAA opened this issue Jul 9, 2024 · 7 comments
Open

Found more tests that pass inconsistently #175

AlysonStahl-NOAA opened this issue Jul 9, 2024 · 7 comments

Comments

@AlysonStahl-NOAA
Copy link
Collaborator

There are some tests that are occasionally failing. It's a little hard to tell what's going on, but this time its the actual output that's inconsistent, not just EOL or whitespace like in #137. Typically, if I just rerun the checks it will pass the next time.

I have experienced this issue with the following tests:

run_wgrib2_tests.sh:

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
diff -w 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
diff -w uv.txt data/ref_uv.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv

echo "*** Testing spread output"
../wgrib2/wgrib2 data/ref_simple_packing.grib2 -v2 -spread spread.txt
touch spread.txt
diff -w data/ref_simple_packing.grib2.spread.txt spread.txt

run_wgrib2_rpn_tests.sh

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):"
-if ":UGRD:" -rpn "sto_1" -fi
-if ":VGRD:" -rpn "sto_2" -fi
-if_reg 1:2
-rpn "rcl_1:sq:rcl_2:sq:+:sqrt:clr_1:clr_2"
-set_var WIND
-grib_out tmp_windspeed.grb

@webisu
Copy link
Collaborator

webisu commented Jul 10, 2024 via email

@AlysonStahl-NOAA
Copy link
Collaborator Author

@webisu @edwardhartnett
I found more instances of tests failing. These ones are from the ipolates tests, specifically those testing the conversion to different grid definitions. I've seen this occasionally pop up for different grids, not just the same one. For example here:

*** Testing conversion to NCEP grid definition 129
1:0:d=2024042612:UGRD:0.01 mb:anl:
....
14:816827:d=2024042612:VGRD:0.4 mb:anl:
49c49
< unscaled lat=89843514 to -89843514 lon=0 to 359795455:12Z26apr2024:UGRD U-Component of Wind [m/s]:lvl1=(100,7) lvl2=(255,missing):0.07 mb:anl::lon=10.022727,lat=11.959112,i=876530,ix=50,iy=499,val=-1.25732:lon=20.045455,lat=80.034019,i=1462659,ix=99,iy=832,val=9.74268
---
> unscaled lat=89843514 to -89843514 lon=0 to 359795455:12Z26apr2024:UGRD U-Component of Wind [m/s]:lvl1=(100,7) lvl2=(255,missing):0.07 mb:anl::lon=10.022727,lat=11.959112,i=876530,ix=50,iy=499,val=-0.930981:lon=20.045455,lat=80.034019,i=1462659,ix=99,iy=832,val=10.069

Another example for a different grid:

*** Testing conversion to NCEP grid definition 3
1:0:d=2024042612:UGRD:0.01 mb:anl:
...
14:816827:d=2024042612:VGRD:0.4 mb:anl:
66c66
< unscaled lat=90000000 to -90000000 lon=0 to 359000000:12Z26apr2024:UGRD U-Component of Wind [m/s]:lvl1=(100,20) lvl2=(255,missing):0.2 mb:anl::lon=10.000000,lat=12.000000,i=36731,ix=11,iy=103,val=-7:lon=20.000000,lat=80.000000,i=61221,ix=21,iy=171,val=9
---
> unscaled lat=90000000 to -90000000 lon=0 to 359000000:12Z26apr2024:UGRD U-Component of Wind [m/s]:lvl1=(100,20) lvl2=(255,missing):0.2 mb:anl::lon=10.000000,lat=12.000000,i=36731,ix=11,iy=103,val=-8:lon=20.000000,lat=80.000000,i=61221,ix=21,iy=171,val=9

The actual differences are in the values labeled as 'val'. Looks like this is also related to calculations involving the u/v components for wind, so I'm keeping these under the same issue.

@webisu
Copy link
Collaborator

webisu commented Aug 23, 2024 via email

@edwardhartnett
Copy link
Contributor

OK, so these are large differences in the results? Too large to be acceptable?

Are they happening in wgrib2 or ip? @AlexanderRichert-NOAA you may wish to add or check your testing for this.

@AlysonStahl-NOAA
Copy link
Collaborator Author

The other failing tests do not use ip, but they do involve the wind calculations. I'm thinking the error is in there.

@webisu
Copy link
Collaborator

webisu commented Aug 26, 2024 via email

@edwardhartnett
Copy link
Contributor

If this is correct behavior, increase the epsilon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants