The JCMT Gould Belt Survey: evidence for radiative heating and contamination in the W40 complex