CP-DRIVER MANUAL 13-Feb-16 Pedro Salvador Dept. of Chemistry, Oakland University, Rochester, Michigan, US Institute of Computational Chemistry, University of Girona, Spain The CP program automatically calls Gaussian94/98 in order to perform either energy, gradient optimizations or frequency corrected for Basis Set Superposition Error. Three methods can be used automatically to correct for BSSE. Moreover, the user can define which fragment calculations are necesary in each case in terms of the fragment symmetry of the supermolecule or any further approximation. In order to carry on geometry optimizations with high accuracy, link l103 of Gaussian must be slightly modified to output (to the file fort.99) the gradient vector with full precision. The modification consists in adding the following lines in subroutine GrdOpt, open(unit=99,status='unknown',form='unformatted') rewind 99 write(99) Nvar write(99) (aprint(2,iii),iii=1,Nvar) close (99) after line: 515 Continue A bug in link l301 (Massge subroutine) must be fixed too. The massage of an atom located in the z-matrix just before a dummy atom induces to an error that stops the gradient calculation. To fix the bug substitute the following lines Do 210 J = 1, NZ If(IAnZ(J).ge.0) I = I + 1 If(I.eq.ICntr) IAnZ(J) = IAn(ICntr) 210 Continue by 1 Do 210 J = 1, NZ If(IAnZ(J).ge.0) I = I + 1 If(I.eq.ICntr) then IAnZ(J) = IAn(ICntr) goto 213 endif 210 Continue 213 continue (Note that in Gaussian98 label 210 is changed to 20) To create the new l103.exe and l301.exe files, first rename the original l103.exe and l301.exe , use the update utility of Gaussian from the $g9*root/g9* directory, mg l103.exe mg l301.exe then move the new l103.exe and l301.exe files to the desired directory and finally restore the original l103.exe and l301.exe files. The new links must be used for the CP-corrected geometry optimizations, hence, before the route card of the Gaussian calculation the following lines must be included: 2 % subst l301 /home/usr/CP % subst l103 /home/usr/CP (full path of the directory where the l301.exe and l103.exe files are placed) Counterpoise-correction methods Site-Site CP method: The BSSE is defined as the difference between the energy (gradient) of each fragment with its own basis set and the basis set of the whole molecule, and summed up to the uncorrected supermolecule respective values. Pairwise Aditive CP method: In this case, the BSSE is defined as the difference, for all pairwise interactions, between the energy (gradient) of each fragment with its own basis set and the basis set of each dimer in the supermolecule geometry. Again, the resulting energy(gradient) is summed up to the uncorrected supermolecule respective values. Hierarchical CP method: The BSSE is split in one ,two-body, three-body etc… contributions to the supermolecule energy. The number of calculations increases dramatically with the number of fragments. Note that 17 calculations are needed for a three-body calculation. Files: cp.f -> Source code of the driver program. Input file: cp.met 3 Output files: cp.out, cp.res (info to restart calculation), cpfreq.out (only for frequency calculations) Scratch files: *.in, cp.geo, cp.com, cp.fchk, cpfreq.fchk (only for frequency calculations) Use Fortran77 compiler to create the executable, e.g. cp.x hess.f -> Program to yield inverse hessian from a Gaussian output file. matrix is created in file HESS and can be read by the driver program. Usage : hess.x < gaussian_file Use Fortran77 compiler to create the executable, e.g. hess.x glocal.com -> Unix script to invoke Gaussian and formchk Gaussian utility. For instance: #!/bin/csh setenv g98root /usr/soft source $g98root/g98/bsd/g98.login setenv GAUSS_SCRDIR /scratch g98 < $1.in > cp.qfi formchk $1.chk cp.fchk rm cp.qfi 4 The freqlocal.com -> Unix script to invoke Freqchk Gaussian utility. For instance: #!/bin/csh setenv g98root /usr/soft source $g98root/g98/bsd/g98.login freqchk cpfreq.chk <fc.inp> cpfreq.out Note that formchk output MUST be cp.fchk whereas Gaussian output for $1.in calculation can be overwritten. Also, input file for freqchk MUST be named cpfreq.chk. File fc.inp is used to include the desired options for the freqchk utility (temperature, pressure, etc..) The cpfreq.fchk Gaussian formatted checkpoint file is obtained from the respective supermolecule calculation checkpoint file (cp.fchk), where ONLY the second derivative matrix has been substituted by the CP-corrected one. Hence, one can further use the freqchk utility to extract the uncorrected frequencies from the cp.fchk file (at the given geometry). Files cp.x, glocal.com and freqlocal.com must be in the same directory and this directory should be included in the user’s PATH, in order to allow user to run the calculations in another directory. When executing the driver program several gaussian input files (*.in) will be created, as well as a the file cp.geo, containing the current geometry. The cp.res file is either read upon request in cp.met file or created in order to save information to resume the calculation. Unix script cp.com is also created for each calculation and called by the previously set glocal.com script. Note that only one calculation can be performed correctly in a given directory. Use different directories for simultaneous calculations. 5 Input file: cp.met File consists in several sections, each starting with the following set of characters: # NAME_OF_SECTION #. 1-# METODE # section: Main section of the input file. Includes several fields in the form: NAME_OF_FIELD= integer (I) or real (R) numbers Fields in # METODE # section: NFRAG= I, being I the number of fragments of the calculation NVAR= I, being I the number of variables for the calculation. (up to 100) -Options for the geometry optimization: TOL= R, being R the threshold of the RMS of the gradient for the geometry optimization. MAXIT= I, being I the maximum number of iterations for the geometry optimization NDIIS= I, being I the maximum dimension of the DIIS subspace for the geometry optimization (up to 10) HESS= 1 if file HESS is to be used as starting hessian for the optimization, 0 if no initial hessian is given (default) UPDATE= 1 to activate the BFGS method to update the hessian for the optimization, 0 otherwise (default) HESS= 1 if file HESS is to be used as starting hessian for the optimization, 0 if no initial hessian is given (default) -Options for the CP method and fragment definition 6 BSSE = 0 for the SSCP method, 1 for the hierarchical NBODY method, or 2 for the PACP method, default 0. SYM= 1 to use symmetry, included in # SYMMETRY # section (see below), 0 otherwise, default 0 RESTART= 1 to use cp.res file data to resume the calculation, 0 otherwise (cp.res file will be overwritten), default 0 SPIN= 0 to use supermolecule charge and multiplicity for all fragments, 1 to use specific values for each fragment calculation, either in # FRAG SYMMETRY # sections (see below). If BSSE=1 then specific multiplicity must be introduced in # SYMMETRY # charge or # and # section. Problems and restrictions: Using the hierarchical counterpoise method, the number of fragment calculations needed increase enormously with the number of fragments. For this reason, automatic calculations of either energy or geometry optimizations are not allowed if NFRAG > 3 and BSSE=1. However, in this case, if symmetry between the fragments exists, the calculation can be performed by including in the # SYMMETRY # section the necessary fragment calculations and their respective scale factors for both energy and gradient. 2-# GEOM # section: Enter Z-matrix or Cartesian coordinates in Gaussian format. Dummy atoms can be used, however BQ should be avoided. eg. # GEOM #### X F1 1 r1 F2 1 r1 2 120. F3 1 r1 3 120. 2 180. H1 2 rh1 1 alpha 4 180. H2 3 rh1 1 alpha 2 180. H3 4 rh1 1 alpha 3 180. 7 3-# FRAGS # section: Free format input. Fist line must include the number of atoms included in each fragment. The next N lines include, for each fragment, the number of the atoms (as specified in the z-matrix or cartesian coordinates in # GEOM # section) belonging to it. Finally, if SPIN=1 then two extra lines are needed. First one including the charge and the second one the multiplicity of each fragment. Note that, in this case, if BSSE=1 the charge and multiplicity must be included instead in the # SYMMETRY # section. 4-# VARIABLES # section: Free format. Enter initial values for the variables specified in the z-matrix or cartesian coordinates. Do not use “=” between variable name and its value 5-# VARTYP # section: Free format. Single line including, for each variable 1 if it represents a distance or 2 if is an angle. 6-# GAUSSIAN # section: Enter route card and charge and multiplicity for Gaussian calculation. Nosymm keyword must be included. If force keyword is present CP-geometry optimization is performed. If freq is present CP-frequency calculation is carried out (see below). If none of the above keywords are present then a single-point CP-energy is performed If a general basis is used for the calculation, the basis set specification MUST be included in file cp.gbs but not in this section. For instance, # GAUSSIAN ### %mem=100Mb 8 %subst l103 /usr/users/pedros/bin # mp2/6-31++G(d,p) 6d nosymm force MP2 HF-trimer CP-corrected optimization 01 Restrictions and problems: Input is CASE SENTITIVE. Please, use lower case for force, freq and gen Gaussian keywords. Frequency calculations: No symmetry can be used. Note that the second derivatives for the fragment calculations are obtained using the following Gaussian keywords: opt=CalcFC optcyc=1 Hence, most probably, an error message will appear at the end of each Gaussian calculation, which, however, will not affect the CP-corrected frequency calculation. 7-# SYMETRY # section Must be included if SYM=1 on # METODE # section. First, enter number of fragment calculations will be performed. Then enter, separated by commas, name of calculation to be performed, scale factor for the gradient and energies. Charge and multiplicity for each calculation must also be included if BSSE=1 and SPIN=0 in # METODE # section. The name of each calculation is set in this way: (fragments included) _ (basis set used) For instance, the following line 12_123 , -2.0 , 0 ,1 specifies that fragments 1 and 2 (as defined in # FRAGS # section) using basis set of fragments 1, 2 and 3 are included in the calculation. Also, both energy and gradient will be scaled by -2.0 and summed up to the corresponding uncorrected 9 supermolecule energy and gradient respectively. Charge=0 and multiplicity=1 will be used. Restrictions and problems: The uncorrected supermolecule calculation must be included in the last line. eg. for N fragments: 12...N_12...N, 1.0, 0 , 1 8-Ending card: Line including “---“ set of characters indicates the end of the input file. 10 EXAMPLE 1: HF trimer SCF/SSCP geometry optimization using symmetry: # METODE ## NVAR=3 NFRAG=3 NDIIS=5 MAXIT=9 UPDATE=1 HESS=1 SPIN=0 BSSE=0 RESTART=0 SYM=1 TOL=0.0001 # VARIABLES ##### rh1 0.941 r1 1.550 alpha 52.3 # VARTYP #### 112 (Type of variable, in the same order as in previous section) # FRAGS ##### 222 14 25 36 000 (charge optional as SPIN=0) 111 (multiplicity optional as SPIN=0) # GEOM #### X (dummy atom not considered in previous section) F1 1 r1 F2 1 r1 2 120. F3 1 r1 3 120. 2 180. H1 2 rh1 1 alpha 4 180. H2 3 rh1 1 alpha 2 180. H3 4 rh1 1 alpha 3 180. # GAUSSIAN ### %subst l103 /usr/users/pedros/bin %subst l301 /usr/users/pedros/bin # MP2/6-31G(d,p) nosymm force (CP-geometry optimization) MP2 calculation of HF trimer using symmetry 01 # SYMETRY ## 3 1_1 , 3.0 1_123 ,-3.0 123_123 ,1.0 --- (three calculations are needed) (HF basis calculation, equiv. to the other HF’s in molecule) (HF full basis calc., equiv. to the other HF’s in molecule) (Trimer calculation introduced last) (end of file line) 11 EXAMPLE 2: HF trimer SCF/PACP energy calculation: # METODE ## NVAR=3 NFRAG=3 NDIIS=5 MAXIT=9 UPDATE=1 HESS=1 SPIN=0 TOL=0.0001 BSSE=2 SYM=0 (any field not present set to default value) # VARIABLES ##### rh1 0.941 r1 1.550 alpha 52.3 # VARTYP #### 112 (Type of variable, in the same order as in previous section) # FRAGS ##### 222 14 25 36 # GEOM #### X (dummy atom not considered in previous section) F1 1 r1 F2 1 r1 2 120. F3 1 r1 3 120. 2 180. H1 2 rh1 1 alpha 4 180. H2 3 rh1 1 alpha 2 180. H3 4 rh1 1 alpha 3 180. # GAUSSIAN ### %subst l301 /usr/users/pedros/bin %subst l103 /usr/users/pedros/bin # SCF/6-31G(d,p) nosymm 6d (CP-corrected energy calculation) gfinput HF calculation of HF trimer 01 --- (end of file line) 12 EXAMPLE 3: HF trimer MP2/ Hierachical CP-corrected frequencies: # METODE ## NVAR=3 NFRAG=3 NDIIS=5 MAXIT=9 UPDATE=1 HESS=1 SPIN=0 BSSE=1 RESTART=0 SYM=0 # VARIABLES ##### rh1 0.941 r1 1.550 alpha 52.3 # VARTYP #### 112 (Type of variable, in the same order as in previous section) # FRAGS ##### 222 14 25 36 # GEOM #### X (dummy atom not considered in previous section) F1 1 r1 F2 1 r1 2 120. F3 1 r1 3 120. 2 180. H1 2 rh1 1 alpha 4 180. H2 3 rh1 1 alpha 2 180. H3 4 rh1 1 alpha 3 180. # GAUSSIAN ### %subst l103 /usr/users/pedros/bin %subst l301 /usr/users/pedros/bin # MP2/6-31G(d,p) nosymm freq (CP-frequency calculation) MP2 calculation of HF trimer 01 # SYMETRY ## (No symmetry can be used for frequencies) --- (end of file line) 13