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

(RESOLVED) How to run ungrib.exe on grib files with mixed grib1 and grib2 data

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.

Chapacha

New member
I have been trying to run ungrib.exe (of WPS version 3.9.1) on grib files that may contain both grib1 data and grib2 data and I always get the following error messages in the ungrib.log file:

*** stopping in gribcode ***\n
\tI was expecting a Grib1 file, but this is a Grib2 file.
\tIt is possible this is because your GRIBFILE.XXX files
\tare not all of the same type.
\tWPS can handle both file types, but a separate ungrib
\tjob must be run for each Grib type.\n
STOP gribsize in gribcode
STOP
*** stopping in gribcode ***\n
\tI was expecting a Grib1 file, but this is a Grib2 file.
\tIt is possible this is because your GRIBFILE.XXX files
\tare not all of the same type.
\tWPS can handle both file types, but a separate ungrib
\tjob must be run for each Grib type.\n
STOP gribsize in gribcode
STOP

I am just wondering how I can solve the problems.

Thanks,
Yongxin
 
Hi Yong Xin,
In this case you have to separate grib1 and grib2 first, before you can run WPS to ungrib the data.
WPS has no function to process grib1 and grib2 data simultaneously.
Good luck!
 
Hi Ming,

Thanks a lot. I am wondering if you or anyone know a tool or software that can be used to separate the grib1 and grib2 variables from the grib files.

Yongxin
 
Hi Yongxin,
I asked around and sorry to tell that we don't have the utility to separate grib1 and grib2 records contained in the same single file.
Ming
 
Hi Ming,

Many thanks for asking around. I found one tool from ECMWF that does that so we are good with that.

Thanks again,
Yongxin
 
Hi Yongxin,
I had the same problem as you, may I ask what software in ECMWF do you use to distinguish grib1 and grib2?
 
One of my colleagues here built the NCEP WGRIB2 tool for me that is able to separate the grib2 variables from the grib1 variables and that solved the problem. The NCEP WGRIB2 tool should be free to download. Hope that this information helps.

Thanks,
Yongxin
 
Top