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

Output WRF data in grib?

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
Hello all,

Is it possible to save WRF output data in a grib format instead of NetCDF?

If not, does anyone know of a way to convert from NetCDF to grib?

Hi Trevor,
Theoretically, there is a namelist option that can be used for outputting data in GRIB1 or GRIB2 format. You would just set:
io_form_history = 5 (GRIB1)
io_form_history = 10 (GRIB2)

However, I'm not sure if either of these options actually work. In the past we were aware that at least the GRIB2 option was not working properly, and I don't believe any modifications have been made to correct the problem. Someone recently claimed that they were able to get the GRIB1 option to work, but I cannot say for sure whether this will work.

There is a utility that will convert from GRIB format to NetCDF format. I'm not sure how difficult it would be to configure the utility to convert the other way, but it may be worth a look:

There may be other tools available somewhere, but I'm unaware of them. If you do find something, please update this post so that users in the future can use it. Thanks!
Thanks for the help kwerner!

I have tried setting io_form_history = 10, but that was unsuccessful (I'm running WRF V4.0.1). I'll try setting it to 5 and update the thread.

Since posting I've come across the Climate Data Operator (cdo) tool, which is apparently capable of converting from NetCDF to GRIB. However, I haven't fully tested it yet.