Thank you Mike and Barry for your response. I am attaching my code with this email. I am actually taking the dimension from original file as it is, like name, units, precision etc. But I am changing the dimension value in the program. I am not expert in R, so the code is not very compact. <br>
<br>In my previous email there was a mistake, the dimension of the original file is 240 x 120 x 2920, where 240 is DimX, 120 is DimY and 2920 is Time Dimension. The new file dimension is 240 x 120 x 1460, where 240 is DimX, 120 is DimY and 1460 is Time Dimension. I am changing time dimension in the destination file. <br>
<br>Thanks in advance,<br><br>Narayani <br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 6:28 PM, Barry Rowlingson <span dir="ltr"><<a href="mailto:b.rowlingson@lancaster.ac.uk">b.rowlingson@lancaster.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Fri, Jun 17, 2011 at 7:02 PM, Narayani Barve <<a href="mailto:narayani@ku.edu">narayani@ku.edu</a>> wrote:<br>
> Hi All,<br>
><br>
> I am using ncdf package to manipulate netcdf file downloaded from ECMWF<br>
> website. The downloaded data file contains 8 observations per day for a<br>
> single variable. The size of file is 800+ mb for a whole year data. The<br>
> dimension for the data is 240 x 120 x 1460, where 240 is DimX, 120 is DimY<br>
> and 2920 is Time Dimension. I want to take only 4 observations from this<br>
> file. To do this I wrote a script in R and used ncdf package to manipulate<br>
> the data. My script is working great. And my effective dimension of the<br>
> variable is 240 x 120 x 1460 (which is half of 2920). The only trouble is<br>
> size of the new file is same as old file. In my opinion, the file size<br>
> should have reduced to half. But this is not happening. Is there any<br>
> documentation which tell me more about how the file size is decided, OR Do<br>
> you think I am doing something wrong ? OR is there any way to compact the<br>
> file size like in Microsoft Access, there is a option to compact database ?<br>
><br>
> Thanks in advance, any help is appreciated.<br>
<br>
</div> Hard to tell without seeing your code. I suspect either you are<br>
creating the new netcdf file with the same dimensions as the original,<br>
and then only writing the first 1460 of the time dimension, or<br>
possibly your source file is in single precision and you are writing<br>
in double precision...<br>
<font color="#888888"><br>
Barry<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
R-sig-Geo mailing list<br>
<a href="mailto:R-sig-Geo@r-project.org">R-sig-Geo@r-project.org</a><br>
<a href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Narayani Barve<br>PhD Student,<br>Ecology and Evolutionary Biology,<br>University of Kansas, KS 66044<br>