<div dir="ltr"><div dir="ltr"><div dir="ltr">Doug,<div><br></div><div>When creating a new netcdf-4 file, the "format" option must be globally selected *before* the addfile command.  This is documented on the setfileoption doc page under "format", but it is obscure.  Try rearranging your script like this:</div><div><br></div><div><span style="font-size:14px">    setfileoption ("nc","</span><wbr style="font-size:14px"><span style="font-size:14px">Format","NetCDF4")</span></div><div><span style="font-size:14px"></span><span style="font-size:14px">    file_chem = addfile (filename+”.nc", "w")</span><br style="font-size:14px"><span style="font-size:14px">    setfileoption (file_chem,"</span><wbr style="font-size:14px"><span style="font-size:14px">CompressionLevel",4)</span><br><div><br></div><div>Example 5 at the bottom of the same page also talks about this.</div><div><br></div><div>--Dave</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 4, 2018 at 8:11 AM, Douglas Lowe <span dir="ltr"><<a href="mailto:Douglas.Lowe@manchester.ac.uk" target="_blank">Douglas.Lowe@manchester.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Dear all,<br>
<br>
I’m trying to use the file compression option listed on this manual page:<br>
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>setfileoption.shtml</a><br>
<br>
This is my code:<br>
file_chem   = addfile(filename+”.nc", "w")<br>
setfileoption(file_chem,"<wbr>Format","NetCDF4")<br>
setfileoption(file_chem,"<wbr>CompressionLevel",4)<br>
<br>
However, I am not finding that there’s any extra compression of the data compared to<br>
using the default compression level - and if I compress the file myself using nccopy<br>
I find I can greatly compress the file (5Mb down to 50kb).<br>
<br>
Have I missed any extra code that I should be adding (my variable processing / writing<br>
code is the same as I’d use for netcdf3 files) to make this compression work?<br>
<br>
thanks,<br>
Doug<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>
</blockquote></div><br></div></div></div></div></div>