diff --git a/Compiler/BackEnd/BackendDAETransform.mo b/Compiler/BackEnd/BackendDAETransform.mo index 65f9f828de..c941605362 100644 --- a/Compiler/BackEnd/BackendDAETransform.mo +++ b/Compiler/BackEnd/BackendDAETransform.mo @@ -104,8 +104,13 @@ algorithm then (syst, comps); else algorithm - Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo()); - then fail(); + if Flags.isSet(Flags.NF_SCALARIZE) then + Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo()); + fail(); + else + Error.addCompilerWarning("BackendDAETransform.strongComponentsScalar failed (sorting strong components)"); + end if; + then (inSystem, {}); end matchcontinue; end strongComponentsScalar; diff --git a/Compiler/BackEnd/BackendEquation.mo b/Compiler/BackEnd/BackendEquation.mo index 371b15f1e0..8d99525c97 100644 --- a/Compiler/BackEnd/BackendEquation.mo +++ b/Compiler/BackEnd/BackendEquation.mo @@ -188,11 +188,17 @@ public function equationArraySize "author: lochel should correspond to the number of variables." input BackendDAE.EquationArray equationArray; output Integer outSize; +protected + Boolean nfScalarize = Flags.isSet(Flags.NF_SCALARIZE); algorithm outSize := 0; for i in 1:ExpandableArray.getLastUsedIndex(equationArray) loop if ExpandableArray.occupied(i, equationArray) then - outSize := outSize + equationSize(ExpandableArray.get(i, equationArray)); + if nfScalarize then + outSize := outSize + equationSize(ExpandableArray.get(i, equationArray)); + else + outSize := outSize + 1; + end if; end if; end for; end equationArraySize;