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

Re: How to extract Wind Direction data at a specific location from WRFOUT files

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.

Hi,

I am using WRF to simulate the winds and I seek assistance as to how I can extract the wind direction data at a specific location from the wrfout files.

I can successfully extract the wind speed at 10 m using the script provided on the NCL website.

But, I can not locate any sample script to extract the wind direction.

Appreciate sample scripts, guidance, assistance and advice.

Regards
Kunal
 
Hi Kunal,

Please use the wrf_user_getvar function to do this:

spddir = wrf_user_getvar(a,"wspd_wdir10",0)

or for earth relative speed and direction:

spddir = wrf_user_getvar(a,"uvmet10_wspd_wdir",0)

These will give you both the speed (dim 0) and the direction (dim 1)

http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml
 
Dear Abjaye,

Sorry if I ask a simple question. I'm new in ncl.
I used your suggest script to extract the wind direction, and it printed out the whole domain. How can I specify for only 1 grid cell?

Thank you very much
This is my script
Code:
a = addfile("wrfout_d03_2018-03-01_01:00:00.nc","r")

spddir = wrf_user_getvar(a,"uvmet10_wspd_wdir",-1)
print (spddir)
And here is the first lines of results
Code:
Number of Dimensions: 4
Dimensions and sizes:   [wspd_wdir | 2] x [Time | 240] x [south_north | 85] x [west_east | 100]
Coordinates:
Number Of Attributes: 7
  units :       m/s
  FieldType :   104
  MemoryOrder : XY
  stagger :
  coordinates : XLONG XLAT XTIME
  description : 10m earth relative wind speed and direction
  _FillValue :  9.96921e+36
(0,0,0,0)       3.478787
(0,0,0,1)       3.661115
(0,0,0,2)       3.681363
(0,0,0,3)       3.526386
(0,0,0,4)       3.645055
(0,0,0,5)       3.689897
(0,0,0,6)       3.55269
(0,0,0,7)       3.532065
 
Top