<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Izidine,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First we have to break down this problem to make sure the files are valid. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The error message is admittedly confusing, because you clearly have a ".nc" extension. BUT, it could be that the file is not named what you think.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What happens if you type the following from the UNIX command line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">ls <span style="font-size:12.8px">/home/user/Documents/yr/<wbr>tasmax/tasmax_NCC-NorESM1-M_<wbr>historical_19510101-20051231.<wbr>nc</span></font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="font-size:12.8px">ls </span><span style="font-size:12.8px">/home/user/Documents/yr/<wbr>tasmax/tasmax_CNRM-CERFACS-<wbr>CNRM-CM5_historical_19510101-<wbr><a href="http://20051231.nc">20051231.nc</a></span></font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="font-size:12.8px">ncl_filedump </span><span style="font-size:12.8px">/home/user/Documents/yr/<wbr>tasmax/tasmax_NCC-NorESM1-M_<wbr>historical_19510101-20051231.<wbr>nc <br>ncl_filedump </span><span style="font-size:12.8px">/home/user/Documents/yr/<wbr>tasmax/tasmax_CNRM-CERFACS-<wbr>CNRM-CM5_historical_19510101-<wbr><a href="http://20051231.nc">20051231.nc</a></span></font></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">If the above doesn't produce any errors, then try this in your script:</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="font-size:12.8px"> files = asciiread("/home/files_path.<wbr>txt",-1,"string") <br> print(files)<br> f0 = addfile(files(0),"r")</span><span style="font-size:12.8px"><br></span></font></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><span style="font-size:12.8px"> f1 = addfile(files(1),"r")<br></span><span style="font-size:12.8px"> print(f0) ; this is like doing an "ncl_filedump" on the file</span></font></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><font face="monospace, monospace"> print(f1)</font></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I'm thinking that addfiles could be struggling to read them as a set of files, so I like to try addfile on them individually to be sure they can at least be opened by NCL. Of course, if the ncl_filedump works on both files, then addfile should work on both files.</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">--Mary</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><i style="font-size:12.8px"><br></i></div><div class="gmail_default" style="font-size:small"><i style="font-size:12.8px"><br></i></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 2, 2017 at 9:46 AM, Izidine Pinto <span dir="ltr"><<a href="mailto:izidinep@gmail.com" target="_blank">izidinep@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear NCL users<br><br>I'm trying to read a bunch of netcdf files from a list using the script below. However I get the following error<br><br>fatal:["FileSupport.c":4159]:(<wbr>/home/user/Documents/yr/<wbr>tasmax/tasmax_NCC-NorESM1-M_<wbr>historical_19510101-20051231.<wbr>nc) has no file extension, can't determine type of file to open<br><br>It has worked before. Am I missing something obvious? <br>And I'm using NCAR Command Language Version 6.3.0<br> <br><br><i>;*****************************<wbr>******************************<wbr>************<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"<br><br>begin<br><br>;*****************************<wbr>*******************<br>; read in netCDF file<br>;*****************************<wbr>*******************<br> files = asciiread("/home/files_path.<wbr>txt",-1,"string") <br> print(files)<br> f1 = addfiles(files,"r")<br><br>end<br></i><br>The files_path.txt contains the path of the files such as <br><i><br>/home/user/Documents/yr/<wbr>tasmax/tasmax_NCC-NorESM1-M_<wbr>historical_19510101-20051231.<wbr>nc <br>/home/user/Documents/yr/<wbr>tasmax/tasmax_CNRM-CERFACS-<wbr>CNRM-CM5_historical_19510101-<wbr><a href="http://20051231.nc">20051231.nc</a></i><br><br></div>Thanks in advance <br><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div><div class="m_3662521218942304994gmail_signature"><div dir="ltr"><div>Izidine Pinto<br><br><br><br><br></div></div></div></div>
</div></font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>