# [ncl-talk] Fwd: FW: Ocean Heat Content

Dennis Shea shea at ucar.edu
Wed Apr 29 07:35:12 MDT 2015

```Regardless of what language you use ...

Simple overview:

[1] Determine the layer thicknesses (the 'dz' in the integral).
[2] At each grid point

HeatContent = (rho*Cp)*SUM[ T(k)*dz(k) ] ....

where 'k' spans the depths appropriate for 0 to 700m

===============
Atmospheric functions for pressure layer thickness in the atmosphere can be
seen via

http://www.ncl.ucar.edu/Document/Functions/Contributed/dpres_plevel_Wrap.shtml
Examples 1 and 2

================
There are no 'dz' functions for ocean depth like there are for atmospheric
pressure (dpres_hybrid_ccm, dpres_plevel) so you must create your own code.
I have one for our ocean model

;=============
undef("dz_pop")
; compute all layer thicknesses for POP: z_t ot z_w
function dz_pop(z[*])
local kz, dz
begin
kz                = dimsizes(z)
dz               = new( kz, typeof(z), "No_FillValue")
dz(0)           = 0.5*(z(0)+z(1))                               ; top
layer has sfc
dz(1:kz-2)   = 0.5*(z(2:kz-1)-z(0:kz-3))
dz(  kz-1)    = z(kz-1) - 0.5*(z(kz-1)+z(kz-2))       ; bottom layer
copy_VarCoords(z, dz)
dz at long_name = "layer thickness"
dz at units     = z at units

return(dz)
end

============

If 700m is a level for your data, that is good. However, if 700m is not you
must do some interpolation. Perhaps,

https://www.ncl.ucar.edu/Applications/iso.shtml
Example 4

=============

Good Luck

On Mon, Apr 27, 2015 at 1:36 PM, Fernanda Casagrande <
fe.casagrande2 at gmail.com> wrote:

> Dear Ncl users,
>
> I'm new in NCL and I would like calculate and plot Ocean Heat Content
> (h1=300m, h2=0) for Arctic region.
> My data is Ocean Potential Temperature T(z) .
> The ocean heat content is defined as
> H = pCp ∫ T(z)dz
> p= water desnity == constant
> Cp = Sea water heat capacity = Constant
>
> h1 = 700 m
> h2=0 m
> Thanks for any help.
> best regards,
> Fernanda
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150429/64a5bc91/attachment.html
```