<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div>please find data in this link : <a href="https://drive.google.com/open?id=1semO2FGV60dLKjHha1oNG607zvlKA8Uf" rel="nofollow" target="_blank" class="enhancr_card_2964969280">ERA-I_1_1_1979-2017_Tmax_Tmin_NTA.nc</a>  </div><div><br></div><div id="ydp5e86ee2eenhancr_card_2964969280" class="ydp5e86ee2eyahoo-link-enhancr-card ydp5e86ee2eyahoo-link-enhancr-not-allow-cover ydp5e86ee2eymail-preserve-class ydp5e86ee2eymail-preserve-style" style="max-width:400px;font-family:"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;" data-url="https://drive.google.com/open?id=1semO2FGV60dLKjHha1oNG607zvlKA8Uf" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://drive.google.com/open?id=1semO2FGV60dLKjHha1oNG607zvlKA8Uf" style="text-decoration:none !important;color:#000 !important;" class="ydp5e86ee2eyahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydp5e86ee2ecard-wrapper ydp5e86ee2eyahoo-ignore-table" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="400"><table class="ydp5e86ee2ecard ydp5e86ee2eyahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td><table class="ydp5e86ee2ecard-info ydp5e86ee2eyahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-image: none; background-repeat: repeat; background-attachment: scroll; background-size: auto auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"><img class="ydp5e86ee2ecard-object-1 ydp5e86ee2eyahoo-ignore-inline-image ydp5e86ee2eymail-preserve-class" src="https://s.yimg.com/nq/storm/assets/enhancrV2/23/logos/google.png" style="min-width:36px;margin-top:3px;" height="36"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;"><h2 class="ydp5e86ee2ecard-title" style="font-size:14px;line-height:19px;margin:0 0 6px 0;font-family:"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;word-break:break-word;color:#26282a;">ERA-I_1_1_1979-2017_Tmax_Tmin_NTA.nc</h2><p class="ydp5e86ee2ecard-description" style="font-size:12px;line-height:16px;margin:0px;color:#979ba7;word-break:break-word;"></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div><br></div><div>Actually there isn't any error message. It just kills the script and shows up this message:"killed".<br><div><br></div><div><br></div><div class="ydpf4d1f7cesignature">-----------------------------<br>GUIGMA</div></div>
            <div><br></div><div><br></div>
            
            <div id="yahoo_quoted_2965673414" class="yahoo_quoted">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                    
                    <div>
                        On Monday, 26 March 2018, 23:09:03 GMT+1, Rashed Mahmood <rashidcomsis@gmail.com> wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                    <div><div id="yiv3612014882"><div><div dir="ltr">Sorry I meant to send it to ncl-talk. here it is:<br clear="none"><div><div class="yiv3612014882yqt4352960357" id="yiv3612014882yqtfd02696"><div class="yiv3612014882gmail_quote">---------- Forwarded message ----------<br clear="none">From: <b class="yiv3612014882gmail_sendername">Rashed Mahmood</b> <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:rashidcomsis@gmail.com" target="_blank" href="mailto:rashidcomsis@gmail.com">rashidcomsis@gmail.com</a>></span><br clear="none">Date: Mon, Mar 26, 2018 at 3:02 PM<br clear="none">Subject: Re: [ncl-talk] Sequences of values<br clear="none">To: Kiswendsida Hyacinthe GUIGMA <<a rel="nofollow" shape="rect" ymailto="mailto:karongseba@gmail.com" target="_blank" href="mailto:karongseba@gmail.com">karongseba@gmail.com</a>><br clear="none"><br clear="none"><br clear="none"><div dir="ltr">That's too many loops! ...I can not test without data set, what error messages you get when you run this?<br clear="none"></div><div class="yiv3612014882HOEnZb"><div class="yiv3612014882h5"><div class="yiv3612014882gmail_extra"><br clear="none"><div class="yiv3612014882gmail_quote">On Mon, Mar 26, 2018 at 1:20 PM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:karongseba@gmail.com" target="_blank" href="mailto:karongseba@gmail.com">karongseba@gmail.com</a>></span> wrote:<br clear="none"><blockquote class="yiv3612014882gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div><div>Please find attached an example of a code. </div><div>My data spans 0 to 35N and 20W to 50E with resolution in both directions of 1*1. It is too big to be uploaded in NCL_talk<br clear="none"></div><div><br clear="none"></div><div>Kindest regards<br clear="none"></div><div><br clear="none"></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163ydp1275d4d9signature">-----------------------------<br clear="none">GUIGMA</div></div>
            <div><br clear="none"></div><div><br clear="none"></div>
            
            <div class="yiv3612014882m_1897331985444617648m_3166969670626823163yahoo_quoted" id="yiv3612014882m_1897331985444617648m_3166969670626823163yahoo_quoted_2571667525">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><span>
                    
                    </span><div>
                        On Monday, 26 March 2018, 20:40:32 GMT+1, Rashed Mahmood <<a rel="nofollow" shape="rect" ymailto="mailto:rashidcomsis@gmail.com" target="_blank" href="mailto:rashidcomsis@gmail.com">rashidcomsis@gmail.com</a>> wrote:
                    </div>
                    <div><br clear="none"></div>
                    <div><br clear="none"></div>
                    <div><div id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884"><div><span></span><div dir="ltr">How does your script look like? and what is the size of input data?<br clear="none"></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884yqt1965475992" id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884yqt40086"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884gmail_extra"><br clear="none"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884gmail_quote"><span>On Mon, Mar 26, 2018 at 8:45 AM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:karongseba@gmail.com" target="_blank" href="mailto:karongseba@gmail.com">karongseba@gmail.com</a>></span> wrote:<br clear="none"></span><blockquote class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><span></span><div>Hi Rashed and everyone,</div><div>Thank you for your suggestion.</div><div>I also had the idea of using many loops. It works perfectly for no large data. But when it comes to apply it to a 3D data covering half of the Africa domain, it slows down the execution and ends up killing the process. That's why I was thinking that there exist an other way to do that using not as much iterations.</div><div><br clear="none"></div><div>Best<br clear="none"><div><br clear="none"></div><div><br clear="none"></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683ydpdd8a04cfsignature">-----------------------------<br clear="none">GUIGMA</div></div><div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884h5">
            <div><br clear="none"></div><div><br clear="none"></div>
            
            <div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yahoo_quoted" id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yahoo_quoted_3048719941">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><span>
                    
                    </span><div>
                        On Saturday, 24 March 2018, 18:30:38 GMT, Rashed Mahmood <<a rel="nofollow" shape="rect" ymailto="mailto:rashidcomsis@gmail.com" target="_blank" href="mailto:rashidcomsis@gmail.com">rashidcomsis@gmail.com</a>> wrote:
                    </div>
                    <div><br clear="none"></div>
                    <div><br clear="none"></div>
                    <div><div id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430"><div><div dir="ltr"><div><div><div><span></span><div>Hi Guigma,<br clear="none"></div>For 1 dimensional series you can use the following. however, you would need to adapt this to your 3D data sets through loops/ind function and need to do TESTING, this is a very time consuming process.<br clear="none">begin<br clear="none">;  X1 = (/0,1,0,0,1,1,1,1,1,0,0,1,0,1, 1,1,1,0,0,1,0/) ; orignal <br clear="none">   X1 = (/0,1,0,0,1,1,1,1,1,0,0,1,0,1, 1,1,1,0,0,1,0,1,1,0,0,1,0,1,0, 1,1/) ; for testing<div><div class="yiv3612014882m_1897331985444617648h5"><br clear="none"><br clear="none">   X2 = new(dimsizes(X1),integer)<br clear="none"><br clear="none"> do n=0,dimsizes(X1)-1<br clear="none">     if(n.eq.0)<br clear="none">       if(X1(n).eq.1.and.X1(n+1).eq. 0)<br clear="none">         X2(n) = 0<br clear="none">        else<br clear="none">         X2(n) = X1(n)<br clear="none">       end if<br clear="none">     end if<br clear="none"><br clear="none">    if(n.gt.0.and.n.lt.dimsizes( X1)-1)<br clear="none">      if(X1(n).eq.1)<br clear="none">         if(X1(n-1).eq.0.and.X1(n+1). eq.0)<br clear="none">            X2(n) = 0<br clear="none">          else<br clear="none">            X2(n) = X1(n)<br clear="none">         end if<br clear="none">       else<br clear="none">          X2(n) = X1(n)<br clear="none">      end if<br clear="none"><br clear="none">    end if<br clear="none"><br clear="none">    if(n.eq.dimsizes(X1)-1)<br clear="none">      if(X1(n).eq.1.and.X1(n-1).eq. 1)<br clear="none">        X2(n) = X1(n)<br clear="none">       else<br clear="none">        X2(n) = 0<br clear="none">      end if<br clear="none">    end if<br clear="none"> end do<br clear="none">    print(X1+" ... "+X2)<br clear="none"><br clear="none">end<br clear="none"><br clear="none"><br clear="none"></div></div></div><div><div class="yiv3612014882m_1897331985444617648h5">Note I have NOT tested it as much one should so I would let you to test and find out if that is what you are looking for.<br clear="none"><br clear="none"></div></div></div>Cheers,<br clear="none"></div>Rashed<br clear="none"><div><div><br clear="none"><br clear="none"><div><br clear="none"><br clear="none"><br clear="none"><br clear="none"></div></div></div></div><div><div class="yiv3612014882m_1897331985444617648h5"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430gmail_extra"><br clear="none"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430gmail_quote">On Sat, Mar 24, 2018 at 6:44 AM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:karongseba@gmail.com" target="_blank" href="mailto:karongseba@gmail.com">karongseba@gmail.com</a>></span> wrote:<br clear="none"><blockquote class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430yqt3038823429" id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430yqt43503"><div><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div>Thank you for your reply and for your help. </div><div>Actually, before to post my question, I tried to make a use of dim_numrun_n but it didn't solve my problem.</div><div><br clear="none"></div><div>You misunderstood a bit my [1]. I said that I successfully did that... So it is OK for that.</div><div> </div><div><br clear="none"></div><div>For [2] , what the dim_numrun_n  function allows is just to do a count. What me I'd rather like is to set to _FillValue (or to 0 if use of where function) all values that are not in a sequence of at least 04 days. As an example I would like to have something as follows:</div><div>X1=(/0,1,0,0,1,1,1,1,1,0,0,1, 0,1,1,1,1,0,0,1,0,/) ==========> X2= (/0,<b>0</b>,0,0,1,1,1,1,1,0,0,<b>0</b>,0,1, 1,1,1,0,0,<b>0</b>,0,/).</div><div>In other words it is to replace all "isolated" 1s by 0.</div><div><br clear="none"></div><div>Kindest regards<br clear="none"><pre><b></b><br clear="none"></pre><br clear="none"><div><br clear="none"></div><div><br clear="none"></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487ydp2124e450signature">-----------------------------<br clear="none">GUIGMA</div></div>
            <div><br clear="none"></div><div><br clear="none"></div><div>
            
            </div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yahoo_quoted" id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yahoo_quoted_2361277437">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                    
                    <div>
                        On Friday, 23 March 2018, 22:17:11 GMT, Dennis Shea <<a rel="nofollow" shape="rect" ymailto="mailto:shea@ucar.edu" target="_blank" href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:
                    </div>
                    <div><br clear="none"></div>
                    <div><br clear="none"></div>
                    <div><div id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992"><div><div dir="ltr"><div><div><div><div><div><div><div><div>Sorry, I'm I am not looking at any code.<br clear="none"></div><div><br clear="none"></div>   tcrit = 30.<br clear="none"><br clear="none"></div>   f  = addfile(...)<br clear="none"></div>  T = f->T                  ; (time,lat,lon)<br clear="none"><br clear="none"><br clear="none">[1] "setting
 values below the threshold to _FillValue" is simple.<br clear="none"><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml">https://www.ncl.ucar.edu/ Document/Functions/Built-in/ where.shtml</a><br clear="none"><br clear="none"></div>   Tcrit = where(T.ge.tcrit, T, T@_FillValue)<br clear="none"></div>   copy_VarMeta(T, Tcrit)<br clear="none">===========<br clear="none"></div><div>[2] You do not need to do [1]<br clear="none"><br clear="none"></div><div>Maybe you could use the following function:<br clear="none"><br clear="none"></div><div>=========<br clear="none"><div><a rel="nofollow" shape="rect" target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_numrun_n.shtml">http://www.ncl.ucar.edu/ Document/Functions/Built-in/ dim_numrun_n.shtml</a><br clear="none"></div><b>***Look at the examples***</b><br clear="none">=========<br clear="none"><br clear="none"></div>  T10= where(T.ge.tcrit,1, 0)  <br clear="none"></div><div>  T10@long_name = "Exceed=1; No=0"<br clear="none"></div>  copy_VarCoords(T, T10)<br clear="none"></div>  printVarSummary(T10)<br clear="none"><div><div><pre> r0 = <b>dim_numrun_n</b> (T10, <b>0</b>, 0)  ; (ntim,nlat,mlon)
 r1 = <b>dim_numrun_n</b> (T10, <b>1</b>, 0)  
