<div dir="ltr"><div><div><div><div><div><div><div>From an NCL perspective, why would you want to do that? <br>NCL can read & plot the nc files without the intermediate .ctl file.<br><br>--<br></div><div>There is no automated way to construct .ctl files. Most people want to do the reverse:<br> <a href="http://www.ncl.ucar.edu/Applications/grads.shtml">http://www.ncl.ucar.edu/Applications/grads.shtml</a><br>--<br><br></div>The .ctl file has 2 parts: a descriptor file (text) and one or more binary records.<br><br></div>; create a binary record<br><br><pre><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml" target="_blank"><b> setfileoption</b></a>("bin","WriteByteOrder","LittleEndian") ; "BigEndian</pre><br></div> f = addfile("<a href="http://foo.nc" target="_blank">foo.nc</a>", "r")<br></div> t = f->TEMP<br></div></div><br></div><div> fbindirwrite("T.dir_bin", t) ; .ctl=> options stream little_endian<br></div><div>or<br></div> fbinrecwrite("T.seq_bin", 0, t) ; .ctl=> options sequential little_endian<br><br><div><div><br></div><div>; create the descriptor file ... <br>; do it manually or via NCL using str_* functions and asciiwrite<br><br></div><div>Good luck<br></div><div><br><br></div><div> <br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 9, 2014 at 8:29 PM, amit timilsina <span dir="ltr"><<a href="mailto:timilsinaamit87@huskers.unl.edu" target="_blank">timilsinaamit87@huskers.unl.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
How can I convert .nc file to .ctl file? Is there any way?<br>
<br>
Amit<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>