[ncl-talk] read ncdf data from ascii

Izidine Pinto izidinep at gmail.com
Thu Feb 2 09:46:55 MST 2017


Dear NCL users

I'm trying to read a bunch of netcdf files from a list using the script
below. However I get the following error

fatal:["FileSupport.c":4159]:(/home/user/Documents/yr/tasmax/tasmax_NCC-NorESM1-M_historical_19510101-20051231.nc)
has no file extension, can't determine type of file to open

It has worked before. Am I missing something obvious?
And I'm using NCAR Command Language Version 6.3.0


















*;***********************************************************************load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"begin;************************************************;
read in netCDF file;************************************************
files = asciiread("/home/files_path.txt",-1,"string")     print(files)
f1 = addfiles(files,"r")end*
The files_path.txt contains the path of the files such as


*/home/user/Documents/yr/tasmax/tasmax_NCC-NorESM1-M_historical_19510101-20051231.nc
/home/user/Documents/yr/tasmax/tasmax_CNRM-CERFACS-CNRM-CM5_historical_19510101-20051231.nc*

Thanks in advance

Izidine Pinto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170202/f8986d81/attachment.html 


More information about the ncl-talk mailing list