[ncl-talk] Precipitation Accumulation, Running Total?

Brock Tropea brockt.1337 at gmail.com
Fri Jun 28 14:51:29 MDT 2019


Hi everyone

I'm using WRF in my work, and I'm trying to make plots of accumulated
precipitation over the course of an entire event. I had tried to do this in
Python, but NCL works better in this instance.

My problem is that I don't know how to make a running total, so to speak.
Without showing my entire program:
"...
  wtsnctrltotal = new((/1015,1359/),float,0)
 ...
do
...
    wtsnctrlstep = where((notracesnowctrl .gt. 0 .and. wetbulbctrl .gt.
0),notracesnowctrl,0)
    wtsnctrltotal = wtsnctrltotal + wtsnctrlstep
"

The "wtsnctrltotal" is just an empty array to hold the running total.
I have "wtsnctrlstep" as the stepwise value for whatever current record
number the do loop is working on. This array has the correct values in it,
and is working fine.

The specific thing that isn't working is that I cannot figure out how to
add the step value to the total value, the last line of code. Checking it
with PrintVarSummary as well as max/min shows 0 for everything.

I've already tried enclosing the right side of the equals with brackets,
but no dice. In a very similar program I made in Python, you have a very
handy operator for doing this, which is " += ". This adds another value
with the variable's value and assigns the new value to the variable. This
is what I'd like to do, but I've been searching for a few days and I can't
find a way to do such a thing.

Of course, I'm probably going about this all wrong. Any suggestions?


Thank you!

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190628/efca457d/attachment.html>


More information about the ncl-talk mailing list