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

metgrid.exe error: missing values despite input extent being larger than specified domains

GewellLlorin

New member
Hello! I would like to ask about an error I encounter when running metgrid.exe using pywinter-derived boundary condition files:
WARNING: Field PRES has missing values at level 200100 at (i,j)=(1,1)
WARNING: Field DEWPT has missing values at level 200100 at (i,j)=(1,1)
WARNING: Field PMSL has missing values at level 201300 at (i,j)=(1,1)
WARNING: Field PSFC has missing values at level 200100 at (i,j)=(1,1)
ERROR: Missing values encountered in interpolated fields. Stopping.

For some context, I am trying to run WRF with "composite atmosphere" boundary conditions: I average the usual ERA5 pressure level and surface input data for specific days of interest into one day with 6-hourly timesteps. I then loop this over several days with a dummy dates and would like to use this as boundary condition files. Because of this, I decided to directly convert the processed netcdf data into the intermediate file format used in WPS through the python pywinter library (its usage is documented here.)

While the files are created with no issue, metgrid.exe errors as seen above. Previous posts with the same problem seem to generally have input data that didn't cover their specified domains, hence the missing values at the edge points. However, I have rechecked my input data multiple times, even the final intermediate format files with int2nc.exe. There are no NaN values. The input data I downloaded covers [115 - 135E, 5 - 25N] while my outermost domain is only over ~[118.4 - 126.2E, 12.0 - 19.7N]. Why can it not find the data? Also, why is it only these fields when all variables follow the same extent?

I have tried the alternative route of creating GRIB files from my composite atmosphere netcdf files using CDO and running them through ungrib.exe. The metgrid.exe utility still gives the same result. As a last resort, I have also tried outright reducing my domains to half their original sizes to see if it really was an issue with the input data. I encounter the same error.

I have compiled all the files that may help diagnose this issue here. These include the namelist.wps file I use, the scripts I used to create the intermediate files using pywinter (pywinterBCs.py) and the grib files (cdoBCs.sh). I also included some basis composite atmosphere files (composites folder), sample outputs from pywinter (pywinterFiles folder), and sample grib outputs from using cdo (GRIBfiles folder). Lastly, a sample result of the int2nc.exe utility I used to check the fields is added in the pywinterFiles folder (P2p_SRF:2025-03-01_00.nc).

Any guidance would be appreciated. Thank you so much!
 

Attachments

  • namelist.wps
    778 bytes · Views: 4
Last edited:
Hi,
When I use the plotfmt program to look at the intermediate file data, it doesn't look like the data covers the area you mention. I'm attaching a screenshot. However, when I use the rd_intermediate.exe tool to look at the data, I can see that the ref_lat and ref_lon include points you said you downloaded (which are outside of the area in the screenshot. So I'm also confused! I even tried to make your domain much smaller, and tried to place your domain in the area shown in the screenshot and it still gives the same error. I'm going to ask a colleague for their opinion and get back to you. In the meantime, if you make any progress or figure out anything useful, please let me know. Thanks!
 

Attachments

  • Screenshot 2024-08-05 at 12.11.48 PM.png
    Screenshot 2024-08-05 at 12.11.48 PM.png
    224.6 KB · Views: 4
Hi,
When I use the plotfmt program to look at the intermediate file data, it doesn't look like the data covers the area you mention. I'm attaching a screenshot. However, when I use the rd_intermediate.exe tool to look at the data, I can see that the ref_lat and ref_lon include points you said you downloaded (which are outside of the area in the screenshot. So I'm also confused! I even tried to make your domain much smaller, and tried to place your domain in the area shown in the screenshot and it still gives the same error. I'm going to ask a colleague for their opinion and get back to you. In the meantime, if you make any progress or figure out anything useful, please let me know. Thanks!
Thank you so much for taking the time to check my files!

While I have not yet figured out the issue with my previous method, I backtracked to the beginning and found an alternative that works for what I want to do. What I did before was:
  1. download the NETCDF ERA5 files for my days of interest
  2. process the data into composite atmosphere files on python
  3. write the composite atmosphere files into the WPS intermediate file format (with the pywinter library) or into GRIB files (using cdo)
After some thought and consultation, I believe that perhaps something is lost either during the compositing (perhaps the operation changes the data structure?) or the conversion from a NETCDF format to the Intermediate file or GRIB format. Following this, I decided to:
  1. download the GRIB format version of the ERA5 files for my days of interest
  2. combine and average the data for each 6-hourly interval using the cat and cdo timmean utilities on bash
  3. duplicate these files and adjust their time information using the grib_set utility
This method is quite convoluted but metgrid.exe runs just fine with the newly-generated files after they pass through ungrib.exe. I will be working with this alternative moving forward but hopefully the previous issue I reported can be addressed in the future. I am still open to suggestions for it.

Thank you again and I hope this helps others who would like to do something similar!
 
Great! I'm happy to hear that you did find a work-around. Thank you so much for updating the post with the method that's working for you.
 
Top