The COSY language independent architecture: Porting COSY source files

As part of the project of porting the code COSY INFINITY[1] to a language independent architecture, a tool is being developed that translates COSY language to C++ language. The tool will allow the use of C++ classes for all elementary operations of COSY, which represent a wrapper around high-performance COSY C source. This will allow those unfamiliar with the COSY language access to the power of COSY. 1 The COSY language independent architecture and the COSY syntax Recently the COSY system [2] [1] [3] [4] [5] [6] [7] has been ported to a language independent platform to accommodate the use in various modern and widely used programming environments. In particular, the languages supported include FORTRAN 77, C, as well as the object oriented environments of FORTRAN 90 and C++. This is achieved in the following way. The original FORTRAN 77 based language environment consists mainly of operations on a suite of COSY objects, most notably the DA (Differential Algebra) objects that have proven very useful for beam physics purposes [8]. These objects can traditionally be utilized either within the environment of a FORTRAN precompiler[9][10][11], or within the object oriented language environment of the COSY scripting tool[1], which will be discussed in detail below. Support in the C world is achieved by the use of a FORTRAN-to-C precompiler, and the FORTRAN source has been adjusted to achieve reliable cross-compilation to the C environment that results in efficient code. To assure future reliability and reproducibility of this porting operation, the C source code of the cross-complier is maintained together with the FORTRAN package. The use within C++ and FORTRAN90 are achieved by a suite of light wrappers providing C++ and FORTRAN90 objects for the COSY objects [12]. Great care is taken to maintain the high ∗Currently at GeneData AG, CH-Basel 4016, Switzerland.

[1]  K. Makino,et al.  COSY INFINITY Version 8 . 1 Programming Manual ∗ , 2002 .

[2]  M. Berz,et al.  COSY INFINITY version 7 , 1997, Proceedings of the 1997 Particle Accelerator Conference (Cat. No.97CH36167).

[3]  P. W. Hawkes,et al.  Modern map methods in particle beam physics , 1999 .

[4]  K. Makino,et al.  COSY INFINITY Version 8 . 1 User ’ s Guide and Reference Manual ∗ , 2001 .

[5]  M. Berz,et al.  COSY INFINITY and Its Applications in Nonlinear Dynamics , 1996 .

[6]  Martin Berz,et al.  COSY INFINITY Version 9 , 2006 .