-
Notifications
You must be signed in to change notification settings - Fork 4
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
Problem using wgrib2 to interpolate from a global to regional lat/lon grid #1
Comments
The problem does exist in both the ip and ip2 library. The offending line in both iplib and ip2lib is in the navigation gdswiz routines to calculate DLON, the longitude step. It is: DLON=HI*(MOD(HI*(RLON2-RLON1)-1+3600,360.)+1)/(IM-1) When RLON2 is less than one degree bigger than RLON1, the gdswiz routines assume this is a global extent grid including a bit of wraparound. It is unknown why that assumption had to be made but that is the effect of this calculation. For instance, if IM=7 and RLON2-RLON1=0.6 and HI=1 then HI*(MOD(HI*(RLON2-RLON1)-1+3600,360.)+1) would be 360.6 and DLON would be 60.1. The interpolations thereafter will be misplaced. The proper solution could be to take the "-1" and "+1" out of the formula above, or to actually use the DLON that is provided in the grid metadata accurate to a millionth of a degree. |
Recommendation: For ip and ip2 in gdswiz00 and gdswzd00, set:
For ip2, this can be quality controlled with the "Di" metadata given with nominal 1.e-6 precision.
|
Are we going to take the suggestion of @MIredell ? If so, we need one or more tests to support this change. |
@GeorgeGayno-NOAA @kgerheiser what should be done with this issue? This code has been moved to NCEPLIBS-ip. |
I would add this fix. |
wgrib2 uses the ip2 lib for interpolating between grids. James Cogan of the US ARMY ARL found a problem when interpolating 0.25-degree GFS grib 2 data to a small regional lat/lon grid. Wesley was able to reproduce the problem. Wesley's script and test data are on Mars: /gpfs/dell2/emc/modeling/noscrub/George.Gayno/ip2lib.git/wgrib2_interp_prob
Make sure the problem does not exist in the ip2 library.
The text was updated successfully, but these errors were encountered: