A comprehensive new radiation code based on the two-stream equations in both the long-wave and short-wave spectral regions is described. The spectral resolution of the code is variable, enabling it to be used in a wide range of applications. Because of its flexibility, the code is well-suited to the investigation of the sensitivity of radiative calculations to changes in the way in which physical processes are parametrized. The gaseous transmission data are derived from a line-by-line model. Particular attention is directed towards the treatment of the water vapour continuum, the overlap between gases, and the sensitivity to changing the carbon dioxide concentrations. The performance of the code is examined both at high spectral resolution and in a lower-resolution configuration designed for the UK Meteorological Office United Forecast/Climate Model (UM). Particularly for use in the UM, the code must be shown to perform satisfactorily across the whole range of atmospheric conditions. Comparisons are therefore made with reference calculations in both the long-wave and the short-wave, in clear and cloudy skies, and the accuracy with which various processes may be represented is studied. For the cloudy calculations in the short-wave, a new method is presented for deriving the single-scattering properties in broad bands, based on the analytic expression for the reflectivity of an optically thick cloud. This minimizes the errors in calculating the short-wave radiative properties of water clouds when the spectral resolution is reduced to that designed for the UM. In contrast, for ice clouds the errors are minimized by deriving the single-scattering properties using linear averaging, as appropriate for optically thin clouds. In the long-wave, the vertical distribution of the radiative heating in cirrus clouds is examined at high spectral resolution. The effect of scattering of long-wave radiation, usually ignored in large-scale models, is examined in some detail and is explained using a simple model. Taking all these studies into account, it is concluded that the configuration designed for the UM retains the generality of the code, without significantly compromising the overall accuracy.