211 1998 Krister Åhlander krister@tdb.uu.se Implementing Runge--Kutta schemes for reusability Abstract -------- Four different strategies for implementing Runge--Kutta time stepping schemes are discussed. Explicit Runge--Kutta, ERK, schemes are studied, but the results can be generalized to diagonally implicit Runge--Kutta methods as well. The four different strategies combine the concepts of forward and reverse communication with and without a state machine approach. The idea of using state machines is novel. The different implementation strategies are studied for a model problem, in a parallel multi-block grid code, and in Compose, a PDE solving environment, which uses overlapping grids and finite differences. It is found that the state machine approach does not degrade performance. The state machine approach with forward communication is advantageous in the context of a general PDE solving environment. The reason is that this approach combines the flexibility of reverse communication with the simplicity of forward communication, which allows for a high reusability. The incompressible Navier--Stokes equations are shown as a case where a state machine ERK component is reusable, whereas a traditional implementation with forward communication would require modifications in the ERK implementation. The conclusion is that the the novel ERK communication strategies are comparable with respect to performance. The choice of implementation may therefore be driven by other objectives, such as reusability. In this respect, the state machine implementation is advantantageous.