# How to de-stagger (or unstagger) WRF wind fields?

I am trying to calculate wind speed from the U and V wind components of a Weather Research and Forecasting (WRF) simulation. However, I came to realize that some variables of the model (including wind components) are staggered. This makes it really difficult to analyze the model output as is, since the dimensions of staggered variables differ from those of non-staggered variables .

Does anybody have any hints on how to de-stagger these fields in a netcdf file produced by the WRF model?

• Is this what you want - ncl.ucar.edu/Document/Functions/WRF_arw/… ? Dec 17 '19 at 15:05
• python does it too - buildmedia.readthedocs.org/media/pdf/wrf-python/1.0b1/… Dec 17 '19 at 15:24
• Thanks for the links. The problem with those solutions is that your have to manually extract the data, de-stagger it and then reconstruct the netcdf file with the updated data. This is pretty advanced, and I have little experience with Python and NCL. I'm looking for some more generic tool that does all the work automatically - if such a tool exists. Dec 17 '19 at 17:49

The simplest way I've found in Python is to use the getvar function with the 'ua,' 'va,' or 'wa' variables from the WRF-Python module. Alternatively, you can take the midpoint between the staggers.

Edit: For example, using the WRF-Python module, you can get the destaggered wind variables with the following code

import netcdf4 as nc

import wrf

f=nc.Dataset('example.nc')

u=wrf.getvar(f,'ua')

v=wrf.getvar(f,'va')

w=wrf.getvar(f,'wa')

• Willing to share a sample script? Dec 17 '19 at 17:47
• import wrf, import netCDF4 as nc, f=nc.Dataset(fName), u=wrf.getvar(f,'ua') Dec 17 '19 at 18:09
• Thanks for sharing! I think I can do the same in R. But what about the de-staggering itself? Dec 17 '19 at 18:16
• There is a function for that too! wrf-python.readthedocs.io/en/latest/user_api/generated/… Dec 17 '19 at 18:19
• But a rough destaggering could be something like (var[:,:,1:,:]+var[:,:,:-1,:])/2. Dec 17 '19 at 18:20