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

compare variables before and after running ungrib.exe

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.

Guo guo

New member
Dear Professors,
I encountered some problems while running the ungrib.exe of WPS. The grib data I use is FNL and GFS and the edition I use is WPS3.5. I found that the value of the decoded variable of RH2(relative humidity at 2 m) and RH(at pressure levels )by ungrib.exe are not the same as before decoding. In addition, the decoded variable SNOW( its description is Water equivalent snow depth) is twice that before decoding. While other variables, for rexample PMSL (Sea-level Pressure), PSFC, TT, et al, are the same before and after decoding by ungrib.exe. So why this happend? Whether these variables(RH2, RH, SNOWH) were processed when running ungrib.exe? If so, what is the treatment of these variables? Why do you do that?

I am looking forward to your response. Thank you very much.
Please send me your namelist.wps to take a look. It will also be helpful if you can tell me where you download the FNL/GFS data.

Ming Chen
Guo guo is correct. The WRF system expects RH is with respect to water. The GFS RH (and EC, too) provide an RH that is a function of temperature (with respect to ice or water or a blend of ice and water). Ungrib converts the RH so that it's with respect to water.

The snow depth is also modified based on how NCEP computes it to what WRF expects. Fortunately, there are only a few fields from the various models that need to be converted to proper units in ungrib.
Dear Professor Chen,
Thank you very much for your reply. The content below is my namelist.wps.

parent_id =1,1,2
parent_grid_ratio =1,3,3,
i_parent_start =1,19,25,
j_parent_start =1,17,25,
e_we= 11,109,148,
e_sn= 11,97,103,
geog_data_res = '30s','30s','30s',


And the FNL data I use is from the website:
I have another question I would like to ask for advice. If I want to decode data in other ways instead of ungrib.exe, what should I deal with RH and SNOWH? Is there any specific formula? Could you give me a specific method please?
I am looking forward to your reply. Thank you very much.
Sincerely yours,
Guo guo

if you don't want to use ungrib, probably you can try to use wgrib/wgrib2 to extract variables from FNL directly. For details about WGRIB package, please look at the website here:

Ming Chen
Dear Professor Chen,
Thank you very much for your reply. In fact, I am using wgrib to decode data. But this method is just a simple decoding, and does not treat RH and SNOWH the same as ungrib.exe. This will cause the final wrfout results to be different from ungrib.exe. How did you solve this problem?
Thank you very much.
Guo guo
I am not sure whether I understand your question correctly. RH and SNOWH directly extracted from FNL (by wgrib) are different from the output of ungrib. Jim has explained in his post why they are different. And it is expected that RH and SNOWH in wrfout are different from that in the intermediate file produced by ungrib. What makes you think they should be the same?
Ming Chen