Page tree
Skip to end of metadata
Go to start of metadata

NWChem is an open source computational chemistry program package developed at EMSL/PNNL.

The documentation is available at: https://github.com/nwchemgit/nwchem/wiki

Submitting jobs

NWChem jobs can be submitted to the queue with the following command:

jsub -np 2 nw <input file>

Important: NWChem jobs need always at least two processors to run (serial runs with only one processor crash due to MPI issues)

For example, submitting an input file co2_pbe0_tzvp_opt.nw:

jsub -np 6 nw co2_pbe0_tzvp_opt.nw

The output file would be c02_pbe0_tzvp_opt.nwo.

Monitoring jobs

Check optimization progress:

grep '@' filename.nwo


Input examples

DFT-PBE0/def2-TZVP/COSMO geometry optimization and numerical frequencies
# echo input file to output
echo
title "H2O"
memory 2000 mb

# Charge of the system
charge 0

# XYZ coordinates in Angstrom units (default)
# Automatic symmetry detection enabled (default tol 0.01). Disable with noautosym.
geometry units angstroms autosym 0.1
O       0.00000      0.00000      0.00000
H      -0.63500      0.63500     -0.63500
H       0.63500     -0.63500     -0.63500
end

# This is a DFT job
dft
  # Exchange-correlation functional
  xc pbe0
  # Always use direct SCF
  direct
  # Spin multiplicity 2S + 1, where S = 0, 1/2, 1, 3/2, ...
  mult 1
  # Reduce output during geometry optimization
  noprint "final vectors analysis"

  ## Extra options
  # To increase the number of SCF iterations
  #iterations 100
  # Smearing (a.u.?)
  #smear 0.001
  # For open-shell singlet calculation, use
  #odft
  # Grimme DFT-D3 (zero-damping)
  #disp vdw 3
end

basis
  # Recommended basis sets:
  # def2-svp for fast structure optimization and exploration
  # def2-tzvp for production-level DFT
  * library def2-tzvp
end

# Turn on COSMO solvent model when necessary
cosmo
end

# Options for the geometry optimizer
driver
  # Max 100 optimization steps
  maxiter 100
  # Don't use restart information from a previous run
  #clear
  # Print XYZ coordinates of each step
  #xyz 
end

# Optimize geometry
task dft optimize

# Calculate numerical frequencies
# With COSMO, only numerical frequencies are possible
task dft freq numerical
# For analytical hessians
# Done with in-core algorithm (6.8) -> small systems only!
#task dft freq

# Final property analysis with MO vector printout
dft 
  print "final vectors analysis"
end
property 
  mulliken 
end
task dft property

CCSD/cc-pVTZ single-point energy calculation
# echo input file to output
echo
title "H2O"
memory 4000 mb
 
# Charge of the system
charge 0
 
# XYZ coordinates in Angstrom units (default)
# Automatic symmetry detection enabled. Disable with noautosym.
geometry units angstroms autosym
O       0.00000      0.00000      0.00000
H      -0.63500      0.63500     -0.63500
H       0.63500     -0.63500     -0.63500
end
 
# Hartree-Fock reference wavefunction
scf
  # Spin multiplicity: singlet, doublet, triplet, ... (up to octet)
  singlet
  # Default open-shell approach is ROHF. Enable to switch to UHF
  #uhf
  #adapt off
  #sym off
  # Always use direct SCF
  direct
  
  # Convergence criterion. Norm of the orbital gradient, default 1.0e-4 
  thresh 1.0e-6

  ## Extra options
  # To increase the number of SCF iterations
  #iterations 100
end
 
basis
  # Recommended starting point: cc-pvtz
  # For anions and radicals, consider aug-cc-pvtz
  * library cc-pvtz
end

# Options for the Tensor Contraction Engine
tce
  # Use HF reference wavefunction
  scf
  # Choose electron-correlation method. ccsd, ccsd(t), ...
  ccsd
  # Freeze core orbitals
  freeze atomic
  # io? default: ga, may run out of memory. Test replicated / see TCE documentation
  #io replicated
end 

# Calculate single-point energy
task tce energy

Further tips and tricks

Start a geometry optimization with a Hessian from previous frequency calculation

  • The Hessian (oldjob.hess) can be e.g. from previous optimization+frequency job with lower level of theory.
  • Create a new input file newjob.nw
  • Starting coordinates in the new input file should match the geometry where the previous Hessian was calculated.
  • Copy the Hessian oldjob.hess to a new name newjob.hess
  • Include the directive "inhess 2" in the driver block and submit the job:
driver
inhess 2
maxiter 100
end


  • No labels