<div dir="ltr"><div>Well, there can not be an NCL  function for 'everything' , you just have to write one.<br><br>undef("steps_tf")<br>function steps_tf(x[*]:numeric)<br>local nx, foo, tf<br>begin<br>  nx  = dimsizes(x)<br>  foo = x(1:)-x(0:nx-2)<br>  tf    = where(foo.ge.0, 1, 0)<br>  return(tf)<br>end<br>;=============<br>;   test<br>;============<br><br>   x = (/ 1,2,3,2,-1,-1,2 /)<br>   tf= steps_tf(x)<br>   print(tf)<br><br>=======================================<br><br></div>%> ncl damjan.ncl<br><br>Variable: tf<br>Type: integer<br>Total Size: 24 bytes<br>            6 values<br>Number of Dimensions: 1<br>Dimensions and sizes:    [6]<br>Coordinates: <br>(0)    1<br>(1)    1<br>(2)    0<br>(3)    0<br>(4)    1<br>(5)    1<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 27, 2018 at 4:39 AM, Damjan Jelic <span dir="ltr"><<a href="mailto:dnjelic@gmail.com" target="_blank">dnjelic@gmail.com</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"><div>Dear NCL support,</div><div><br></div><div>is there any built-in function which can compare consecutive steps and assign true/false if difference is positive or negative? for example:<br></div><div>input  :1,2,3,2,-1,-1,2  <br></div><div>output:1,1,0,0, 1, 1</div><div><br></div><div>all the best!</div><span class="HOEnZb"><font color="#888888"><div>Damjan<br></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>