shallow water code