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

NetCDF as input

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.

skew_t_pie

New member
I am reading data through MATLAB which is unpacked using their NC-Toolbox. As I understand it, the WPS takes GRIB data, re-purposes it to an intermediate format, then to NetCDF? If this is the case, can I by-pass the "ungrib.exe" process if the input data is already in NetCDF? It doesn't matter if the data I'm reading through MATLAB is GRIB or NetCDF; the toolbox can unpack either. However, I do not know of any software in MATLAB that writes to GRIB but writing data to NetCDF is pretty straightforward.
 
If the data is in netCDF format, you definitely can skip running ungrib. Instead, you can read the netCDF data directly, write it to intermediate files, and then run metered.exe.

The format of intermediate file can be found in https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap3.html#_Writing_Meteorological_Data
 
Ming Chen said:
If the data is in netCDF format, you definitely can skip running ungrib. Instead, you can read the netCDF data directly, write it to intermediate files, and then run metered.exe.

The format of intermediate file can be found in https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap3.html#_Writing_Meteorological_Data

OK, thank you very much
 
Ming Chen said:
If the data is in netCDF format, you definitely can skip running ungrib. Instead, you can read the netCDF data directly, write it to intermediate files, and then run metered.exe.

The format of intermediate file can be found in https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap3.html#_Writing_Meteorological_Data

is this the same as the ./util/rd_intermediate.exe FILE:***?

I have a netcdf of SST and I want to use it for WRF? I looked at the link you mentioned but unfortunately, I got lost along the way.

will i just do ./util/rd_intermediate.exe SST:2020**.nc?
 
Hi,
Yes, that should work. In the above, "FILE" is simply the prefix name of the intermediate file. If yours is SST, then you will use that instead.
 
Hi, kwerner:

Thank you for the response. To clarify, my SST filename appears like this.

'SST_aug_clim.nc'

How do I proceed with the metgrid.exe? My intended run for SST is to use the climatological SST without changing/updating it throughout the run.
 
Hi, kwerner:

So I have SST_Aug.nc. When I tried to use ./util/rd_intermediate.exe SST_Aug.nc

An error showed:

ERROR: Didn't recognize format version of data in SST_Aug8120.nc.\nFound version 0 but expected either 3, 4, or 5. This could be an endian problem.

Since I was not able to do this, I renamed SST_Aug.nc as SST:20xx-xx_18.

Then I put constants_name: ./SST:20xx-xx_18 as directed in the link you have provided. The metgrid is running but there is an error showing:

WARNING: Couldn't open file constants_name::20xx-xx-xx_18 for input.

The xx is the following timestep. Is that supposed to be just alright? When I opened the met_d0*.nc, there is no SST in variables and the skintemp is definitely not constant.
 

Attachments

  • SST_Aug8120.nc
    513.6 KB · Views: 49
  • sample_WPS.txt
    314 bytes · Views: 72
Hi,
I believe the problem is that the SST data are likely in NetCDF format (indicated by the .nc suffix on the file). The metgrid program is looking for data that are in intermediate file format. Your options would be to convert that netcdf data to intermediate format, or to modify the met_em.d0* files to add the SST data to them, but you would need to use some sort of tool for modifying NetCDF files, which isn't provided with the WPS/WRF code. You may want to look into NCO for that purpose, or NCL may have a function to do that (Note that we have an NCL section as part of this forum, so if you have any questions related to NCL, you can post in there).
 
Top