Problem with ensemble average and variable landmask/fill_value across CMIP5 files
Added by Trond Kristiansen almost 12 years ago
Hi all. I have re-gridded the CMIP5 model output from 10 different ESM models to a standard rectangular grid (360x180). I next calculate the ensemble mean (ensmean) for both the historical (1961-1990) and future RCP85 projections for the period 2025-2050. This works mostly fine, but I have some problems with grid cells particularly along land that may contain values in one file while in others only fill_value or landmask is present. Still, ensmean averages across the values for each grid cell regardless if the value is masked in the netcdf file or not. What i would like to do, is to only output values in grid cells where all 10 ESM models have actual values. If not I would like the value to be masked/fill_value. My command for creating the ensemble mean is simply "cdo ensmean *.nc ensemble_average.nc" where the *.nc files contains the ESM model output of the yearly average sea surface temperature value. suggestions for how to solve my problem is highly appreciated.
Thanks! Cheers, Trond
Replies (2)
RE: Problem with ensemble average and variable landmask/fill_value across CMIP5 files - Added by Jaison-Thomas Ambadan almost 12 years ago
Hi,
I don't think you can do that in one step since cdo doen't really allow chaining of [other] operators with "ensemble" operators. You may try the following:
Suppose you have 32 input files like ifile.000, ifile.002 ... ifile.032, then you use the "setvrage" to set the valid range and then use "ensmean"
step 1: for i in ifile.m0??; do cdo -setvrange,-10,10 $i $i.tmp ; done step 2: cdo -ensmean ifile.0[0-9][0-9].tmp ofile
If you have a common mask file then you may "mask" all input files instead of using "setvrange"
Hope this helps!
Cheers,
J
RE: Problem with ensemble average and variable landmask/fill_value across CMIP5 files - Added by Trond Kristiansen almost 12 years ago
Thanks! Your suggestion solved my problem and everything works perfectly now. Cheers, Trond