-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdo.html
51 lines (46 loc) · 2.91 KB
/
cdo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>CDO tutorial</title>
<style>
h1 {text-align: center; color: tomato; font-size:60px;}
h2 {text-align: left; color: black; font-size:40px;}
h2 {text-align: left; color: black; font-size:30px;}
h3 {text-align: center; color: black; font-size:18px;}
p {text-align: left; color: black; font-size:18px;}
img {display: block; margin-left: auto; margin-right: auto;}
footer {text-align: center; color: grey;}
</style>
</head>
<body>
<h1>The Climate Data Operators (CDO) software</h1>
<h3>Create date: June 30 2024</h3>
<p>Go back to the main page <a href="index.html" target="_self">View</a></p>
<p> The Climate Data Operators (CDO) software is a collection of many operators for standard processing of climate and forecast model data. The operators include simple statistical and arithmetic functions, data selection and subsampling tools, and spatial interpolation. CDO was developed to have the same set of processing functions for GRIB and NetCDF datasets in one package. A tutorial of CDO is given here, which is refered to official website: https://code.mpimet.mpg.de/projects/cdo/wiki/Tutorial (<a href="https://code.mpimet.mpg.de/projects/cdo/wiki/Tutorial" target="_self">View</a>). In addition, there are some examples followed by it. </p>
<h2> 1. Tutorial</h2>
<embed src="DOC/cdo.pdf" width="100%" height="1000px" />
<h2> 2. CDO Example </h2>
<p> (1) Merge data </p>
<p style="background-color:grey;"> cdo -b F64 -f nc2 mergetime file1.nc file2.nc file3.nc output.nc </p>
<p> (2) Time interpolation </p>
Interpolate time by number of timesteps from one timestep to the next: <br>
<p style="background-color:grey;"> cdo -intntime,12 infile outfile </p>
<p> (3) Convert grib file to netcdf file </p>
<p style="background-color:grey;"> cdo -f nc copy filetry.grib filetry.nc </p>
<h2> 3. NCO Example </h2>
<p> (1) Extract variable “SST” from in.nc </p>
<p style="background-color:grey;"> ncks -v SST in.nc out.nc </p>
<p> (2) Delete variable “lev” from in.nc </p>
<p style="background-color:grey;"> ncks -C -O -x -v lev in.nc out.nc </p>
<p> (3) Delete dimension “lev” from in.nc </p>
<p style="background-color:grey;"> ncwa -a lev in.nc out.nc </p>
<p> (4) Repeack the out.nc after averaging-out the level dimension with “ncwa” </p>
<p style="background-color:grey;"> ncpdq in.nc out.nc </p>
<p> (5) Change Variable Name </p>
<p style="background-color:grey;"> ncrename -v old_variable, new_variable monthly_data.nc </p>
<p> (6) Convert a variable type </p>
<p style="background-color:grey;"> ncap2 -s 'time=float(time)' </p>
<p> (7) Add, modify attribute </p>
<p style="background-color:grey;"> ncatted -a att_nm, var_nm, mode, att_typ, att_val in.nc [out.nc] </p>
<p>for mode: a=append, c=create, d=delete, m=modify, o=overwrite; for att_typ: f=float, d=double, l=long, s=short, c=character, b=byte, i=integer </p>
</body>
</html>