Project

General

Profile

How CDO deals with different calendars

Added by Liam Lachs over 2 years ago

Hi CDO Team,

I would like to ask how CDO functions deal with different calendars among input files. The following two examples work fine, but I'm unsure exactly how the CDO functions deal with differing calendars. For example:
  • February 30th is only present for the infile with 360_day calendar
  • January 31st is present in observational data but not in 360_day calendar

A) Subtraction (climatologies)

In this case, I wish to find the difference (-sub) in the annual cycle of daily climatologies (e.g., output of -ydaymean run on baseline period)
  • a global climate model annual cycle (GCM, calendar = 360_day)
  • an observational dataset annual cycle (OBS, calendar = standard)

cdo -sub GCM.nc OBS.nc Difference.nc

B) Subtraction (timeseries)

In a different case, I wish to compute an anomaly by subtracting a hypothetical threshold timeseries (HypThresh, calendar = proleptic_gregorian) from a GCM timeseries (GCM, calendar = 360_day).

cdo -sub GCM_t.nc HypThresh_t.nc GCM_t_anomaly.nc

Looking forward to hearing your ideas on this,

Liam

GCM.nc (55.1 KB) GCM.nc 360_day calendar
HypThresh_t.nc (2.4 MB) HypThresh_t.nc proleptic_gregorian calendar
OBS.nc (57.6 KB) OBS.nc standard calendar
GCM_t.nc (4.88 MB) GCM_t.nc 360_day calendar

Replies (2)

RE: How CDO deals with different calendars - Added by Uwe Schulzweida over 2 years ago

Hi Liam,

The calendar is used to calculate the correct date. This date is only used when selecting.
With all arithmetic operators the date is not checked. The sub operator simply subtracts one field after the other from the two files.
The structure of the two input files must be the same. Neither the order of the variables nor the date is checked.

Cheers,
Uwe

RE: How CDO deals with different calendars - Added by Ralf Mueller over 2 years ago

I think that the -sub operators cannot know in advance, which calendar you prefer to be kept in the output. so it's up to you to decide: Do you want to delete the 29th of February in one dataset or compute an additional 30th February in the other one.

best
ralf

    (1-2/2)