Entropy of photons in the Sun / Earth system - Do infrared photons have higher entropy than ultraviolet/visible photons? The entropy of a photon gas in equilibrium (emitting e.g., black-body radiation; BB) is
$S \propto V \cdot T^3$
where $V$ is the volume and $T$ is the temperature of the gas [see https://en.wikipedia.org/wiki/Photon_gas].
Now, in case of a BB, $T$ is linked to the peak frequency of the BB, $\nu_{\rm peak}$, according to the Wien's law:
$\nu_{\rm peak} \propto T$
[see https://en.wikipedia.org/wiki/Wien%27s_displacement_law].
So, the entropy of a BB in a unit volume is proportional to the to the third power of peak frequency:
$S \propto \nu_{\rm peak}^3$.
Thus, from this I understand that, for instance, a BB radiation peaking at visible wavelengths (like the Sun) would have higher entropy than a BB radiation peaking at infrared wavelengths (like the Earth).
However, this looks in contradiction with many arguments saying that the Earth is "powered" by low-entropy photons coming from the Sun, which are absorbed and then irradiated as high-entropy infrared photons [see e.g., https://www.preposterousuniverse.com/blog/2016/11/03/entropy-and-complexity-cause-and-effect-life-and-time/].
Where am I getting wrong?
 A: The fundamental mistake here is that the Sun radiation system is not in equilibrium past the surface. As it radiates out, the photon density decreases.
Once the energy density is sufficiently reduced,  BB-radiation-curve peaking at visible wavelengths (like the Sun) has lower entropy than BB-radiation-curve peaking at infrared wavelengths (like the Earth).
Let us demonstrate by showing that re-radiating the energy as BB radiation at $R-1$ radii away from the sun's surface results in higher entropy.
At $R$ radii away, the entropy density due to the sun's radiation is now:
$$S/V=\frac{k_1T^3}{R^2}$$
The energy density  is now:
$$U=\frac{k_2T^4}{R^2}$$
If we reradiate BB radiation of this energy, the new temperature $T'$ follows:
$$U=k_2T'^4$$
Which gives
$$T'=\frac{T}{\sqrt{R}}$$
Which has an entropy density
$$S'=k_1T^3=\frac{T'^3}{{R}^{3/2}}$$
Which is greater than our original entropy density from the sun's radiation, since we are $R-1>0$ radii from the sun's surface
A: In about 1995 I derived the result that the production of a photon of any energy increases entropy by exactly the same amount regardless of photon energy. The derivation did follow from the known entropy formula for a photon gas, but I don't recall the details. I later found two papers arriving at the same conclusion derived differently from my result. One published in 2002 and the other in 2003. I've also seen a lengthy calculation of the rate of entropy increases resulting from radiation received from the sun by the Earth and radiation radiated from the Earth at constant average temperature which was completely consistent with this result.
