<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">http://www.ncl.ucar.edu/Applications/HiResPrc.shtml</a><br></div>See: <a href="http://www.ncl.ucar.edu/Applications/Scripts/cpcuni_1.ncl">cpcuni_1.ncl</a><br><br></div>There are additional options: (i) create netCDF4 rather than the 'classic' netCDF-3; (ii) Have the script invoke the netCDF Operatoe 'ncrcat' via NCL's 'system' 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"><<a href="mailto:minallah@umich.edu" target="_blank">minallah@umich.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"><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 = "./" <br>fil = systemfunc("cd "+diri+" ; ls PRCP_CU_GAUGE_V1.0GLB_0.50deg.lnx.*")<br>nfil = dimsizes(fil)<br> <br>do nf = 0,nfil-1 <br> fili = addfiles(diri+fil(nf),"r") <br>netCDF = True <br> PLOT = False <br><br> if (netCDF) then<br> ncDir = "./" <br> ncFil = fili+".nc" <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 "<i>Could not coerce values for operation</i>"<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 "<i>...has no file extension, can't determine type of file to open</i>"<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">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>