Re: subscript out of range error!!

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 23 2012 - 14:42:26 MDT

Hi Marzie,

Something had to have changed from the time you last ran this script.
Are you using a different data file? Did NCL get upgraded since you
last ran it?

I can't tell from your script below exactly which line is line #29,
because line 29 appears to be this one:

printVarSummary(DUST_1)

Which doesn't make sense, given the error message.
The error message is telling you that some array is
being subscripted with an out-of-range index.

Which line is line #29? You should be able to figure out the
source of your error by doing a "printVarSummary" on
some of your variables before you reach line 29.

>From the printVarSummary output, double-check that
you are subscripting your arrays properly.

--Mary

On Jul 23, 2012, at 1:48 PM, marziyeh dadizadeh wrote:

> Dear NCL users,
>
> I have a script that worked with it and it was true, without any problem.
> now I,m trying run it again, didn't change any thing but I am not understanding why get this error:
>
> fatal:Subscript out of range, error in subscript #1
> fatal:Execute: Error occurred at or near line 29 in file pmm.ncl
>
> Can anyone suggests a way to solve this problem?
>
> thanks in advance,
> Marzie
>
>
>
> here is the script:
> ---------------------------------------------------------
> 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/wrf/WRFUserARW.ncl"
>
> begin
>
> a = addfile("wrfout_d01_2010-05-18_00_00_00.nc","r")
>
>
>
> times = wrf_user_getvar(a,"times",-1)
> ntimes = dimsizes(times)
> do it = 0,ntimes-1,1 ; TIME LOOP
>
> DUST_1 = wrf_user_getvar(a,"DUST_1",it)
> DUST_2 = wrf_user_getvar(a,"DUST_2",it)
> DUST_3 = wrf_user_getvar(a,"DUST_3",it)
> DUST_4 = wrf_user_getvar(a,"DUST_4",it)
> DUST_5 = wrf_user_getvar(a,"DUST_5",it)
>
> DUST = DUST_1
> DUST = 0
> DUST = ((DUST_1)+(DUST_2)+(DUST_3)+(DUST_4)+(DUST_5))
> dust_total = DUST(0,:,:)
>
> dust_total!0 = "lat"
> dust_total!1 = "lon"
>
> printVarSummary(DUST_1)
> printVarSummary(DUST)
> printVarSummary(dust_total)
>
>
> data= asciiread("lat&lon-M.csv",(/20/),"float")
>
> output = new((/10/),float)
> output!0 = "Dust"
>
> do i = 0,19,2
> loc = wrf_user_ll_to_ij(a, data(i),data(i+1), 0)
> output(i/2) = dust_total(loc(0)-1,loc(1)-1)
>
> end do
>
> printVarSummary(output)
> asciiwrite("dust.txt",output)
>
> end do
>
> end
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 23 14:42:35 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2012 - 09:48:26 MDT