Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Problems with copygb on small areas

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member

I got a problem with converting UPP output (grib 1 data) to lat lon grid using copygb. I use the copygb_hwrf.txt file out of UPP to feed the copygb.exe. However, for bigger areas I got no problems, but I tried a high resolution run on a small area and got no values except on the edges of the output grib.

Does anyone know what that can be?

I use UPPV4.1 for postprocessing. Output is ok. The command after unipost has finished is

./copygb.exe -xg "255 0 152 152 34784 139108 128 35467 139944 5 4 64" WRFPRS_d03_2019-08-03_01:00:00 wrfprs_d03_2019-08-03_01:00:00

The WRF run got the following resolutions: 7500,1500,500 meters. Output after copygb for distances 7500 and 1500 are ok, the last one not. I allready extended e_we and e_sn to a bigger size from 109 points to 154 points, but it doesn't work.

Thanks for help in advance.
Best regards


I found on the ncep noaa page this:

Recently discovered bug in IPOLATES. To avoid the bug, all grids should have a size of greater than 1 degree longitude. The IPOLATES library wanted to handle the case of a global grid going from xE to (x+360)E which is be encoded as going from xE to xE. To allow for rounding errors, a grid from xE to yE (y-x ≤ 1) was condsidered to be a grid from xE to (360+x)E. This causes a problem when the grids are ≤ than 1 degree in longitude. This bug will occur occur for both the input and output grids.

I have seen that IPOLATES is used by copygb. Can anyone confirm that this is a bug in copygb, too?
Unfortunately, UPP no longer supports GRIB1 and copygb, so we can't look into it further, but this certainly sounds like it could be the issue. I see in your grid definition, that your longitude goes from 139.108 to 139.944 which does not encompass a distance of 1 degree longitude. Did you try increasing the grid to at least 1 degree. Did that work? If so, then the bug you pointed out is likely the issue. Also did you try GRIB2 output from UPP and using wgrib2 new_grid to regrid ? Did that give the same issue? Since I see the bug statement on the wgrib2 website, I would think you would see the same response with GRIB2 format using wgrib2, but curious if you tried it.

The interpolation routine is part of the NCEP libraries: You could possibly open an issue about the interpolation bug there for grid domains <1 deg longitude.