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Ā <span></span><br><br>On Friday, November 14, 2014, Walter Kolczynski <<a href="mailto:walter.kolczynski@noaa.gov">walter.kolczynski@noaa.gov</a>> 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 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>