[ncl-talk] problem regarding drought Index SPI plot

Izidine Pinto izidinep at gmail.com
Wed May 3 02:13:19 MDT 2017


Hi Saharwardi,

The error is on line 22 and if I'm not mistaken your line 22 might be this
one spi(nr,:) = dim_spi_n(prc, runlen(nr), opt, 0)

Your SPI must be more than 2 dimensions.

See example 2 from here
https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_spi_n.shtml

hope it helps
Izidine


Izidine Pinto





On 3 May 2017 at 07:58, Md. Saquib Saharwardi 1610303 <saquib16 at iiserb.ac.in
> wrote:

> Dear NCL-user,
>                      I am trying to plot SPI (standardized precipitation
> Index) for 30-years data. It is always showing the problem while execution
> of scripts.
>
> please provide me suggestions on that.
>
> I haver attached the script with error below.
>
> fili   = "precip.1981.2010.nc"
>    f      = addfile(fili, "r")
>
>    yyyymm = f->time
>
>    ntim   = dimsizes(yyyymm)
>    if ((ntim%12).ne.0) then
>         print("ntim must be divisable by 12")
>         exit
>    end if
>    print(ntim)
>
>    prc    = f->precip
>    prc at _FillValue = -999.0      ; change from the default
>    pmsg   = prc at _FillValue      ; convenience
>
>    printVarSummary(prc)
>    printMinMax(prc,0)
>
>    runlen = (/ 3, 6, 12, 24, 36, 48 /)
>    nrun   = dimsizes(runlen)
>
>    opt    = False
>   ;opt at spi_type = 3             ; 6.3.0 onward; only if opt=True
>
>    spi = new( (/nrun,ntim/), typeof(prc), pmsg)
>    do nr=0,nrun-1
>       spi(nr,:) = dim_spi_n(prc, runlen(nr), opt, 0)
>    end do
>
> fatal:Dimension sizes on right hand side of assignment do not match
> dimension sizes of left hand side
> fatal:["Execute.c":8573]:Execute: Error occurred at or near line 22
>
>
>
>
> Thankyou in Advance
>
> With regards
> ************************************************************
> *****************
> Md. Saquib Saharwardi
> Research Scholar
> Department of Earth and Environmental Sciences
> Indian Institute of Science Education and Research Bhopal (IISERB)
> Bhopal- 462066, Madhya Pradesh
> Email: saquib16 at iiserb.ac.in
> Mob: +91-7471112404 <+91%2074711%2012404>
> CGMLI (Home Page) <http://home.iiserb.ac.in/%7Ekumarp/index.html>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170503/aecb68ba/attachment.html 


More information about the ncl-talk mailing list