Project

General

Profile

CDO mergetime creates file larger than the individual files used.

Added by Ahmed Shaaban about 4 years ago

Hello,
I am using the command cdo -b mergetime input*.nc output to merge files.
I have around 496 files, each with size ~ 80 Mb; hence, I anticipated a file with size ~ 40 Gb, yet I got a 151 Gb file.
Any idea why this is the case.
I am using cdo version 1.9.7..
Thanks

Ahmed Shaaban
University at Albany.


Replies (8)

RE: CDO mergetime creates file larger than the individual files used. - Added by Karin Meier-Fleischer about 4 years ago

Hi Ahmed,

without any file it is hard to answer. Do you use the -b parameter with F64 and your input data is 32-bit?

-Karin

RE: CDO mergetime creates file larger than the individual files used. - Added by Ahmed Shaaban about 4 years ago

Hi,
I attached two sample files that I am using (ERA-5 dataset). From the ncdump, I can see that some variables are float, others are double. I am not sure if the -b option is valid in this case.

Thanks,

Ahmed

RE: CDO mergetime creates file larger than the individual files used. - Added by Ahmed Shaaban about 4 years ago

Hi Karin,

Merging the previously attached two files using the following command

cdo mergetime u_component_of_wind_2020_1_daily.nc u_component_of_wind_2020_2_daily.nc test.nc

gave me ~ 17 Mb file which is still much larger than the sum of the file sizes.

I am wondering if I need to include some parameters while using mergtime.

Thanks,
Ahmed

RE: CDO mergetime creates file larger than the individual files used. - Added by Karin Meier-Fleischer about 4 years ago

Which cdo version are you using? I'm using 1.9.8 and the output file size is correct.

cdo -O -mergetime u_component_of_wind_2020_*.nc test.nc

u_component_of_wind_2020_1_daily.nc :  83414740
u_component_of_wind_2020_2_daily.nc :  37673452
test.nc :                             121084148

The u-variable has the type short and if you convert it to float with '-b F32' then
the output file size will be larger.

Just using -mergetime without the -b option will preserve the variable's type short.

RE: CDO mergetime creates file larger than the individual files used. - Added by Ahmed Shaaban about 4 years ago

Thanks a lot.
I am using CDO 1.9.7.1.

I tried to the mergetime without the '-b F32', yet I got the following error with some files. [[https://app.box.com/s/ztl5bdr3kh44ahuiq3oj8jjf3eo7ypcg]] and [[https://app.box.com/s/azjmxpor7wb4t73c89yp3twefv58zan6]]

Here is the error.
cdf_put_vara_double: name=u type=NC_SHORT minval=-33720.000000 maxval=28264.000000

Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable

I checked the files and they look similar to the others.

Thanks

RE: CDO mergetime creates file larger than the individual files used. - Added by Karin Meier-Fleischer about 4 years ago

Some of the values are larger than the maximum value of type short and will be converted to type I32
automatically. This will increase the output file size.

Warning: Some data values (min=-33720 max=28264) are outside the
    valid range (-32768 - 32767) of the used output precision!

RE: CDO mergetime creates file larger than the individual files used. - Added by Ahmed Shaaban about 4 years ago

Thanks a lot. It seems that the file size will definitely increase.

RE: CDO mergetime creates file larger than the individual files used. - Added by Mara Antonella almost 2 years ago

Hello everyone,

I have the same issue and I received the same error when I tried to merge without -b F32. So there is no solution for this issue? The final file is much larger than the sum of the first ones and that is a huge problem for me.

Thank you very much,
Mara

    (1-8/8)