Anatomy of an input file

An ORCA input file is free-format ASCII. Indentation is free, and ORCA is case-insensitive (with the exception of file names). An input file consists, broadly, of three pieces:

# ① Keyword line — most of the setup fits on a single line
! B3LYP def2-TZVP TightSCF Opt

# ② %-block — for detailed options
%scf
   MaxIter 200
end

# ③ Coordinate input
* xyz 0 1
  O   0.000   0.000   0.119
  H   0.000   0.763  -0.477
  H   0.000  -0.763  -0.477
*

With just those three pieces you can drive most calculations. Here is each one in turn.

The keyword line !

Lines that start with an exclamation mark (!) are called simple input: they summarise on a single line settings that would otherwise have to be spread across several blocks. A file may contain several such lines, and several keywords may share one line.

# Both formulations below are equivalent
! B3LYP def2-TZVP TightSCF
! RIJCOSX def2/J Opt Freq

# Same on one line
! B3LYP def2-TZVP TightSCF RIJCOSX def2/J Opt Freq

Keywords fall into the following broad categories:

CategoryExamplesMeaning
MethodHF, B3LYP, MP2, CCSD(T), DLPNO-CCSD(T)Choice of electronic-structure theory.
Basis setdef2-SVP, def2-TZVP, cc-pVTZAtomic-orbital basis.
Auxiliary basisdef2/J, def2-TZVP/CFitting basis required by RI / RIJCOSX.
Run typeOpt, Freq, EnGrad, NumFreq, NEB-TSSingle point, optimisation, frequencies, …
Algorithm optionsRIJCOSX, RI-JK, UKS, UNOIntegral approximation, spin handling, etc.
Convergence thresholdNormalSCF, TightSCF, VeryTightSCFHow strict the SCF convergence criteria are.
Integration gridDefGrid1, DefGrid2, DefGrid3DFT numerical-integration grid (DefGrid2 is the default).
SolvationCPCM(water), SMD(ethanol)Implicit-solvent models.
ParallelPAL4, PAL8, …, PAL64Number of cores.
Keyword order does not matter

! B3LYP def2-TZVP Opt and ! Opt def2-TZVP B3LYP are completely equivalent. For readability the conventional order is method → basis → auxiliary basis → run type → options.

Block input %...end

When you need finer control, use block input: start the block with % and end it with end; inside, options take the form variable = value.

# SCF convergence details
%scf
   MaxIter     300          # maximum number of iterations
   ConvForced   1            # continue even if not converged
   DIIS         true         # use DIIS acceleration
   SOSCF        true         # use SOSCF
end

# Method-level details
%method
   Functional  B3LYP
   RunTyp      Opt
end

# Optimisation options
%geom
   MaxIter     200
   Constraints
       { B 0 1 1.25 C }   # freeze 1–2 bond at 1.25 Å
   end
end

The blocks you will see most often:

BlockRole
%scfSCF convergence (iterations, DIIS, level shift, …).
%methodGeneral method settings: functional, run type, …
%basisElement-specific basis overrides, ECP specification.
%geomOptimisation options, constraints, potential-surface scans.
%freqFrequency-calculation options (step size, central vs forward differences, …).
%cpcmImplicit-solvent model details.
%tddft / %cisTD-DFT / CIS excited-state options.
%mp2MP2 settings (e.g. DLPNO thresholds).
%mdciCoupled-cluster options.
%casscfMulti-reference active-space settings.
%nebNudged-Elastic-Band settings.
%palParallel-process configuration.
%maxcoreMemory per core (in MB).
%outputControl of output verbosity.

Coordinate input styles

Coordinates are written inside a block delimited by *. Three formats are available.

① Cartesian (xyz)

The most common and recommended form. Units are Ångström by default.

* xyz 0 1            # charge 0, multiplicity 1 (singlet)
  C   0.000000   0.000000   0.000000
  O   0.000000   0.000000   1.130000
*

