[ncl-talk] wrf_user_interp_level

李秋阳 1271634064 at qq.com
Fri Sep 17 04:04:03 MDT 2021


Dear NCL Community,
I want to interpolate the zonal wind in the wrfout-data to a height of 100m from the ground. 
I use the function 'wrf_user_interp_level'. 
Before interpolation, the data of all grid points have a value. After the interpolation, the data of one grid point is the default value. After checking, I found that the data at the height of 100m from the grid point to the ground can be obtained without interpolation, so I would like to ask you if there is a problem with this function. 
My NCL version is 6.6.2. The script runs without errors.


My script is:
begin
a=addfile("wrfout_d01_2005-12-20_00:00:00.nc","r")
u = wrf_user_getvar(a,"ua",-1)
z = wrf_user_getvar(a,"z",-1)
hgt = a->HGT
dimll=dimsizes(z)
hfg=new((/dimll(0),dimll(1),dimll(2),dimll(3)/),float)
copy_VarMeta(z, hfg)


do time=0,dimll(0)-1
    do lev=0,dimll(1)-1
        do jj=0,dimll(3)-1
            do ii=0,dimll(2)-1
                hfg(time,lev,ii,jj)=z(time,lev,ii,jj)-hgt(time,ii,jj)
            end do
        end do
    end do
end do


u_plane = wrf_user_interp_level(u,hfg,100.,False)
loc = wrf_user_ll_to_ij(a,95.5,33,True)
locX = loc(0) - 1
locY = loc(1) - 1
print(u(3,:,locY,locX-1))
print(u_plane(3,locY,locX-1))
print(hfg(3,:,locY,locX-1))
end


And the result is:



You see, hfg(3)=100, and it is the _FillValue when the zonal wind is interpolated to 100m,but u(3)=9.758717. And u(3) is the value obtained by interpolating the zonal wind to a height of 100m above the ground. So I would like to ask if this is the problem with the interpolation function?


Any hint is much appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210917/754e214f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8B0C0F5F at ADB6082B.13684461.png.jpg
Type: image/jpeg
Size: 35359 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210917/754e214f/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 68DA018A at D2035317.13684461.png.jpg
Type: image/jpeg
Size: 11796 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210917/754e214f/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2E946003 at DED58419.13684461.png.jpg
Type: image/jpeg
Size: 35963 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210917/754e214f/attachment-0002.jpg>


More information about the ncl-talk mailing list