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?
a000000.nc (26.4 MB) a000000.nc | |||
b000000.nc (26.4 MB) b000000.nc | |||
c000000.nc (26.4 MB) c000000.nc | |||
ensmean.nc (26.4 MB) ensmean.nc | |||
enssum.nc (26.4 MB) enssum.nc | |||
yearsum_divc.nc (26.4 MB) yearsum_divc.nc |
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?
ensmean.png (150 KB) ensmean.png | |||
enssum_divc.png (323 KB) enssum_divc.png |
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:
ensmean_divc.png (150 KB) ensmean_divc.png | |||
enssum.png (323 KB) enssum.png |
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.