Page 1 of 1

Max of own variables Grads

Posted: Tue May 20, 2014 4:07 pm
by weatherc
Hi gurus,

I have a little problem. :mrgreen:

I want to get max value of each gridpoint for a timeserie, say t=0 to t=24 from an own defined/calculated variable so i get a "24h variable" and that plotted to a map.

The variable is the thu1 in this example:

'define ha1=const(const(maskout(ownlftx,ownlftx-1.25),1),0,-u)'
'define he1=const(const(maskout(avcape,avcape-400),1),0,-u)'
'define ts1 = const(he1+ha1,0,-u)'
'define thu1=const(const(maskout(ts1,ts1-2),1),0,-u)'

Any idea how to do that?

// Henkka

Re: Max of own variables Grads

Posted: Tue May 20, 2014 5:34 pm
by meteoadriatic
Does 'define xx=max(thu1,t=1,t=24)' helps?

Re: Max of own variables Grads

Posted: Tue May 20, 2014 6:48 pm
by weatherc
Nope.
It just get first timestep data.
I guess the custom defined variables like ownlftx just get the t=10 whats set at the beginning of the script.
The tricky seems to be that in the full script are there multiple and big calculation/functions whats results runned trought similar const/maskout-functions, and, each of the values (ownlftx, avcape etc) needs to be from same hour...

// Henkka

Re: Max of own variables Grads

Posted: Tue May 20, 2014 10:17 pm
by weatherc
I found the solution: http://www.cpc.ncep.noaa.gov/products/wesley/g2grb.html

Its to save the own variable to a new grib-file in a normal while-loop and then use that for 'define xx=max(thu1,t=1,t=24)'. In this case are there no "thu1" in the grib-template but saving it as say tmpsfc seems to work. :)

// Henkka