Basic CHARMM Commands

CHARMM commands may be entered via standard input or (usually) via an input file. CHARMM only reads the first four letters of a command and commands are not case-sensitive. For example, "GENERATE", "generate", "GENE", and "gene" would all execute the same command.

However, care must be taken when using both lower and upper case characters. For example, when accessing a file /home/user/Charmm/file.psf would not work because "/Charmm/" has an uppercase "C". This can be overcome by enclosing the path in quotation marks, e.g. "/home/user/Charmm/file.psf".

Each CHARMM script must begin with a title, which is an arbitrary number of lines beginning with asterisks (*) and containing whatever text the user would like to identify the script. The end of a title is specified by a line with only a single asterisk on it. An example title is:

* This is my CHARMM script
*

A CHARMM script should end with the STOP command.

CHARMM supports basic logical and mathematical operations within input scrips and can parse IF, GOTO, LABEL, STREam, RETUrn, SET, INCRement, and DECRement statements.

The IF statement works like any other if statement in programming and it has the following test cases:


.GT. greater than
.LE. less than
.GE. greater than or equal to
.LE. less than or equal to
.EQ. equal to
.NE. not equal to
.AE. almost equal (diff<0.0001)

Example:

IF phi .EQ. 1.618
     SET pi = 3.14

For the GOTO command a LABEL must be established first and if there is more than one label with the same string then GOTO goes to the first label. This is typically used to create loops in CHARMM scripts.

Example:

SET i = 1 
LABEL LOOP 

do something... 

INCRement i by 1 
IF @i .LT. 10 THEN GOTO LOOP

STREAM allows another file to be directly imported to the input file. This can help split up one large input file to keep the input script clean and allow the user to import commonly used commands with a single line. This is analogous to reusable subroutines in programing. A file that will be streamed in must have a title and rather than a "stop" command at the end of the input file, there should be a "return" command. An example is given below.

*File to be streamed in. File name is stream_example.str
*

OPEN UNIT 1 READ CARD NAME /path/to/coordinate_file.crd
READ COOR UNIT 1 CARD
CLOSE UNIT 1

RETURN

*Input file that streams in a file
*

STREam stream_example.str

The SET command for CHARMM is a way to assign numbers to variables. DEFIne is used for strings.

Example:

SET phi = 1.618

When a value is set, it will stay the same value even if used in another command until the user manually changes the value.

CALC is used for calculations. CHARMM requires spaces between numbers, operations, and parenthesis

Example:

calc pi = 2.14 + 1

Result: Variable "pi" is set to 3.14

DEFIne may be used as:

DEFI bigprotein SELEct SEGID A END

In this situation, bigprotein will hold the atom selection. the word "bigprotein" can be used as an alias for all the atoms that have the segment ID (SEGId) A.

There are many different options for the select command. More information on the SELEct command may be found in the CHARMM documentation (select.doc).

To continue lines in a CHARMM input script use a hyphen (-). To add comments to the CHARMM input script use an exclamation mark (!).

Example:

! Define the region
DEFIne REGIon SELE ATOM A* 1 C1 OR. ATOM A* 1 C2 -
 .OR. ATOM A* 1 H1 .OR. ATOM A* 1 H2 -
 .OR. ATOM A* 1 H3 .OR. ATOM A* 1 H4 -
 .OR. ATOM A* 1 H5 SHOW END

The amount of information printed out by CHARMM during execution can be controlled with the WRNLev and PRNLev commands. Warnings are assigned levels between -5 and 5, with lower numbers indicating a higher severity. WRNLev sets the least severe warning that will be displayed to the user. default value is 5 (all warnings are printed). , non-warning output statements are assigned a priority from 0 to 10 and only those less than the current PRNLev are displayed. default value for PRNLev is 5.

The BOMBlev (or BOMLev) command is used to set the least severe warning that will cause CHARMM to abort execution. The default value is 0 and running with a BOMBlev less than -2 is generally not recommended because serious errors can affect the validity of calculations. All warnings at or beneath level 0 should be carefully scrutinized to make sure that they do not cause issues with the results.