Project

General

Profile

netcdf mergetime precision truncation

Added by will hewson over 9 years ago

Hello there,

Thanks for providing the excellent CDO package, this has been very useful for me over the last year or so.

I have a little problem regarding an unwanted truncation of f64 time values when using the mergetime operator:
cdo -b F64 -f nc4c -z zip_2 mergetime a.nc b.nc out.nc

Time values are stored in F64 format in the original files (a.nc and b.nc), whilst in the outfile these are rounded off to the nearest integer, although still outputted as F64.
Is there a setting to prevent this behaviour?

Also, the file size is greatly inflated for the new file compared to it's parent files. Am I missing another setting here to counter this (guess it's something to do with the newly unlimited time dimension)?

My CDO build details are:
cdo -V
Climate Data Operators version 1.6.3 (http://code.zmaw.de/projects/cdo)
Compiled: by will on host-166-196.eduroam-local.wifi.le.ac.uk (x86_64-apple-darwin13.4.0) Jan 12 2015 10:36:09
Compiler: clang -g -O2 -D_THREAD_SAFE -pthread
version: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Features: PTHREADS NC4 OPeNDAP SZ Z JASPER
Libraries:
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.6.3 of Jan 12 2015 10:36:05
CGRIBEX library version : 1.6.3 of Jan 8 2014 19:55:18
GRIB_API library version : 1.12.3
netCDF library version : 4.3.2 of Dec 7 2014 08:00:46 $
HDF5 library version : 1.8.14
SERVICE library version : 1.3.1 of Jan 12 2015 10:36:01
EXTRA library version : 1.3.1 of Jan 12 2015 10:35:59
IEG library version : 1.3.1 of Jan 12 2015 10:35:59
FILE library version : 1.8.2 of Jan 12 2015 10:35:59

Thanks for your help,

Will.

a.nc (489 KB) a.nc
b.nc (435 KB) b.nc
out.nc (6.38 MB) out.nc

Replies (2)

RE: netcdf mergetime precision truncation - Added by Uwe Schulzweida over 9 years ago

Hi Will,

thanks for this example! CDO does not support milliseconds. Do you have really milliseconds in your data or is this a rounding error?
Unfortunately the time value is truncated to full seconds in CDO, this is wrong. In the next CDO version this will be rounded off to the nearest integer.

The netCDF4 compressing is implemented in CDO only for a horizontal slice of a variable. The horizontal dimension of your variables is 1, therefore these variables can't be compressed with CDO.

Cheers,
Uwe

RE: netcdf mergetime precision truncation - Added by will hewson over 9 years ago

Thanks for this Uwe,

We do use milliseconds for our data - satellite CO2 columns in this case.
Will keep an eye out for the next CDO version to catch this update.

Thanks for the explanation of CDO compression - that makes sense to me, will stick with my Python script for the time being!

All the best,
Will.

    (1-2/2)