CamCASP/Notes/4

From CUC3
Jump to navigation Jump to search

CamCASP => Notes => Odds and Ends

Converting units

The energy file produced by the ENERGY-SCAN module will probably use the units: Bohr, Degree, cm-1. These may not be appropriate and may need changing. It is easy enough to do this using a script, but there is a more convenient and probably more reliable way of converting the units in this file. That is to use the PROCESS program.

Here's the PROCESS command file to convert the energies in file energy_file.dat to kJ/mol.

Global
  Units kJ/mol
  CamCASP /home/am592/CamCASP/current
End

Energy
  Read energy_file.dat
  Write energy_file_kJ.dat
End

Finish

NOTES:

  1. The advantage of this over any script is first of all speed --- the code's already written for you so why bother writing your own.
  2. PROCESS can read in multiple files --- say, from multiple energy-scan runs --- each with its own set of units (encoded in the files), and it (should) all work correctly. PROCESS will write out one energy file containing all the data.
  3. Third, PROCESS will convert from any of the recognised energy units to kJ/mol and it knows what units the energies are in as this information is in the energy file. Here's an example of the header of an energy file:
TITLE  Energy scan of MOL-A by MOL-B
TITLE  pyridine1 and pyridine2
TITLE  Basis sadlej and type MC
TITLE  Midbonds NONE and type weighted
MOL-A  pyridine1
MOL-B  pyridine2
POINTS     500
ENERGY-UNITS  KJ/MOL
LENGTH-UNITS  BOHR
ANGLE-UNITS  DEGREE

Concatenating Energy files

Multiple energy files (for the same pair of molecules) can be concatenated into one file using PROCESS. These files may have energies in different units. No problem.

Global
  Units kJ/mol
  CamCASP /home/am592/CamCASP/current
End

Energy
  Read energy_file_1.dat
  Read energy_file_2.dat
  Read energy_file_3.dat
  
  Write energy_file_kJ.dat
End

Finish

NOTES:

  1. The advantage of this over any script is first of all speed --- the code's already written for you so why bother writing your own.
  2. PROCESS can read in multiple files --- say, from multiple energy-scan runs --- each with its own set of units (encoded in the files), and it (should) all work correctly. PROCESS will write out one energy file containing all the data.
  3. Third, PROCESS will convert from any of the recognised energy units to kJ/mol and it knows what units the energies are in as this information is in the energy file. Here's an example of the header of an energy file:
TITLE  Energy scan of MOL-A by MOL-B
TITLE  pyridine1 and pyridine2
TITLE  Basis sadlej and type MC
TITLE  Midbonds NONE and type weighted
MOL-A  pyridine1
MOL-B  pyridine2
POINTS     500
ENERGY-UNITS  KJ/MOL
LENGTH-UNITS  BOHR
ANGLE-UNITS  DEGREE

VIM tricks

  • Inserting the Type field in the *.mom files
:map t ^vllly$a  Type ^[p^[

The first '^' is the usual '^' character, but the '^[' at the end are obtained using <CRTL>-v-<ESC>. So cut-and-paste will not work. You've got to type in this sequence.

Then search for Rank and type t.

Creating an energy file

You will need an energy file (and overlap file) when creating an overlap model. The energy file should be in a the format (for example):

TITLE  Energy scan of MOL-A by MOL-B
TITLE  pyridine1 and pyridine2
TITLE  Basis sadlej and type MC
TITLE  Midbonds NONE and type weighted
MOL-A  pyridine1
MOL-B  pyridine2
POINTS     500
ENERGY-UNITS  KJ/MOL
LENGTH-UNITS  BOHR
ANGLE-UNITS  DEGREE
LABELS    INDEX         Rx            Ry            Rz            alphaNx            Ny            Nz            
 E(1)elst       E(2)ind        E(2)disp       E(1)exch       E(2)exind      E(2)exdisp    
 TotOverlap     Elst-Asymp   Ind2-Asymp     Disp-Asymp     Delta
         1  -5.870040E-01  3.957260E+00  9.016280E+00  1.227930E+02 -9.097780E-01 -1.008600E-01  4.026560E-01
  1.087500E-01 -2.364920E+00 -9.875980E+00  4.871440E+00       0.0E+00       0.0E+00       0.0E+00 
      0.0E+00       0.0E+00  0.0E+00       0.0E+00
...
...
END
END-FILE

If you have performed the energy scan using the ENERGY-SCAN module in CamCASP, then this file will be in such a format. But if you have performed a number of single-point (dimer geometry) calculations at specific dimer geometries using the batch_SAPT.pl script, you will not have such a file.

So, how do you construct it?

Use the batch_search.pl script as follows.

  1. Create a file called keys containing just saptdft-camcasp. This keyword will tell the search.pl script to search for SAPT(DFT) energies in the format used by CamCASP.
  2. Run the batch_search.pl script using a command like:
batch_search.pl pyridine2 -geom random-scan2.dat -d 6 -camcasp > energy_saptdft.dat

The file energy_saptdft.dat should look something like:

TITLE
MOL-A
MOL-B
POINTS 500
ENERGY-UNITS KJ/MOL
LENGTH-UNITS
ANGLE-UNITS

LABELS     INDEX            Rx            Ry            Rz         alpha Nx            Ny            Nz
      E(1)elst       E(2)ind      E(2)disp      E(1)exch     E(2)exind    E(2)exdisp     TotOverlap 
    Elst-Asymp   Ind2-Asymp  Disp-Asymp    Delta
         1  -5.870040E-01  3.957260E+00  9.016280E+00  1.227930E+02 -9.097780E-01 -1.008600E-01  4.026560E-01
  1.087500E-01 -2.364920E+00 -9.875980E+00  4.871440E+00       0.0E+00       0.0E+00       0.0E+00    
   0.0E+00       0.0E+00  0.0E+00       0.0E+00
...

So it is in almost the correct format. You need to fill up the preamble. For example, the complete pre-amble might look like:

TITLE  Energy scan of MOL-A by MOL-B
TITLE  pyridine1 and pyridine2
TITLE  Basis sadlej and type MC
TITLE  Midbonds NONE and type weighted
MOL-A  pyridine1
MOL-B  pyridine2
POINTS     500
ENERGY-UNITS  KJ/MOL
LENGTH-UNITS  BOHR
ANGLE-UNITS  DEGREE

Yes, you can have multiple TITLE fields. The first few will be used by CamCASP, the rest will be ignored. The other fields are more important, so make sure they are correct. In particular, get your units correct!

That is all you need do, unless you want to fill up the Elst-Asymp, Ind2-Asymp, Disp-Asymp and Delta fields. For the first three you will need to use ORIENT and the batch_ORIENT.pl script. The last one, Delta, is any energy correction you would like to include. See Overlap Models for more details.