On the nonlinear internal waves propagating in an inhomogeneous shallow sea