[gradsusr] define a simple scalar

Lisa Welp-Smith lwelp at ucsd.edu
Mon Aug 1 12:56:26 EDT 2011


Dear Joey,

I see how you suggest defining the multiple variables, but I don't see 
how this gets me any closer to creating detrended observations?

I was aiming for:
detrend = obs - trend
where: trend(t) = slope*t, over t=1 -> t=20

Given your suggestion, I can imagine creating a loop to display:
d obs(t) - slope*t

But without writing those values to a variable, e.g. detrend, I don't 
see how I can use the detrended observations for any additional 
calculations (for example, in tcorr).

Thank you,
Lisa

------------------------------ Date: Sat, 30 Jul 2011 15:31:13 -0500 
From: Joey Woodson <instantweathermaps at gmail.com> Subject: Re: 
[gradsusr] define a simple scalar To: GrADS Users Forum 
<gradsusr at gradsusr.org> Message-ID: 
<CAJv4EQoa6wPtWB-f+F4vMsBA6Yh1VaoFx+M7UrTzw7SuxAZbMw at mail.gmail.com> 
Content-Type: text/plain; charset="iso-8859-1" set t 1 variable1 = 
const(kanto, 1, -a) set t 2 variable2 = const(kanto, 2, -a) where 
"kanto" is any variable in the file. AFAIK there is no way to define 
different timesteps of the same variable in different ways. A for loop 
can take care of the trouble involved with using multiple variables. On 
Sat, Jul 30, 2011 at 2:00 PM, Lisa Welp-Smith <lwelp at ucsd.edu> wrote:

> >  Hello,
> >
> >  I'm having a problem with what I'm sure is a simple task.  I want to
> >  define a scalar to convert a slope (i.e. units/year) into a trend line
> >  over several years.  I'm using this to detrend a time series.
> >  Basically I just need to construct a simple scalar (i.e. variable = 1 2
> >  3 4 5...) or a variable that equals the year of each entry of my dataset
> >  (i.e. variable = 1991 1992 1993 1994 1995...) that I can multiply by my
> >  slope values.  I can use tloop to create the right dimensions (variable
> >  = 1 1 1 1 1...) but I can't seem to get the values to increase for each
> >  time step.
> >
> >  Imagine I could either create a datafile manually and read it in or
> >  somehow extract the year information from the existing dataset into a
> >  user defined variable.
> >
> >  Is there an equivalent of 'define variable(t=2) = 2'?  I know this
> >  syntax is wrong.
> >
> >  Any advice would be appreciated.
> >
> >  Lisa
> >
> >  --
> >  Lisa Welp-Smith
> >  Carbon Dioxide Research Group
> >  Scripps Institution of Oceanography
> >
> >
> >  _______________________________________________
> >  gradsusr mailing list
> >  gradsusr at gradsusr.org
> >  http://gradsusr.org/mailman/listinfo/gradsusr
> >

-- 
Lisa Welp-Smith
Carbon Dioxide Research Group
Scripps Institution of Oceanography





More information about the gradsusr mailing list