Project

General

Profile

Merge netcdf files error

Added by Muhammad Ramzan over 1 year ago

Hi

I am number of Netcdf files in one directory please

named as era_temperature_2000.nc era_temperature_2001.nc and so on

I want to make one netcdf file from these.

I have tried the following commands but getting the error

cdo mergetime era_temperature_2000.nc era_temperature_2001.nc era_temperature.nc
File era_temperature.nc already exists, overwrite? (yes/no): y
cdf_put_vara_double: name=t type=NC_SHORT minval=-39483.000000 maxval=738.000000

Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable

cdo merge era_temperature_2*.nc era_temperature.nc
cdo merge (Warning): Duplicate entry of parameter name t in era_temperature_2001.nc!
cdf_put_vara_double: name=t type=NC_SHORT minval=-33882.000000 maxval=1202.000000

Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable


Replies (1)

RE: Merge netcdf files error - Added by Karin Meier-Fleischer over 1 year ago

You should take a look at each single file then you can see that each time the scale_factor and the add_offset of the variable t is changing.

2000:
        t:scale_factor = 0.000789376720268796 ;
        t:add_offset = 294.658907069452 ;
2001:
        t:scale_factor = 0.00089752684835312 ;
        t:add_offset = 290.967202603763 ;
2002:
        t:scale_factor = 0.000911437719116705 ;
        t:add_offset = 291.218660492078 ;
...

You can merge all files using the option '-b F64' but this will increase the file size.

cdo -b F64 -mergetime era_temperature_*.nc out.nc
    (1-1/1)