Re: NCL runtime error: Subscript out of range, error in subscript #0

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 12 2011 - 20:50:53 MDT

Hi Ilze,

The problem is that your WRF output file only has one timestep on it.
You read in "times" with:

   times = wrf_user_list_times(a) ; get times in the file
   ntimes = dimsizes(times) ; number of times in the file

If you print "ntimes", you will see that it is equal to 1.

Later, you have a "do" loop that is trying to access index 2 of the
times array:

   do it = 2,ntimes-1,2
. . .
     res@TimeLabel = times(it)

This is where the error is coming from.

--Mary

On Sep 12, 2011, at 1:51 PM, ilze jansen van rensburg wrote:

> Good day.
>
> When I run the ncl script 2dhill.ncl that I have obtained from the
> WRF (its for the WRF two dimensional idealized hill case) users
> site, I get the following error messages:
>
> Variable: times
> Type: string
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> description : times in file
> _FillValue : missing
> (0) 0001-01-01_00:00:00
> fatal:Subscript out of range, error in subscript #0
> fatal:An error occurred reading times
> fatal:Execute: Error occurred at or near line 52 in file 2dhill.ncl
>
> I am not sure why this happens. I have a feeling that thare may be
> something wrong with my NETcdf file, as I changed the topography
> from the default topography of the model, but WRF ran sucessfully
> without any error messages (although, changing the topography should
> not alter the times). I attach my ncl script and my netcdf file to
> this email for your information.
>
> An help in this regard will be reatly appreciated.
>
> Kind regards
> Ilze
> <
> 2dhill
> .ncl
> >
> <
> wrfout_d01_0001
> -01-01_00:00:00>_______________________________________________
> 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 Sep 12 20:51:02 2011

This archive was generated by hypermail 2.1.8 : Fri Sep 16 2011 - 11:24:25 MDT