Dear Chuck,<BR>Thank you very much. The script works very well.<BR>Wish you all the best,<BR>Abbas Mofidi<BR><BR><B><I>Charles Seman <Charles.Seman@NOAA.GOV></I></B> wrote: <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Abbas Mofidi,<BR><BR>I'm not sure if this is what you want to do, but here is a<BR>possibility... Note, it is assumed that each netCDF dataset has the same<BR>grid coordinates... Please note, the following code has not been tested,<BR>so use with caution...<BR><BR>'sdfopen ncdata\hour\uwind200mb-1apr-31oct1994-daily.nc'<BR>'sdfopen ncdata\hour\vwind200mb-1apr-30sep1994-daily.nc'<BR>'sdfopen ncdata\hour\hgt200mb-1apr-30sep1994-daily.nc'<BR>*<BR>* define pentad averages (centered running means) for all time levels<BR>between t=64 to t=151 (ie 62-66, 63-67, ... ,149-153)<BR>*<BR>'set lat 10 50'<BR>'set lon 20 110'<BR>'set z 1'<BR>'set t 64 151'<BR>'set dfile 1'<BR>'define u5 =
ave(uwnd,t-2,t+2)'<BR>'set dfile 2'<BR>'define v5 = ave(vwnd,t-2,t+2)'<BR>'set dfile 3'<BR>'define z5 = ave(hgt,t-2,t+2)'<BR>*<BR>* plot desired time levels (every 5th time level) between t=64 to t=151<BR>(ie 62-66, 67-71, ... ,149-153)...<BR>*<BR>ti = 64<BR>while ti <= 151<BR>'clear'<BR>*<BR>* assuming "u5", "v5", and "z5" are on the same grid...<BR>*<BR>'set t ' ti<BR>'set lat 10 50'<BR>'set lon 20 110'<BR>'set z 1'<BR>*<BR>* plot vorticity (assuming "u5" and "v5" are on the same grid)<BR>*<BR>'set dfile 1'<BR>'set gxout shaded'<BR>'set csmooth on'<BR>'set grid off'<BR>'set cint 0.00001'<BR>'set black -1e-06 1e-06'<BR>'set font 2'<BR>'set xlopts 1 5 0.14'<BR>'set ylopts 1 5 0.14'<BR>'display hcurl(u5,v5)/0.00001'<BR>'run cbarn'<BR>*<BR>* overlay heights<BR>*<BR>'set dfile 3'<BR>'set gxout contour'<BR>'set csmooth on'<BR>'set grid off'<BR>'set cint 25'<BR>'set clskip 2'<BR>'set font 2'<BR>'set cthick 6'<BR>'set xlopts 1 5 0.14'<BR>'set ylopts 1 5 0.14'<BR>'set ccolor
1'<BR>'set map 1'<BR>'display z5'<BR>'draw title Vorticity 700hPa and Geop.Height 200hPa-' ti''<BR>'printim Vort&Hgt200mb' ti '.gif gif x1200 y1000 white'<BR>ti = ti + 5<BR>ENDWHILE<BR>say<BR><BR>I hope this helps,<BR>Chuck<BR><BR>abbas mofidi wrote:<BR>> Dear Grads users,<BR>> I am new to Grads and I have a question related to getting time<BR>> average. I have written a sript to compute the pentad averages of<BR>> variables. I don't know what's wrong with it which instead of pentad<BR>> averages(for example in the following script: the pentad for 62-66,<BR>> 67-71,72-76,......) it is displaying just for the first day of each<BR>> pentad(62th,67th,72th,...)?<BR>> Thank you very much for your assistance<BR>> A. Mofidi<BR>> * script For Computing pentad Vorticity and Hgt 200hpa-JJA<BR>> ti = 62<BR>> while ti <= 153<BR>> 'sdfopen ncdata\hour\uwind200mb-1apr-31oct1994-daily.nc'<BR>> 'sdfopen
ncdata\hour\vwind200mb-1apr-30sep1994-daily.nc'<BR>> 'sdfopen ncdata\hour\hgt200mb-1apr-30sep1994-daily.nc'<BR>> 'clear'<BR>> 'set dfile 1'<BR>> 'set t ' ti<BR>> 'set lat 10 50'<BR>> 'set lon 20 110'<BR>> 'set z 1'<BR>> 'set ave(z 1,ti=62,ti=153)'<BR>> 'u=uwnd'<BR>> 'set dfile 2'<BR>> 'set t ' ti<BR>> 'set z 1'<BR>> 'set ave(z 1,ti=62,ti=153)'<BR>> 'v=vwnd'<BR>> 'set gxout shaded'<BR>> 'set csmooth on'<BR>> 'set grid off'<BR>> 'set cint 0.00001'<BR>> 'set black -1e-06 1e-06'<BR>> 'set font 2'<BR>> 'set xlopts 1 5 0.14'<BR>> 'set ylopts 1 5 0.14'<BR>> 'display hcurl(u,v)/0.00001'<BR>> 'run cbarn'<BR>> 'set dfile 3'<BR>> 'set t ' ti<BR>> 'set lat 10 50'<BR>> 'set lon 20 110'<BR>> 'set z 1'<BR>> 'set ave(z 1,ti=62,ti=153)'<BR>> 'set gxout contour'<BR>> 'set csmooth on'<BR>> 'set grid off'<BR>> 'set cint 25'<BR>> 'set clskip 2'<BR>> 'set font 2'<BR>> 'set cthick
6'<BR>> 'set xlopts 1 5 0.14'<BR>> 'set ylopts 1 5 0.14'<BR>> 'set ccolor 1'<BR>> 'set map 1'<BR>> 'display hgt'<BR>> 'draw title Vorticity 700hPa and Geop.Height 200hPa-' ti''<BR>> 'printim Vort&Hgt200mb' ti '.gif gif x1200 y1000 white'<BR>> ti = ti + 5<BR>> ENDWHILE<BR>> say<BR>><BR>><BR>> __________________________________________________<BR>> Do You Yahoo!?<BR>> Tired of spam? Yahoo! Mail has the best spam protection around<BR>> http://mail.yahoo.com<BR>><BR><BR>--<BR><BR>Please note that Charles.Seman@noaa.gov should be considered my NOAA<BR>email address, not cjs@gfdl.noaa.gov.<BR><BR>********************************************************************<BR>Charles Seman Charles.Seman@noaa.gov<BR>U.S. Department of Commerce / NOAA / OAR<BR>Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547<BR>201 Forrestal Road fax: (609) 987-5063<BR>Princeton, NJ 08540-6649
http://www.gfdl.noaa.gov/~cjs/<BR>********************************************************************<BR><BR>"The contents of this message are mine personally and do not reflect<BR>any position of the Government or NOAA."<BR></BLOCKQUOTE><BR><p> 
<hr size=1>Ahhh...imagining that irresistible "new car" smell?<br> Check out
<a href="http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-">new cars at Yahoo! Autos.</a>