Problem with max function

Witold Interewicz yinter_robocze at WP.PL
Tue Apr 18 08:51:09 EDT 2006


Hello,

I have the following problem. I'm trying to plot a map of maximum values (maximum over time for each point of a grid). Data I have already is some extremum, valid over period that is shorter than I need.
For some reason, in my case, max function used as in example presented some time ago on this forum (cited below) doesn't work. Data I'm trying to plot is a result from X hours of simulation dumped each Y hours, resulting in dataset of N separate gribs. TDEF record in descriptor (I expect this could be source of problem) is
tdef N linear <some base date> Yhr.
I use code like this (exactly as in example cited below):

'set lon 'lonmin' 'lonmax
'set lat 'latmin' 'latmax
'set z 1'
'set t 't1
* (t1 is start time, t2 is terminating time, t2<=N)
'define tempfld = max(somefld,t='t1',t='t2')'
'd  tempfld'

and get the following message:

Cannot contour grid - all undefined values

What could be the reason of this error?

Witek

Dnia 18-11-2005 o godz. 22:40 Charles Seman napisał(a):
> Hi Ben,
>
> For a time series of domain max values, please try something like this:
>
> 'set lon 0'
> 'set lat 0'
> 'set z 1'
> 'set t 1 't_8yr   * "t_8yr" is the time index for 8 years...
> 'define precmax1 = max(max(precip,lon=0,lon=360),lat=-90,lat=90)'
> 'd precmax1'
>
> For a map of max values over a time period, please try something like
> this:
>
> 'set lon 0 360'
> 'set lat -90 90'
> 'set z 1'
> 'set t 1'
> 'define precmax2 = max(precip,t=1,t='t_8yr')'   * "t_8yr" is the time
> index for 8 years...
> 'd precmax2'
>
> I hope this helps,
> Chuck
>
> Ben Burford wrote:
>
> >        Hello,
> >
> >I'm a beginner at Grads.  I want to find the max value of my data so I
> tried
> > the max function defined in the documentation:
> >d max(max(precip,lon=0,lon=360),lat=-90,lat=90)
> >
> >But it produces only 1 value for the entire data set.
> >
> >I have a global gridded 1 degree by 1 degree daily data (for an 8 year
> perio
> >d) netcdf file.  I open the file with sdfopen.  I want to find the
> maximum v
> >alue at each individual grid cell and display a global map of those
> (maximum
> >) values.  Can you tell me how to do this?
> >
> >Also, I want to write these values out to a file to save and use later.
> >
> >Finally, I'm runnings Grads under Windows XP and the file I'm opening
> is 360
> > MB.  After I perform the first Grads function my computer becomes
> incredibl
> >y slow (for everything, Msword, Powerpoint, Grads, whatever).  Is there
> some
> >thing I can set (e.g a memory allocation for Grads) that will prevent
> this?
> >
> >Thanks very much in advance.
> >
> >Ben
> >
> >
>
> --
>
> ********************************************************************
>  Charles Seman                                charles.seman at noaa.gov
>  U.S. Department of Commerce / NOAA / OAR
>  Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
>  201 Forrestal Road                              fax: (609) 987-5063
>  Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
> ********************************************************************
>
> "The contents of this message are mine personally and do not reflect
> any position of the Government or NOAA."
>



----------------------------------------------------
Darmowy polski poker on-line na Wirtualnej Polsce!
200.000 graczy każdego miesiąca
Rozdajemy dziennie 10 mln wirtualnej gotówki! Zagraj:
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fpk.html&sid=723



More information about the gradsusr mailing list