[ncl-talk] A problem when I use wrf_user_vert_interp function

Fangda tengfangda at gmail.com
Fri Apr 13 01:38:37 MDT 2018


Hello Everyone

I use ncl 6.4.0 under Cygwin on Windows, when I deal with wrfout_* files
generated by WRF, I have this problem:
I just want to plot a cross section through a specific longitude and
pressure levels, so I decide to use qrain2 =
wrf_user_vert_interp(a,qrain,"pressure",level,opts)
to interpolate the model data to pressure level and then use qrain3 =
rcm2rgrid_Wrap(lat2d,lon2d,qrain2,lat,lon,1) to interpolate the data to
longitude-latitude grids.

But I got this fatal message:

> fatal:wrf_vintrp: The pres and field arrays must have the same
> dimensionality
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 2348 in
> file /usr/local/ncl6.4.0/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 83 in
> file wrf_cross_q_pl2.ncl


Here is part of my code:

> lon = fspan(110,125,15)
> lat = fspan(25,55,30)
> level = ispan(200,1000,100)
> lon at units = "degrees_east"
> lat at units = "degrees_noeth"
> level at units = "hPa"
> a = addfile("wrfout_d01","r")
> times = wrf_user_getvar(a,"times",-1)
> lat2d = wrf_user_getvar(a,"XLAT",0)
> lon2d = wrf_user_getvar(a,"XLONG",0)
> opts = True
> do it = 0,ntimes-1,12
> qrain = wrf_user_getvar(a,"QRAIN",it)
> qrain2 = wrf_user_vert_interp(a,qrain,"theta",level,opts)
> qrain3 = rcm2rgrid_Wrap(lat2d,lon2d,qrain2,lat,lon,1)
> qrain3!0 = "pressure"
> qrain3!1 = "lat"
> qrain3!2 = "lon"
> qrain3&pressure = level
> qrain3&lat = lat
> qrain3&lon = lon
> plot(ii) = gsn_csm_pres_hgt(wks,qrain3(:,:,{115}),res)
> end do


What's wrong with my code? And is this a correct method to plot a cross
section through a specific longitude and pressure levels?

Fangda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180413/c9b7ca39/attachment.html>


More information about the ncl-talk mailing list