[CDO] conditional statement (if then)


It’s become much powerful when you can use conditional statement with an arithmetic. I recently learned it because I really would subtract strange value follows the coastal lines from one of CMIP5 model data.

So, you can take values excepting the values greater than -2 degrees Celsius,


cdo ifthen -gtc,-2 input.nc input.nc output.nc

Meaning: if first input.nc is greater than -2 then let it be second input.nc and it writes as output.nc


Here is a short overview of all operators in this section:
eq: Equal
ne: Not equal
le: Less equal
lt: Less than
ge: Greater equal
gt: Greater than
eqc: Equal constant
nec: Not equal constant
lec: Less equal constant
ltc: Less than constant
gec: Greater equal constant
gtc: Greater than constant


I am still learning other conditional statements. So, it will be updated in a near future.


So, Simple 🙂