renamed flag COUPLE_WITH_DSM to COUPLE_WITH_EXTERNAL_CODE, and added a new parameter called EXTERNAL_CODE_TYPE to determine the type of external code to couple with