<div dir="auto">Hi Fangda,<div dir="auto"><br></div><div dir="auto">You need to set the time index in your options to wrf_user_vert_interp by using the "time" attribute for your options Boolean (see <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_vert_interp.shtml">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_vert_interp.shtml</a>). By default, the time index is -1, which is going to extract all the times for pressure, thus creating a 4th dimension for pressure, while your field of interest is only 3. This is what the error is complaining about. Make sure this time index matches the time index for your field of interest when it was extracted.</div><div dir="auto"><br></div><div dir="auto">Hope this helps,</div><div dir="auto"><br></div><div dir="auto">Bill</div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Apr 13, 2018, 1:38 AM Fangda <<a href="mailto:tengfangda@gmail.com">tengfangda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Everyone<div><br></div><div>I use ncl 6.4.0 under Cygwin on Windows, when I deal with wrfout_* files generated by WRF, I have this problem:</div><div>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)</div><div>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.</div><div><br></div><div>But I got this fatal message:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">fatal:wrf_vintrp: The pres and field arrays must have the same dimensionality<br>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<br>fatal:["Execute.c":8640]:Execute: Error occurred at or near line 83 in file wrf_cross_q_pl2.ncl</blockquote></div><div><br></div><div>Here is part of my code:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">lon = fspan(110,125,15)<br>lat = fspan(25,55,30)<br>level = ispan(200,1000,100)<br>lon@units = "degrees_east"<br>lat@units = "degrees_noeth"<br>level@units = "hPa"<br>a = addfile("wrfout_d01","r")<br>times = wrf_user_getvar(a,"times",-1)<br>lat2d = wrf_user_getvar(a,"XLAT",0)<br>lon2d = wrf_user_getvar(a,"XLONG",0)<br>opts = True<br>do it = 0,ntimes-1,12<br>qrain = wrf_user_getvar(a,"QRAIN",it)<br>qrain2 = wrf_user_vert_interp(a,qrain,"theta",level,opts)<br>qrain3 = rcm2rgrid_Wrap(lat2d,lon2d,qrain2,lat,lon,1)<br>qrain3!0 = "pressure"<br>qrain3!1 = "lat"<br>qrain3!2 = "lon"<br>qrain3&pressure = level<br>qrain3&lat = lat<br>qrain3&lon = lon<br>plot(ii) = gsn_csm_pres_hgt(wks,qrain3(:,:,{115}),res)<br>end do</blockquote></div><div><div><br></div></div><div>What's wrong with my code? And is this a correct method to plot a cross section through a specific longitude and pressure levels?</div><div><br></div><div>Fangda</div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>