Hello,
I followed the two examples to read my ASCII file (float; 2 dimension, lat and lon; but don't know how many rows and columns; file name is "carbonbio.txt"). However, it showed "command not found" when I run either of the below script files.
Please help me to check what is the problem with scripts.
Thank you for your time!
Lifen
File1:
latlon2d = asciiread("carbonbio.txt",(/2,nlat,nlon/),"float") ;
lat2d = latlon2d(0,:,:) ;
lon2d = latlon2d(1,:,:) ;
printVarSummary(latlon2d) ; Print information about file only.
print(latlon2d) ; Print data, one value per line
File2:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
filename = "carbonbio.txt"
; Calculate the number of columns.
ncols = numAsciiCol(filename)
; Given the # of columns, we can use readAsciiTable to read this file.
data = readAsciiTable(filename,ncols,"float",0)
nrows = dimsizes(data(:,0)) ; calculate # of rows
print("'" + filename + "' has " + nrows + " rows and " + ncols + \
" columns of data.")
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 15 13:48:59 2013
This archive was generated by hypermail 2.1.8 : Sat Jan 19 2013 - 10:23:16 MST