<div dir="ltr">Hi Juris,<div>When using addfiles as opposed to addfile you need to change your read-in syntax a bit. Change this:</div><div>xlat = f->XLAT<br></div><div>to this:</div><div>xlat = f[0]->XLAT</div><div><br></div><div>I'm assuming in the above that the first listed file (files(0)) has XLAT/XLONG in it. </div><div><br></div><div>When you go to read in a variable across files you would do something like this:</div><div>tk = f[:]->TK</div><div><br></div><div>Refer to the addfiles documentation page here for more information:</div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml</a><br></div><div><br></div><div>Hope that helps. If you have further questions please respond to the ncl-talk email list.</div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 2:57 PM, Juris Almonte <span dir="ltr"><<a href="mailto:Juris.Almonte@umanitoba.ca" target="_blank">Juris.Almonte@umanitoba.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hi NCL talk,
<div><br>
</div>
<div>I have several hourly output files with variables such as TK, RH, etc. and one file with the coordinate/constant variables within them (e.g. XLAT, XLONG). I would like to join the constants variables file with the hourly output file.</div>
<div><br>
</div>
<div>I have tried using the addfiles function without success where only one hourly file </div>
<div>
<div style="margin:0px;font-size:11px;font-family:Menlo"><br>
</div>
<div style="margin:0px;font-size:11px;font-family:Menlo">
<div style="margin:0px">ncl 0> files = systemfunc("ls *.nc")</div>
<div style="margin:0px">ncl 1> f = addfiles(files,"r")</div>
<div style="margin:0px">ncl 2> ListSetType (f, "join") </div>
<div style="margin:0px">ncl 3> xlat = f->XLAT</div>
<div style="margin:0px">fatal:(f) not reference to a valid file</div>
<div style="margin:0px">fatal:["Execute.c":8573]:<wbr>Execute: Error occurred at or near line 3</div>
<div style="margin:0px;min-height:13px"><br>
</div>
<div style="margin:0px">ncl 4> printVarSummary(f)</div>
<div style="margin:0px;min-height:13px"><br>
</div>
<div style="margin:0px">Variable: f</div>
<div style="margin:0px">Type: list <join | fifo></div>
<div style="margin:0px">Total items: 2</div>
<div style="margin:0px;min-height:13px"><br>
</div>
<div style="margin:0px">ncl 5> </div>
</div>
</div>
<div><br>
</div>
<div>I know NCO can do this with the use of ncecat, however, I want the data to stay intact as individual hourly files.</div>
<div><br>
</div>
<div>Is there a way to do this in NCL?</div>
<div><br>
</div>
<div>Thanks in advance,</div>
<div><br>
</div>
<div>Juris</div>
<div>M.Sc. Student</div>
<div>University of Manitoba</div>
</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>