A previously developed numerical-multilayer modeling approach for systems of governing equations is extended so that unwanted terms, resulting from vertical variations in certain background parameters, can be removed from the dispersion-relation polynomial associated with the system. The new approach is applied to linearized anelastic and compressible systems of governing equations for gravity waves including molecular viscosity and thermal diffusion. The ability to remove unwanted terms from the dispersion-relation polynomial is crucial for solving the governing equations when realistic background parameters, such as horizontal velocity and temperature, with strong vertical gradients, are included. With the unwanted terms removed, previously studied dispersion-relation polynomials, for which methods for defining upgoing and downgoing vertical wavenumber roots already exist, are obtained. The new methods are applied to a comprehensive set of medium-scale time-wavepacket examples, with realistic background parameters, lower boundary conditions at 30 km altitude, and modeled wavefields extending up to 500 km altitude. Results from the compressible and anelastic model versions are compared, with compressible governing-equation solutions understood as the more physically accurate of the two. The new methods provide significantly less computationally expensive alternatives to nonlinear time-step methods, which makes them useful for comprehensive studies of the behavior of viscous/diffusive gravity waves and also for large studies of cases based on observational data. Additionally, they generalize previously existing Fourier methods that have been applied to inviscid problems while providing a theoretical framework for the study of viscous/diffusive gravity waves.
Graphic abstract