WebMO Job Template Help

Getting Started

WebMO presents the user with a list of pre-defined jobs for each of the various computational engines. These jobs are defined in a template file (*.tmpl), located in the <cgiBase>/interfaces directory. For example, pre-defined Gaussian jobs can be found in gaussian.tmpl. This file can be edited or amended to customize or add additional capabilities to WebMO. Jobs defined in this location are available to every WebMO user.

User Templates (WebMO Pro only)
In addition, template files can be created in the <userBase>/<username> directory to add additional jobs specific to a single user (gaussian.tmpl, gamess.tmpl, etc). These jobs will be available only to the user in whose directory they appear.

File Structure

Each template file is divided into sections, separated by a line of equal signs (=). The first line of each section contains the name of the job, for example "Geometry Optimization". The remainder of the section makes up the contents of the input file which is fed to the appropriate computational engine.

Each template section can contain variables, which are then substituted for in the input file before submission to the computational engine. For example, the theory, basis set, charge, and geometry are all such variables. All variables are preceded by a dollar sign ($).

For example, the following is an excerpt from a Gaussian template

#$outputMode $theory/$basisSet OPT FREQ $additionalKeywords

Assuming that the user chose normal output mode, HF theory, the 3-21G basis set, and no additional keywords, this line would be interpreted as


The following is a list of the most common variables variables. Other variables are defined on the 'Job Options' and 'Advanced Options' pages for each computational engine.

Variable Description
$jobName The name given to this job by the user
$theory The selected level of theory
$basisSet The selected basis set
$charge The charge of the molecule
$multiplicity The multiplicity of the molecule
$geometry The molecular geometry, in an appropriate form
$additionalKeywords Any user specified additional keywords
$calculation The type of calculation specified by the user (only used when "Other" is selected)

Special Characters
The following characters are treated specially within templates.

Character Description
\n New-line
/ (at end of line) Continue onto next line as if no line break occurred
\$ Dollar sign ($).

Conditional Statements
The template can also contain conditional statements, whose values depends upon a set condition. For example, the Gaussian templates use such statements to add a Geom=AllCheck to the input file if a checkpoint file has been selected.

The WebMO template system use the Template Toolkit library to evaluate condition statements, as well as other powerful constructs, such as loops, etc. Full documentation on how to use these features, as well as the syntax for these conditional statements is rather simple, and available online at: Template Toolkit Homepage.


The pre-defined jobs found in the default template files provide many examples of these concepts. These template files (*.tmpl) can be found in the <cgiBase>/interfaces directory. These should provide a vast number of examples for the user who wishes to develop their own set of job templates.
Program Help Editor Help Administration Help