<div dir="ltr"><div class="gmail_default" style="color:rgb(7,55,99)">Hi,<br><br></div><div class="gmail_default" style="color:rgb(7,55,99)">Thank you Dennis! I realized what was wrong after Kyle pointed it out, just replacing  fili = addfiles(diri+fil(nf),&quot;r&quot;) with fili = fil(nf) in my modified script works great.<br><br></div><div class="gmail_default" style="color:rgb(7,55,99)">I also scaled it later after seeing absurdly large values. Thank you, your script is of great help.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><div><div class="gmail_default" style="color:rgb(7,55,99)"><br></div><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)">--<br></span></span></font></div><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)">Samar</span></span></font><br><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Mar 24, 2016 at 12:34 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>FYI: I have updated the example at:<br><br><a href="http://www.ncl.ucar.edu/Applications/HiResPrc.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/HiResPrc.shtml</a><br></div>See: <a href="http://www.ncl.ucar.edu/Applications/Scripts/cpcuni_1.ncl" target="_blank">cpcuni_1.ncl</a><br><br></div>There are additional options: (i) create netCDF4 rather than the &#39;classic&#39; netCDF-3; (ii) Have the script invoke the netCDF Operatoe &#39;ncrcat&#39; via NCL&#39;s &#39;system&#39; procedure. <br><br>The previous example (a) did not set the _FillValue (=-999.0) and (b) did not scale the values (*0.1). This does both.<br><br></div>Cheers<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 18, 2016 at 4:35 PM, Samar Min Allah <span dir="ltr">&lt;<a href="mailto:minallah@umich.edu" target="_blank">minallah@umich.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)"></span></span></font><span style="color:rgb(7,55,99)">I am trying to convert multiple binary files (CPC_Unified precip data) to netcdf format using the following NCL script:</span><br><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div style="color:rgb(7,55,99)"><a href="https://www.ncl.ucar.edu/Applications/Scripts/cpcuni_1.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/cpcuni_1.ncl</a><br><br></div><div style="color:rgb(7,55,99)">I modified the script to read multiple files together by adding the following;<br><br>diri   = &quot;./&quot;      <br>fil   = systemfunc(&quot;cd &quot;+diri+&quot; ; ls PRCP_CU_GAUGE_V1.0GLB_0.50deg.lnx.*&quot;)<br>nfil = dimsizes(fil)<br>      <br>do nf = 0,nfil-1  <br>   fili = addfiles(diri+fil(nf),&quot;r&quot;) <br>netCDF = True                            <br>   PLOT   = False                            <br><br>   if (netCDF) then<br>       ncDir   = &quot;./&quot;                        <br>       ncFil   = fili+&quot;.nc&quot;              <br>   end if<br>.<br>.<br></div><div style="color:rgb(7,55,99)">. <i>(the remaining code is same as the script)</i><br></div><div style="color:rgb(7,55,99)">end do<br></div><div style="color:rgb(7,55,99)"><br></div><div style="color:rgb(7,55,99)">When I run the code; I get this error &quot;<i>Could not coerce values for operation</i>&quot;<br></div><div style="color:rgb(7,55,99)">Also, I believe addfiles require a file extension but when I add .bin next to the file name I get the message &quot;<i>...has no file extension, can&#39;t determine type of file to open</i>&quot;<br><br></div><div style="color:rgb(7,55,99)">I have also attached two sample files.<br><br></div><div style="color:rgb(7,55,99)">Thanks!<br></div><div style="color:rgb(7,55,99)"><br></div><div style="color:rgb(7,55,99);display:inline">​​</div><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)"></span></span></font><br><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
</div><br></div>
</div><br></div>
<br>_______________________________________________<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></div>