Table of Contents

Tables and plotting

Tables

Variables can be printed in Table form using the command

TABLE,var1,var2,…

The values of each variable are printed in one column, so all variables used must be defined for the same range, and corresponding elements should belong together. For example, if in a calculation one has stored R(i), THETA(i), ECI(i) for each geometry i, one can print these data simply using

TABLE, R, THETA, ECI

By default, the number of rows equals the number of elements of the first variable. This can be changed, however, using the RANGE subcommand.

The first ten columns of a table may contain string variables. For instance,

hf;etot(1)=energy;method(1)=program;cpu(1)=cpustep
ccsd;etot(2)=energy;method(2)=program;cpu(2)=cpustep
qci;etot(3)=energy;method(3)=program;cpu(3)=cpustep
table,method,etot,cpu

prints a table with the SCF, CCSD, and QCI results in the first, second, and third row, respectively. For other use of string variables and tables see the examples in Tables and Macro definitions using string variables.

The apparence of the table may be modified using the following commands, which may be given (in any order) directly after the the TABLE card:

REGRESSION_SLOPE, REGRESSION_INTERCEPT,
LOWERBOUNDMIN_SLOPE, LOWERBOUNDMIN_INTERCEPT,
UPPERBOUNDMIN_SLOPE, UPPERBOUNDMIN_INTERCEPT,
LOWERBOUNDMAX_SLOPE, LOWERBOUNDMAX_INTERCEPT,
UPPERBOUNDMAX_SLOPE, UPPERBOUNDMAX_INTERCEPT.

For the Python data format, the output is a complete Python module containing the following.

If the output file is modified after running Molpro, a subsequent run of Molpro will replace the data, but leave the code modifications intact.

Example:

do i=1,37; x(i)=(i-1)*10; c(i)=cos(x(i)); s(i)=sin(x(i)); enddo
table,x,c,s;save,trig_example.py,new,2;title,'Trigonometry';title,'sines and cosines'

followed by, in Python,

from trig_example import molpro_table, latex_molpro_table, plot_molpro_table
plot_molpro_table(molpro_table,'trig_example') # produces trig_example.pdf, just like python trig_example.py
print(latex_molpro_table(molpro_table, decimals=3, transpose=False))

The Python environment should include the matplotlib, scipy and numpy packages.

Plotting

[PLOT[,col1,col2,$\dots$][,options]

Construct input for a plotting program using the table as data. PLOT is a subcommand of TABLE and must follow TABLE or any of its valid subcommands given in the previous section. More than one PLOT command can be included within a single TABLE, and each invocation generates a new plot. However, PLOT must appear after all other TABLE subcommands.

col1, col2,$\dots$ are the names of the table columns to be plotted. These must be an exact subset of those given on the TABLE command. The first column is taken as abscissa, and the values of the remainder will be plotted against it. If no columns are specified, then the entire table is plotted; if a single column is specified, it will be used as abscissa, and all other columns in the table will be plotted as ordinate. options can be chosen from the following.

The following additional directives can be given before the PLOT directive:

Diatomic potential curve analysis

For the case that a table contains one or more potential energy functions for a diatomic molecule, with the first column containing bond lengths in Bohr or Ångstrom, it is possible to calculate spectroscopic constants using

DIATOMIC[,DEGREE=n][,MASS=m][,PRINT=p]

The data are fitted to a polynomial of degree $n$ (default is number of points minus 1, ie interpolation), and spectroscopic constants calculated using reduced mass $m$ expressed in u. Note that it is possible to constrain which bond lengths are used through the use of the RANGE subcommand.

D$_{\rm e}$ and D$_0$ are computed from the energy at the fitted minimum distance, and the energy at the longest distance along the potential curve. If the longest distance is less than 10 Å, then D$_{\rm e}$ and D$_0$ are not computed, and instead a value of 0 is printed.