added residual computation in DEBUG_MODE in c interface ric mhe if