"Science is the belief in the ignorance of the experts."
-Richard P. Feynman
Some Common Misconceptions in the Meaning and Uses of Temperature and Heat
The global average temperature as a non-thermodynamic construction.
So what is heat anyway?
Further, in thermodynamics the amount of heat in a system is not a state function. That is, only the difference in heat output or input "Delta Q" for a given thermodynamic process start to finish is available. There is no heat function Q(P,V,T,N,...) of the coordinates of the manifold. The amount of heat gained or lost, Delta Q, depends on the shape of the curve or path in state space connecting the initial and final states of the process. One way to describe this, is to recognized that the differential heat change dQ is not an exact differential.
In order to obtain dQ one uses the equation dQ = T dS where T is the absolute temperature and S is the entropy of the system at each point in the state space of the system. Unlike Q, both S and T are state functions.
Further, one needs the equation of state of the system. The equation of state defines a sub-manifold of equilibria embedded within the general abstract state space of the system. Thermodynamic processes of the system can be represented by curves on this sub-manifold. In order to compute the integral of dQ along such a curve one integrates TdS along the curve. One needs to know the entropy as a function of all state variables, S= S(P,V,T, N1, N2, N3, ...) restricted to the equation of state sub-manifold.
Of course, in the real world not all processes can be described by such continuous curves in state space. We will not discuss such such non-quasi-static processes here.