In this work, we present a novel methodology to efficiently compile large scale dynamical systems described as Modelica models, and its implementation in a prototype Modelica Compiler called ModelicaCC. The methodology allows to perform the different stages of the compilation process without expanding the content of repetitive structures so the resources (CPU time and memory) used by the compiler result independent on the model size. Besides introducing the methodology with their algorithms and the implementation in the ModelicaCC compiler, we analyze their efficiency comparing its performance with that of OpenModelica in different large scale models.