17 December 2013

536. Briefly: Getting ECCE to work with Gaussian 09 (G09) part 1: frequency calcs

I'm slowly looking at improving the support for G09 in ECCE. One of the things that haven't worked in the past is visualising frequency calcs.

Since I'm not using G03 I've been content with editing the g03 files so that they work with G09. My changes will be submitted upstreams at a later point.

Anyway, turns out this was a very simple one.

How ECCE works:
data is extracted from the output through the use of perl parser scripts. These are located in apps/scripts/parsers, and are fairly clearly named.

The script that deals with Gaussian vibrational analyses is called gaussian-03.vib

To use it manually with a gaussian 'log' file (here called g03.output), do
./gaussian-03.vib < g03.output

So far so easy. However, if you use it on a g09 output file you'll end up with a single message: 'Zero atoms'.

Turns out that the reason is that the script looks for instances of 'Atom AN', with a single white space between m and N. In G09, however, there are two white spaces: 'Atom AN'.

The fix:
So, edit line 277:
276     while ()  {
277       if (/Atom AN/) {
278         last;

and change it to
276     while ()  {
277       if (/Atom\s*AN/) {
278         last;

Do the same thing with line 315:
314     while ()  {
315       if (/Atom\s*AN/) {
316         last;

Done!

535. Briefly: ACS journal latex template -- achemso

There's no outright template for the preparation of tex files for ACS journals. However, there are two files provided: a bibtex styles file, achemso.bst, and a macro file, achemso.cls. Both are available in the texlive-latex-extra package on debian.

Luckily there's a lot of information online, including a demo file: ftp://ftp.dante.de/tex-archive/biblio/bibtex/contrib/achemso/

Anyway, here's a simple file that can act as a template. Have a look at the demo file at ftp.dante.de for a much more exhaustive example, including how to use schemes and insert references.

You can figure out the journal abbreviations from their URLs. Otherwise, page 4 in this pdf has a list: http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/achemso/achemso.pdf

Anyway:

\documentclass[journal=inoraj, layout=twocolumn]{achemso}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\author{Vera Hill}
\affiliation{Department of Chemistry, This University, This Country}
\email{my@email}
\author{I. Lindqvist}
\affiliation{Department of Chemistry, Another University, That Country}
\title{A quick, non-exhaustive tex template}

\begin{document}
\maketitle

%\begin{tocentry} %graphical TOC
%\includegraphics{example.eps}
%TOC text goes here
%\end{tocentry}

\begin{abstract}
The ACS should provide a simple template. They don't, so I do.
\end{abstract}

\section{Introduction}
\section{Results and Discussion}

%\begin{figure}
% \includegraphics{graphic}
% \caption{A figure}
% \label{fig:example}
%\end{figure}


\subsection{References}
\section{Experimental}
\begin{acknowledgement}
VH thanks the internet. IL thanks the electron.
\end{acknowledgement}

\begin{suppinfo}
See supporting information for additional experimental details.
\end{suppinfo}

\end{document}

Example:

05 December 2013

534. Adding new options to ECCE -- adding solvation models for G03 (G09)

To minimize the amount of manual editing of my input files I've started to modify the menus in ECCE. One thing that was missing before was the option of selecting a solvation model for Gaussian jobs. I've added that now.

I will eventually submit my changes upstreams, but for now I'll just post a clunky list of changes that I've made:
There are two files to edit:

apps/scripts/codereg/ged03theory.py.

Add the following right after the DFT options section and before the MP options section (ca line number 273 in my case)
#Theory options solvation -CAO sovSizer = EcceBoxSizer(self, label = "Solvation", cols = 2) sovLeftSizer = EcceVBoxSizer() sovRightSizer = EcceVBoxSizer() #Use solvation self.useSCRF = EcceCheckBox(self, #useCosmo label = " Use SCRF" name = "ES.Theory.SCF.UseSCRF", default = False) sovLeftSizer.AddWidget(self.useSCRF, border = EcceGlobals.BorderDefault) #SCRF type scrfChoice = ["PCM", "CPCM", "IPCM", "SCIPCM", "SMD", "Dipole"] self.scrf = EcceComboBox(self, choices = scrfChoice, name = "ES.Theory.SCF.SCRF", label = "SCRF type:", default = 0) sovRightSizer.AddWidget(self.scrf, border = EcceGlobals.BorderDefault) #Solvent type solventChoice = ["Water", "Acetonitrile", "Methanol", "Ethanol", "Manual", "Benzene", "Chloroform", "Diethylether", "Dichloromethane", "Dichloroethane", "Carbontetrachloride", "Toluene", "Chlorobenzene", "Nitromethane", "Heptane", "Aniline", "Acetone", "Tetrahydrofuran", "Dimethylsulfoxide", "Argon", "Krypton", "Xenon", "n-Octanol", "1-Butanol" "Cyclohexane", "Isoquinoline", "Quinoline", ] self.solvent = EcceComboBox(self, choices = solventChoice, name = "ES.Theory.SCF.Solvent", label = "Solvent:", default = 0) sovRightSizer.AddWidget(self.solvent, border = EcceGlobals.BorderDefault) self.scrfDielec = EcceFloatInput(self, default = 78.4, name = "ES.Theory.SCF.Dielectric", label = "Dielectric Constant:", hardRange = "(0..)", unit = "Debye") sovRightSizer.AddWidget(self.scrfDielec, border = EcceGlobals.BorderDefault) sovSizer.AddWidget(sovLeftSizer, flag = wx.ALL) sovSizer.AddWidget(sovRightSizer, flag = wx.ALL) self.panelSizer.Add(sovSizer) #End theory options solvation -CAO

Also add the following to the def CheckDependency(self) block, right before the "if (EcceGlobals.Category == "MP" or" line:
# SCRF solvation -- CAO if EcceGlobals.Category == "DFT" or EcceGlobals.Category == "SCF": self.solvent.Enable(self.useSCRF.GetValue()) self.scrf.Enable(self.useSCRF.GetValue()) self.scrfDielec.Enable(self.useSCRF.GetValue() and self.solvent.GetValue() == "Manual") # end SCRF

Edit apps/scripts/parsers/ai.gauss03 and put the following somewhere in the file.
############################################################################## # # Description: # SCRF options field -CAO # ############################################################################## sub SCRFOptions { my($options,$result); $result = ""; $options = ""; #scrf type if ($AbiDict{"ES.Theory.SCF.UseSCRF"}) { if ($AbiDict{"ES.Theory.SCF.SCRF"} eq "" ) { $options .= "PCM,"; } else {$options .= ($AbiDict{"ES.Theory.SCF.SCRF"}).","}; # solvent/dielectric if ($AbiDict{"ES.Theory.SCF.Solvent"} eq "Manual") { if (defined($AbiDict{"ES.Theory.SCF.Dielectric"})) { $options .= "Dielectric=".$AbiDict{"ES.Theory.SCF.Dielectric"}.""; } } elsif ($AbiDict{"ES.Theory.SCF.Solvent"} eq "") { $options .= "Solvent=water"; } else { $options .= "Solvent=".$AbiDict{"ES.Theory.SCF.Solvent"}; } if ($options ne "") { $result = "SCRF=("; $result .= $options; $result .= ") "; } return $result; } }
Also add the following right below the "$route .= &SCFOptions;" line:
$route .= &SCRFOptions;

And you're done: