[ncl-talk] Number of files that can be read in NCL

Dennis Shea shea at ucar.edu
Fri Oct 14 11:59:55 MDT 2016


The error message tell you that the error occurs at line 138

133   do i=0,numfiles-1
134         data := asciiread(files(i),-1,"string")
135         delim := ","
136         lat := stringtofloat(str_get_field(data,2, delim))    ;
latitude values
137         lon := stringtofloat(str_get_field(data,3, delim))    ;
longitude values
138         plot(i) = gsn_add_polyline(wks, map, lon, lat, gres)
139   end do

At line 102, you have

102   plot = new(4,graphic)

Well, if  'numfiles' > 4, you are out of bounds  !!!

That should be:

plot = new(numfiles,graphic)


On Fri, Oct 14, 2016 at 11:49 AM, Black, Forrest (LARC-D318)[UNIVERSITIES
SPACE RESEARCH ASSOCIATION] <forrest.black at nasa.gov> wrote:

> Hello all,
>
>
>
> I have a script where I am reading csv files. If I try to read more than 4
> files, I get the error:
>
>
>
> fatal:Subscript out of range, error in subscript #0
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 138 in
> file traject1f.ncl
>
>
>
> If I read 4 files or less it works fine. Does anyone know how to read more
> than 4 files?
>
> I am using version 6.3.0.
>
>
>
> Thanks,
>
>
>
> Forrest
>
> _______________________________________________
> 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/20161014/5f533bd4/attachment.html 


More information about the ncl-talk mailing list