Interface blocks are used to enforce type checking for the external routines ie main/, ybos/, etc. The required information for each procedure (procedure name and definitions of the passed variables) are placed in files procedure.ifb in the include/ directory and included in all routines accessing this procedure. When interfacing to f77-style routines, the Interface block specifications must also be f77 style. Please see F90 Interface block types for a caution in using interface blocks.
The procedures for filling the new geometry data structures and the tdc hit structures are now implemented in f90 modules in free source format. The intention is that the new code to be written for pattern recognition and tracking will be placed in modules and obtain required globals and procedures from modules. For code in modules interface blocks are not allowed an type-checking of parameters is automatic.
We are developing a strategy aimed at data encapsulation to facilitate program reliability and debugging. The basic concept is to base modules on groupings of related data objects - the kinds of things that we would normally group into a common block. Module components would group together data-type definitions, procedures accessing the components of these data structures, and operators defined for these data types. The varibles themselves may be declared either within the module or the calling routines. When the data compnents need be accessed only by procedures within the module, then the components may be declared PRIVATE facilitating encapsulation. In some cases it will be more convenient or efficient to have procedures which operate on data components (eg histograming calls) defined in several different modules and pass the data to them as global variables through USE association. In this case the rule for which module to place a procedure in will be determined by the hierarchical nature of use association; if module b uses a, then a cannot use b.
We've also come up with some convenient naming conventions:
Data type definitions end in "_type".
Module names are root_mod".
Procedure names within the module will contain root.