0

I have daily data of 9 regional climate models each with different timesteps, different ending days and different calendar types but the same starting day.

I want to create a daily ensemble out of them with respect to the one with the highest timesteps which has a standard calendar.

Is there a CDO way to solve it?

I tried creating an ensemble mean (daily) in CDO for my hydrologic model, however there is a problem in timesteps as CDO stopped creating the ensemble at the end date of the member with lowest timesteps.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Emre
  • 1
  • 2

1 Answers1

1

This is a tricky one in CDO. Your problem is slightly ambiguous in that it's not clear how you want to convert the calendars. I will assume you just want to take first 360 days of the year and use those values. To convert those to a 360 day calendar, you will need to chain three commands, selyear, settaxis and setcalendar.

You'll need to do things year by year. The code below would do it for 1987:

cdo -selyear,1987 -settaxis,1987-01-01,12:00:00,1day -setcalendar,360_day -selyear,1987 infile outfile

That will give you 360 days for 1987. You will need to modify this for your use case. For example, you might want to remove 5 or 6 dates before processing to make sure the data is not slightly skewed.

Robert Wilson
  • 3,192
  • 11
  • 19
  • Dear Robert and Adrian thank you for your answers. What I really want to do is to take each available date in the shortest model and drag their corresponding timesteps in the longer models and then form a daily ensemble data. Was I able to express my intention? Please let me know if you need further explanation. – Emre Mar 19 '23 at 21:09
  • Still ambiguous. I don’t know what you mean by ‘drag’. Example, how do you want February to be handled? You want 30 days in each month, so you need to specify how they will be created for each month – Robert Wilson Mar 20 '23 at 06:23
  • Apologies for all the ambiguity going on, here's my final intention after thinking on it for the last week; I want to create an ensemble mean out of 9 different RCMs. I want to use the calendar of the RCM with the most timesteps and would like to assign NaN values to the shorter ones with no data on the related days. While I was on Google I found a Python tool named XClim which promises to do so but I think I failed to make it work. I desperately need a CDO solution :) – Emre Mar 25 '23 at 14:36
  • Ok. This is the opposite of what you said in the question. Please rewrite the question so that it’s clear what you are trying to do – Robert Wilson Mar 25 '23 at 14:39
  • It’s also unclear how you would want to convert from 360 to 365 days. What is your variable? Do you conserve annual totals? – Robert Wilson Mar 25 '23 at 14:42
  • I want to assign NaN values for the missing days in calendars with 360 days, by doing that ensmean will ignore them when calculating the ensemble mean. Here my intention is to use the all data available instead of discarding their data for the shortest ensemble member. My variables are temperature and precipitation. – Emre Mar 25 '23 at 14:46
  • Once again you’ve changed the question. As I said this is a coding website. Questions should be about code. Right now it’s not really clear what you really want to do – Robert Wilson Mar 25 '23 at 14:53
  • Your answer to my previous question did not work as the time bounds were not supported with the setaxis operator. It created a new NetCDF file but the data was inaccesible. – Emre Mar 25 '23 at 15:52
  • Not easy to provide further help. Your question is poorly defined, and you haven’t provided data so no way to figure out if methods work – Robert Wilson Mar 25 '23 at 16:48