next up previous contents
Next: The MOD function Up: Fortran Routines Previous: Cactus Fortran Functions   Contents

Fortran Modules

Fortran modules should be placed into source files that have the same name as the module, followed by the corresponding file name suffix. A module metric should thus be placed, e.g. into a file metric.F90. This convention allows the Cactus build system to automatically deduce the compile time dependencies.

If you do not follow this convention, then you have to include the modules into the thorn's make.code.deps file (Section B3.5.1) to ensure they are compiled before the routines which use them. This is especially important for parallel building. For example, if a routine in MyRoutine.F90 uses a module in MyModule.F90, then add the line:

MyRoutine.F90.o:         MyModule.F90.o