Project

General

Profile

CDO variable unpacking

Added by Nikhil Garg 2 months ago

I have a novice question around unpacking of variables in CDO when using the following operators.

Does CDO applies the scale_factor and offset to the variable or do I need to do this explictly?

cdo -L --silent --history -b F32 -f nc4c -z zip_4 \
        -daymax -mul file1.nc \
        -pow,1.67 file2.nc \
        outfile.nc

I have computed a variable using the command shown above but I suspect some values in the output file and wanted to rule out any issues with variable unpacking.


Replies (1)

RE: CDO variable unpacking - Added by Uwe Schulzweida 2 months ago

CDO unpacks the data for all functions that change the data. The scale_factor and add_offset attributes of the packed data are removed. The same applies when changing the data type (-b F32).
The data can be repacked using the CDO function pack:

cdo -L --silent --history -b F32 -f nc4c -z zip_4 \
        -pack \
        -daymax -mul file1.nc \
        -pow,1.67 file2.nc \
        outfile.nc

    (1-1/1)