<div dir="ltr"><div><div><div><div><div>Hi Rajasivaranjan,<br></div>I just pasted your script into a window here and used my own precipitation dataset and I get no errors whatsoever with NCL v6.2.1 or v6.3.0, so I am not sure what the problem is. <br><br></div>With regards to writing out netCDF files, there is an applications page devoted to examples of outputting .nc files. Go to the Examples page:<br><a href="http://www.ncl.ucar.edu/Applications/">http://www.ncl.ucar.edu/Applications/</a><br><br></div>and on the lower right hand side of the page there is a link entitled &quot;Output netCDF&quot;. You will likely want to use method #1, as the inefficient method is sufficient for most applications. <br><br></div>Hope that helps. If you have further questions please respond to the ncl-talk email list.<br></div>Adam<br><div><div><br><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 21, 2015 at 9:57 AM, Raja Sivaranjan <span dir="ltr">&lt;<a href="mailto:rajasivaranjan92@gmail.com" target="_blank">rajasivaranjan92@gmail.com</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><div><div><div><div>Dear all,<br><br></div>i&#39;m trying to calculate spi for aphrodite from 1951 to 2007 using dim_spi_n function. I&#39;m not successfull, below is the code and error:<br><span style="background-color:rgb(255,255,0)"><br><b><span style="background-color:rgb(204,204,204)">f      = addfile(&quot;/home/ponraj/Desktop/<a href="http://aphrodite_mon.nc" target="_blank">aphrodite_mon.nc</a>&quot;,&quot;r&quot;)<br>prc    = f-&gt;precip                    <br>printVarSummary(prc)<br><br>dimp   = dimsizes(prc)              ; # monthly precipitation values<br>ntim   = dimp(0)<br>nlat   = dimp(1)<br>mlon   = dimp(2)<br><br>len    = (/3, 6, 12/)<br>klen   =  dimsizes(len)<br>spi    =  new((/klen,ntim,nlat,mlon/) ,float,prc@_FillValue<br>opt    = False<br><br>do k=0,klen-1<br>   spi(k,:,:,:) = dim_spi_n(prc, len(k), opt, 0)<br>end do</span></b></span><br><b><br></b></div><b>error:<br><br><span style="background-color:rgb(204,204,204)">fatal:Undefined identifier: (spi) is undefined, can&#39;t continue<br>fatal:[&quot;Execute.c&quot;:8126]:Execute: Error occurred at or near line 33</span><br></b><br></div><span style="background-color:rgb(255,255,255)"><span>And also i want to save this spi array in netcdf file. i&#39;m not familiar with netcdf file writing in ncl. i kindly request you to </span></span>sort out the above problem.<br><br></div>Thanks in advance<br></div>Rajasivaranjan<br><div><br></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>