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

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 03 2013 - 10:15:35 MDT

Luis,

We can't debug your script for you without the data files to run it.

The error message is telling you what the problem is:

> fatal:Subscript out of range, error in subscript #0
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 95 in file write_ascii.ncl

Look at line 95 of the file and see how you are subscripting any arrays on that line. You are apparently
using a subscript value that is out-of-range of the array size.

I *think* line 95 is this one:

     P_in = wrf_user_getvar(in, "PSFC", time) ; Extract surface temperature

Perhaps "time" is out of range. "time" is coming from this loop:

    do it = 0,10 ;ntimes-1

If you have 10 time steps on the file, then this loop should be:

    do it = 0,9

Better yet, you should use "ntimes:

    do it = 0,ntimes-1

Remember that NCL does its array subscripting starting at index 0. So, if you have
a 1D array of length 100, you can only use subscript indexes from 0 to 99.

--Mary

On Jun 3, 2013, at 9:10 AM, Luis Fernando Montana Roa wrote:

> Dear NCL users,
>
> When I run the script (attached), I get the following error:
>
> fatal:Subscript out of range, error in subscript #0
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 95 in file write_ascii.ncl
>
> I just wonder how I can fix this, and how can write the same variables for all grid points, all time steps and all levels.
>
> Thanks in advance
> --
> Fernando
> <extract.ncl>_______________________________________________
> 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 Jun 3 10:15:49 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 04 2013 - 09:50:17 MDT