I had problems with wgrib2 accepting negative numbers, so I had to make adjustments as follows:
Dataset: GFS 0.25 Degree Hourly
# bounding box for domain
leftlon: -162.
rightlon: -80.
bottomlat: 24.
toplat: 65.# what values to use for wgrib2 slicing?
leftlon positive: -162+360=198
rightlon positive: -80+360 = 280
(rightlon+360)-(leftlon+360)=280-198=82
82*4 =328
toplat-bottomlat = 65-24=41
(toplat-bottomlat)*4 = 41*4=164-lola (leftlon+360):[(rightlon+360)-(leftlon+360)]*4:(degree)
(bottomlat):(toplat-bottomlat)*4:(degree)
-lola (-162+360):[(-80+360)-(-162+360)]*4:0.25 (24):(65-24)*4:0.25
-lola 198:[(280)-(-198)]*4:0.25 (24):(65-24)*4:0.25
-lola 198:82*4:0.25 24:41*4:0.25
-lola 198:328:0.25 24:164:0.25# -lola out X..Z,A lon-lat grid values X=lon0:nlon:dlon Y=lat0:nlat:dlat Z=file A=[bin|text|spread|grib]
wgrib2 gfs_2025051600f000.grib2 -lola 198:328:0.25 24:164:0.25 output.grb grib# without degree 0.25, using degree 1.0 - loss of resolution!
#wgrib2 gfs_2025051600f000.grib2 -lola 198:82:1 24:41:1 output.grb grib
I was able to verify the results in xygrib