CDO yearsum produces nan value
Added by Abinesh Ganapathy 3 months ago
I use CDO to calculate yearly sum value for my nc file. It ends up creating the yearly sum for some of the grids for certain years as nan. When I look at the daily value of these grids, I noticed that nan exist for some of the days but not for all the days.
My original assumption with CDO yearsum is this function omit the days with nan value and sum all the remaining days but it didn't end up the way I thought.
I believe there is some inbuilt criterion exists for this function to omit the grids. (Additional note: All the grids of my nc file has nan value for some days but the mentioned grids have nan value for more days compared to the rest of the grids)
Kindly help me produce the yearly sum value for the grids neglecting the nan days.
cdo yearsum -setmissval,9.9692100e+36 -setmissval,-99.0 CDR_2023-10-31054447pm_1983.nc avg_PERSIANN.nc
Replies (2)
RE: CDO yearsum produces nan value - Added by Karin Meier-Fleischer 3 months ago
If your missing value is -99.0 then you should use setctomiss (set constant value to missing value).
cdo -yearsum -setctomiss,-99.0 infile.nc outfile.nc
RE: CDO yearsum produces nan value - Added by Abinesh Ganapathy 3 months ago
Hello Karin,
Thanks a lot. It worked for me perfectly.