<div dir="ltr"><div>Dave,<br><br>A ticket has been opened: JIRA-2699: dim_cumsum_n: add new options<br><br></div><div>-------------<br></div><div>I tagged this for the 6.5.0 release but that may not be possible.<br><br></div><div>Regards<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 24, 2017 at 2:38 PM, Dave Allured - NOAA Affiliate <span dir="ltr"><<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">NCL team,<div><br></div><div>I would like to suggest several new options for the dim_cumsum family of four functions. The current three options are:<br><br>opt = 0 ; when _FillValue is encountered no additional summing will be performed. <br>opt = 1 ; when _FillValue is encountered set element to _FillValue and resume summing.<br>opt = 2 ; treat _FillValue as numeric zero when summing.</div><div><br></div><div>Frequently only the final array slice of the customized summing operation is wanted. So I propose several new options:</div><div><br></div><div>opt = 4 ; when _FillValue is encountered, return _FillValue.</div><div>opt = 5 ; return sum only up to the first encountered _FillValue.</div><div>opt = 6 ; return sum only following the last encountered _FillValue.</div><div>opt = 7 ; treat _FillValue as numeric zero, and return only the final sum.<br></div><div><br></div><div>The first three existing options return an <span style="font-size:14px;color:rgb(51,51,51);font-family:verdana,sans-serif">array of the same type and dimensionality as </span><em style="font-size:14px;margin:0px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif">x</em><span style="font-size:14px;color:rgb(51,51,51);font-family:verdana,sans-serif">. These four new options would return an array of one lesser rank than x; the summing dimension would be removed.</span></div><div><span style="font-size:14px;color:rgb(51,51,51);font-family:verdana,sans-serif"><br></span></div><div><font face="verdana, sans-serif" color="#333333">Options 4, 6, and 7 would return exactly the same result as taking the "last" array slice on the summing dimension, of options 0, 1, and 2 respectively.</font></div><div><font face="verdana, sans-serif" color="#333333"><br></font></div><div><font face="verdana, sans-serif" color="#333333">Option 5 would be special. Summing would end on the FIRST encountered _FillValue, and that result would be returned. Option 5 would be exactly the same as option 6 with reversed input ordering on the summing dimension. Option 5 is included mainly for symmetry and completeness.</font></div><div><font face="verdana, sans-serif" color="#333333"><br></font></div><div><font face="verdana, sans-serif" color="#333333">To be consistent with current option 1, _FillValue is explicitly returned when:</font></div><div><font face="verdana, sans-serif" color="#333333"><br></font></div><div><font face="verdana, sans-serif" color="#333333">opt = 5 and the first input element is _FillValue.</font></div><div><font face="verdana, sans-serif" color="#333333">opt = 6 a</font><span style="color:rgb(51,51,51);font-family:verdana,sans-serif">nd the last input element is _FillValue.</span></div><div><font face="verdana, sans-serif" color="#333333"><br></font></div><div><font face="verdana, sans-serif" color="#333333">These new options would simplify user code in some cases, such as Rashed's case today. In</font><span style="color:rgb(51,51,51);font-family:verdana,sans-serif"> </span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif">large array applications, these options could also</span><span style="color:rgb(51,51,51);font-family:verdana,sans-serif"> reduce memory consumption and run time.</span></div><span class="HOEnZb"><font color="#888888"><div><font face="verdana, sans-serif" color="#333333"><br></font></div><div><font face="verdana, sans-serif" color="#333333">--Dave</font></div></font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>