Re: subscript out of range error!!

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 23 2012 - 14:45:21 MDT

Hi,

Your script must have been reformatted somehow in email transit, because as far as I can tell, line 29 corresponds to the line "printVarSummary(DUST_1)"; the error message does't make sense for that line or any others nearby.

Nonetheless, the error message is telling you exactly what the problem is -- an attempt to access some array outside of its bounds. You might try putting in a few print statements and make sure the arrays' dimensions are what you think they should be. In particular, I wonder if wrf_user_ll_to_ij() might be generating indices outside the range of dust_total ?

Hope that helps…
Rick

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

> 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
Received on Mon Jul 23 14:45:30 2012

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