Description
Do you work with climate data and find yourself struggling to efficiently manipulate and process your data? Climate Data Operators (CDO) is a powerful tool that can help you analyze and process large amounts of climate data in a fast and efficient way. In this tutorial, I will guide you through the process of installing CDO (and it’s essential dependencies) on Linux from sources.
Target Audience
This guide is specifically designed for Linux users who are looking to install the Climate Data Operators (CDO) on their systems. If you are a Windows user, this guide may not be applicable to you. This guide is ideal for High Performance Computing (HPC) users who do not have root privileges on their systems. It is also well-suited for those who are enthusiastic about programming and want to get the most out of their CDO tour.
- Is it suitable for a experienced Linux user? YES
- Is it suitable for a novice Linux user? YES
- How? Answered at the end.
List of tools that will be installed during the CDO installation
Name | Version |
---|---|
zlib | 1.2.11 |
HDF5 | 1.12.1 |
curl | 7.80.0 |
netcdf-c | 4.8.1 |
netcdf-fortran | 4.5.3 |
udunits | 2.2.28 |
expat | 2.4.1 |
libxml2 | 2.9.12 |
sqlite3 | 2022-3400100 |
proj | 8.2.0 |
CDO | 1.9.10 |
Downloading Sources
|
|
Extract Packages
|
|
Compile Packages
Assuming, we want to install cdo and all its dependencies in a directory defined by a variable prefix .
Go to the respective package folder and perform the following task
For compiling proj we need to keep the extracted files from sqlite-tools-linux-x86-3400100.zip into any PATH locations of the system
|
|
The above code can be be further tuned to alter your cdo installation experience.
Bonus
I have created a bash installation script for CDO that automates the entire installation process and even allows you to take advantage of multiple cores for faster compilation.
The typical form of cdo installation now looks like this (isn’t this exciting?):
curl -s url | bash -s arg1 arg2 arg3 aarg4
Arguments
When we suppy 4 arguments, their meaning are as follows:
Arg 1: "y" or "n". Do you want to create a new directory?
Arg 2: "y" or "n". Do you want parallel make configuration?
Arg 3: Full path name of the new folder to be created
Arg 4: Integer number of CPU cores to use for building packages
If Arg 1 and Arg 2 both are ‘n’, we need only 2 args. In this case cdo will be installed in current working directory with no parallel make.
If Arg 1 = ‘y’ and If Arg 2 = ‘n’; 3 rd argument is needed, which is full path name of the new folder to be created.
If Arg 1 = ‘n’ and If Arg 2 = ‘y’; 3 rd argument is needed, which is number of CPU cores to use for building.
Example
An real example using the automated cdo installation script will look something like this;
|
|
Benefits
The CDO installation script offers several benefits over a manual installation:
- Automation: The script automates the entire installation process, saving you time and effort.
- Customization: The script allows you to customize your installation based on your needs, such as creating a new directory or using parallel make configuration.
- Speed: The script takes advantage of multiple CPU cores for faster compilation, which can significantly speed up the installation process.