Max of own variables Grads

All other topics about postprocessing model data (GrADS and other software), about other numerical weather prediction software (including WRF-NMM and WRF-ARW discussion unrelated to UEMS/WRF EMS), and general meteorology talk go in this forum.
Post Reply
weatherc
Posts: 64
Joined: Tue Sep 25, 2012 2:39 am

Max of own variables Grads

Post by weatherc » Tue May 20, 2014 4:07 pm

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

meteoadriatic
Posts: 1588
Joined: Wed Aug 19, 2009 10:05 am

Re: Max of own variables Grads

Post by meteoadriatic » Tue May 20, 2014 5:34 pm

Does 'define xx=max(thu1,t=1,t=24)' helps?

weatherc
Posts: 64
Joined: Tue Sep 25, 2012 2:39 am

Re: Max of own variables Grads

Post by weatherc » Tue May 20, 2014 6:48 pm

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

weatherc
Posts: 64
Joined: Tue Sep 25, 2012 2:39 am

Re: Max of own variables Grads

Post by weatherc » Tue May 20, 2014 10:17 pm

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

Post Reply