A unified linear theory of wavelike perturbations under general ocean conditions