<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Try this:<br>
      <br>
      <tt>do i=0, dimsizes(week_53)-1</tt><tt><br>
      </tt><tt>    matching = ind( year_52.eq.week53(i) )</tt><tt>    ;
        What's the index(es) with the value of week53(i)<br>
      </tt><tt>    if( .not.ismissing(matching) ) then       ; Make sure
        there is at least one index <br>
                </tt><tt>year_52(matching) = year_52@_FillValue     ;</tt><tt>
        Set the value at that index(es) to missing<br>
            end if<br>
      </tt><tt>end do</tt><br>
      <br>
      <tt>Year_52 = year_52( ind( .not.ismissing(year_52) ) )     ; Copy
        non-missing values to Year_52</tt><br>
      <br>
      - Walter Kolczynski<br>
      <br>
      On 14-Nov-14 18:15, Ipshita Majhi wrote:<br>
    </div>
    <blockquote
cite="mid:CA+ObMNAYNezbk6UbPHC40XqXOQx4kbD449zezqbDBTAFvEh=TQ@mail.gmail.com"
      type="cite"><br>
      <br>
      On Friday, November 14, 2014, Ipshita Majhi &lt;<a
        moz-do-not-send="true" href="mailto:ipmajhi@alaska.edu">ipmajhi@alaska.edu</a>&gt;
      wrote:<br>
      <blockquote class="gmail_quote" style="margin:0 0 0
        .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
        <div>I want to extract years with 52 weeks and yeara with 53
          weeks</div>
        <div>I have a matrix going from 1968 to 2013 and that is year_52</div>
        <div>Then i have few years which I have stored in week_53 </div>
      </blockquote>
      <div>I want to remove the years with 53 weeks from year_ 52 and
        then use those indices to extract snow cover extent</div>
      <div>Thank you dor help<span></span> </div>
      <blockquote class="gmail_quote" style="margin:0 0 0
        .8ex;border-left:1px #ccc solid;padding-left:1ex">
        <div><br>
          <br>
          On Friday, November 14, 2014, Walter Kolczynski &lt;<a
            moz-do-not-send="true"
            href="javascript:_e(%7B%7D,'cvml','walter.kolczynski@noaa.gov');"
            target="_blank">walter.kolczynski@noaa.gov</a>&gt; wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>There are a several problems:<br>
                <br>
                1) Every time through the loop, you are overwriting your
                existing Year_52, so only the last iteration will
                control the end result.<br>
                2) Week_same(i) contains the index where the two weeks
                are the same, but then the equality in the where
                statement is checking for equality of that *index* with
                the *values* of year_52. Unless the values of year_52
                are equal to the index, this is probably not what you
                want.<br>
                3) This code will fail if more than one value in week_52
                and week_53 match.<br>
                <br>
                I'm not sure exactly what you are trying to do, but I
                believe this structure is either wrong or just more
                complicated than you need. Can you tell us what you are
                trying to accomplish (i.e., what you expect Week_52 and
                Week_53 to be at the end)?<br>
                <br>
                - Walter Kolczynski<br>
                <br>
                On 14-Nov-14 17:35, Ipshita Majhi wrote:<br>
              </div>
              <blockquote type="cite">Hi
                <div>I am replacing indices that match with indices but
                  the whole array gets replaced by fill values</div>
                <div><br>
                </div>
                do i = 0,9-1
                <div>Week_53=year_53(i)</div>
                <div>Week_same(i)=ind(year_52.eq.week_53)</div>
                <div>Year_52=where(year_52.eq.week_same(i),year_52,year_52@fillvalue)</div>
                end do
                <div><br>
                </div>
                It will be great if someone can help<span></span> <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a moz-do-not-send="true" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
      </blockquote>
      <div> </div>
    </blockquote>
    <br>
  </body>
</html>