Evolution of solitary waves in a two-pycnocline system