Project

General

Profile

Calculating volume of gridcell

Added by Anne Moree over 2 years ago

Hello CDO,

CDO offers a neat operator gridarea which helps to calculate the area of each gridcell useful for e.g. weighted means.
Now I need to do this in 3D and hence need a volume of each gridcell. Is there a direct (maybe undocumented?) way to do this in CDO?

I have depth bounds, depth levels and was also already able to calculate gridarea with the file in question.
The file is too large to share here, although I could prepare a small sample if needed.

Thank you in advance,

Anne


Replies (4)

RE: Calculating volume of gridcell - Added by Anne Moree over 2 years ago

Hello again,

I have by now made a file manually using the depth bounds and gridarea. I would still be interested to hear though whether CDO offers a direct operator to calculate the volume of each gridcell.

Cheers,
Anne

RE: Calculating volume of gridcell - Added by Ralf Mueller over 2 years ago

hi Anne!

you can use the 'expr' operator like this .

cdo -h expr
will show you the complete list of options/methods to use (maybe cdeltaz()).

cheers
ralf

RE: Calculating volume of gridcell - Added by Anne Moree over 2 years ago

Hi Ralf!

Thank you - I did not see cdeltaz in the documentation or on the page you refer to, but it sounds like it could be used for this purpose. I see in the 'news' section that it is a really recent addition (https://code.mpimet.mpg.de/projects/cdo/news).

Cheers,
Anne

RE: Calculating volume of gridcell - Added by Ralf Mueller over 2 years ago

In case you have your vertical coordinate in a separate file or data variable, you can use normal arithmetic of data variables, too

    (1-4/4)