NOAA-EMC / wgrib2

Provides functionality for interacting with, reading, writing, and manipulating GRIB2 files.
27 stars 13 forks source link

wgrib2 v2.0.8 does not work for rotated latlon grids #51

Closed aliabdolali closed 1 month ago

aliabdolali commented 3 years ago

I am trying to interpolate the RAP model outputs on its native grid (rotated latlon) to a latlon grid, using wgrib2 v2.0.8 and it ended up with empty values.

My diagnosis shows that

For the operational RAP, it uses the following version on WCOSS: _/gpfs/hps/nco/ops/nwprod/gributil.v1.0.5/exec/wgrib2 (v0.2.0.5) and it works as expected. However, the wgrib2.v2.0.8 does not work on WCOSS and HERA. /gpfs/dell2/emc/modeling/noscrub/emc.hurpara/local/bin/wgrib2.v2.0.8 /apps/wgrib2/2.0.8/intel/18.0.3.222/bin/wgrib2

my command is: wgrib2 tmp1.grib2 -set_bitmap 1 -set_grib_type jpeg -new_grid_winds grid -new_grid_vectors "UGRD:VGRD:USTM:VSTM:VUCSH:VVCSH" -new_grid_interpolation bilinear -new_grid latlon 226.0:560:0.15 5.0:350:0.15 tmp2.grib2

kgerheiser commented 3 years ago

This is because the current build of wgrib2 is built with ip2 library for interpolation which does not support NCEP rotated lat-lon grids (but does support WMO rotated lat-lon). It needs to be built with ip instead which supports NCEP rotated lat-lon (but not WMO).

We are aware of this issue and will provide an updated build.

aliabdolali commented 3 years ago

Hi, I checked with HERA while you are working on the build update. Here is what they asked: Hera helpdesk: I checked our installation notes as well as the instruction from "cpc" https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/compile_questions.html. There is no mention of "ip" and "ip2". What are those libraries? How could they be used to build the wgrib2? Could you ask the developer, since we need the installation instructions.

Hera helpdesk also checked the linked libraries for wgrib2. There is no "ip" or "ip2" libraries involved. Anyway, we need the installation instruction from the developer to activate the "ip" instead of "ip2".

Could you provide the instruction how to do it, so we can have an intermediate solution on Hera for our development?

kgerheiser commented 3 years ago

The option is USE_IPOLATES. USE_IPOLATES=1 is to use the ip library (NCEP rotated lat-lon), and USE_IPOLATES=3 is ip2 (WMO rotated lat-lon).

aliabdolali commented 3 years ago

@kgerheiser thanks for the guidance. Hera admin is going to compile it with USE_IPOLATES=3 for ip2 and they asked me if they can compile wgrib2 v3. Is it still the case? In other words, does it work for NCEP rotated lat-lon if they compile v3 (USE_IPOLATES=3 for ip2)?

kgerheiser commented 3 years ago

If you want NCEP rotated lat-long then you want ‘USE_IPOLATES=1’. And yes it works for wgrib2 3.x.x

aliabdolali commented 3 years ago

Hi, I can confirm the v3 with different USE_IPOLATES option works for my applications (WMO and NCEP rotated latlon). I'd appreciate it if you inform me when a unified version is available that handle both WMO and NCEP rotated latlon grids. Or if this is not a plan?

For now and on Hera: for NCEP rotated lat-lon: module load gnu module load wgrib2/3.0.2_ncep or for WMO rotated lat-lon: module load gnu module load wgrib2/3.0.2_wmo AA

edwardhartnett commented 2 months ago

We believe this will be fixed in the upcoming 3.4.0 release. It also requires NCEPLIBS-ip-5.1.0.