Project

General

Profile

cdo fldmean unrealistic values

Added by Sonny L about 4 years ago

Hi all,
I am very beginner on cdo software. I am trying to obtain the average value of variable (Chlorophyll-a, named Chl_a) over sub domain of netcdf file. The file contain only one variable over a global domain. The Chl_a:_FillValue = -99999.f ; and the Chl_a:missing_value = -99999.f .
Over the land the file doesn’t report (obviously) the Chl_a values, and it Is filled by -99999 values.
Example
To obtain the mean value of Chl_a I do :
cdo -fldmean -sellonlatbox,-30,30,10,75 infile.nc outfile.nc
I get unrealistic mean result because cdo calculates the mean value of all data, including the -999999.
How can I avoid it and obtain the “real” mean value?
thanks very much,
S.


Replies (10)

RE: cdo fldmean unrealistic values - Added by Karin Meier-Fleischer about 4 years ago

Hi Sonny,

can you upload the file?

-Karin

RE: cdo fldmean unrealistic values - Added by Sonny L about 4 years ago

Hi Karin,

thanks! I upload the % anomalies Chl_a file.

thanks
Sonny

RE: cdo fldmean unrealistic values - Added by Karin Meier-Fleischer about 4 years ago

The missing_value attribute is missing. The following adds the attribute and should fix the problem:

cdo setattribute,aChl_a@missing_value="-9999.f" GMIS_V_ANO_CHLA_05_2017.nc GMIS_V_ANO_CHLA_05_2017_missing.nc

RE: cdo fldmean unrealistic values - Added by Sonny L about 4 years ago

thank you !
unfortunately I receive this message :
Operator >setattribute< not found!
Similar operators are:
(not found)
should I install "setattribute" routine ?

RE: cdo fldmean unrealistic values - Added by Karin Meier-Fleischer about 4 years ago

Which version do you use (cdo -V)?

RE: cdo fldmean unrealistic values - Added by Sonny L about 4 years ago

I have two machines, one with cdo version 1.6.4, and the second with cdo version 1.7.2

RE: cdo fldmean unrealistic values - Added by Karin Meier-Fleischer about 4 years ago

You have to update cdo because the versions are too old.

RE: cdo fldmean unrealistic values - Added by Sonny L about 4 years ago

thank you for your suggestions!

RE: cdo fldmean unrealistic values - Added by Karin Meier-Fleischer about 4 years ago

Just to complete it you can use NCO's ncatted to add, change or delete, too.

ncatted -O -a missing_value,aChl_a,c,f,-9999. GMIS_V_ANO_CHLA_05_2017.nc GMIS_V_ANO_CHLA_05_2017_missing.nc

RE: cdo fldmean unrealistic values - Added by Sonny L about 4 years ago

It works !!
thanks so much, Karin!

    (1-10/10)