CP2K input reference

Version information

This HTML manual refers to CP2K version 2023.2 (git:056df93) and was generated automatically from a CP2K executable compiled on Sat Jul 22 11:14:08 UTC 2023 using the --xml command line option (see how to generate this manual). Thus the manual describes exactly this version of the code.

Journal papers

List of references cited in the CP2K input manual.

CP2K units

Available units of measurement which can be used in the CP2K input for keyword values. The units can be used to specify an alternative unit of measurement for keyword values, for which a default unit has been explicitly defined. They are specified in the form of a string [unit] as a separate token before any value. A unit specification is applied to all values on the same line following that specification, unless explicitly overwritten by a another unit specification.

Internal input preprocessor

Before the input is parsed, the input is run through a simple internal preprocessor. The preprocessor recognizes the following directives independent of capitalization:

@INCLUDE 'filename.inc'
The file referenced by filename.inc is included into the input file and parsed. Recursive inclusions are not allowed and the files have to exist in the current working directory. There can be only one @INCLUDE statement per line. Single or double quotes have to be used if the filename contains blanks.
@SET VAR value
Assigns the text value to the preprocessing variable VAR. value is the text following VAR with the outer whitespace removed. The variable can be recalled with a ${VAR} (or $VAR) statement. There can be only one @SET statement per line. A variable name can only contain alphanumerical characters plus the underscore and must not start with a number.
${VAR} or $VAR
Expand the variable VAR. The text ${VAR} (or $VAR) is replaced with the value assigned to VAR in the last @SET directive. There can be multiple variable statements per line. The expansion process is repeated until no more variables are found.
${VAR-DEFAULT}
Expand the variable VAR if defined. The text ${VAR-DEFAULT} is replaced with the value assigned to VAR in the last @SET directive if defined, otherwise with the value specified after the dash - (here: DEFAULT).
@IF / @ENDIF
Conditional block. The text from the @IF line up to the next line with a valid @ENDIF is skipped, if the expression following @IF resolves to false. Available expressions are lexical comparisons for equality '==' or inequality '/='. If none of the two operators are found, a '0' or whitespace resolves to false while any text resolves to true. @IF/@ENDIF blocks cannot be nested and cannot span across files. There can be only one test (== or /=) per @IF statement.

Input structure

All sections that can be part of a CP2K input file are shown here with their allowed nestings. A detailed description of each section and its keywords can be obtained by clicking on the section links. The links in the detailed descriptions switch back to the corresponding index entries. In this way a toggling between the index and the detailed description is feasible.

Index of all input sections

Last update: Sat Jul 22 11:14:08 UTC 2023


Back to the main page of this manual or the CP2K home page (Last update: 22.7.2023)