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) ungrib issue while creating met_em.d01.*.nc file

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 have a couple of issues in getting the files created while running ungrib.exe.
I am using the GFS0p5fcst files at 00, 06, 12, and 18 hours.
1. What I understand from the code is the date and time are read from the grib2 file. For example, even though the file name is for 06 hours, the time is 09 hours (for 2015-01-10). Therefore, the file FILE:2015-01-10_06 is not created. The code has an option to create the file at 06 hours using the surrounding files at 00 and 09 hours, which it fails to do.
2. What should be done if one of the four grib2 files are missing?
Thank you.
(1) You can always figure out the time of the data based on the file name. For example,
suppose you have the file gfs.0p25.2020010100.f006.grib2, the time of the data is for 2020010106. f006 means this is the output at 6hr forecast, 2020010100 is the initial time.

(2) ungrib has the capability to interpolate data at surrounding times to produce data at the time you specify. I just run a quick test and this capability works fine.
I am attaching the file that shows the execution for 2015-01-10. In line 87, it can be seen that time is read as 09 hours for the file named GFS_Global_0p5deg_20150110_0600.grib2. In lines 309-311, intermediate files are created for 00 and 09 hours and the code tries to interpolate to 06 hours and stops with an error.


  • met.o3650167.dat
    70.3 KB · Views: 62
The error message indicates that ungrib.exe cannot find the file /glade/work/lijid/version_4.1.3/WPS/FILE:2015-01-10_09, but I did see a file named /glade/work/lijid/version_4.1.3/WPS/PFILE:2015-01-10_09

I am not sure yet what is wrong here. Please tell me where your GRIB file is located. Also send me your namelist.wps to take a look. Thanks.
The grib files are located at /glade/scratch/lijid/dataset/met_files/GFS0p5fcst/2015/01/10
I have attached the namelist.wps file.
Thank you.


  • namelist.wps.dat
    1.2 KB · Views: 78
I run WPS to process your GFS files. All works fine, I cannot repeat your error.
All files are saved at /glade/scratch/chenming/WRFHELP, where you can find GRIB files, GFS files and namelist.wps.
I run with WPSV4.1
Your GFS files are at 6-hour interval, and I output files at 3-hour interval. ungrib can successfully interpolate data form 6-hr interval to 3-hour interval.

Can you use the GFS files I produced to run metgrid and see how it works?
Please let me know if you have more questions.