<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Sorry. Change the following lines;</div><div class=""><br class=""></div><div class="">;===</div><div class="">&nbsp; &nbsp; &nbsp;dust_tot=(/dustJ1,dustJ2,dustJ3,dustJ4,dustJ5/)</div><div class="">to</div><div class="">&nbsp; &nbsp; &nbsp;dust_tot=dim_sum_n((/dustJ1,dustJ2,dustJ3,dustJ4,dustJ5/),0)</div><div class=""><br class=""></div><div class="">and</div><div class="">&nbsp; &nbsp; dustnew = dim_avg_n(dust_tot, (/0,1,2/))</div><div class="">to</div><div class="">&nbsp; &nbsp; dustnew = dim_avg_n(dust_tot, (/0,1/))</div><div class="">;===</div><div class=""><br class=""></div><div class="">Jack</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On 19 Nov 2015, at 19:04, Jack Ogaja &lt;<a href="mailto:jack.ogaja@gmail.com" class="">jack.ogaja@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Dear Ioannis,</div><div class=""><br class=""></div>I think sometimes it is better if you just show the error message instead of asking people to download the data. For example your script simply generates the following error;<br class=""><div class=""><div class="">;=====</div><div class="">fatal:Number of subscripts do not match number of dimensions of variable,(2) Subscripts used, (1) Subscripts expected</div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 77 in file readwrite_dust_all_2.ncl</div><div class="">;=====</div><div class="">which should be a clear message and indicating where the error occurs.</div><div class=""><br class=""></div><div class="">Anyway, since you are only interested in the numbers, I think you would understandably do away with the outer loop and try something like;</div><div class=""><br class=""></div><div class="">;=====</div><div class="">&nbsp; &nbsp; &nbsp;aJ = addfile(FILES(0)+".nc","r")</div><div class="">&nbsp; &nbsp; &nbsp;bJ = addfile(FILES(1)+".nc","r")</div><div class="">&nbsp; &nbsp; &nbsp;…</div><div class="">&nbsp; &nbsp; &nbsp;dustJ1 &nbsp;= (/wrf_user_getvar(aJ,"DUST_1",it), wrf_user_getvar(bJ,"DUST_1",it)/)</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">&nbsp; &nbsp; &nbsp;dustJ5 &nbsp;= …</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp;dustnew = dim_avg_n(dust_tot, (/0,1,2/))&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">&nbsp; &nbsp; &nbsp;.</div><div class="">;=====</div><div class=""><br class=""></div><div class="">See the attached script with such lines(modified from your original script).</div><div class=""><br class=""></div><div class="">Jack</div><div class=""><br class=""></div><div class=""></div></div></div><span id="cid:86B08163-DFCA-4A50-9652-FF00B72C8773">&lt;readwrite_dust_all_2_Jack20151119.ncl&gt;</span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div class=""><div class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On 19 Nov 2015, at 16:04, Ioannis Koletsis &lt;<a href="mailto:koletsis@meteo.noa.gr" class="">koletsis@meteo.noa.gr</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="Section1" style="page: Section1; font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Dear all,<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">I would like to write down the average value of a variable for each lat, lon point from a number of wrfoutput files….<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">The input files are the wrfoutput files which you can find here<span class="Apple-converted-space">&nbsp;</span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">(<a href="https://www.dropbox.com/s/kgogk9jcn0m65e8/wrfout_d01_2015-09-12_12%253A00%253A00?dl=0" style="color: purple; text-decoration: underline;" class="">https://www.dropbox.com/s/kgogk9jcn0m65e8/wrfout_d01_2015-09-12_12%253A00%253A00?dl=0</a><span class="Apple-converted-space">&nbsp;</span>,<span class="Apple-converted-space">&nbsp;</span><a href="https://www.dropbox.com/s/u8d0wkr2i2u7ydc/wrfout_d01_2015-09-12_15%253A00%253A00?dl=0" style="color: purple; text-decoration: underline;" class="">https://www.dropbox.com/s/u8d0wkr2i2u7ydc/wrfout_d01_2015-09-12_15%253A00%253A00?dl=0</a><span class="Apple-converted-space">&nbsp;</span>)<span class="Apple-converted-space">&nbsp;</span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">and the variable that I want to calculate the average value from the input files is the dust_tot…<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Have you got any idea what is going wrong with my script?<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Any help would be appreciated …<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Best Regards<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Ioannis<span class="Apple-converted-space">&nbsp;</span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white;" class=""><span lang="EN-US" style="font-family: 'Book Antiqua', serif;" class="">Dr. Ioannis Koletsis</span><span lang="EN-US" style="font-family: Helvetica, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white;" class=""><span lang="DE" style="font-family: 'Book Antiqua', serif;" class="">National Observatory of Athens<br class="">Institute for Environmental Research<br class="">Lofos Koufou<br class="">15236-Penteli<br class="">Athens-Greece</span><span lang="DE" style="font-family: 'Book Antiqua', serif; color: rgb(31, 73, 125);" class=""><br class="">Tel:<span class="Apple-converted-space">&nbsp;</span></span><span lang="EN-US" style="font-family: 'Book Antiqua', serif; color: rgb(31, 73, 125);" class="">+</span><span lang="DE" style="font-family: 'Book Antiqua', serif; color: rgb(31, 73, 125);" class="">30 2108109134<br class="">e-mail:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:koletsis@meteo.noa.gr" style="color: purple; text-decoration: underline;" class=""><span style="color: blue;" class="">koletsis@meteo.noa.gr</span></a></span><span lang="EN-US" style="font-family: Helvetica, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white;" class=""><span lang="DE" style="font-family: 'Book Antiqua', serif; color: rgb(31, 73, 125);" class="">----------------------------------------------------------------------------------------<br class="">Weather forecasts:<span class="Apple-converted-space">&nbsp;</span><a href="http://www.noa.gr/forecast" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: blue;" class="">http://www.noa.gr/forecast</span></a><span class="Apple-converted-space">&nbsp;</span>(in english)<br class="">or<span class="Apple-converted-space">&nbsp;</span><a href="http://www.meteo.gr/" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: blue;" class="">http://www.meteo.gr</span></a><span class="Apple-converted-space">&nbsp;</span>(in greek)<br class="">Weather forecasts for Europe:<span class="Apple-converted-space">&nbsp;</span><a href="http://www.eurometeo.gr/" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: blue;" class="">http://www.eurometeo.gr</span></a><span class="Apple-converted-space">&nbsp;</span>(in english)</span><span lang="EN-US" style="font-family: Helvetica, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white;" class=""><span lang="DE" style="font-family: 'Book Antiqua', serif; color: rgb(31, 73, 125);" class="">----------------------------------------------------------------------------------------</span><span style="font-family: Helvetica, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div></div><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><hr style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; border: none; color: rgb(144, 144, 144); background-color: rgb(176, 176, 176); height: 1px; width: 490.046875px;" class=""><table style="font-family: Helvetica; letter-spacing: normal; orphans: auto; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-collapse: collapse; border: none;" class=""><tbody class=""><tr class=""><td style="border: none; padding: 0px 15px 0px 8px;" class=""><a href="https://www.avast.com/antivirus" style="color: purple; text-decoration: underline;" class=""><img border="0" src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" class=""></a></td><td class=""><p style="color: rgb(61, 77, 90); font-family: Calibri, Verdana, Arial, Helvetica; font-size: 12pt;" class="">Αυτό το e-mail ελέγχθηκε για ιούς από το πρόγραμμα Avast antivirus.<span class="Apple-converted-space">&nbsp;</span><br class=""><a href="https://www.avast.com/antivirus" style="color: purple; text-decoration: underline;" class="">www.avast.com</a></p></td></tr></tbody></table><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div></div></div><span id="cid:1CCDA82C-86B1-4595-91CC-1D86520E102A">&lt;readwrite_dust_all_2.ncl&gt;</span><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ncl-talk mailing list</span><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:ncl-talk@ucar.edu" style="color: purple; text-decoration: underline; font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">ncl-talk@ucar.edu</a><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">List instructions, subscriber options, unsubscribe:</span><br style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="color: purple; text-decoration: underline; font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>