SPI calculation

From: Setareh Rahimi <setareh.rahimi_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 29 2013 - 16:14:16 MDT

Dear all,

I run the SPI codes with another data set,but still get errors!!!, below
are the detailes of the data set , the code I have run and the error I got.
Please help me to sort it out.

Kind regards,
______________________________________________________________________________________________________________________________________
[rahimi@localhost seti]$ ncdump -h precip.mon.total.nc
netcdf precip.mon.total {
dimensions:
    lat = 360 ;
    lon = 720 ;
    nbnds = 2 ;
    time = UNLIMITED ; // (1320 currently)
variables:
    float lat(lat) ;
        lat:long_name = "Latitude" ;
        lat:units = "degrees_north" ;
        lat:standard_name = "latitude" ;
        lat:axis = "Y" ;
        lat:coordinate_defines = "center" ;
        lat:actual_range = 89.75f, -89.75f ;
    float lon(lon) ;
        lon:long_name = "Longitude" ;
        lon:units = "degrees_east" ;
        lon:standard_name = "longitude" ;
        lon:actual_range = 0.25f, 359.75f ;
        lon:axis = "X" ;
        lon:coordinate_defines = "center" ;
    double time(time) ;
        time:long_name = "Time" ;
        time:units = "days since 1800-1-1 00:00:00" ;
        time:actual_range = 36889., 77035. ;
        time:delta_t = "0000-01-00 00:00:00" ;
        time:standard_name = "time" ;
        time:axis = "T" ;
        time:coordinate_defines = "start" ;
        time:totalling_period = "0000-01-00 00:00:00" ;
    float precip(time, lat, lon) ;
        precip:add_offset = 0.f ;
        precip:scale_factor = 1.f ;
        precip:missing_value = -9.96921e+36f ;
        precip:units = "mm" ;
        precip:actual_range = 0.f, 4412.31f ;
        precip:dataset = "GPCC Precipitation Full V6 (0.5x0.5)" ;
        precip:var_desc = "Precipitation" ;
        precip:level_desc = "Surface" ;
        precip:statistic = "Total" ;
        precip:parent_stat = "Observations" ;
        precip:long_name = "GPCC Monthly total of precipitation" ;
        precip:valid_range = 0.f, 8000.f ;

// global attributes:
        :history = "Created 07/2012 based on V5 data obtained via ftp" ;
        :title = "GPCC Full Data Reanalysis Version 6 0.5x0.5 Monthly
Means" ;
        :convention = "CF 1.0" ;
        :Documentation = "
http://www.esrl.noaa.gov/psd/data/gridded/data.gpcc.html" ;
        :Original_Source = "
http://www.dwd.de/en/FundE/Klima/KLIS/int/GPCC/GPCC.htm\n",
            " is the webpage and the data is at
ftp://ftp.dwd.de/pub/data/gpcc/download.html" ;
        :Reference = "Users of the data sets are kindly requested to give
feed back and to refer to GPCC publications on this webpage:
http://www.dwd.de/bvbw/appmanager/bvbw/dwdwwwDesktop/?_nfpb=true&_pageLabel=_dwdwww_klima_umwelt_datenzentren_wzn&T12404518261141645246564gsbDocumentPath=Content%2FOeffentlichkeit%2FKU%2FKU4%2FKU42%2Fteaser__product__access.html&_state=maximized&_windowLabel=T12404518261141645246564&lastPageLabel=_dwdwww_klima_umwelt_datenzentren_wzn"
;
        :original_source = "
ftp://ftp-anon.dwd.de/pub/data/gpcc/html/fulldata_download.html" ;
______________________________________________________________________________________________________________________________________
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

   f = addfile("precip.mon.total.nc","r")
   prc = f->precip
   dimp = dimsizes(prc)
   ntim = dimp(0)
   nlat = dimp(1)
   mlon = dimp(2)

   len = (/3, 6, 12, 24, 36, 48 /)
   klen = dimsizes(len)
   spi = new((/klen,ntim,nlat,mlon/) ,float,prc@_FillValue)

   do k=0,klen-1
      spi(k,:,:,:) = dim_spi_n(prc, len(k), False, 0)
   end do

   print(sprintf("%8.2f", prc) \
               +sprintf("%8.2f", spi(0,:,:,:)) \
               +sprintf("%8.2f", spi(1,:,:,:)) \
               +sprintf("%8.2f", spi(2,:,:,:)) \
               +sprintf("%8.2f", spi(3,:,:,:)) \
               +sprintf("%8.2f", spi(4,:,:,:)) \
               +sprintf("%8.2f", spi(5,:,:,:)) )
end
__________________________________________________________________________________________________________
fatal:NclMalloc Failed:[errno=12]
fatal:New: could not create new array:[errno=12]
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 16 in file
spi2.ncl

[rahimi@localhost seti]$
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- 
S.Rahimi

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 29 16:14:28 2013

This archive was generated by hypermail 2.1.8 : Thu Aug 01 2013 - 15:55:03 MDT