Re: Wrfout wind profiler scripting

From: Tardif, Elliot M <elliot.tardif_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 20 2011 - 07:25:15 MDT

Hi Adam, I'm happy to report that I was able to get things figured out based on your advice. It took me a little while to translate into my script, but what I eventually did was read in the height variable "z", took the first hour's height field and read that in as my 'heights' array. I read in pressure initially, but found that height was more desirable because there was less variation over time. I then set a maximum height of about 5000m, and thinned out a few wind barbs at lower levels. I've attached my script and output.

I do have a new question though....I am now attempting to produce similar output as in meteo4a.ps for observed hourly profiler data, which are in text files, one file per hour. The number of height levels are different in each file- some have a few, some have many. Right now, I'd like to produce output for one file, then work on producing output for more than one file. I have attached my script as it stands now (meteogramob.ncl), as well as the text file I'm reading in to NCL (1.txt). The current error message I get when attempting to run meteogramob.ncl is as follows: "fatal:Number of dimensions in parameter (1) of (gsn_csm_vector_scalar) is (1), (2) dimensions were expected
fatal:Execute: Error occurred at or near line 93 in file meteogramob.ncl". Is it even possible to get the desired output in this case? If so, how?

Thanks again for your help,

Elliot Tardif.

Elliot Tardif, Meteorologist I
NC DENR, Division of Air Quality
Planning Section, Attainment Planning Branch
1641 Mail Service Center
Raleigh, NC 27699-1641
Phone:  919-715-9773
Fax  :  919-715-7476
Email:  Elliot.Tardif@ncdenr.gov
Web  :  http://www.ncair.org

*****************************************************************************************
Email correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties unless the content is exempt by statute or other regulation.
*****************************************************************************************

-----Original Message-----
From: Adam Phillips [mailto:asphilli@ucar.edu]
Sent: Thursday, September 15, 2011 12:38 PM
To: Tardif, Elliot M
Subject: Re: Wrfout wind profiler scripting

Hi Elliot,
It is definitely possible to overlay 2 plots created via gsn_csm_xy and
gsn_vector_scalar, as long as the x and y axis ranges overlap for each
plot. So that shouldn't be a problem.

With regards to this warning: "warning:VectorFieldSetValues: coordinate
array vfYArray requires 34 elements: defaulting."

NCL is telling you that the number of elements of your top_bottom
dimension of your plotting array (= size 34) does not match the number
of pressures you input into vfYArray...Those dimension sizes much match.
An alternative to setting vfYArray is to assign the pressure array as
the 0th coordinate variable to your ugrid, vgrid, wspd array:

ugrid&bottom_top = (your pressure array)
and repeat for the other 2 plotting arrays...

Beyond this advice I'm not sure what else to say.. If the above doesn't
help at all, email me the latest version of your script and assuming the
data files are bigger than 10MB you can follow the ftp instructions here
to get them to me:
http://www.ncl.ucar.edu/report_bug.shtml
Adam

