<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=""><font color="#ff2600" class="">Hello All,</font><div class=""><br class=""></div><div class=""><font color="#ff2600" class="">Thanks to Dennis, I am able to appreciate the power of NCL computing SPI. My next step is to produce&nbsp;</font></div><div class=""><font color="#ff2600" class="">&nbsp;(1) a time serious XY plot for seasonal (SPI-3 ending in May and ending in November), annual (SPI-12) and multi annual (SPI-24 and SPI-36 months) and&nbsp;</font></div><div class=""><font color="#ff2600" class="">(2) Shape map of selected annual SPI with extremely sever drought events to examine the spatial characteristics of the drought.</font></div><div class=""><font color="#ff2600" class=""><br class=""></font></div><div class=""><font color="#ff2600" class="">I’m not asking for help before I try by my self (thanks Dennis for the push to do this). However, I need a quick comment how I should proceed from the last step producing the SPI output, which was printing:&nbsp;</font></div><div class=""><br class=""></div><div class=""><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class="">print(yyyymm+sprintf("%8.2f", prc(:,nl,ml)) &nbsp; \&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font></span></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(0,:,nl,ml))+sprintf("%8.2f", spi(1,:,nl,ml)) \ &nbsp;</font></span></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(2,:,nl,ml))+sprintf("%8.2f", spi(3,:,nl,ml)) \&nbsp;</font></span></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(4,:,nl,ml))+sprintf("%8.2f", spi(5,:,nl,ml)) \ &nbsp;</font></span></p><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(6,:,nl,ml)))</font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#0433ff" class=""><br class=""></font></span></div><div class=""><font color="#ff2600" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Do I need to go through this and then start with plot&nbsp;</span>parameters, or I can continue with plot parameters without the print command?</font></div><div class=""><font color="#0433ff" class=""><br class=""></font></div><div class=""><font color="#ff2600" class="">Thank you so much</font></div><div class=""><font color="#ff2600" class="">Dawit</font></div><div class=""><font color="#0433ff" class=""><br class=""></font></div><div class=""><font color="#0433ff" class=""><br class=""></font></div><div class="">&nbsp;&nbsp;</div><div class=""><div><blockquote type="cite" class=""><div class="">On Apr 5, 2017, at 4:43 PM, Dennis Shea &lt;<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">The error mesages is telling you the exact problem:<br class="">&nbsp;&nbsp; <span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">fatal:Plus: Number of dimensions do not match, can't continue</font></span></div><div class=""><br class="">spi has 4-dimensions:<br class="">&nbsp;&nbsp; <span style="font-variant-ligatures:no-common-ligatures" class="">[len | 7] x [time | 1368] x [lat | 4] x [lon | 9]<br class=""><br class=""></span></div><span style="font-variant-ligatures:no-common-ligatures" class="">prc has 3-dimensions<br class="">&nbsp;&nbsp; </span><span style="font-variant-ligatures:no-common-ligatures" class="">[time | 1368] x [lat | 4] x [lon | 9]<br class=""><br class=""></span></div><span style="font-variant-ligatures:no-common-ligatures" class="">yyyymm has 1-dimension<br class="">&nbsp;&nbsp; </span><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures" class="">[time | 1368]<br class=""><br class="">==============<br class=""></span></div><span style="font-variant-ligatures:no-common-ligatures" class="">The print statement you used was copied from:<br class="">&nbsp;&nbsp;&nbsp; <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_spi_n.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_spi_n.shtml</a><br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp;&nbsp;&nbsp; Example 2<br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class="">That was working upon a single time series prc[*]<br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span><font color="#0433ff" class=""></font><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; <br class=""><br class=""></font></span></div><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">You have a 4-D array. *You* must make the appropriate changed to handle your situation.<br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">The eamples are not generic to all dimensions.<br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class=""><br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp; nlat=4<br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp; mlon=9<br class=""><br class=""></font></span></div><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp; do nl=0,nlat-1<br class=""></font></span></div><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do ml=0,mlon-1<br class=""></font></span></div><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print("------------------------------------------------")<br class=""></font></span><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><br class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">print(yyyymm+sprintf("%8.2f", prc(:,nl,ml)) &nbsp; \&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(0,:,nl,ml))+sprintf("%8.2f", spi(1,:,nl,ml)) \ &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(2,:,nl,ml))+sprintf("%8.2f", spi(3,:,nl,ml)) \&nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(4,:,nl,ml))+sprintf("%8.2f", spi(5,:,nl,ml)) \ &nbsp;</font></span></div>
<span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(6,:,nl,ml)))<br class=""><br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp;&nbsp;&nbsp; end do<br class=""></font></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; en do<br class=""></font></span></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 5, 2017 at 2:20 AM, Dawit Abebe <span dir="ltr" class="">&lt;<a href="mailto:dawit.kan@gmail.com" target="_blank" class="">dawit.kan@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Hello all,</span></div><div class=""><br class=""></div><div class="">Kindly help me to fix my problem with printing SPI. I pasted below first the return of printVarSummary(spi), which seems okay. However, my attempt to print &nbsp;the output (text in blue) did not work.&nbsp; What was wrong?</div><div class=""><br class=""></div><div class="">Greatly appreciate your help.</div><div class=""><br class=""></div><div class="">Dawit</div><div class=""><br class=""></div><div class="">…………………………………….</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">copy_VarCoords(prc,spi(0,:,:,:<wbr class="">))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">spi@long_name = "SPI"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">spi!0 &nbsp; &nbsp; &nbsp; &nbsp; = "len"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">spi&amp;len &nbsp; &nbsp; &nbsp; =&nbsp; len</span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">



</p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">printVarSummary(spi)</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Variable: spi</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Type: double</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Total Size: 2757888 bytes</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 344736 values</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Number of Dimensions: 4</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Dimensions and sizes:<span class="m_-3429062055612373153Apple-tab-span" style="white-space:pre-wrap">        </span>[len | 7] x [time | 1368] x [lat | 4] x [lon | 9]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Coordinates:&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; len: [1..36]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time: [ 380..41987]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lat: [3.75..5.25]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lon: [36.75..40.75]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Number Of Attributes: 2</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; long_name :<span class="m_-3429062055612373153Apple-tab-span" style="white-space:pre-wrap">        </span>SPI</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; _FillValue :<span class="m_-3429062055612373153Apple-tab-span" style="white-space:pre-wrap">        </span>-999</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">yyyymm = cd_calendar(f-&gt;time, -1)&nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class=""><br class=""></font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">print(yyyymm+sprintf("%8.2f", prc) &nbsp; \&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(0,:))+sprintf("%8.2f", spi(1,:)) \ &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(2,:))+sprintf("%8.2f", spi(3,:)) \&nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(4,:))+sprintf("%8.2f", spi(5,:)) \ &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+sprintf("%8.2f", spi(6,:))) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">fatal:Plus: Number of dimensions do not match, can't continue</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><font color="#0433ff" class="">fatal:["Execute.c":8638]:<wbr class="">Execute: Error occurred at or near line 37</font></span></div><div class=""><br class=""></div></div><div class=""><br class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>