<br clear="none"> copy_VarCoords(T, r0)<br clear="none"> copy_VarCoords(T, r1)<br clear="none"><br clear="none"></pre><pre>;---Pick one grid point to see what is happening<br clear="none"><br clear="none"></pre><pre>  LAT = ..<br clear="none">  LON = ..<br clear="none">  print(T(:,{LAT},{LON})+"  "+Tcrit(:,{LAT},{LON})+"  "+T10(:,{LAT},{LON}) \<br clear="none">                        +"  "r0(:,{LAT},{LON})+"   "+r1(:,{LAT},{LON})</pre><div><div>    <br clear="none"></div></div></div></div></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992gmail_extra"><br clear="none"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992gmail_quote">On Fri, Mar 23, 2018 at 3:29 PM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:karongseba@gmail.com" target="_blank" href="mailto:karongseba@gmail.com">karongseba@gmail.com</a>></span> wrote:<br clear="none"><blockquote class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992yqt6827108155" id="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992yqt42772"><div><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div style="font-family:verdana, helvetica, sans-serif;font-size:16px;"><div><div>Dear NCL users,</div><div>I have 3D (time,lat,lon) array of 
temperature from which I would like to keep only sequences (consecutive 
days) exceeding a certain threshold.  This consist concretely in setting
 values below the threshold to _FillValue.  The length of sequence is 
set to 4. So far,  have been able  to set to _FillValu only individual 
days that exceed the threshold. Then I would be pleased if you could 
provide me with a method to also set to _FillValue values that are not 
into sequences of at least 04 days.</div><div><br clear="none"></div><div>Please find attached my data and my code.<br clear="none"></div><div><br clear="none"></div>Regards<div><br clear="none"></div><div><br clear="none"></div><div class="yiv3612014882m_1897331985444617648m_3166969670626823163yiv5187759884m_6032098021478253683yiv0791746430m_-12244688286929487yiv0687598992m_7026875322926614417ydp786f0203signature">-----------------------------<br clear="none">GUIGMA</div></div></div></div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div></div>
                </div>
            </div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div></div></div></div>
                </div>
            </div></div></div></div></div></blockquote></div><br clear="none"></div></div></div></div></div>
                </div>
            </div></div></div></blockquote></div><br clear="none"></div>
</div></div></div><br clear="none"></div></div></div></div></div></div>
                </div>
            </div></div></body></html>