[ncl-talk] reading consecutive ascii files in do loop

David Adams dave.k.adams at gmail.com
Tue Jun 12 12:51:20 MDT 2018


Hi all,
I am using the skew T plot routine. I try to open each ascii file and plot
it as a pdf. My file list contains the file name and number of lines (i.e.,
pressure levels) in the sounding files.
filename       nlvl
7_11_00.dat  129
7_11_12.dat  122
7_12_00.dat  148
 etc...
I read and open the files this way
-------------------------------------------------------------------------
 filename ="Sounding_file_list.txt"
   data = asciiread(filename,-1,"string")
    input  = str_get_cols(data,0,10)
    nlvl = stringtofloat(str_get_cols(data,13,15))
    ncol =11

  do i = 0,47
      fsl_data = asciiread(input(i),(/nlvl(i),ncol/), "float")
etc...
But I get the following error.

fatal:asciiread: The input dimension sizes must be byte, short, integer or
long  fatal:["Execute.c":8575]:Execute: Error occurred at or near line 27
in file test.ncl

Here is the print out of the variable filenames
---------------------------------------------
Variable: input
Type: string
Total Size: 384 bytes
            48 values
Number of Dimensions: 1
Dimensions and sizes:    [48]
Coordinates:

I am sure this is a simple error, but I am brain dead at this point.
thanks in advance,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180612/26dbcdd7/attachment.html>


More information about the ncl-talk mailing list