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

Wind speed extract for different height

518er2005

Member
Hello everyone,
For my analysis related to wind resource assessment, I need to find the wind speed values at various heights, i.e., 10m, 20m, and likewise up to 100m. I tried using "wrf.vinterp()", but it seems after 50 m the values are not changing. Also, I tried using "wrf.interplevel". While using "wrf.interplevel" the issue is that over the land I am getting nan values at the lower heights, such as 50m, 20m, 60m, etc. I am attaching the images as well as the code.
So, in this regard, if anyone can help how to compute the wind speed for various heights, it will be much appreciated.
The code used:

import xarray as xr
import numpy as np
from wrf import getvar, interplevel, to_np
from netCDF4 import Dataset
# Load the WRF output file (replace with your file path)
file_path = '/home/user/WRF/WRF_OUT/GOPALPUR/TOPO_INC/GDAS/sim1/wrfout_d03_2020-05-31_12:00:00'
ds = Dataset(file_path)
# Extract U and V wind components and pressure levels
u = getvar(ds, "wspd",15,units='m s-1' )
z = getvar(ds, 'z', units='m') # Height levels
# Define the target height
target_height = 100.0 # in meters
# Interpolate U and V at the target height
w_50m = interplevel(u, z, target_height)


With regards,
Debashis
 

Attachments

  • ws_20m.png
    ws_20m.png
    16.4 KB · Views: 0
  • ws_30m.png
    ws_30m.png
    37 KB · Views: 0
  • ws_50m.png
    ws_50m.png
    39.8 KB · Views: 0
  • ws_60m.png
    ws_60m.png
    40.8 KB · Views: 0
  • ws_100m.png
    ws_100m.png
    46.1 KB · Views: 0
Last edited:
The piece of python code you posted looks fine.

I didn't find the option for extrapolation in the function interplevel. However, wrf.vinterp does have the option for extrapolation. Can you turn on this option and retry? Let me know whether you still get NaN value for lower levels.
 
Top