<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--></style><title>Re: plotting the time-averaged wind barbs over a
domain</title></head><body>
<div>>Hello, fellow GrADs users! Using a time series of u and
v components, I am</div>
<div>>seeking to plot the mean wind direction (in the form of a
barb),</div>
<div>>time-averaged over a month, at a given vertical level.
This is not at a</div>
<div>>single grid point, but over a domain. I've read through
the GrADs tutorial</div>
<div>>and also searched through each year of the online listserv
(and read through</div>
<div>>many responses) for assistance and to see if someone else
asked this</div>
<div>>question, but I have still come up empty-handed.</div>
<div>></div>
<div>>I have my script below, which produces a contoured plot of
mean wind</div>
<div>>direction, rather than the barbs. The length of the
barbs would indicate</div>
<div>>the mean wind speed at the given level.</div>
<div>></div>
<div>>'open lowlvl_winds.ctl'</div>
<div>>'set t 1'</div>
<div>>'set x 1 142'</div>
<div>>'set y 1 142'</div>
<div>>'set z 1'</div>
<div>>'set gxout barb'</div>
<div>>'set grads off'</div>
<div>>'define wdir = 2*3.141592654 - atan2(u,-v)'</div>
<div>>'define wdir = (wdir * 180.0/3.141592654) - 180.0'</div>
<div>>* plot the mean wind direction during the month</div>
<div>>'d ave(wdir,t=1,t=720)'</div>
<div><br></div>
<blockquote><font color="#0000FF">This doesn't work because averaging
won't take the discontinuity into account (at -180 to 180 or 0 to
360). You need to do this with vectors.</font></blockquote>
<div><br></div>
<div>></div>
<div>>Alternately, I have attempted to draw vectors directly within
the ave()</div>
<div>>command, which would precisely be the plot I want to create
(if this would</div>
<div>>theoretically work!):</div>
<div>></div>
<div>>'d ave(skip(u,4);skip(v,4),t=1,t=720)</div>
<div><br></div>
<blockquote><font color="#0000FF">Try using 'd
ave(skip(u,4),t=1,t=720);ave(skip(v,4),t=1,t=720)'</font></blockquote>
<blockquote><font color="#0000FF">which averages each vector
separately for the month and then plots them. You can even drop
the skip function on one of u or v as the resultant value will be set
to missing if either of these are missing.</font></blockquote>
<div><br></div>
<div>></div>
<div>>but the semicolon is not recognized in this specific GrADs
command.</div>
<div>></div>
<div>>Thanks in advance for your insights and clarifications.</div>
<div>></div>
<div>>Paul</div>
<div>></div>
<div>>-- -- --</div>
<div>></div>
<div>>Paul Stuart Wichansky</div>
<div>>Department of Environmental Sciences</div>
<div>>Rutgers University, Cook College</div>
<div>>pstuart@cep.rutgers.edu</div>
<div><br></div>
<blockquote><font color="#0000FF">Mike Timlin</font></blockquote>
<blockquote><font
color="#0000FF">timlin@atmos.uiuc.edu</font></blockquote>
</body>
</html>