<div dir="ltr"><div><div><div>Kyle,<br><br></div>Thanks. I tried with your option :<br>fname = systemfunc("ls -1 ../../MODIS/Monthly/AOD/*.nc")<br> m = addfiles(fname,"r")<br> ListSetType (m, "join")<br><br> print(m)<br></div>and it printed out all the 144 file names. I have attached a text file of the output. But still shows, it cannot read that variable. <br><br></div>Debasish<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 25, 2015 at 1:38 PM, Kyle Griffin <span dir="ltr"><<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</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">Have you considered the input to addfiles? You appear to be passing the filesize value (column 5 when you run ls -l (lower case L) in your directory) to the NCL function. I can't imagine this is intended, as addfiles is looking for the file name itself - but fname ends up as the size, not the name. Even if you were getting them as names, you then run toint(fname), which should fail if you were actually getting the names as strings.<div><br></div><div>Try using 'ls -1 filenames*.nc' (the number one) and this should print out all of your files in that directory with one name on each line, a format that addfiles will read from quite well and you can avoid your use of awk. Your current method could also work, but would require pulling a later column in the awk command (perhaps 9?).</div><div><br></div><div>Consider what you actually want your 'print(fsz)' statement to output...you do well by looking at it, but that output is showing you the problem of trying to read the variable from a bunch of numbers and not files.</div><div><br></div><div><br></div><div>Kyle</div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1407</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On Wed, Nov 25, 2015 at 12:28 PM, Debasish Hazra <span dir="ltr"><<a href="mailto:debasish.hazra5@gmail.com" target="_blank">debasish.hazra5@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hi,<br><br></div> I am trying to read bunch of files in ncl and at first it gave " ncl fatal:incorrect size for list filevar subselection" error. Followed by ncl examples I tried something like this : <br><br> fname = systemfunc("ls -l ../../MODIS/Monthly/AOD/*.nc | awk '{print $5}' ")<br> fsz = toint(fname)<br> m = addfiles(fsz,"r")<br> ListSetType (m, "join")<br><br> print(fsz)<br> printVarSummary(fsz)<br><br> mod_aod = m[:]->MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean<br><br></div>which print outs and gave error as :<br><br> Variable: fsz<br>Type: integer<br>Total Size: 576 bytes<br> 144 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [144]<br>Coordinates:<br>(0) 264160<br>(1) 263836<br>(2) 263836<br>(3) 263836<br>(4) 263836<br>(5) 263836<br>(6) 263836<br>(7) 263836<br>(8) 263836<br>(9) 263836<br></div>[SNIP]<br>(133) 522664<br>(134) 522664<br>(135) 522664<br>(136) 522664<br>(137) 522664<br>(138) 522668<br>(139) 522668<br>(140) 522668<br>(141) 522668<br>(142) 522664<br>(143) 522664<br><div><br>fatal:No valid instance of variable MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean found in file list<br><br></div><div>However, ncl_filedump of this files show : <a href="http://g4.subsetted.MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean.20130701.180W_90S_180E_90N.nc" target="_blank">g4.subsetted.MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean.20130701.180W_90S_180E_90N.nc</a><br></div><div><div><br></div><div>shows <br>title : MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean (180W_90S_180E_90N)<br> dimensions:<br> time = 1 // unlimited<br> lat = 180<br> lon = 360<br> variables:<br> float MYD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean ( time, lat, lon )<br><br></div><div>Any help why this one is not working. Thanks.<br><br></div><div>Attached is the one of the many identical files I was trying to work on. <br></div><span><font color="#888888"><div><br></div><div>Debasish.<br></div><div><br></div></font></span></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>