Automatimg Define

Started by ym21d@fsu.edu, May 19, 2023, 08:25:22 PM

Previous topic - Next topic

ym21d@fsu.edu

I am using turbomole through the program PuTTY, which uses Unix line commands. I am trying to automate my workflow as much as possible. Is there a way that I can use the Unix line commands to utomate calling define movimg through each step, making the selections I want. Or, is there another way of automating define?
Thank you,

antti_karttunen

Hi,

sure, you can feed define any input with the standard approach in Unix:

define < define.in

where define.in contains the commands for define.

Define sessions can be "recorded" easily with the tee command, please see the script below for an example.

Best wishes,
Antti


#!/bin/bash
# defrec: Record define session to file for later usage

OUTNAME=define.in

program_usage(){
cat <<EOF

*****************************************************************
*    defrec: Record define session to file for later usage      *
*****************************************************************

Usage: defrec

- defrec records all commands given to define into file $OUTNAME
- After finishing define, interupt defrec with Ctrl+C
- The command file can then be executed in another job directory:

  define < $OUTNAME

- Useful when you need to construct many similar Turbomole jobs.

EOF
}

# Check parameters
while [[ $# -gt 0 ]]
do
  case "$1" in
    "-h" | "-help" | "--help" ) program_usage ; exit 1 ;;
    *  ) program_usage ; exit 1 ;;
  esac
done

tee $OUTNAME | define


Michael_Patzschke

Hei Antti,

that was very useful. Thank you! Is it possible to automate the cosmoprep routine as well?

Best wishes,
Michael

Michael_Patzschke

Well I answer it myself. It is possible with cosmoprep < prep.in Where prep.in can be similarly recorded with the script provided by Antti!

uwe

Hi,

why do you want to use define if you want to create automated inputs?

Instead of creating a define input and piping it into define, it is much easier to write a simple control file which is independent of your molecular structure. Like this one:

$coord file=coord
$atoms
  basis = def2-TZVP
$dft
  functional pbe
$rij
$marij
$cosmo
$cosmo_out file=out.cosmo
$end


This is for a RI-DFT input using COSMO with default settings. Place the coord file to the same directory and call jobex or ridft for a geometry optimization or a single-point energy calculation.

Or do you plan to use some specialties which only define is able to do?

Best Regards, Uwe

Michael_Patzschke

Thank you for the reply.

How would I account for different spin multiplicities in such an input?

uwe

Hello,

a good starting point is the Turbomole tutorial (not the documentation, tutorial is named tutorial_turbomole.pdf in the DOC directory), one of the first chapters is named "The s[ai]mple input".

As define is not used to generate start orbitals the molecular charge and optionally the number of
unpaired electrons (1 for doublet, 2 for triplet, etc.) can be added by using the $eht keyword:
     $eht charge=<n>
     $eht charge=<n> unpaired=<m>
Examples:
     $eht charge=-1
     $eht charge=2 unpaired=1


Please note that when starting a job directly from a short control file some tasks will be done automatically:

  • symmetry is checked and activated if found, similar to running desy in define. If you do not want to use symmetry by default, add
    $symmetry c1
    to the input control file
  • a closed shell occupation is taken by default for even number of electrons, also similar to what define is doing - to enforce unrestricted calculations, add
    $uhf
    to the control file
  • for geometry optimizations internal redundant coordinates are automatically generated
  • energy and gradient results are directly written to the control file, so when I script Turbomole, I always add $energy and $grad to avoid getting a long control file:
    $energy file=energy
    $grad file=gradient

  • to freeze orbitals add $freeze with the energy window to define which ones to freeze
    $freeze
      fpc=-3.0 fpv=50.0

    will freeze orbitals with energies below -3.0 Hartree and larger than +50.0 Hartree

Hope this helps. Please report any issues using this way to write input!

Best wishes

ym21d@fsu.edu

Using tee is a life saver.
This is a simple set of instructions:
Instead of typing define, type:
tee define.in | define      # takes what you type and writes it to the file define.in.
#  | define: also sends the same input to the define program.

After going through define, press cntrl+c to exit tee. Then keep the output file "define.in"

You can then use this file as input in a new directory which has a coord file.

define < define.in      #in a new directory, use this to input recorded define entry

Thank you so much.