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

Wesley Ebisuzaki - NOAA Federal wesley.ebisuzaki at noaa.gov
Mon Feb 15 15:18:22 EST 2016


Christopher,

   I used wgrib2 to calculate the growing degree days with -rpn.  What you
want to calculate is no more complicated.

Wesley

On Mon, Feb 15, 2016 at 12:12 PM, Christopher Gilroy <chris.gilroy at gmail.com
> wrote:

> 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?
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160215/6fd10e5e/attachment.html 


More information about the gradsusr mailing list