@cd: <i>the rough potential energy of the atmosphere should be around 3.2 E24</i>
You had me worried for a moment that I'd misplaced the decimal point, cap'n. But let's check with round numbers. The atmosphere has mass m = 5E18 kg, surface gravity g = 10 m/s2, and the average height of a parcel of atmosphere (same thing as the scale height) is 8000 m. Hence mgh = 4E23 J.
For more decimal places (namely 7.55E8*5.10E14 = 3.85E23) see <a href="http://judithcurry.com/2010/12/05/confidence-in-radiative-transfer-models/#comment-20196" rel="nofollow">my reply to Miskolczi</a> in this blog on Dec. 9, 2010.
<i>which would put KE at 1.6 E24</i>
Dividing your 1.6 yottajoules (a lot of joules!) by 5.1E18 kg (mass of the atmosphere) gives a mean energy per kg of 310 kJ. The constant-volume specific heat of air is cv = 0.716 kJ/kg/K, so your estimate of the atmosphere's KE makes its mean temperature 310/0.716 = 433 K, hot as hell!
But fixing the decimal point brings it down to 1.6E23 for a mean temperature of 43.3K, colder than liquid nitrogen. So that can't be the only error.
Looks like you're on Miskolczi's side. According to my reply to Miskolczi cited above, that would make your temperature estimate low by a factor of exactly 5. The mean temperature of the atmosphere should be more like 5*43.3 = 217 K, not unreasonable considering the lapse rate is somewhere between 6 and 10 degrees per km.
(The reason for using cv instead of cp, constant-pressure specific heat, is that the latter includes the work done on the environment by expanding the volume while holding the pressure constant. We don't want to count that work as part of the internal energy of the gas. Holding the volume constant ensures that no work is done on the environment during the heating of the gas starting from 0 K.)