<div dir="auto">If one write the following line what does it mean?<div dir="auto"><br></div><div dir="auto">Fn=(/"day1.dat","day2.dat","day3.dat","day4.dat"/)</div><div dir="auto"><br></div><div dir="auto">The above line is not mean that all dat file names are concatenate in variable Fn?</div><div dir="auto">I required the same thing for 100 files but without manually putting the file name.</div><div dir="auto"><br></div><div dir="auto">That was the question.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Arka</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 21, 2017 01:37, "Dennis Shea" <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>@Arka: Please read the <br><br><a href="https://www.ncl.ucar.edu/Document/Manuals/" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Manuals/</a><br><br><ul><li><a href="https://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide" target="_blank">NCL User Guide, V1.1</a> <img src="https://www.ncl.ucar.edu/Images/new.gif">
</li><li><a href="https://www.ncl.ucar.edu/Document/Manuals/language_man.pdf" target="_blank">Mini-Language (pdf)</a></li></ul><p>==============================<wbr>======<br></p></div><div>NCL does allow a user to specify a <b><i>variable</i> </b>which spans multiple netCDF, grib or HDF files to (effectively) be concatenated via <b>addfiles </b>and the appropriate<b> ListSetType </b>options. <b>NOTE: the files are not concatenated ....only the specified variable.<br></b><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>addfiles.shtml</a><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/ListSetType.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>ListSetType.shtml</a><br></div><div><br>=====<br>There is <b>no </b>explicit NCL function which concatenates <b>binary</b> or <b>text</b> (ascii)<i> files</i>.  <br>Please Read: <a href="https://www.ncl.ucar.edu/Applications/r-binary.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Applications/r-binary.shtml</a><br></div><div><br>===<br></div><div>Some options:<br><br></div><div>[1] On the {U/Li}nix command line:<br><br></div><div>%> <b>cat</b> LocalBinaryFiles*dat <b>>!</b> BigBinary.dat<br></div><div><br></div>The <b>!</b> will overwrite 'BigBinary.dat' if the file currently exits.<br><br></div><div>Depending on the binary file type, use:<br></div><pre>    Direct Access:            data = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/fbindirread.shtml" target="_blank"><strong>fbindirread</strong></a>("BigBinary.dat",<wbr>rec,dim,type)

    Sequential Access:        data = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/fbinrecread.shtml" target="_blank"><strong>fbinrecread</strong></a>("BigBinary.dat",<wbr>rec,dim,type)<br><br></pre><pre><b>Please read</b> the documentation for these function:<br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fbindirread.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>fbindirread.shtml</a><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fbinrecread.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>fbinrecread.shtml</a><br><br></pre><pre>also, binary files could be '<i>BigEndian</i>" or '<i>LittleEndian</i><b>. </b>The following allows you to specify<br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/isbigendian.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>isbigendian.shtml</a><br><br> if (<strong>isbigendian</strong>() ) then   ; is local machine big or little endian?
     <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml" target="_blank"><strong>setfileoption</strong></a>("bin","<wbr>ReadByteOrder","LittleEndian")
 end if
</pre><pre> x = <b>fbindirread</b>(...)<br></pre><pre>or<br></pre><pre> c = <b>fbinrecread</b>(...)<br><br></pre><pre>Sfter you are finished, you may want to delete the 'BigBinary.dat' file<br><br></pre><pre>%> rm BigBinary.dat<br><br></pre><pre>Or, perhaps the individual binary files and keep the concatenated file:<br><br></pre><pre>%> rm LittleBinary*dat<br></pre><pre><br>[2] <br><br></pre><pre>diri = ".../"    ; input dir<br></pre><pre>if (<strong>.not.fileexists</strong>("BigBinary.<wbr>dat")) then</pre><pre>    system("cat LocalBinary*dat >! "BigBinary.dat")<br></pre><pre>end if<br></pre><pre><br>    Direct Access:            data = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/fbindirread.shtml" target="_blank"><strong>fbindirread</strong></a>("BigBinary.dat",<wbr>rec,dim,type)

    Sequential Access:        data = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/fbinrecread.shtml" target="_blank"><strong>fbinrecread</strong></a>("BigBinary.dat",<wbr>rec,dim,type)<br><br><br><br><br><br></pre><pre>   <br></pre><div><div><div><div><div><div><br></div></div></div></div></div></div></div><div class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 20, 2017 at 10:27 AM, Laura Fowler via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Arka:<br>
<br>
I usually use systemfunc, followed with ListSetType, and then addfiles<br>
to read a bunch of the same kind of files together. There are lots of<br>
examples on how to use systemfun on the ncl web site.<br>
<br>
Hope this helps,<br>
Laura<br>
<div><div class="m_12629403495640755h5"><br>
<br>
On Wed, Dec 20, 2017 at 9:13 AM, Arka Banerjee via ncl-talk<br>
<<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br>
> Hi all,<br>
><br>
> How to concatenate all file names in a single variable in NCL? I have 100 of<br>
> .dat files in a directory and I want to call them all in a variable like<br>
> below;<br>
><br>
> fn=(/"gsmap_nrt.20100805.0600.<wbr>dat","gsmap_nrt.20100805.0900.<wbr>dat"/)<br>
><br>
> So that 'fn' will be re-structured for 100 of .dat files in the same way of<br>
> above line.<br>
><br>
><br>
> How to execute this thing? Function 'addfiles' helps in this case? As I have<br>
> found it is not for ascii formate.<br>
><br>
><br>
> Thanks,<br>
><br>
> Arka<br>
><br>
</div></div>> ______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
><br>
<br>
<br>
<br>
--<br>
!-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------------<br>
Laura D. Fowler<br>
Mesoscale and Microscale Meteorology Division (MMM)<br>
National Center for Atmospheric Research<br>
P.O. Box 3000, Boulder CO 80307-3000<br>
<br>
e-mail: <a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a><br>
phone: <a href="tel:303-497-1628" value="+13034971628" target="_blank">303-497-1628</a><br>
<br>
!-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------------<br>
______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>
</div></blockquote></div><br></div>