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) Using non-GRIB data

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.

mitchellkcm

New member
This question kind of overlaps with the ‘running ungrib’ forum ...

I have been looking for some datasets that cover North America and specifically southwestern Ontario on the RDA site maintained by UCAR. If I use a GRIB2 file format will that work ok with WPS/WRF v3.8.1? Can I use data files of NetCDF format? If so do I still need to run ungrid.exe? Do I still need to get the NetCDF files to the intermediate format?
 
Yes, grib2 file format is perfectly fine to use with V3.8.1

Yes, you can use files in NetCDF format, but you will still need to get them into intermediate format so that the metgrid program can read them. You will then skip the ungrib.exe process and after converting the files, just run metgrid. You can read a bit about converting files to intermediate format here:
http://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap3.html#_Writing_Meteorological_Data

I’ll also attach a template fortran file that you can use, if you decide to use NetCDF files. This file was created for another application, so you will need to change it to make it your own.
 

Attachments

  • netcdf-to-intermediate-share.f
    29.1 KB · Views: 114
It seems all SST data available are in NetCDF format. Are there default scripts out there for converting these SST data into intermediate format for input into WRF? Or are you aware of GRIB-based SST data sources?
 
Hi,

Yeah, I think it's pretty standard that most climate data (including SST data) are typically in netCDF format. Unfortunately the only script I'm aware of that would serve as a template for converting to intermediate format is the script I provided further up in this topic. Perhaps others have different resources they can provide?
 
For those familiar with Python, I found that the Iris package was very effective at converting NetCDF to GRIB data for use in WRF. As an example, see the code below for turning NOAA SST data into a GRIB format that WRF will accept. Getting the metadata correct was key:

import iris
import iris_grib

radius=iris.fileformats.pp.EARTH_RADIUS

cubes = iris.load('put netcdf filename here)
sst = cubes[0]

sst.coord(dimensions=[2]).coord_system=iris.coord_systems.GeogCS(radius)
sst.coord(dimensions=[3]).coord_system=iris.coord_systems.GeogCS(radius)
sst.units = 'celsius'
sst.standard_name = 'air_temperature'

iris.save(sst,'put grib filename here')
 
Top