merged Vadim's support for coupling with DSM, cleaned and improved by Cl...

...ément Durochat