Tuesday, January 10, 2012

Hub-height wind speeds from WRF and GFS

I need to extract wind speed from an atmospheric model at 80m above ground level. That should be pretty simple right? There must be a tool which does that already? Anywhere?

Atmospheric models generally don't like height above ground as vertical coordinate. Most human beings do. This makes getting variables at specified heights a bit of a mission. Especially if the files are in GRIB format, which is a pain in itself.

One option I've have found for WRF is the Universal Post Processor, UPP. UPP will interpolate variables onto a fixed set of heights above sea level, flight levels. These are hard-coded into UPP at: 30m, 50m, 80m, 100m, 305 and a bunch of other heights up to 6000m.

A (not-documented) feature of UPP is that if you specify the vertical levels with a '2', they are interpolated to heights above ground level. Or at least above the level of the model terrain. So put

L = (22220, 0000 ....)

into you wrf_cntrl.parm file, you will get variables out at 30m, 50m, 80m and 100m, above terrain level. Additionally, if you dig into the UPP source code and edit:

src/unipost/MISCLN.f

Then you change the heights to be whatever you want. I settled on every 10m up to 120m. However, a quick check in
src/unipost/FDLVL.f reveals the interpolation is done linearly in height from the levels above and below the height you are interested in. OK if your model levels are close together. However, linearly interpolating wind speed from 150m to 80m is a bit questionable. Don't expect any magic to recreate the vertical wind speed profile.

It would be nice if UPP at least had the option to interpolate in log h. I looked at changing the source code to do this, but then backed away. It didn't look too difficult, I'm just lazy.

Oh - and UPP produces GRIB output. This is fine for me as I need GRIB format for input into the MET tool. But for most uses, GRIB is pretty painful to work with. I mean, fancy taking your lovely NetCDF files and giving you back GRIB. It's just not a deal.

GFS output proved even more of a challenge. UPP can apparently can work directly with GFS data, but there is no documentation on it. I tried it, and it attempted to read GFS files using an i/o module designed to import WRF data, so it fell over and died.

Next I tried using CDO. But I was unable to work with GFS output, as CDO seemed to think there was more than one timestep in my GRIB files (there wasn't).

The only tool left is NCL, which can't write GRIB output. I have implemented some code to which interpolate wind speeds to heights above ground level. My options now are to write that to NetCDF format, and then try and convert to GRIB so that I can input it into MET.

Surely there must be an easier way.

Monday, January 9, 2012

Building CDO with Grib2 support

I was struggling to build CDO with GRIB2 support. Some instructions here:
http://www.eamnet.eu/cms/?q=node/95

Eventually I succeeded using:

$ ./configure --prefix=$HOME/usr --with-netcdf=/cm/shared/apps/netcdf/gcc/64/4.0.1 --with-hdf5=/cm/shared/apps/hdf5/current --with-zlib=/usr --with-szlib=$HOME/usr --with-grib-api=$HOME/usr --disable-shared --with-jasper=$HOME/usr

WRF Reference Configurations

The DTC test centre have a useful set of tried-and-tested WRF configurations here:
http://www.dtcenter.org/config/

These could save me a lot of time and effort...

Friday, October 14, 2011

Data sources for WRF

Some of the useful data sources for WRF:

Dataset Resolution Link
GFS Final Analysis 1 degree http://dss.ucar.edu/datasets/ds083.2/
GFS Final Analysis 0.5 degree http://dss.ucar.edu/dsszone/ds335.0/index.html?g=9
Recent GFS Analysis and Forecasts 0.5 degree ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod
PreBUFR obs NA http://dss.ucar.edu/datasets/ds337.0/
SST data 0.5 ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/sst.<date>
Archived GFS forecast1 degree
0.5 degree
http://nomads.ncdc.noaa.gov/data.php?name=access#hires_weather_datasets
Archived GFS forecast1 degree http://dss.ucar.edu/datasets/ds335.0/MSS-rqst-list.html?g=10
Blended ocean winds 0.25 degree http://www.ncdc.noaa.gov/oa/rsad/air-sea/seawinds.html
Dataset Resolution Link
Dataset Resolution Link


GFS final analyses are readily available archived back to 2000. However, using these as boundary conditions all the way through a forecast is cheating. At the time of doing a forecast, you only have one analysis available, and have to rely on a global forecast for your future boundary conditions.

Archived GFS forecasts are available from NOMADS. These are kept 'online' for 1 year. Archived forecasts are available 'offline' back to 2005 for 1 degree and 2006 for 0.5 degree forecasts. However, my requests for online data didn't match any files. Offline means you have to wait for the request to get processed, and can only request 14 days at a time.  Also the offline system will close to new order when 45 orders are sitting in the queue.  A lot of good links to NOMAD servers are available here: http://nomad5.ncep.noaa.gov/

The GFS forecast cycle is at 00, 06, 12 and 18, and the forecast interval is 3 hours from out to 180 hours. The resolution of the GFS forecast grids are:

  • #004 0.5 degree (output in grib 2 format)
  • #003 1.0 degree
  • #002 2.5 degree

Friday, October 7, 2011

Forecast verification in MET

This week I almost managed to get the MET verification tool working with WRF, with a lot of excellent help from met help at UCAR.   It's been quite a bit of work but I'm hoping it saves me some time in the long run.

The program flow goes something like this:

Will post up some more interesting results next week.

Wednesday, October 5, 2011

Testing Google Earth gadget

OK, here is a test to display forecast data using the Google Earth Plugin.  I can't test it at work as I'm not allowed to install the plugin on my own computer!

WRF in Google Earth

Traditionally weather maps aimed to present an enormous array of data as a simple output: a sun, a sun behind a cloud, or some rain.  Or possibly a cloud getting blown along by a face.  That's great, as what most people want to know is: will it rain or not?

But this hides is the beauty and complexity behind the weather, we are immersed in a big mass of swirling fluid, rising, falling, heating, cooling.  Enormous amounts of energy are transported around the world, air masses collide, jet streams arc and split. In the midst of this, occasionally everything stills, and there is hardly a breeze.  It's one big never-ending dance, and it looks beautiful.

That's why I'm trying to put forecast data into Google Earth, because you get a real feel for the fact the UK's weather doesn't end at the edge of the map.

Using NCL and some code from rpavlick, this is my first attempt to put a forecast into Google Earth. At the moment it is just a picture, but hopefully I'll get a Google Earth gadget working soon.