### 2.12.5.10. Energy Conservation[¶](#energy-conservation "Permalink to this headline")

To check energy conservation, the left-hand side of equation [(2.12.32)](#equation-12-27) is re-written to yield the total enthalpy of the lake system (J m\-2) \\(H\_{tot}\\) :

(2.12.62)[¶](#equation-12-57 "Permalink to this equation")\\\[H\_{tot} =\\sum \_{i=j\_{top} }^{N\_{levlak} +N\_{levgrnd} }\\left\[c\_{v,i} \\left(T\_{i} -T\_{f} \\right)+M\_{liq,i} H\_{fus} \\right\] -W\_{sno,bulk} H\_{fus}\\\]

where \\(M\_{liq,i}\\) is the water mass of the _i_th layer (similar to section [2.12.5.8](#phase-change-lake)), and \\(W\_{sno,bulk}\\) is the mass of snow-ice not present in resolved snow layers. This expression is evaluated once at the beginning and once at the end of the timestep (re-evaluating each \\(c\_{v,i}\\) ), and the change is compared with the net surface energy flux to yield the error flux \\(E\_{soi}\\) (W m\-2):

(2.12.63)[¶](#equation-12-58 "Permalink to this equation")\\\[E\_{soi} =\\frac{\\Delta H\_{tot} }{\\Delta t} -G-\\sum \_{i=j\_{top} }^{N\_{levlak} +N\_{levgrnd} }\\phi \_{i}\\\]

If \\(\\left|E\_{soi} \\right|<0.1\\)W m\-2, it is subtracted from the sensible heat flux and added to _G_. Otherwise, the model is aborted.

