Climate Data Operators
The Climate data operators (CDO) software is a large collection of operators to analyse and process climate and NWP model data. CDO was developed by Max-Planck-Institut für Meteorologie and is part of the „European Network for Earth System Modelling“ as a free package under GPL terms. CDO has the same set of processing functions for GRIB and NetCDF datasets in one package. Moreover, the Climate Data Interface [CDI] can be used for file format independent access. The local MPI-MET data formats SERVICE, EXTRA and IEG are also supported.
The main CDO features
- More than 700 operators available
- Modular design and easily extendable with new operators
- Very simple UNIX command line interface
- A dataset can be processed by several operators, without storing the interim results in ﬁles
- Most operators handle datasets with missing values
- Fast processing of large datasets
- Support of many diﬀerent grid types
- Tested on many UNIX/Linux systems, Cygwin, and MacOS-X
CDO operators classes
CDO Operators are simple functions which can be grouped in different classes. The relevant operators classes for the BAW are listed and briefly described here (from the official documentation):
- Information Operators to print information about datasets. All operators print there results to standard output.
- File operations Operators to perform operations on files like copy, replace, cat, merge and split.
- Selection Operators to select time steps, fields or a part of a field from a dataset.
- Comparison Operators to compare datasets. The resulting field is a mask containing 1 if the comparison is true and 0 if not.
- Modification Operators to modify the metadata, fields or part of a field in a dataset.
- Arithmetic Operators to arithmetically process datasets. Amongst others, one can add, subtract, multiply or divide a constant. The direct processing of fields is also possible. Moreover, time series can similarly be added, subtracted, multiplied or divided.
- Statistical values Operators to compute statistical values of datasets like minimum, maximum, sum, mean, average, median, variance, standard deviation, percentiles and histograms.
- Interpolation Operators to interpolate datasets. ieren. There are several operators to interpolate horizontal fields to a new grid. Some of those operators can handle only 2D fields on a regular rectangular grid. Vertical interpolation of 3D variables is possible from hybrid model levels to height or pressure levels. Interpolation in time is possible between time steps and years.
- Import/Export Operators to import and export data files which cannot read or write directly with CDO like binaries or ASCII datasets.
Examples of use at BAW
The present example will show how a COSMO-EU meteo file in GRIB2 format is converted to NetCDF and then further processed . Fort the sake of simplicity, all input files will be denoted by ifile and accordingly, all output files will be denoted by ofile.
- Convert to NetCDF:
cdo -t cosmo002 -f nc copy ifile.grib ofile.nc
- Select variables:
cdo select,name=U,V,PMSL ifile ofile
- Rename variables:
cdo chname,PMSL,slp,U,u10,V,v10 ifile ofile
- Set a new Missing_value / Fill_value:
cdo setmissval,999.99 ifile ofile
- Calculate the wind velocity magnitude:
cdo expr,vel=sqrt(u10^2+v10^2); ifile ofile
- Linux: cdo-1.7.2 from 28.06.2016
- Windows: not available