# [ncl-talk] diagonal cross section with wrf_user_intrp3d

Matthew Fearon Matthew.Fearon at dri.edu
Mon Mar 23 11:40:28 MDT 2015

```Hi Evelyn,
Thank you for your help. I was able to get a diagonal slice using the single pivot point (and angle) example. Still no luck with the two point example. The latter would be better as I could limit the horizontal extent more easily. I'll try again later.
thanks again,
Matt

________________________________
From: Evelyn Grell - NOAA Affiliate [evelyn.grell at noaa.gov]
Sent: Monday, March 23, 2015 8:12 AM
To: Matthew Fearon
Cc: wrf-help at ucar.edu; ncl-talk at ucar.edu
Subject: Re: [ncl-talk] diagonal cross section with wrf_user_intrp3d

Matthew,

Regarding your second question (the easier one), I got confused by this too.  I believe the order of the variables got changed between versions:
In v6.1.2, the order to specify 2 points for a cross section has to be x1,x2,y1,y2.
In v6.2.1, the order to specify 2 points has to be x1,y1,x2,y2.
(maybe wrfhelp could add a note in the example.)

You can check by looking at the code in your
\$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl

Another thing that I ran into is that it assumes you are defining your points in "WRF" space (ie arrays start with 1) rather than in "NCL" space (ie arrays start with 0) so it subtracts 1 for you...

In wrf_user_interp3d:

; set vertical cross section
if (opts) then
xy = wrf_user_set_xy( z, loc_param(0)-1, loc_param(2)-1, \    ; the -1 is for NCL dimensions
loc_param(1)-1, loc_param(3)-1, \
angle, opts )

(loc_param is the variable containing your XS endpoints).

About your first question, maybe you are missing the 2d interpolation that defines the x-axis?

something like:
if (xang.gt.20. .and. xang.lt.340) then
X_plane = wrf_user_intrp2d(lon,xspts,0.,True)
else
X_plane = wrf_user_intrp2d(lat,xspts,0.,True)
end if
dimsX = dimsizes(X_plane)
xspan = dimsX(0)-1

res at tmXBValues              = fspan(0,xspan,2)

Hope that helps,
Evelyn Grell

On Mon, Mar 23, 2015 at 12:21 AM, Matthew Fearon <Matthew.Fearon at dri.edu<mailto:Matthew.Fearon at dri.edu>> wrote:

Dear WRF-help and NCL users,

Has anyone successfully plotted a cross section with wrf data
along a diagonal, say southeast to northwest or vice versa, using
wrf_user_intrp3d? North/south or east/west works fine, but from the
documentation, a diagonal seemed possible using the example below,
although I can't get it working?

Also, the plane is defined (/xstart,xend , ystart,yend/) for sure
rather than (/xstart,ystart , xend,yend/) instead?

thanks,
Matt

time = 1
tc = wrf_user_getvar<https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml>(a,"tc",time)   ; T [C]
z  = wrf_user_getvar<https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml>(a,"z",time)    ; z on mass points

plane = (/  40,81 , 259,81  /) ; approx. START x;y and END x;y point

; Extract cross section from point A to point B, as defined in "plane"
; And vertically interpolate to height coordinates ("z")
tc_plane = wrf_user_intrp3d(tc,z,"v",plane,0.,True)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150323/f8953e32/attachment.html
```