[ncl-talk] Precipitation Accumulation, Running Total?

Adam Phillips asphilli at ucar.edu
Fri Jun 28 16:11:28 MDT 2019


Hi Brock,
The third input to new is the setting for _FillValue. In the following you
are setting the _FillValue to 0:

 wtsnctrltotal = new((/1015,1359/),float,0)

I think what you want to do is this:
wtsnctrltotal = new((/1015,1359/),float,1.e20)
wtsnctrltotal = 0

Setting _FillValue to 0 is generally not recommended, and I'm not sure how
doing that will affect this line:
wtsnctrlstep = where((notracesnowctrl .gt. 0 .and. wetbulbctrl .gt.
0),notracesnowctrl,0)

If after making that change you continue to have issues let ncl-talk know.
Adam

On Fri, Jun 28, 2019 at 2:52 PM Brock Tropea via ncl-talk <ncl-talk at ucar.edu>
wrote:

> 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>
> <#m_-2031139579957799285_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190628/b5f27626/attachment.html>


More information about the ncl-talk mailing list