# How to calculate Ocean heat content?

I have subsurface temperature data for up to 300 m oceanic depth (at varying depth intervals). I want to calculate the ocean heat content for 0-300 m.

The formula is:

OHC = seawater density * Specific heat capacity * integrating the temperature over this depth.

But, the depth is not at the same interval. So I have read that there is a need to use weighted temperature. I want to ask two questions.

1. Why do we have to use weighted temperature?
2. Is there any module or code available to do this? So that it will help me to compute the OHC?
• With variable intervals, different temperature data represent different volumes of water. Commented Dec 30, 2021 at 5:44
• the formula seems to be incomplete; it's dimensionally density · spec. heat capacity · depth = mass / volume · energy / (temperature difference · mass) · (distance difference) · temperature = energy / area, and from a practical point of view it should just be energy. You don't only integrate over depth, you have to integrate over volume. Commented Dec 30, 2021 at 15:42