<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">No, there is officially no function, but you can define a new one that does the job pretty well.<div class=""><br class=""></div><div class="">Here is the prototype that goes before the program "begin".<br class=""><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">function avg_zeros(x:numeric)</font></div><div class=""><font face="Menlo" class="">; compute average not considering zeros,</font></div><div class=""><font face="Menlo" class="">; --&gt; in: &nbsp;rain rate</font></div><div class=""><font face="Menlo" class="">; &lt;-- out: average rain rate</font></div><div class=""><font face="Menlo" class="">local N</font></div><div class=""><font face="Menlo" class="">begin</font></div><div class=""><font face="Menlo" class="">&nbsp;N=num(x .ne. 0)</font></div><div class=""><font face="Menlo" class="">&nbsp;return(sum(x)/ N)</font></div><div class=""><font face="Menlo" class="">end</font></div></div><div class=""><br class=""></div><div class="">Example of a function call</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">rain=avg_zeros(ts-&gt;precp_r)</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">Cheers&nbsp;</font></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 1. Aug 2017, at 08:32, Arun Kumar Dwivedi &lt;<a href="mailto:dwivedi.arunkumar@gmail.com" class="">dwivedi.arunkumar@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><span style="font-size:12.8px" class="">Hello All,</span><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">In NCL ,how to calculate average of any array or data while ignoring all the zeros&nbsp;</div><div style="font-size:12.8px" class="">If there is any command or function, kindly let me know.</div><div style="font-size:12.8px" class=""><br class=""><div class=""><div class="gmail-m_-7886533120381905182gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Thanks &amp; Regards</div></div></div></div></div></div></div><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Arun Kumar Dwivedi,<br class=""></div><div dir="ltr" class=""><br class=""></div></div></div></div></div></div></div>
</div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista" class="">http://guidocioni.altervista</a>.org</div>

</div>
<br class=""></div></div></body></html>