[ncl-talk] problem in SPI code

Raja Sivaranjan rajasivaranjan92 at gmail.com
Tue Jul 21 09:57:53 MDT 2015


Dear all,

i'm trying to calculate spi for aphrodite from 1951 to 2007 using dim_spi_n
function. I'm not successfull, below is the code and error:

















*f      = addfile("/home/ponraj/Desktop/aphrodite_mon.nc
<http://aphrodite_mon.nc>","r")prc    = f->precip
printVarSummary(prc)dimp   = dimsizes(prc)              ; # monthly
precipitation valuesntim   = dimp(0)nlat   = dimp(1)mlon   = dimp(2)len
= (/3, 6, 12/)klen   =  dimsizes(len)spi    =  new((/klen,ntim,nlat,mlon/)
,float,prc at _FillValueopt    = Falsedo k=0,klen-1   spi(k,:,:,:) =
dim_spi_n(prc, len(k), opt, 0)end do*





*error:fatal:Undefined identifier: (spi) is undefined, can't
continuefatal:["Execute.c":8126]:Execute: Error occurred at or near line 33*
And also i want to save this spi array in netcdf file. i'm not familiar
with netcdf file writing in ncl. i kindly request you to sort out the above
problem.

Thanks in advance
Rajasivaranjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150721/5b0b3ca1/attachment.html 


More information about the ncl-talk mailing list