3hourly data to daily data

Arindam Chakraborty arch at IO.MET.FSU.EDU
Wed Feb 22 22:05:15 EST 2006


hi,
        your approach was correct except that you need to set the loop
on z inside the loop on t, because GrADS needs z to vary faster than t.

t1=1
while(t1<977)
'set t 't1
z1=1
while(z1<5)
'set z 'z1
'd ave(u,t='t1',t='t1+7')'
z1=z1+1
endwhile
t1=t1+8
endwhile

--

On Wed, 22 Feb 2006, John Guhin wrote:

> Thanks Arindam. It worked.  Is it possible to do such time mean for a 3D
> data.  I wrote this script, but wrote only at one time.   Am I doing
> something wrong?  Thanks in advance.
> --------------------------------------------
> 'reinit'
> 'c'
> 'set gxout fwrite'
> 'set fwrite u_daily_3D.dat'
> 'open u.ctl'
> 'set lon 40 180'
> 'set lat -10 10'
> t1=1
> z1=1
> while(z1<5)
> 'set z 'z1
> while(t1<977)
> 'set t 't1
> 'd ave(u,t='t1',t='t1+7')'
> t1=t1+8
> endwhile
> z1=z1+1
> endwhile
> ------------------------------------------------------------------------
>
>
> On 2/22/06, Arindam Chakraborty <arch at io.met.fsu.edu> wrote:
> >
> > Hi,
> > Please change 'd ave(u,t=t1,t=t1+7)' to
> > 'd ave(u,t='t1',t='t1+7')'
> >
> > because t1 is a script variable and should be outside the single
> > quotes.
> >
> > --
> >
> > On Wed, 22 Feb 2006, John Guhin wrote:
> >
> > > Hi,
> > >        I was wondering if someone can find the mistake. I am trying to
> > > convert a 3 hourly data to daily data.
> > > The original data is 3D.  any help will be appreciated.
> > > ----------------------------------------------------------------------
> > > * Program to write 3 hourly data to daily data
> > > 'reinit'
> > > 'c'
> > > 'set gxout fwrite'
> > > 'set fwrite u_daily.dat'
> > > 'open u.ctl'
> > > 'set lon 40 180'
> > > 'set lat -10 10'
> > > 'set lev 850'
> > > t1=1
> > > while(t1<977)
> > > 'set t 't1
> > > 'd ave(u,t=t1,t=t1+7)'
> > > t1=t1+8
> > > endwhile
> >
> > >  --------------------------------------------------------------------------------------------------
> > >
> >
>



More information about the gradsusr mailing list