[ncl-talk] Error in plotting average wind speed at higher heights
Dennis Shea
shea at ucar.edu
Wed Nov 25 16:17:09 MST 2020
The variable 'spd' is 3D not 4D
Variables: Dimensions => Sizes
==========================
height: [Time x bottom_top x south_north x west_east] =>
(ntim,klev,nlat,mlon)
cheight: (ntim,klev,nlat,mlon)
u_plane: [Time x south_north x west_east] =>
(ntim,nlat,mlon)
spd: [Time x south_north x west_east] =>
(ntim,nlat,mlon) <=== 3D not 4D
spd_avg = dim_avg_n(spd(0:31,:,:),0) ; <*** spd is
(ntim,nlat,mlon)
spd_avg at description = "Average Wind Speed"
spd_avg at units = "m s-1"
printVarSummary(spd_avg) ; [south_north] x
[west_east] => (nlat,mlon)
On Tue, Nov 24, 2020 at 6:34 PM Kunal Dayal via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> Hi Ncl-talk,
>
> I am trying to plot the average wind speed maps at 55 m above ground level
> and I am getting the following error message:
> "
> *fatal:conform_dims: the dimension sizes of the second argument do not
> match those indicated by the third argument*
> "
> The specific section of the script where the error occurs is highlighted
> below:
> "
> u = wrf_user_getvar(a,"ua",-1)
> v = wrf_user_getvar(a,"va",-1)
> height = wrf_user_getvar(a,"z",0)
> ter = wrf_user_getvar(a,"ter",0)
>
> nheight = conform(height,ter,(/1,2/))
> height = height - nheight
>
> *cheight=conform_dims(dimsizes(u),height,(/1,2,3/))*
> u_plane = wrf_user_intrp3d(u,cheight,"h",55,0.,False)
> v_plane = wrf_user_intrp3d(v,cheight,"h",55,0.,False)
>
> spd = (u_plane*u_plane + v_plane*v_plane)^(0.5)
> spd at description = "55 m Wind Speed"
> spd at units = "m s-1"
>
> spd_avg = dim_avg_n(spd(0:31,:,:,:),0)
> spd_avg at description = "Average Wind Speed"
> spd_avg at units = "m s-1"
> "
> I understand that the dimension of u is time x lev x lat x lon (0, 1, 2,
> 3) and the dimension for height is time x lat x lon (0, 2, 3).
>
> I have tried the following in the script:
>
> - cheight=conform_dims(dimsizes(u),height,(/1,2,3/))
> - cheight=conform_dims(dimsizes(u),height,(/0,2,3/))
> - cheight=conform_dims(dimsizes(u),height,(/0,1,2/))
> - cheight=conform_dims(dimsizes(u),height,1)
> - cheight=conform_dims(dimsizes(u),height,0)
>
> But, the problem remains with the same error message.
>
> Appreciate your assistance and advice.
>
> Regards
> Kunal
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201125/7e1cd6ba/attachment.html>
More information about the ncl-talk
mailing list