Tonto | ||
---|---|---|
<< Previous | Next >> |
There are only a few extra rules to write valid foo code for use in TONTO, in addition or contradiction to the usual rules of Fortran95.
Lower case letters must be used for all Fortran95 keywords.
All C-preprocessor macros must be placed in the file called macros
All derived type definitions used must be placed in the file types.foo.
Capital letters must be used for every module name, and for every macro definition. Capitalised names are only allowed if their intended meaning does not clash with any C-preprocessor macros.
Every foo module XXXX must consist of a set of routines concerned with actions on a Fortran95 type XXXX. The name XXXX stand for a C-preprocessor macro which defines the type. If the types is a Fortran95 derived type, then the name of the derived type must be xxxx_type.
The module GAUSSIAN, contained in file gaussian.foo, is concerned with actions of gaussian functions. These functions are represented by a type gaussian_type, defined in file types.foo as follows:
type gaussian_type INT :: l REALVEC(3) :: pos REAL :: ex end |
#define GAUSSIAN type(gaussian_type) |
For any foo module XXXX, the macros file and the automatically generated interface file xxxx.int must be included, using the C-preprocessor, after any use and implicit statements
It is illegal to use any routine name which ends in the characters _n, where n is an integer greater than 0.
The arguments to a foo routine must be on one single line.
The Fortran95 keywords: subroutine, function, and module procedure are not allowed.
The result syntax must always be used to define functions
The Fortran95 syntax for declaring recursive, pure, and elemental routines is modified by placing the strings [recursive], [pure], and [elemental] after the routine name
The Fortran95 keywords: program, module, interface, select, type, else, do, contains, if, then, must not be used on a line with multiple statement, involving the character ;
Expressions involving the dot character . are banned except for real number constants. In particular, C-preprocessor macros TRUE, FALSE, NOT, AND, and OR must be used for the logicals .true. , .false., .not. and .or.
Procedures which are contained within another procedure are not allowed.