It pays to get comfortable with the charge / multiplicity notation. For instance, the CO+ radical cation (one electron removed, doublet) reads:

* xyz 1 2            # charge +1, multiplicity 2 (doublet, S = 1/2)
  C   0.0   0.0   0.0
  O   0.0   0.0   1.1105
*
Computing multiplicity

Multiplicity is 2S + 1, where S is the total spin. Singlet = 1, doublet = 2, triplet = 3, and so on. For odd-electron systems it is generally a good idea to also specify ! UKS (or ! UHF).

② Internal coordinates (Z-matrix)

With the int keyword you can enter coordinates as bond lengths, angles, and dihedrals. Handy for small molecules or whenever you want direct control over specific bond lengths during optimisation.

* int 0 1
  C   0 0 0    0.0     0.0     0.0
  O   1 0 0    1.2     0.0     0.0       # 1.2 Å to C
  H   1 2 0    1.1   120.0     0.0       # C-H 1.1, OCH angle 120°
  H   1 2 3    1.1   120.0   180.0       # dihedral 180°
*

The connectivity rule is:

  • NA: atom that defines the distance (RN) to the current atom.
  • NB: atom that defines the angle (AN) involving the current atom, NA, and NB.
  • NC: the fourth atom defining the dihedral (DN), measured looking down the NA–NB axis.

