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?

  • $\begingroup$ Is this what you want - ncl.ucar.edu/Document/Functions/WRF_arw/… ? $\endgroup$
    – user1066
    Dec 17, 2019 at 15:05
  • $\begingroup$ python does it too - buildmedia.readthedocs.org/media/pdf/wrf-python/1.0b1/… $\endgroup$
    – user1066
    Dec 17, 2019 at 15:24
  • $\begingroup$ 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. $\endgroup$ Dec 17, 2019 at 17:49

1 Answer 1


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





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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.