On 09/15/2011 08:18 AM, Tardif, Elliot M wrote:
> Good morning Adam,
>
> Thanks for your response, but I might be a little misunderstood. I don't want to overlay pressure wind barbs on top of sigma wind barbs, I just want the pressure wind barbs. I wasn't sure if it was possible to overlay different plot types (e.g., gsn_csm_xy and gsn_vector_scalar) to be able to plot pressure wind barbs. Plotting it as you suggested, setting vfYArray = (pressure array) then producing the gsn_vector_scalar gives me this warning message: "warning:VectorFieldSetValues: coordinate array vfYArray requires 34 elements: defaulting." This means it's still producing the plot using sigma levels, and not pressure. I checked my home directory for a .hluresfile, and I do have one; the function code is ~.
>
> Thanks again for your help,
>
> Elliot Tardif.
>
> Elliot Tardif, Meteorologist I
> NC DENR, Division of Air Quality
> Planning Section, Attainment Planning Branch
> 1641 Mail Service Center
> Raleigh, NC 27699-1641
> Phone: 919-715-9773
> Fax : 919-715-7476
> Email: Elliot.Tardif@ncdenr.gov
> Web : http://www.ncair.org
>
> *****************************************************************************************
> Email correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties unless the content is exempt by statute or other regulation.
> *****************************************************************************************
>
>
> -----Original Message-----
> From: Adam Phillips [mailto:asphilli@ucar.edu]
> Sent: Wednesday, September 14, 2011 5:42 PM
> To: Tardif, Elliot M
> Cc: ncl-talk@ucar.edu
> Subject: Re: Wrfout wind profiler scripting
>
> Hi Elliot,
> Sure, you can overlay, but as you said I'm not quite sure where you
> would put the overlaid (pressure based) wind barbs. You could offset the
> overlaid wind barbs by plotting the sigma wind barbs at say
> (/0.8,1.8,2.8.3.8/), and then the pressure wind barbs at
> (/1.2,2.2,3.2,4.2/)... Note that if you do that the sigma and pressure
> values would have to be in the same range.
>
> To do all this you would create a 2nd plot, say, windlayer2, and set:
> res2D@vfYArray = your_pressure_level_array
> windlayer2 =
> gsn_vector_scalar(wks,ugrid(bottom_top|:,Time|:),vgrid(bottom_top|:,Time|:),wspd(bottom_top|:,Time|:),uv_res)
>
> then
> <snip>
> overlay(loglin,windlayer) ; overlay plot with the loglin plot
> overlay(loglin,windlayer2) ; overlay 2nd plot with the loglin plot
> draw(loglin)
> frame(wks) ; now frame the plot
>
> I've never specifically done this type of thing, but I see no reason why
> it wouldn't work.
>
> Finally, looking at your plot (contains default fonts) it looks to me
> like you don't have a .hluresfile set up in your home directory. We
> recommend you set one up, if for no other reason that you change your
> function code from : to ~:
> http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml
>
> Hope that helps..
> Adam
>
> On 09/14/2011 03:16 PM, Tardif, Elliot M wrote:
>> Hi Adam, thanks very much for your response! After some further analysis,
>> I think using pressure as my y-axis variable would be more suitable.
> >The big challenge is how to fit the plotting of the pressure variable
> into
> > the script. I have the plot of the winds and wind speed
> >
> ("windlayer =
> gsn_vector_scalar(wks,ugrid(bottom_top|:,Time|:),vgrid(bottom_top|:,Time|:),wspd(bottom_top|:,Time|:),uv_res)"),
>
> > but there's no room in this particular program to plot the wind barbs on
> pressure levels across the time period, instead of on sigma levels. I
> want to plot them
> like this to show the variation in pressure for a given sigma level
> across the
> time period. Will an overlay of some type work in this case?
>>
>> Thanks,
>>
>> Elliot Tardif.
>>
>> Elliot Tardif, Meteorologist I
>> NC DENR, Division of Air Quality
>> Planning Section, Attainment Planning Branch
>> 1641 Mail Service Center
>> Raleigh, NC 27699-1641
>> Phone: 919-715-9773
>> Fax : 919-715-7476
>> Email: Elliot.Tardif@ncdenr.gov
>> Web : http://www.ncair.org
>>
>> *****************************************************************************************
>> Email correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties unless the content is exempt by statute or other regulation.
>> *****************************************************************************************
>>
>> -----Original Message-----
>> From: ncl-talk-bounces@ucar.edu [mailto:ncl-talk-bounces@ucar.edu] On Behalf Of Adam Phillips
>> Sent: Tuesday, September 13, 2011 6:23 PM
>> To: ncl-talk@ucar.edu
>> Subject: Re: Wrfout wind profiler scripting
>>
>> Hi Elliot.
>> Looking at your script I don't see an array that would house the height
>> in meters of each sigma level. Sigma levels vary in height, so I'm not
>> sure what you want to use as your heights. Regardless, assuming you have
>> an array that houses the heights for each sigma level, I think the
>> easiest thing for you to do would be to set uv_res@vfYArray = to your
>> height array. Note that dimensions of your height array would have to
>> match the bottom_top dimension of your ugrid/vgrid/wspd array.
>>
>> Hope that helps in some way. If not, let the group know..
>> Adam
>>
>> On 09/13/2011 01:42 PM, Tardif, Elliot M wrote:
>>> Good afternoon,
>>>
>>> I am attempting to produce wind profiler-type output from wrf output
>>> files, colorizing the wind barbs by speed. I have successfully done
>>> something like this using a combination of the wrf_meteo_5.ncl (link:
>>> http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/wrf_meteo_5.ncl)
>>> and the barb_4.ncl scripts (link:
>>> http://www.ncl.ucar.edu/Applications/Scripts/barb_4.ncl), but the y-axis
>>> is in sigma levels (see attached meteo4a.ps). Instead of sigma levels, I
>>> would like to change the y-axis to height, in meters, using the height
>>> of each sigma level for each hour. What do I need to change in my NCL
>>> script (attached) to make this happen?
>>>
>>> Thanks,
>>>
>>> Elliot Tardif.
>>>
>>> Elliot Tardif, Meteorologist I
>>>
>>> NC DENR, Division of Air Quality
>>>
>>> Planning Section, Attainment Planning Branch
>>>
>>> 1641 Mail Service Center
>>>
>>> Raleigh, NC 27699-1641
>>>
>>> Phone: 919-715-9773
>>>
>>> Fax : 919-715-7476
>>>
>>> Email: Elliot.Tardif@ncdenr.gov<mailto:Nick.Witcraft@ncdenr.gov>
>>>
>>> Web : http://www.ncair.org<http://www.ncair.org/>
>>>
>>> *****************************************************************************************
>>>
>>> *Email correspondence to and from this address is subject to the North
>>> Carolina Public Records Law and may be disclosed to third parties unless
>>> the content is exempt by statute or other regulation*.
>>>
>>> *****************************************************************************************
>>>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli





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

Received on Tue Sep 20 09:28:03 2011

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2011 - 17:12:44 MDT