[gradsusr] wgrib capable of doing some (advanced?) calculation (-rpn?)

Christopher Gilroy chris.gilroy at gmail.com
Mon Feb 15 12:12:01 EST 2016


We currently use this for our snowfall accumulation 10:1:

define snowtot =
const((sum(maskout(weasdsfc.1-weasdsfc.1(t-1),weasdsfc.1-weasdsfc.1(t-1)),t=2,t=37)*0.0393701)*10,
0, -u)

and since the further out the t data goes the long it takes to process,
which makes sense, but I'm a performance/speed guy and I'm wondering if
there's any way to speed it up. The only real area for improvement (to my
knowledge) would be if wgrib2 could do that sort of calculation (even if it
had to write it to a seperate grib file/record, that's fine) since it's
OpenMP ability should allow it to perform an operation like that much
faster than grads single-thread capabilities.

As to it taking longer and longer the further out the t goes with our
current grads script, I assumed it was because of the calculation of
needing to sum it all and the const with maskout'ing it all. I've dabbled
with fwriting that variable out to a seperate file, since I assumed it
would be pre-calculated and then I could have simply done:

'd snowtot(t=2)+snowtot(t=3)+snowtot(t=4) ...'

all the way out to the end so all grads would be doing it taking
pre-compiled data and adding without doing any other functions but it still
seemed like it was taking the exact same amount of time even having all
that snowtot variable pre-calculated?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160215/e95a0caf/attachment.html 


More information about the gradsusr mailing list