Compression of the Koopman matrix for nonlinear physical models via hierarchical clustering