Project

General

Profile

Weighted average over a z-range

Added by M Mengel over 11 years ago

Hi all,

Let's assume I have zlevels 10, 50, 100 and 200 with z-boundaries 30, 75 and 150. I now want to calculate the average of a variable v in the interval 15 to 100. By hand, that would be
ave = (15*v(z=10) + 45*v(z=50) * 25*v(z=100)) / (15+45+25)
Can cdo handle this?
I used something like
cdo vertmean -sellevel,10,50,100
so far, being not the same as what I posted above.

Thanks a lot,
M.


Replies (3)

RE: Weighted average over a z-range - Added by Jaison-Thomas Ambadan over 11 years ago

Hi,

CDO averaging is "weighted" (with grid/cell weights I suppose)- so it is different from simple averaging.

Cheers,
J.

RE: Weighted average over a z-range - Added by M Mengel over 11 years ago

Hi J.,

ok thanks, good to know. But still, how can I average over a range that has boundaries not coinciding with lev_bnds?
I know that programs like ferret handle this and wonder if it is available in cdo as well.

Cheers,
M.

RE: Weighted average over a z-range - Added by Micah Wilhelm over 10 years ago

Yeah its really a shame that cdo still does not support this kind of vertical weighted mean functionality.. Vertical integration of soil moisture data and cloud cover are very common operations. It would be nice if they could make a separate function for it or at the least add the weighted mean functionality for the z axis...

    (1-3/3)