<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, Siraj</div><div><br></div><div>I'm sorry the former code has an error. These codes should be following:</div><div><br></div><div>precip = inFile-&gt;PRECT</div><div>precip2 = onedtond(precip, (/10, 5, 96, 144/))</div><div>precip_JJA = dim_avg_n(precip2(:, 1:3, :, :), 1)</div><div><br></div><div>BTW, onedtond can transfer an nd data to another n dimensions data. It is very powerful.</div><div><br></div><div><div>ÔÚ 2011-10-5£¬ÉÏÎç3:38£¬ Siraj ul Islam Ð´µÀ£º</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all,<br><br>This may be a very easy question. I have a ten year monthly data file and for each year there are only 5 months (May, June, July, August and Sep.) data. In total my 10 year data has (10 x 5) 50 months. Now I want to analyze JJA season each year. As all the built in functions (<strong>clmMonLLT</strong>, month_to_season) in NCL need 12 months data file (time dimension must be a multiple of 12) and therefore I cannot use them for my data. Is there any other way to average out JJA each year or to calculate climatology for each month?<br>
<br>here is the ncdump out put for my file.<br><br><br>netcdf cam4_dsp_may_2000_2009 {<br>dimensions:<br>&nbsp;&nbsp;&nbsp; lat = 96 ;<br>&nbsp;&nbsp;&nbsp; lon = 144 ;<br>&nbsp;&nbsp;&nbsp; time = UNLIMITED ; // (50 currently)<br>variables:<br>&nbsp;&nbsp;&nbsp; double lat(lat) ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lat:long_name = "latitude" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lat:units = "degrees_north" ;<br>&nbsp;&nbsp;&nbsp; double lon(lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lon:long_name = "longitude" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lon:units = "degrees_east" ;<br>
&nbsp;&nbsp;&nbsp; double time(time) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; time:long_name = "time" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; time:units = "days since 2000-05-01 00:00:00" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; time:calendar = "noleap" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; time:bounds = "time_bnds" ;<br>
&nbsp;&nbsp;&nbsp; float PRECT(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PRECT:units = "m/s" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PRECT:long_name = "Total (convective and large-scale) precipitation rate (liq + ice)" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PRECT:cell_methods = "time: mean" ;<br>
&nbsp;&nbsp;&nbsp; float PS(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PS:units = "Pa" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PS:long_name = "Surface pressure" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PS:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float TREFHT(time, lat, lon) ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TREFHT:units = "K" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TREFHT:long_name = "Reference height temperature" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TREFHT:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float U200(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U200:units = "m/s" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U200:long_name = "Zonal wind at 200 mbar pressure surface" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U200:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float U850(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U850:units = "m/s" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U850:long_name = "Zonal wind at 850 mbar pressure surface" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; U850:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float V200(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V200:units = "m/s" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V200:long_name = "Meridional wind at 200 mbar pressure surface" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V200:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float V850(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V850:units = "m/s" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V850:long_name = "Meridional wind at 850 mbar pressure surface" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; V850:cell_methods = "time: mean" ;<br>&nbsp;&nbsp;&nbsp; float Z500(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Z500:units = "m" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Z500:long_name = "Geopotential Z at 500 mbar pressure surface" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Z500:cell_methods = "time: mean" ;<br>
<br>// global attributes:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :Conventions = "CF-1.0" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :source = "CAM" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :case = "fv1.9x2.5_2000_05" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :title =&nbsp; ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :logname = "siraj" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :host = "b158" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :Version = "$Name$" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :revision_Id = "$Id$" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :initial_file = "/home/siraj/ccsm4_working_copy/inputdata/2000/May/cam_initial_day01_00Z.nc" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :topography_file = "/home/siraj/ccsm4_working_copy/inputdata/atm/cam/topo/<a href="http://USGS-gtopo30_1.9x2.5_remap_c050602.nc/">USGS-gtopo30_1.9x2.5_remap_c050602.nc</a>" ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :history = "Wed Sep 21 15:55:24 2011: ncrcat <a href="http://fv1.9x2.5_2000_05.cam2.h0.2000-05.nc/">fv1.9x2.5_2000_05.cam2.h0.2000-05.nc</a> <a href="http://fv1.9x2.5_2000_05.cam2.h0.2000-06.nc/">fv1.9x2.5_2000_05.cam2.h0.2000-06.nc</a> <a href="http://fv1.9x2.5_2000_05.cam2.h0.2000-07.nc/">fv1.9x2.5_2000_05.cam2.h0.2000-07.nc</a> <a href="http://fv1.9x2.5_2000_05.cam2.h0.2000-08.nc/">fv1.9x2.5_2000_05.cam2.h0.2000-08.nc</a> <a href="http://fv1.9x2.5_2000_05.cam2.h0.2000-09.nc/">fv1.9x2.5_2000_05.cam2.h0.2000-09.nc</a> <a href="http://fv1.9x2.5_2001_05.cam2.h0.2001-05.nc/">fv1.9x2.5_2001_05.cam2.h0.2001-05.nc</a> <a href="http://fv1.9x2.5_2001_05.cam2.h0.2001-06.nc/">fv1.9x2.5_2001_05.cam2.h0.2001-06.nc</a> <a href="http://fv1.9x2.5_2001_05.cam2.h0.2001-07.nc/">fv1.9x2.5_2001_05.cam2.h0.2001-07.nc</a> <a href="http://fv1.9x2.5_2001_05.cam2.h0.2001-08.nc/">fv1.9x2.5_2001_05.cam2.h0.2001-08.nc</a> <a href="http://fv1.9x2.5_2001_05.cam2.h0.2001-09.nc/">fv1.9x2.5_2001_05.cam2.h0.2001-09.nc</a> <a href="http://fv1.9x2.5_2002_05.cam2.h0.2002-05.nc/">fv1.9x2.5_2002_05.cam2.h0.2002-05.nc</a> <a href="http://fv1.9x2.5_2002_05.cam2.h0.2002-06.nc/">fv1.9x2.5_2002_05.cam2.h0.2002-06.nc</a> <a href="http://fv1.9x2.5_2002_05.cam2.h0.2002-07.nc/">fv1.9x2.5_2002_05.cam2.h0.2002-07.nc</a> <a href="http://fv1.9x2.5_2002_05.cam2.h0.2002-08.nc/">fv1.9x2.5_2002_05.cam2.h0.2002-08.nc</a> <a href="http://fv1.9x2.5_2002_05.cam2.h0.2002-09.nc/">fv1.9x2.5_2002_05.cam2.h0.2002-09.nc</a> <a href="http://fv1.9x2.5_2003_05.cam2.h0.2003-05.nc/">fv1.9x2.5_2003_05.cam2.h0.2003-05.nc</a> <a href="http://fv1.9x2.5_2003_05.cam2.h0.2003-06.nc/">fv1.9x2.5_2003_05.cam2.h0.2003-06.nc</a> <a href="http://fv1.9x2.5_2003_05.cam2.h0.2003-07.nc/">fv1.9x2.5_2003_05.cam2.h0.2003-07.nc</a> <a href="http://fv1.9x2.5_2003_05.cam2.h0.2003-08.nc/">fv1.9x2.5_2003_05.cam2.h0.2003-08.nc</a> <a href="http://fv1.9x2.5_2003_05.cam2.h0.2003-09.nc/">fv1.9x2.5_2003_05.cam2.h0.2003-09.nc</a> <a href="http://fv1.9x2.5_2004_05.cam2.h0.2004-05.nc/">fv1.9x2.5_2004_05.cam2.h0.2004-05.nc</a> <a href="http://fv1.9x2.5_2004_05.cam2.h0.2004-06.nc/">fv1.9x2.5_2004_05.cam2.h0.2004-06.nc</a> <a href="http://fv1.9x2.5_2004_05.cam2.h0.2004-07.nc/">fv1.9x2.5_2004_05.cam2.h0.2004-07.nc</a> <a href="http://fv1.9x2.5_2004_05.cam2.h0.2004-08.nc/">fv1.9x2.5_2004_05.cam2.h0.2004-08.nc</a> <a href="http://fv1.9x2.5_2004_05.cam2.h0.2004-09.nc/">fv1.9x2.5_2004_05.cam2.h0.2004-09.nc</a> <a href="http://fv1.9x2.5_2005_05.cam2.h0.2005-05.nc/">fv1.9x2.5_2005_05.cam2.h0.2005-05.nc</a> <a href="http://fv1.9x2.5_2005_05.cam2.h0.2005-06.nc/">fv1.9x2.5_2005_05.cam2.h0.2005-06.nc</a> <a href="http://fv1.9x2.5_2005_05.cam2.h0.2005-07.nc/">fv1.9x2.5_2005_05.cam2.h0.2005-07.nc</a> <a href="http://fv1.9x2.5_2005_05.cam2.h0.2005-08.nc/">fv1.9x2.5_2005_05.cam2.h0.2005-08.nc</a> <a href="http://fv1.9x2.5_2005_05.cam2.h0.2005-09.nc/">fv1.9x2.5_2005_05.cam2.h0.2005-09.nc</a> <a href="http://fv1.9x2.5_2006_05.cam2.h0.2006-05.nc/">fv1.9x2.5_2006_05.cam2.h0.2006-05.nc</a> <a href="http://fv1.9x2.5_2006_05.cam2.h0.2006-06.nc/">fv1.9x2.5_2006_05.cam2.h0.2006-06.nc</a> <a href="http://fv1.9x2.5_2006_05.cam2.h0.2006-07.nc/">fv1.9x2.5_2006_05.cam2.h0.2006-07.nc</a> <a href="http://fv1.9x2.5_2006_05.cam2.h0.2006-08.nc/">fv1.9x2.5_2006_05.cam2.h0.2006-08.nc</a> <a href="http://fv1.9x2.5_2006_05.cam2.h0.2006-09.nc/">fv1.9x2.5_2006_05.cam2.h0.2006-09.nc</a> <a href="http://fv1.9x2.5_2007_05.cam2.h0.2007-05.nc/">fv1.9x2.5_2007_05.cam2.h0.2007-05.nc</a> <a href="http://fv1.9x2.5_2007_05.cam2.h0.2007-06.nc/">fv1.9x2.5_2007_05.cam2.h0.2007-06.nc</a> <a href="http://fv1.9x2.5_2007_05.cam2.h0.2007-07.nc/">fv1.9x2.5_2007_05.cam2.h0.2007-07.nc</a> <a href="http://fv1.9x2.5_2007_05.cam2.h0.2007-08.nc/">fv1.9x2.5_2007_05.cam2.h0.2007-08.nc</a> <a href="http://fv1.9x2.5_2007_05.cam2.h0.2007-09.nc/">fv1.9x2.5_2007_05.cam2.h0.2007-09.nc</a> <a href="http://fv1.9x2.5_2008_05.cam2.h0.2008-05.nc/">fv1.9x2.5_2008_05.cam2.h0.2008-05.nc</a> <a href="http://fv1.9x2.5_2008_05.cam2.h0.2008-06.nc/">fv1.9x2.5_2008_05.cam2.h0.2008-06.nc</a> <a href="http://fv1.9x2.5_2008_05.cam2.h0.2008-07.nc/">fv1.9x2.5_2008_05.cam2.h0.2008-07.nc</a> <a href="http://fv1.9x2.5_2008_05.cam2.h0.2008-08.nc/">fv1.9x2.5_2008_05.cam2.h0.2008-08.nc</a> <a href="http://fv1.9x2.5_2008_05.cam2.h0.2008-09.nc/">fv1.9x2.5_2008_05.cam2.h0.2008-09.nc</a> <a href="http://fv1.9x2.5_2009_05.cam2.h0.2009-05.nc/">fv1.9x2.5_2009_05.cam2.h0.2009-05.nc</a> <a href="http://fv1.9x2.5_2009_05.cam2.h0.2009-06.nc/">fv1.9x2.5_2009_05.cam2.h0.2009-06.nc</a> <a href="http://fv1.9x2.5_2009_05.cam2.h0.2009-07.nc/">fv1.9x2.5_2009_05.cam2.h0.2009-07.nc</a> <a href="http://fv1.9x2.5_2009_05.cam2.h0.2009-08.nc/">fv1.9x2.5_2009_05.cam2.h0.2009-08.nc</a> <a href="http://fv1.9x2.5_2009_05.cam2.h0.2009-09.nc/">fv1.9x2.5_2009_05.cam2.h0.2009-09.nc</a> -v TREFHT,PS,PRECT,V200,U200,V850,U850,Z500 <a href="http://cam4_dsp_may_2000_2009.nc/">cam4_dsp_may_2000_2009.nc</a>" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :nco_openmp_thread_number = 1 ;<br>}<br><br><br>-- <br>Siraj Ul Islam<br><br><br><font></font><br><br>
_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></blockquote></div><br></body></html>