Re: How to specify data coordinates in wrf_contour

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 04 2014 - 08:40:21 MST

Hi,

I think wrfhelp (CC'ed here) will need to take this one. With the wrf_user_intrp3d routines, I don't see that there
is any 2D coordinate information returned, but there maybe a way to compute these.

--Mary

On Feb 28, 2014, at 12:06 PM, Gökhan Sever <gokhansever@gmail.com> wrote:

> Hello,
>
> I am interested in getting data coordinates in 2D simulations, particularly to the output from em_hill2d_x in WRF.
>
> The example NCL plots/script shown here
> http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/wrf_Hill2d.htm
> just plots the data contour without having the 2D X and Y data coordinates specified.
>
> For 100 m hill there doesn't seem to be a problem with the simulation and plotting, however setting the mountain height to 2 km results in the model domain top coming down (i.e. starting maximum model height ~20 km at the end of the simulation max height is ~17.5 km). With the current NCL example it's not possible to see this issue. Hence, I am looking for a modified way to plot data contour in NCL.
>
> Thanks.
>
>
> On Thu, Feb 27, 2014 at 12:04 PM, Mary Haley <haley@ucar.edu> wrote:
> Hi Gökhan,
>
> wrf_contour simply draws the contours, with no map projection. wrf_map_overlays is what takes the contours and overlays them on a map.
>
> If you really are only interested in wrf_contour and want to specify the data coordinates, then you need to read XLAT and XLONG off the file (I'm assuming you are plotting lat/lon data), and then set the special sfXArray and sfYArray resources.
>
> Here's a working script that you can try, using the HGT variable on a wrf output file.
>
> Try it both with and without the sfX/YArray settings, to see what happens to the plot. The "trGridType" setting is necessary in order to get tickmarks. If you were putting this over a map (via wrf_map_overlays), then you wouldn't need trGridType:
>
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
> a = addfile("wrfout.nc","r")
> hgt = wrf_user_getvar(a,"HGT",0)
>
> wks = gsn_open_wks("x11","mapgrid")
>
> res = True
> res@sfXArray = wrf_user_getvar(a,"XLONG",0)
> res@sfYArray = wrf_user_getvar(a,"XLAT",0)
> res@trGridType = "TriangularMesh"
>
> plot = wrf_contour(a,wks,hgt,res)
>
> draw(plot)
> frame(wks)
>
> end
>
> On Feb 27, 2014, at 5:43 AM, Gökhan Sever <gokhansever@gmail.com> wrote:
>
>> Hello,
>>
>> Is there a way to specify X,Y coordinates of data surface within wrf_contour? [https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_contour.shtml]
>>
>> Similar to how is done in matplotlib's contour function [http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.contour]
>>
>> Thanks.
>>
>>
>> --
>> Gökhan
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> --
> Gökhan
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 4 08:40:30 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT