  We study how stably stratified or semi-convective layers alter the tidal
dissipation rates associated with the generation of internal waves in planetary
interiors. We consider if these layers could contribute to the high rates of
tidal dissipation observed for Jupiter and Saturn in our solar system. We use
an idealised global spherical Boussinesq model to study the influence of stable
stratification and semi-convective layers on tidal dissipation rates. We carry
out analytical and numerical calculations considering realistic tidal forcing
and measure how the viscous and thermal dissipation rates depend on the
parameters relating to the internal stratification profile. We find that the
strongly frequency-dependent tidal dissipation rate is highly dependent on the
parameters relating to the stable stratification, with strong resonant peaks
that align with the internal modes of the system. The locations and sizes of
these resonances depend on the form and parameters of the stratification, which
we explore both analytically and numerically. Our results suggest that stable
stratification can significantly enhance the tidal dissipation in particular
frequency ranges. Analytical calculations in the low frequency regime give us
scaling laws for the key parameters, including the tidal quality factor $Q'$
due to internal gravity waves. Stably stratified layers can significantly
contribute to tidal dissipation in solar and extrasolar giant planets, and we
estimate substantial tidal evolution for hot Neptunes. Further investigation is
needed to robustly quantify the significance of the contribution in realistic
interior models, and to consider the contribution of inertial waves.
