Project

General

Profile

Why are the results different for "ensmean" and "enssum, divc"?

Added by Yufeng Ju 5 months ago

I have 3 yearly soil temperature files, and I want to calculate mean of these files.

The soil temperature files are:
a000000.nc
b000000.nc
c000000.nc

I first calculated mean of 3 files using "ensmean":
!cdo ensmean *000000.nc ensmean.nc

I graphed the results and found that they might not be quite right.

Then I calculated sum of 3 files using "ensmean", and mean using "divc":
!cdo enssum *000000.nc enssum.nc
!cdo divc,3 enssum.nc yearsum_divc.nc

I also graphed the results of "yearsum_divc.nc" and found that result "enssum.nc" was different from "yearsum_divc.nc".

Why is this happening? Which method calculates the mean is correct?


Replies (4)

RE: Why are the results different for "ensmean" and "enssum, divc"? - Added by Uwe Schulzweida 5 months ago

Without missing values, the result of ensmean and "divc,3 -ensum" is the same. But if there are missing values, the result depends on the number of members involved in the operation. And this number varies between 0 and 3. So the result of ensmean is correct.
Use ensavg if you only want to perform the calculation for complete ensembles (see: https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-510001.9.1).

RE: Why are the results different for "ensmean" and "enssum, divc"? - Added by Yufeng Ju 5 months ago

Thank you very much for your patience to answer my confusion!

So when I used the results calculated by these two methods to plot after regional mean, the results are different. Is this because there are missing values?

These are some of the results of my plots with "ensmean" and "divc,* -ensum", respectively. Thin lines represent individual model, and thick lines represent ensemble mean.The two methods calculate different results due to missing values in the data.

I have a little question, why is figure "enssum_divc" more like ensemble mean , if figure "ensmean" is right?


RE: Why are the results different for "ensmean" and "enssum, divc"? - Added by Yufeng Ju 5 months ago

I am vary sorry, I uploaded the picture with the wrong name.
The correct graph is:

RE: Why are the results different for "ensmean" and "enssum, divc"? - Added by Uwe Schulzweida 5 months ago

Because of the missing values the result of "divc/enssum" provides incorrect results with your data.
enssum calculates the sum of the valid ensemble members and divc divides this sum by the total number of ensemble members.

    (1-4/4)