User Tools

Site Tools


dev:fypp

This is an old revision of the document!


Fortran metaprogramming using Fypp

Fypp (official repository) is a Fortran preprocessor based on Python expressions. Fypp directives can be used in all CP2K Fortran source files for metaprogramming. For simple tasks (such as conditional compilation and include statements), the default Fortran preprocessor (cpp or fpp) can still be used. However cpp is very limited and if more advanced metaprogramming capability is needed (loop unrolling, templates, code generation), usage of Fypp over other tools is highly encouraged. In particular code generators should be written using Fypp instead of custom scripts (if feasible). CP2K's own template engine is deprecated and templates should be implemented using Fypp.

For getting started with Fypp, read the official documentation.

dev/fypp.1485437410.txt.gz · Last modified: 2020/08/21 10:14 (external edit)