<div dir="ltr"><div class="gmail_default" style="font-size:small">I think the issue may simply be with the "week_52(46-i)" part.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When ever you get an error message about index values out-of-range, it's always a good idea to recheck your math and make sure that the array indexes are what you expect.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you print out "46-i" inside the do loop you get values 46,45.,...39,38</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">week_52 is of length 38, and you are trying to subscript it using values >= 38.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 3:25 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</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><div>Hi,<br><br></div>I am getting above mentioned for the text colored in red<br></div>Thank you<br><div><br>*******************************************************************<br><div><div><br>;Now extracting indices for year with 52 weeks<br><br>year_52=ispan(1967,2013,1)<br>year_53=(/1968,1973,1979,1984,1990,1996,2001,2007,2012/)<br>;print(dimsizes(year_53))<br><br>t=dimsizes(year_52)-dimsizes(year_53)<br><br>;print(t)<br><br><br><br>;Find the indices where the two matrices have same value<br><br>week_same=new(9,"integer")<br>week_52=new(38,"integer")<br><br>do i=0,9-1<br><br>week_53=year_53(i)<br>week_same(i)=ind(year_52.eq.week_53)<br><span style="color:rgb(255,0,0)">week_52(46-i)=year_52(ind(year_52.ne.week_same)) ;</span> This is to get the years which are not equal to years with 53 weeks<br>end d<br></div></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>