No subject


Wed Apr 14 09:33:43 EDT 2010


"define varname = expr

...The variable is defined to cover the dimension ranges in effect at the
time the command is issued... "

The only thing I know to do is "set lon" to cover the range of longitudes over which
you want to average before you do your first "define".

Without explicitly doing "set lon" prior to your first "define" (in your case to something
like  "set lon 350 380" or "set lon -10 20"), your new variables are defined only for the default
longitude range. For example,  if your original variable "x" is a global field, then your
defined variable "y1900" is defined from longitude 0 to 360.

Mary Jo


On Monday 12 September 2005 06:56, Rajesh J wrote:
>>  dear gradsusers,
>>  i have a problem regarding how to take the longitude in area averages
>> when it comes like 350 to 20. when i took longitude as -10 to 20 and 350
>> to 380 it gives different answers. why is it so. i paste the script below.
>> please help.
>>
>>
>>  'reinit'
>>  'sdfopen x.nc'
>>  'set lev 250'
>>
>>  tt=1900
>>  while(tt<=2005)
>>  'define y'tt'=ave(x,time=sep'tt-1',time=nov'tt-1')'
>>  tt=tt+1
>>  endwhile
>>
>>  'set lat 15'
>>  'set lon -10'
>>  tt=1900
>>  while(tt<=2005)
>>  'define kk=aave(y'tt',lon=350,lon=380,lat=35,lat=45)'
>>
>>  ************************************************************************
>>  **  when this line is set as
>> * **  'define kk=aave(y'tt',lon=-10,lon=20,lat=35,lat=45)'
>> * **  the answer is different in 'x.dat' but when i plot some parameter
>>  * **  with lon set either of these way it gives the same area. i mean, it
>>  * **  displays the same geographical area. so what could happen wrong? *
>>  ************************************************************************
>>
>>  'd kk'
>>  say result
>>  te=subwrd (result,4)
>>  w=write('x.dat',te)
>>  tt=tt+1
>>  endwhile
>>
>>
>>  **************************************************************
>>
>>  thanking you,
>>  rajesh



More information about the gradsusr mailing list