Project

General

Profile

cdo sub dailydata.nc -monmean dailydata.nc output.nc

Added by Khan 11 about 4 years ago

In the above command what i wanted to confirm is that if i execute this command how will it work. What i personally think it will do is that first it will calculate monmean of the input dailydata.nc and then subtract the monmean of respective dailydata.nc from every day of each month respectively. Then it will move to second month like Feb and subtract the longterm monmean of the second month that is February from each day and so on.

I need some critical answers and details about my personal view or am i wrong about that.


Replies (4)

RE: cdo sub dailydata.nc -monmean dailydata.nc output.nc - Added by Karin Meier-Fleischer about 4 years ago

Hi Khan,

please, don't do cross postings.

Your suggestion above is correct.

-Karin

RE: cdo sub dailydata.nc -monmean dailydata.nc output.nc - Added by Uwe Schulzweida about 4 years ago

cdo sub infile1 infile2 outfile
subtracts the first timestep of infile1 and the first timestep of infile2 and than the second timestep of both, and and so on.
If infile1 is daily data and infile2 monthly data
cdo sub infile1 -monmean infile1 outfile
then the first month is subtracted from the first day and the second month from the second day, and so on.
You have to use monsub if you would like to subtract monthly data from daily data:
cdo monsub infile1 -monmean infile1 outfile

RE: cdo sub dailydata.nc -monmean dailydata.nc output.nc - Added by Karin Meier-Fleischer about 4 years ago

Uwe thank you very much for the explanation, I have learned something new. :)

RE: cdo sub dailydata.nc -monmean dailydata.nc output.nc - Added by Khan 11 about 4 years ago

Thank You Karin and Uwe for the response, and sorry for the cross postings, got confused whether i posted at the correct platform.

I have a follow up question please.

What i wanted to know is that lets say i have 10 years of daily data and what i want to do is ,

1- Calculate monthly mean for each month.
2- Subtract the monmean from each day of respective month (Subtract the Jan mean from all 10 Jan daily data only, and then subtract Feb mean from all 10 Feb daily data, and so on for each month).

The modified command you suggested would be something as !cdo monsub infile1 -monmean infile1 outfile, if not please correct me.

Thank You

    (1-4/4)