All angles are in degrees, and atom indexing here is 1-based (one of the exceptions to ORCA's general convention).

③ Gaussian Z-matrix (gzmt)

Identical to the Z-matrix format used by Gaussian. GUI tools such as Gabedit, Avogadro and Molden often export coordinates in this format.

* gzmt 0 1
   C
   O   1   1.200
   H   1   1.100   2   120.0
   H   1   1.100   2   120.0   3   180.0
*

Reading coordinates from an external file

Keeping the coordinates in a separate file makes the input file much cleaner. The most common form is the standard .xyz file.

# Read coordinates from mycoords.xyz
! B3LYP def2-SVP Opt
* xyzfile 0 1 mycoords.xyz

The standard .xyz format is:

3
Water molecule, optimized at B3LYP/def2-TZVP
O   0.000000   0.000000   0.119262
H   0.000000   0.763239  -0.477047
H   0.000000  -0.763239  -0.477047

Line 1 is the number of atoms, line 2 is a free-form comment, and lines 3+ are coordinates. Gaussian Z-matrix files can be read with * gzmtfile 0 1 file.gzmt.

Special atoms — dummies, point charges, isotopes

NotationMeaning
DA, X, XxDummy atom; a virtual atom used only to define geometry.
O: (colon)Ghost atom: only the basis is placed, no nucleus or electrons (BSSE correction).
QPoint charge; the charge value follows.
O> (angle bracket)Embedding potential.
M = 2.014Non-standard isotope mass.
Z = 5.5Modified nuclear charge (fractional values allowed).
0.5$A $ after a coordinate freezes that component.

Below is a frequency calculation for HD (one hydrogen replaced by deuterium):

! B3LYP def2-TZVP Opt Freq

* xyz 0 1
  H   0.0   0.0   0.000
  H   0.0   0.0   0.741   M = 2.014
*

Multiple jobs in one file — $new_job

ORCA can perform several jobs in sequence inside a single input. A very common pattern is "optimise with a cheap method, then a single point with a more accurate method".

# Step 1: optimise at BP86/def2-SVP
! BP86 def2-SVP def2/J Opt

* xyz 0 1
  O   0.0   0.0   0.119
  H   0.0   0.763  -0.477
  H   0.0  -0.763  -0.477
*

$new_job

# Step 2: single point on the optimised geometry at B3LYP/def2-TZVPP
! B3LYP def2-TZVPP RIJCOSX def2/J TightSCF
* xyzfile 0 1

After $new_job, if you write xyzfile without a file name, ORCA automatically reuses the optimised geometry from the previous job — a very handy shortcut.

One step further — the Compound module

Complex workflows that need loops or conditional branches can be automated with ORCA 6's new Compound module. Inside a %compound block you control variables, loops, conditionals, and output formatting directly. Section 7.59 of the manual and the official script repository (ORCAQuantumChemistry/CompoundScripts) contain a generous collection of examples.

Automation one step further — Compound module for a dissociation curve

$new_job lets you chain several jobs in one input, but a pattern like "the same calculation 20 times, varying one coordinate" quickly grows to hundreds of lines if written out by hand. ORCA 6's Compound module lets you express such repetition with variables and for-loops.

Example ① — H2 bond dissociation curve

Scan the H–H bond length of H2 from 0.5 Å to 3.0 Å in 26 points and evaluate the B3LYP/def2-TZVP single-point energy at each — all in a single input. The result is written cleanly to scan.dat:

%compound
   Variable R, E, step;
   Variable Rmin = 0.5;
   Variable Rmax = 3.0;
   Variable N    = 26;

   Variable outFile = "scan.dat";
   Write_File(outFile, "# R/A    E/Eh\n");

   For step From 0 To N Do
       R = Rmin + step * (Rmax - Rmin) / N;

       New_Step
       ! UKS B3LYP D4 def2-TZVP TightSCF
       * xyz 0 1
          H   0.0   0.0   0.0
          H   0.0   0.0   &{R}
       *
       Step_End

       E = SCF_Energy;
       Write_File(outFile, "%6.3f  %16.10f\n", R, E);
   EndFor
end

The key syntactic elements:

ElementRole
Variable X;Declare a scalar. An initial value can be given on the same line (Variable R = 0.5;).
&{R}Placeholder for inline variable expansion inside coordinates or keyword lines.
New_Step ... Step_EndWraps a regular ORCA input block. Inside, the usual ! keyword lines and * coordinate blocks apply.
SCF_EnergyFinal SCF energy of the previous step. Method-specific variables also exist: OPT_Energy, MP2_Energy, CCSD_T_Energy, …
Write_File(name, fmt, …)Append a line to a file using a C-style printf format. The file is created on the first call and appended to on subsequent calls.
For X From a To b Do … EndForDiscrete counter loop. If … EndIf and While … EndWhile are also available.

Example ② — Reactant + TS + product in one go

A more practical recipe: compute the Gibbs free energies of three species at the same level of theory and immediately print ΔG and ΔG.

%compound
   Variable Gr, Gts, Gp;
   Variable dG, dGdag;

   Read_File("reactant.xyz") As XYZ_File;
   New_Step
   ! B3LYP D4 def2-TZVP RIJCOSX def2/J TightOpt Freq
   Step_End
   Gr = Final_Gibbs_Free_Energy;

   Read_File("ts.xyz") As XYZ_File;
   New_Step
   ! B3LYP D4 def2-TZVP RIJCOSX def2/J OptTS Freq
   Step_End
   Gts = Final_Gibbs_Free_Energy;

   Read_File("product.xyz") As XYZ_File;
   New_Step
   ! B3LYP D4 def2-TZVP RIJCOSX def2/J TightOpt Freq
   Step_End
   Gp = Final_Gibbs_Free_Energy;

   dG    = (Gp  - Gr) * 627.5095;   # Hartree → kcal/mol
   dGdag = (Gts - Gr) * 627.5095;

   Print("Reaction free energy:     %8.2f kcal/mol\n", dG);
   Print("Activation free energy:   %8.2f kcal/mol\n", dGdag);
end
Read the manual alongside

The keywords used here (Variable, For, If, New_Step, Write_File, Final_Gibbs_Free_Energy, …) follow the ORCA 6.0.0 Compound notation, but minor releases occasionally adjust syntactic details (variable declaration style, print format, …). The first time around, keep manual §7.59 and the official examples (ORCAQuantumChemistry/CompoundScripts) open and start from a very small example.

By now you can put an input file together however you like. The thing that actually trips people up next is remembering what each keyword is called — which is what the next chapter gathers into a dictionary.