[ncl-talk] Pressure Vertical Axis
Mary Haley
haley at ucar.edu
Fri Jul 27 16:53:57 MDT 2018
Hi Melissa,
To expand on what Soma suggested, you could visit the WRF online tutorial
that was developed by the WRF developers:
http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/NCL_examples.htm
In particular, look at the "vertical cross section" section
Further, and I don't know how helpful this example would be, but you can
also go to our cross section page and look at "narr_5.ncl". This shows how
to do different cross-sections of curvilinear data, which is what you have:
http://www.ncl.ucar.edu/Applications/transect.shtml
You can still use wrf_user_getvar to retrieve the required variables.
HTH,
--Mary
On Wed, Jul 25, 2018 at 1:25 PM, Soma Roy <somaroy892 at gmail.com> wrote:
> You can use pressure height vector in this case.
>
> Hope this may help.
>
> Thanks.
>
> On Thu, Jul 26, 2018, 00:28 MELISSA KAZEMI RAD <
> mk1369 at scarletmail.rutgers.edu> wrote:
>
>> Hi,
>>
>> I am trying to create a vertical cross_section plot from a wrf output
>> file. I have spent a lot of time looking through all example ncl codes,
>> trying to figure out how to have the y-axis, representing the vertical
>> height show pressure values in pa, rather than the number of eta-levels.
>>
>> Here is my NCL code:
>>
>> 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"
>> ;----------------------------------------------------------------------
>> ; Main code
>> ;----------------------------------------------------------------------
>> begin
>> a = addfile("wrfout_d03_2017-07-17_06_00_00.nc","r")
>>
>> ; type = "x11"
>> ; type = "pdf"
>> ; type = "ps"
>> type = "png"
>>
>> wks = gsn_open_wks(type,"EQTemp_Press_Cross_166")
>>
>> time = 166
>>
>> p = wrf_user_getvar(a, "pressure", time) ; Total Pressure
>> P = wrf_user_getvar(a, "P", time)
>> PB = wrf_user_getvar(a, "PB",time)
>> T = wrf_user_getvar(a,"T",time)
>> U = wrf_user_getvar(a, "ua", time)
>> V = wrf_user_getvar(a, "va", time)
>> ; z = wrf_user_getvar(a,"z",time)
>> qv = wrf_user_getvar(a, "QVAPOR", time)
>>
>>
>> T_t = T + 290. ; potential temperature in K.
>> P_t = P + PB
>> tk = wrf_tk(P_t, T_t)
>> eth = wrf_eth(qv, tk, P_t)
>> plane = (/342, 1387/)
>> t_plane = wrf_user_intrp3d(eth,p,"v",plane,50.,False)
>> P_plane = wrf_user_intrp3d(P,p,"v",plane,50.,False)
>>
>> printVarSummary(t_plane)
>>
>> res = True
>> res at MainTitle = "Vertical Cross-Section of Potential
>> Temperature"
>> res at InitTime = False
>> res at TimePos = "Left"
>> res at Footer = False
>> res at lbTitleOn = True
>> res at lbTitleString = "Temperature"
>> res at tmYLMode = "Explicit"
>> res at tmYLValues = (/1000, 850, 700, 500, 400, 300, 250,\
>> 200, 150, 100, 50, 10/)
>> res at tmYLLabels = "" + res at tmYLValues
>> res at tmXBLabelFontHeightF = 0.015
>> res at tmYLLabelFontHeightF = 0.015
>>
>>
>> tres = res
>> tres at cnFillOn = True
>> tres at cnFillPalette = "BlWhRe"
>> tres at cnSpreadcolor = True
>>
>>
>> pres = res
>> pres at cnFillOn = False
>> pres at ContourParameters = (/ 2. /)
>> pres at cnInfoLabelFontHeightF = 0.01
>>
>>
>>
>>
>> T_contour = wrf_contour(a,wks,t_plane,tres)
>> P_contour = wrf_contour(a,wks,P_plane,pres)
>>
>> pltres = True
>> pltres at gsnMaximize = True
>>
>> plot = wrf_overlays(a,wks,(/T_contour, P_contour/), pltres)
>>
>> end
>>
>> I'd really appreciate your help.
>>
>> Bests,
>> Melissa
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20180727/e13fc5bc/attachment.html>
More information about the ncl-talk
mailing list