<div dir="ltr">Thank you<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 9:23 AM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</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 class="gmail_default" style="font-size:small">This forum is for people having trouble installing NCL.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please repost your question to <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>.</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><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Nov 11, 2014 at 10:07 PM, Ipshita Majhi <span dir="ltr">&lt;<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div>Hi,<br><br>I wrote a code to extract each year and then take a long term weekly average i.e for 52 weeks. There are some years which have 53 years . I get a matrix of 46 by 52 but it is not writing it out in a matrix. <br></div>Error: Subscript out of range, error in subscript #0<br></div> Then when I average it, it gives me only one value instead of 52 and if I use<br></div>dim_avg_n then it gives other sets of concern.<br><br></div>Error : Invalid dimension sizes<br><br>;*******************************************<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>;*******************************************<br><br>;Reading in the data<br><br>a=addfile(&quot;~/Documents/Snow_cover_IMS/<a href="http://nhsce_v01r01_19661004_20140602.nc" target="_blank">nhsce_v01r01_19661004_20140602.nc</a>&quot;,&quot;r&quot;)<br><br>sce=a-&gt;snow_cover_extent<br>time_sce=a-&gt;time<br><br><br>;Now converting the time from georgian to ut_calender<br>;Doing an area average for sce<br><br>sce_area=wgt_areaave_Wrap(sce,1.0,1.0, 0) <br><br>ut_sce=cd_calendar(time_sce,0)<br><br><br>;Extracting just the year information from the time series<br><br>xyears=ut_sce(:,0); Years from the SCE dataset<br><br>;This part of code is to create a matrix with each years weekly data<br>;The years go from 1967 to 2013 i.e 47 years with 52 weeks for each year<br><br>sce_week=new((/46,52/),&quot;float&quot;)<br>years=ispan(1967,2013,1)<br><br><br>do i=1,46<br><br><br>yind=years(i) <br><br><br>;Finding the index matching the year<br><br>time_ind=ind(xyears.eq.2012)<br><br>; Extracting that years snow cover extent <br><br>sce_year=sce_area(time_ind)<br>sce_52=sce_year(0:51)<br><br>;Now checking for years with 53 weeks<br>z=dimsizes(sce_year)<br><br>sce_week(i,0:51)=sce_52(i)<br><br> opt = True<br>opt@title  = &quot;sce_week_matrix.txt&quot;<br><br>;write_matrix(sce_week, &quot;52f1.10&quot;, opt)<br><br>end do<br><br>sce_week_avg=dim_avg_n_Wrap( sce_week, 2 ) <br><br></div>Thank YOu<br></div>Best Regards<span><font color="#888888"><br>Ipshita<br></font></span></div>
<br></div></div>_______________________________________________<br>
ncl-install mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-install" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-install</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>