Resonant Transfer of Energy between Nonlinear Waves in Neighboring Pycnoclines