[ncl-talk] Import Error with Observational Data

Rick Brownrigg brownrig at ucar.edu
Tue Jun 18 20:30:33 MDT 2019


Hi Zach,

Looks like a couple of things going on:

i) There's this line in the docs for str_fields_count():

" If one or more delimiters appear side-by-side in a string, then they are
treated as if they were just one delimiter."

So based of the 2nd line in the file (strs(1)), it return nfields as 10,
rather than what I might have expected as 14.

ii) These two lines:
   strend= ind(strs.eq.",,,,,,")
   iLast = strend(0)

apparently there are no lines in the file with 6 consecutive commas, and
"strend" comes back with one element, the _FillValue, which in this case is
a really large negative number, and so "iLast" is then an invalid index.

Hope that helps...
Rick


On Tue, Jun 18, 2019 at 7:47 PM Zach Rieck via ncl-talk <ncl-talk at ucar.edu>
wrote:

> To Whom it May Concern-
>
> I'm running into an issue when I try importing this CSV file. The error
> I'm getting is a "subscript out of range" exec error on the line where
> first begin importing my data column by column, starting with the year.
>
> I also get an error saying it cannot read my variable "strs" which is tied
> to my ascii import function. I've looked at it and I'm not sure why it's
> giving an error. The number of columns are well within the index I'm using
> and I'm using the right import function.
>
> I've attached my code and data file for reference. Please let me know if
> there's anything I'm doing wrong or if there's a correction I can make.
>
> Thanks in advance for the help!
>
> Respectfully,
>
>  Cedar_Creek_Radiometer.csv
> <https://drive.google.com/file/d/1Wnl1Zte-PSKbr5MkINMQXF_w7EHmXxv3/view?usp=drive_web>
>
> -Zach Rieck
> zrr817 at gmail.com
> (513)-502-5652
> _______________________________________________
> 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/20190618/da058980/attachment.html>


More information about the ncl-talk mailing list