Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
definition_of_molpro_input_language [2020/06/11 18:17] – external edit 127.0.0.1 | definition_of_molpro_input_language [2024/01/08 13:24] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Definition of Molpro input language ====== | ||
+ | |||
+ | ===== Input format ===== | ||
+ | |||
+ | Molpro’s execution is controlled by an input file. In general, each input record begins with a keyword, which may be followed by data or other keywords. Molpro input contains commands, directives, options and data. The commands and directives are sequentially executed in the order they are encountered. Furthermore, | ||
+ | |||
+ | The input file can be written in free format. The following conversions take place: | ||
+ | |||
+ | * **, (comma)** move to next tab stop, i.e. this delimits input fields | ||
+ | * **; (semicolon)** end of record, i.e. a new record is started | ||
+ | * **! (exclamation mark)** ignore rest of input line (useful for comments) | ||
+ | * **'' | ||
+ | |||
+ | Input may be given upper or lower case. The input processor converts all characters to upper case. All integers are appended with “.” (only floating point numbers are read by the program). | ||
+ | |||
+ | Several logical input records can actually be typed on one line and separated by semicolons, i.e., a given input line may contain many actual commands (separated by semicolons), | ||
+ | |||
+ | Exception to these general rules are: | ||
+ | |||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | These commands always occupy a whole line. Using '' | ||
+ | |||
+ | A Molpro input record (card) contains a number of input //fields//. Input fields may be up to 256 characters wide and contain either expressions or strings. The fields can be separated by commas or blanks. We recommend the general use of commas in order to avoid unexpected results. | ||
+ | |||
+ | Each line may start with a label. A label is separated from the body of the line by a colon (:). The colon is part of the label. The length of the label must not exceed 6 characters (including the colon) and the labels must be unique. Labels may be useful with '' | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | |||
+ | Here '' | ||
+ | |||
+ | Strings containing blanks can be entered using quotes. For instance, '' | ||
+ | |||
+ | Input lines may be concatenated using $\backslash$ at the end of the line(s) to be continued. Any number of lines may be concatenated up to a total length of 1024 characters (only 500 characters are possible on older IBM systems). | ||
+ | |||
+ | Filenames may be up to 31 characters long, provided that long filenames are supported by the Unix system used. An exception are older CRAY systems, which allow only 8 characters for the names of binary Molpro files. | ||
+ | |||
+ | ===== Commands ===== | ||
+ | |||
+ | A command invokes a particular program. It may be followed by local input for this program, enclosed in curly brackets((Depending on the parameter '' | ||
+ | )) | ||
+ | |||
+ | The general format is either | ||
+ | |||
+ | '' | ||
+ | |||
+ | or | ||
+ | |||
+ | { '' | ||
+ | // | ||
+ | //data//\\ | ||
+ | } | ||
+ | |||
+ | Examples for commands are '' | ||
+ | |||
+ | In the following, such a sequence of input will be denoted a //command block//. Special command blocks are the geometry and basis blocks. | ||
+ | |||
+ | The options given on the command line may include any options relevant to the current program. For instance, in DF-LMP2-R12 this could be options for density fitting, local, explicit, and/or thresholds. Alternatively, | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | |||
+ | In these cases, only the options belong to the corresponding directive are valid; thus, if an option for '' | ||
+ | |||
+ | As already mentioned, the use of curly brackets is normally compulsory if more than one input line is needed. In the case of one-line commands, curly brackets are needed as well if the next command or procedure has the same name as a directive valid for the current command. | ||
+ | |||
+ | Note: '' | ||
+ | |||
+ | ===== Directives ===== | ||
+ | |||
+ | Directives serve to specify input data and special options for programs. They start with a keyword, followed by data and/or options. The general format is | ||
+ | |||
+ | '' | ||
+ | |||
+ | The format of data and options is specified in the subsequent sections. Data must always be given before any options. | ||
+ | |||
+ | Examples for directives are | ||
+ | |||
+ | '' | ||
+ | |||
+ | ===== Global directives ===== | ||
+ | |||
+ | Certain directives can be given anywhere in the input, i.e. either inside or outside command blocks. If they are given inside of command blocks, the specified options are valid only locally for the current program. However, if they are given outside a command block, they act globally, and are used for all programs executed after the input has been encountered. Local options have preference over global options. | ||
+ | |||
+ | The following directives can be either local or global: | ||
+ | |||
+ | Wavefunction definition: '' | ||
+ | Thresholds and options: '' | ||
+ | |||
+ | If such options are given outside a command block, a context can be specified | ||
+ | |||
+ | '' | ||
+ | |||
+ | e.g., | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | If only a single context is given (no colon), shortcuts for the specifying the '' | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | |||
+ | If no context is given, the default is '' | ||
+ | |||
+ | ===== Options ===== | ||
+ | |||
+ | Options have the general form '' | ||
+ | |||
+ | where value can be a number, and expression, or a string. Several options are separated by comma or blank. '' | ||
+ | |||
+ | Options can also be single keywords, like '' | ||
+ | |||
+ | ===== Data ===== | ||
+ | |||
+ | Data are defined as a sequence of numbers, expressions, | ||
+ | |||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |||
+ | Expressions (including numbers) may contain variables. | ||
+ | |||
+ | Examples for the use of data: geometry and basis input, '' | ||
+ | |||
+ | In some cases several lines of data are needed for a certain command or directive; in such cases the data must follow directly the corresponding command$|$directive, | ||
+ | |||
+ | '' | ||
+ | $\left[ data \right]$ | ||
+ | |||
+ | Normally, the input format of data is '' | ||
+ | |||
+ | If data are included using external files, the input format of //data// is free format: no commas are needed, but no variables and expressions can be used. | ||
+ | |||
+ | ===== Expressions ===== | ||
+ | |||
+ | [sec: | ||
+ | |||
+ | In any input field, data can be entered in the form of expressions. Numbers and variables are special cases of expressions. An expression is typed in Fortran style and may contain any number of nested parenthesis. The standard intrinsic functions are also available (see next section). Molpro understands both arithmetic and logical expressions. The result of an arithmetic expression is a //real// (double precision) number. Internally, all integers are also converted to //real// numbers. The result of a logical expression is either '' | ||
+ | |||
+ | The following standard operations can be performed : | ||
+ | |||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | * ** '' | ||
+ | |||
+ | ===== Intrinsic functions ===== | ||
+ | |||
+ | Expressions may contain the following intrinsic functions: | ||
+ | |||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | Note: all trigonometric functions use or produce angles in degrees. | ||
+ | |||
+ | ===== Variables ===== | ||
+ | |||
+ | [sec: | ||
+ | |||
+ | ==== Setting variables ==== | ||
+ | |||
+ | Data and results can be stored in Molpro variables. Variables can be of type string, floating, or logical and may be used anywhere in the input. | ||
+ | |||
+ | The syntax for setting variables is | ||
+ | |||
+ | '' | ||
+ | |||
+ | where unit is optional. If a variable is undefined, zero is assumed. | ||
+ | |||
+ | Variables are useful for running the same input with different actual parameters (e.g. geometries or basis function exponents), and to store and manipulate the results. //Arrays// are variables with an index in parenthesis, | ||
+ | |||
+ | ==== String variables ==== | ||
+ | |||
+ | Special care is necessary when using strings. In order to avoid unexpected results, either a $ has to be prefixed whenever a string variable is set, or the string has to be given in quotes. Possible forms are | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | Examples: | ||
+ | |||
+ | < | ||
+ | | ||
+ | ! converted to upper case. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | yields | ||
+ | |||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | For more information concerning strings and string variables, see section [[variables# | ||
+ | |||
+ | ===== Procedures ===== | ||
+ | |||
+ | ==== Procedure definition ==== | ||
+ | |||
+ | Procedures are sequences of commands and/or options. They can be defined anywhere in the input as | ||
+ | |||
+ | ['' | ||
+ | //command blocks//\\ | ||
+ | // | ||
+ | $\}$ | ||
+ | |||
+ | or | ||
+ | |||
+ | '' | ||
+ | //command blocks//\\ | ||
+ | // | ||
+ | '' | ||
+ | |||
+ | In order to avoid unexpected results, // | ||
+ | |||
+ | Note that procedures are not executed when encountered in the input, but only when called. Procedure definitions must not be nested. Procedures can contain procedure calls up to a nesting level of 10. | ||
+ | |||
+ | ==== Procedure calls ==== | ||
+ | |||
+ | Procedures can be called anywhere in the input. The syntax is the same as for commands (cf. section [[definition of Molpro input language# | ||
+ | |||
+ | '' | ||
+ | |||
+ | No options are allowed on procedure calls. However, specific options may be set using directives within the procedure, and these are then valid for all programs within the procedure which follow the directive. When execution of the procedure is finished, the previous global options are restored. The hierarchy in which options are processed is as follows: | ||
+ | |||
+ | Global options\\ | ||
+ | Options in procedures\\ | ||
+ | Command line options\\ | ||
+ | Options given on directives within a command block\\ | ||
+ | The last option set is then actually used. Thus, options specified on command lines or within command blocks have preference over procedure options, and procedure options have preference over global options. | ||