;------ Data dirasc = "./" filasc = systemfunc("cd "+dirasc+" ; ls 2015*.txt") pthasc = dirasc+filasc nfil = dimsizes(filasc) print("filasc="+filasc) print("pthasc="+pthasc) print("nfil="+nfil) ;------- Read multiple files do j = 0,0 ; nfil-1 ;----- Read the values in as 1D array of strings datas := asciiread(pthasc(j),-1,"string") nline = dimsizes(datas) print("nline="+nline) ; NCL code is confusing the - delimeter with a minus sign ; Change delimeter embedded with yyyy-mm-dd to yyyy mm dd ; There may be better ways but (1) converting string to character ; (2) converting - character to : character ; (3) change : character to : string datac := tochar(datas) ; (nline,:) datac(:,4) = tochar(":") ; - to : datac(:,7) = tochar(":") ; - to : ;;datac(:,10) = tochar(":") ; space to : datas = tostring(datac) ; overwrite original delim = " :;" ; space is a delimiter nfld = str_fields_count(datas(0), delim) ; look at 1st line only print("nfld="+nfld) yyyy := toint(str_get_field(datas, 1, delim) ) mm := toint(str_get_field(datas, 2, delim) ) dd := toint(str_get_field(datas, 3, delim) ) hh := toint(str_get_field(datas, 4, delim) ) mn := toint(str_get_field(datas, 5, delim) ) sc := toint(str_get_field(datas, 6, delim) ) tunits = "hours since 2015-01-01 00:00:00" ; "seconds/hours/days since ...." time := cd_inv_calendar(yyyy,mm,dd,hh,mn,sc,tunits, 0) time!0 = "time" ntimes = dimsizes(time) printVarSummary(time) LAT := todouble( str_get_field(datas, 8, delim) ) ; fields count starts at 1 LON := todouble( str_get_field(datas, 9, delim) ) VAL := todouble( str_get_field(datas,10, delim) ) if (isMonotonic(time).eq.0) then print("") print("***************> time is not monotonic <*************") print("") idup = ind(time(0:ntimes-2).eq.time(1:ntimes-1)) print(idup) print("") print("time="+time+" yyyy="+yyyy+" mm="+mm+" dd="+dd+" hh="+hh \ +" mn="+mn+" sc="+sc+" LAT="+LAT+" LON="+LON+" VAL="+VAL) print("") exit end if end do