EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

MAD-X Module Writer's Guide


Hans Grote and Frank Schmidt

Introduction

MAD-X, in its actual form, consists of a main program in Fortran-77 that does nothing but call a C program which handles the overall control. This C program (CONTROL in the following) in turn calls modules written in Fortran-77, possibly Fortran-90 or Fortran-95, and C. The Fortran-77 modules come from MAD-8 and are adapted to the new structure.

All I/O (except for debug or error messages) is performed by CONTROL. The modules receive their input data via calls (Fortran), or take them from structures (C); the module outputs are stored in tables or variables via calls (Fortran) or directly in structures (C).

For each new module to be added, FS will provide a complete development environment consisting of:

Additional functionality will be added to CONTROL as it becomes necessary, i.e. to gain access to data not yet provided.

In the following, the different cases are handled separately.