Re: vertical profile of WRF output in NCL

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 21 2012 - 16:43:19 MDT

Xianxiang,

wrfhelp (CC'ed here) handles their questions differently than we do. Maybe
they will respond if there's a way to see an archive of questions and answers
posted to wrfhelp.

Meanwhile, in the past, we've asked them that when they answer questions
that we forward to wrfhelp, to cc ncl-talk so that the NCL users can benefit.

Hopefully they will do that for this question.

--Mary

On Aug 21, 2012, at 12:17 PM, Xianxiang Li wrote:

> I keep seeing people asking this question concerning wrf_user_intrp3d
> and I personally have this problem, too. Whenever I saw people ask
> this question here, it was forwarded to wrfhelp@ucar.edu. Unfortunely,
> I never see anyboday posts any reply from wrfhelp. I wonder if wrfhelp
> can set up something like ncl-talk mailing list system, which archives
> all the questions people have asked and solved, so that many people
> will save their time and energy in looking for the answers in vain?
> This can also save much of the time of WRF developers since they won't
> keep receiving similar questions from users. Actually, if I can't get
> any information about the below question here, I will write to
> wrfhlep@ucar.edu raising the same question.
>
> Xianxiang
>
>>
>> Message: 5
>> Date: Tue, 21 Aug 2012 09:27:59 -0600
>> From: Mary Haley <haley@ucar.edu>
>> Subject: Re: vertical profile of WRF output in NCL
>> To: Joseph Brodie <jbrodie@udel.edu>
>> Cc: ncl-talk USERS <ncl-talk@ucar.edu>, wrfhelp Help
>> <wrfhelp@ucar.edu>
>> Message-ID: <370A1B9C-4005-4A7A-98A7-5AC969936DF9@ucar.edu>
>> Content-Type: text/plain; charset=windows-1252
>>
>> Hi Joe,
>>
>> This is more of a WRF question, so I've fowarded it to wrfhelp@ucar.edu.
>>
>> --Mary
>>
>> On Aug 21, 2012, at 8:33 AM, Joseph Brodie wrote:
>>
>>> Hi all,
>>>
>>> I?m trying to get a lower atmosphere vertical profile from some WRF output data I have (I only want the first 200 meters of the atmosphere) and for some reason, when I use the wrf_user_intrp3d function, and then plot the data, it removes the lowest 100 m of the atmosphere from the data! I know there is data there, because I have model layers starting as low as 8m, and if I plot horizontal data, I have no problem getting the data from the layers below 100 m. Any guidance would be appreciated! The code is below.
>>>
>>> Cheers,
>>> Joe Brodie
>>>
>>> -------- NCL CODE
>>> ; WRF windfarm output processesing - VERTICAL CROSS SECTION
>>> ; J. F. Brodie
>>> ; University of Delaware
>>> ; 8 August 2012
>>>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>>>
>>> begin
>>> a = addfile("wrfout_farm1_newlays.nc","r")
>>> ; a = addfile("wrfout_d01_0001-01-03_00:00:00.nc","r")
>>>
>>> type = "x11" ; X11 visual output
>>> ; type = "pdf" ; PDF output
>>>
>>> plane = (/ 17.0, 17.0/) ; x,y coordinate for vertical cross
>>> angle = 90.0 ; 90 degrees = W-E cross section
>>> FirstTime = True
>>>
>>> wks = gsn_open_wks(type,"WRF_AWEA_farm1")
>>> gsn_define_colormap(wks,"precip3_16lev")
>>> gsn_reverse_colormap(wks)
>>>
>>> ; plot options
>>> res = True
>>> res@MainTitle = "WRF WINDFARM - AWEA"
>>>
>>> pltres = True
>>>
>>> height = 200. ; maximum height I would like displayed, meters
>>>
>>> ; let's get all the times
>>> times = wrf_user_getvar(a,"times",-1)
>>> ntimes = dimsizes(times)
>>>
>>> do it = 0,ntimes-1,1
>>>
>>> print("Working on time " + times(it) )
>>> res@TimeLabel = times(it)
>>>
>>> u = wrf_user_getvar(a,"ua",it)
>>> v = wrf_user_getvar(a,"va",it) ; U and V velocities averaged to mass pts
>>> z = wrf_user_getvar(a, "z",it) ; grid point height
>>>
>>> if ( FirstTime ) then
>>> zz = wrf_user_intrp3d(z,z,"v",plane,angle,False)
>>> b = ind(zz(:,0) .gt. height )
>>> zmax_pos = b(0) - 1
>>> if ( abs(zz(zmax_pos,0)-height) .lt. abs(zz(zmax_pos+1,0)-height) ) then
>>> zspan = b(0) - 1
>>> else
>>> zspan = b(0)
>>> end if
>>> delete(zz)
>>> delete(b)
>>> FirstTime = False
>>> end if
>>>
>>> u_plane = wrf_user_intrp3d(u,z,"v",plane,angle,False)
>>> v_plane = wrf_user_intrp3d(v,z,"v",plane,angle,False)
>>> u_plane@units = "m/s"
>>> v_plane@units = "m/s"
>>>
>>> spd = (u_plane*u_plane + v_plane*v_plane)^(0.5) ; convert to speed
>>> spd@description = "Wind Speed"
>>> spd@units = "m/s"
>>>
>>> ; contour of speed
>>> opts = res
>>> opts@cnFillOn = True
>>> opts@trYMinF = 0
>>> opts@trYMaxF = zspan
>>> ; contour = wrf_contour(a,wks,u_plane(0:zmax_pos,:),opts)
>>> contour = wrf_contour(a,wks,spd(0:zmax_pos,:),opts)
>>> delete(opts)
>>>
>>> ; overlay plots together
>>> plot = wrf_overlays(a,wks,(/contour/),pltres)
>>>
>>> delete(u)
>>> delete(u_plane)
>>> delete(v)
>>> delete(v_plane)
>>> delete(z)
>>> delete(spd)
>>>
>>> end do
>>>
>>> end
>>>
>>> --
>>> Joseph F. Brodie
>>> Graduate Research Assistant, Center for Carbon-free Power Integration
>>> School of Marine Science and Policy
>>> College of Earth, Ocean, and Environment
>>> University of Delaware
>>> 007A Robinson Hall
>>> Newark, DE 19716 USA
>>> Phone: +1 302-831-0694
>>> Fax: +1 302-831-6838
>>> Email: jbrodie@udel.edu
>>>
> _______________________________________________
> 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 Aug 21 16:43:28 2012

This archive was generated by hypermail 2.1.8 : Thu Aug 23 2012 - 16:16:15 MDT