[ncl-talk] problem in SPI code
Adam Phillips
asphilli at ucar.edu
Tue Jul 21 11:02:34 MDT 2015
Hi Rajasivaranjan,
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.
With regards to writing out netCDF files, there is an applications page
devoted to examples of outputting .nc files. Go to the Examples page:
http://www.ncl.ucar.edu/Applications/
and on the lower right hand side of the page there is a link entitled
"Output netCDF". You will likely want to use method #1, as the inefficient
method is sufficient for most applications.
Hope that helps. If you have further questions please respond to the
ncl-talk email list.
Adam
On Tue, Jul 21, 2015 at 9:57 AM, Raja Sivaranjan <rajasivaranjan92 at gmail.com
> wrote:
> 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
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150721/4272fec2/attachment.html
More information about the ncl-talk
mailing list