-
Notifications
You must be signed in to change notification settings - Fork 2
/
crin
2935 lines (2803 loc) · 144 KB
/
crin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl -w
# todo
# fix scf done line in xyz (from molden)
# delete hlc and sym file (G3engmol?)
# symmetry read
# change scf=gdiis
# Gives csv file in G3engmol?
# isolate Br, and 3rd row for com, so, normally, one don't need basis library.
# iodine?
#
# ccsd for close shell ; uccsd for open shell (by default)
################################################################
# CRIN 1.0
# Create Inputs
# David Brittain
# 11/10/06
#
# Modified Leaf 04Jan08
#
# Program to take file containing geometries, extract
# the geometries, and create Gaussian/Q-Chem/Molpro/Gamess Input
#
# Syntax: crin [format] $mol.[log com xyz zmat ar inp uhfna.punch sad.punch opt.punch]
#
# Which is which?
# .log : Gaussian output
# .com : Gaussian input
# .xyz : can be Spartan xyz, which has only lines of xyz coordinate. (?)
# : or Normal xyz, which has Natom, blank line and xyz coordinate.
# : or Molden xyz, which has Natom, comment line and xyz coordinate.
# : or Modified xyz, which has Natom, charge and multiplicity and xyz coordinate.
# .zmat : zmatrix from molden, with or without charge and multiplicity on the top.
# .ar : Gaussian Archive
# .inp : Gamess input
# .uhfna.punch : Gamess uhf punch file
# .sad.punch : Gamess sad punch file
# .opt.punch : Gamess opt punch file
#
# Q-Chem is not working (?)
#
#
# Features:
# Can be used to turn all files in a directory into input
# files with the same directives, eg. turn a directory
# full of molden z-matrices into B3LYP/6-31g* optimizations,
# or turn a dir full of optimized geometry .log files into
# molpro ccsd(t)/6-31g* inputs
#
# Works with both zmat and cartesian coordinates in all input
# formats. Even supports old g98 archive zmat format.
#
# Gaussian:
# Supports multiple --Link1-- jobs. So long as the header and
# footer are matched in that the %chk lines are the same, the
# output will run correctly. The charge/multiplicity line is
# corrected from whatever it is in the footer file to whatever
# it is in the input geometry file.
#
# All comment lines are changed to the current (stripped)
# filename, even if there are multiple --Link1-- jobs.
#
# Molpro:
# Fixes wf card so that nelec and spin are correct and the
# irreducible representation number is as specified on the
# command line.
#
# Puts (stripped) filename in the title card.
#
#
#Changelog:
#
#To do:
#
# -put standard inputs in a library dir in $HOME, then put
# variables pointing to these files in .cshrc
#
# -qchem - strip a possible zero (8th field) from zmat
# input. This arises when using old (g98) archives that
# were opt=zmatrix.
#
#
################################################################
#declarations:
#my($output_type,$symm,$headerfile,$footerfile,$inputfile,$geometry,$stripped_geometry);
#my($i,$inputfile_stripped,$cm,$header,$footer,$finaldeck, $iszmat, $nelec,$c,$m,$spin);
#my($job,@xyz);
#my($data,$mult,$norb,$det,$fin,@vec,$punchline,$T);
#my($HOME,$multi,$charge);
$DIR = $ENV{REMOTE_DIR};
$USR = $ENV{REMOTE_USER};
$HOME="home/$DIR/$USR";
if(@ARGV <2){
die "More arguments needed.\nSyntax: crin [options] \$mol.log \n";
}
$job = $ARGV[0];
if($job =~ /mr/ ) {$output_type="gamess";}
elsif($job =~ /w1m/i ) {$output_type="molpro";}
elsif($job =~ /w1/i ) {$output_type="gaussian";}
elsif($job =~ /cbsrad/i ) {$output_type="gaussian";}
elsif($job =~ /qb3/i ) {$output_type="gaussian";}
elsif($job =~ /cbs4m/i ) {$output_type="gaussian";}
elsif($job =~ /gcc/i ) {$output_type="gaussian";}
elsif($job =~ /dcc/i ) {$output_type="molpro";}
elsif($job =~ /b3sp/i ) {$output_type="gaussian";}
elsif($job =~ /uahf/i ) {$output_type="gaussian";}
elsif($job =~ /spcrs/i ) {$output_type="gaussian";}
elsif($job =~ /vol/i ) {$output_type="gaussian";}
elsif($job =~ /oi/i ) {$output_type="gaussian";}
elsif($job =~ /dens/i ) {$output_type="gaussian";}
elsif($job =~ /fullg3/i ) {$output_type="gaussian";}
elsif($job =~ /fullg4/i ) {$output_type="gaussian";}
elsif($job =~ /g4mp26x/i ) {$output_type="gaussian";}
elsif($job =~ /sphf/i ) {$output_type="gaussian";}
elsif($job =~ /mdbs/i ) {$output_type="gaussian";}
elsif($job =~ /bmk/i ) {$output_type="gaussian";}
elsif($job =~ /mpw/i ) {$output_type="gaussian";}
elsif($job =~ /optm/i ) {$output_type="gaussian";}
elsif($job =~ /freqm/i ) {$output_type="gaussian";}
elsif($job =~ /mp2opt/i ) {$output_type="gaussian";}
elsif($job =~ /ts1/i ) {$output_type="gaussian";}
elsif($job =~ /smd/i ) {$output_type="gaussian";}
elsif($job =~ /optcrs/i ) {$output_type="gaussian";}
elsif($job =~ /xyz/i ) {$output_type="gaussian";}
elsif($job =~ /ar/i ) {$output_type="gaussian";}
elsif($job =~ /rmp2/i ) {$output_type="gaussian";}
elsif($job =~ /ump2/i ) {$output_type="gaussian";}
elsif($job =~ /usmp2/i ) {$output_type="gaussian";}
elsif($job =~ /ulmp2/i ) {$output_type="gaussian";}
elsif($job =~ /ccsdt/i) {$output_type="molpro";}
elsif($job =~ /cisdt/i) {$output_type="molpro";}
#elsif($job eq "-q" ) {$output_type="qchem";}
elsif($job =~ /rim/i ) {$output_type="qchem";}
elsif($job =~ /qhf/i ) {$output_type="qchem";}
elsif($job =~ /qec/i ) {$output_type="qchem";}
elsif($job =~ /adf/i ) {$output_type="adf";}
else {die "unsupported output type $job.\n";}
# ARGV[2] is the diffuse fun switch
if (!$ARGV[2] or $ARGV[2] =~ /0/){
print "no diffuse function\n";
$basis = "6-31G(d)";
$genbasis = "6-31Gd";
}
else{
print "add diffuse function\n";
$basis = "6-31+G(d)";
$genbasis = "6-31pGd";
}
if (!$ARGV[3]){
$T=298;
}
else{
$T = $ARGV[3];
}
#check to see all of the files exist
#strip the geometries from whatever the input file is.
$inputfile = $ARGV[1];
if ($inputfile =~ /\.ar/) {
$inputfile_stripped = stripname($inputfile,"\.ar"); # strip .ar from $inputfilename
$geometry = striparc($inputfile,0); # get geometry string
$stripped_geometry = stripcom($geometry); # cull leading and trailing rubbish
}
elsif($inputfile =~ /\.log/ ){
if($inputfile =~ /\.298\.mecn\.log/ and $job =~ /mecn/i){
$inputfile_stripped = stripname($inputfile,"\.298\.mecn\.log");
print $inputfile_stripped ;
}
else{
$inputfile_stripped = stripname($inputfile,"\.log"); # strip .log from $inputfilename
}
$geometry = striparc($inputfile,0); # get geometry string
if ($geometry eq ""){
print "Caution! $inputfile This is not optimised geometry!\n";
$stripped_geometry = striplastxyz($inputfile);
}
else{
$stripped_geometry = stripcom($geometry); # cull leading and trailing rubbish
}
heavyatom($stripped_geometry);
}
elsif($inputfile =~ /\.com/ ){
$inputfile_stripped = stripname($inputfile,"\.com"); # strip .com from $inputfilename
$geometry = strip($inputfile);
$stripped_geometry = stripcom($geometry);
$stripped_geometry =~ s/\s*\n$//;
if ($job =~ /opt/i){
rename($inputfile,$inputfile_stripped.".oldcom")||die "Can't mv $inputfile to $inputfile_stripped".".old\n";
}
heavyatom($stripped_geometry);
$stripped_geometry = ${stripped_geometry}."\n";
}
elsif($inputfile =~ /\.zmat/ ){
$inputfile_stripped = stripname($inputfile,"\.zmat"); # strip .zmat from $inputfilename
$geometry = strip($inputfile);
$geometry =~ s/\s*\n$//;
if ($geometry =~ /^\s*-*\d+/){
$stripped_geometry = $geometry;
}
else{
print "$inputfile\n";
$charge = &promptUser(" What is the charge of this molecule?",0);
$multi = &promptUser(" What is the multiplicity of this molecule?",1);
$stripped_geometry = ${charge}." ".${multi}."\n".${geometry};
}
$stripped_geometry = ${stripped_geometry}."\n";
}
elsif($inputfile =~ /\.inp/ ){
$inputfile_stripped = stripname($inputfile,"\.inp"); # strip .inp from $inputfilename
$geometry = strip($inputfile);
$stripped_geometry = stripcom($geometry);
}
elsif($inputfile =~ /\.gin/ ){
$inputfile_stripped = stripname($inputfile,"\.gin"); # strip .xyz from $inputfilename
$stripped_geometry = strip($inputfile);
$stripped_geometry =~ s/\s+\n/\n/;
}
elsif($inputfile =~ /\.xyz/ ){
$inputfile_stripped = stripname($inputfile,"\.xyz"); # strip .xyz from $inputfilename
$stripped_geometry = strip($inputfile);
$stripped_geometry =~ s/scf done:\s*-*\d+.\d+//;
$stripped_geometry =~ s/^\s*\d+\s*\n//;
$stripped_geometry =~ s/^\s*\n//;
$stripped_geometry =~ s/\s*\n$//;
if ($stripped_geometry =~ /^\s*-*\d+/){
$stripped_geometry = $stripped_geometry;
}
else{
print "$inputfile\n";
$charge = &promptUser(" What is the charge of this molecule?",0);
$multi = &promptUser(" What is the multiplicity of this molecule?",1);
$stripped_geometry = ${charge}." ".${multi}."\n".${stripped_geometry};
}
heavyatom($stripped_geometry);
$stripped_geometry = ${stripped_geometry}."\n";
}
elsif($inputfile =~ /\.uhfna\.punch/ ){
$inputfile_stripped = stripname($inputfile,"\.punch"); # strip .inp from $inputfilename
$stripped_geometry = stripnatural($inputfile);
($data,$mult,$norb,$det) = stripgam("$inputfile_stripped.inp");
}
elsif($inputfile =~ /\.sad\.punch/ ){
$inputfile_stripped = stripname($inputfile,"\.punch"); # strip .inp from $inputfilename
$stripped_geometry = strippunch($inputfile);
($data,$mult,$norb,$det) = stripgam("$inputfile_stripped.inp");
}
elsif($inputfile =~ /\.opt\.punch/ ){
$inputfile_stripped = stripname($inputfile,"\.punch"); # strip .inp from $inputfilename
$stripped_geometry = strippunch($inputfile);
($data,$mult,$norb,$det) = stripgam("$inputfile_stripped.inp");
}
elsif($inputfile =~ /\.out$/){
$inputfile_stripped = stripname($inputfile,"\.out\$");
$stripped_geometry = stripout($inputfile);
$stripped_geometry =~ s/^\s*\d+\s*\n//;
$stripped_geometry =~ s/^\s*\n//;
if ($stripped_geometry =~ /^\s*-*\d+/){
$stripped_geometry = $stripped_geometry;
}
else{
#$charge = &promptUser(" What is the charge of this molecule?",0);
#$multi = &promptUser(" What is the multiplicity of this molecule?",1);
$charge = "";
$multi = "";
$stripped_geometry = ${charge}." ".${multi}."\n".${stripped_geometry};
}
}
else {
print "Unknown file extension. Supported filetypes:\n";
print "Gaussian .log and .com (zmat and cartesian)\n";
print "Molden .zmat (gaussian format)\n";
print "Qchem .inp\n";
print "Molpro .out\n";
print "Any file containing a charge/multiplicity line,\n";
print "immediately followed by cartesian or zmat (gaussian)\n";
print "coordinates, where the file has a .com, .inp or .zmat\n";
print "extension. Leading and/or trailing garbage is allowed.\n";
die;
}
#Now, create the output.
if ($output_type eq "adf"){
$cm = getcm("$stripped_geometry");
($c,$m)=split(/[ \t]+/,$cm);
$spin = $m-1;
$header ="#! /bin/sh\n\n# ==============================\n# The Molecule\n# ==============================\n\n\"\$ADFBIN/adf\" <<eor\nTITLE fragment\n\nATOMS\n";
$footer = "END\n\nCHARGE $c.0 $spin \n\n";
if($spin!=0){
$footer = ${footer}."UNRESTRICTED\n\n";
}
$footer = ${footer}."\n\nBASIS\ntype TZP\ncore Large\nEND\n\nXC\nGGA Becke Perdew\nEND\n\nSAVE TAPE21 TAPE13\n\neor\n";
$stripped_geometry =~ s/^\s*-*\d+.*\n//g;
$finaldeck = ${header}.${stripped_geometry}."\n".${footer};
writedeck($finaldeck,$inputfile_stripped.".fragment.run");
$header ="#! /bin/sh\n\n# dependency: $inputfile_stripped $inputfile_stripped.fragment.t21\n# ==============================\n# The Molecule\n# ==============================\n\n\"\$ADFBIN/adf\" <<eor\nTITLE \n\nATOMS\n";
$footer = "END\n\nCHARGE $c.0 $spin \n\n";
if($spin!=0){
$footer = ${footer}."UNRESTRICTED\n\n";
}
$footer = ${footer}."SYMMETRY NOSYM\n\nSOLVATION\n\tSurf Delley\n\tDiv ndiv=4\n\tSolvent name=CRS cav0=0.0 cav1=0.0\n\tCharged method=CONJ corr\n\tC-Mat EXACT\n\tSCF VAR ALL\nEND\nBASIS\ntype TZP\ncore Large\nEND\n\nXC\nGGA Becke Perdew\nEND\n\nRESTART\t$inputfile_stripped.fragment.t21\n\nSAVE TAPE21 TAPE13\n\neor\n";
@atom = split(/\n/,$stripped_geometry);
@radiiline = split(/\n/,$stripped_geometry);
for $i (0..$#atom){
$atom[$i] =~ s/-*\d+.*//g;
$atom[$i] =~ s/\s+//g;
$radii = adfradii($atom[$i]);
$radiiline[$i] =~ s/$/\tR=$radii/g;
}
$stripped_geometry = join("\n",@radiiline);
$finaldeck = ${header}.${stripped_geometry}."\n".${footer};
writedeck($finaldeck,$inputfile_stripped.".run");
}
if ($output_type eq "gaussian"){
$cm = getcm("$stripped_geometry");
$iszmat = check_geometry_type($stripped_geometry);
#if it is, only print the first 7 fields of the zmat
#if the no. of fields is 8.
##$finaldeck = ${stripped_geometry}."\n";
#$finaldeck = addcomment($inputfile_stripped, $finaldeck);
if($job =~ /w1ts/i) {
@mult=split(/\s+/,$cm);
if ($mult[1] != 1){
$header ="\%chk=$inputfile_stripped.w1ts.chk\n\#UB3LYP/cc-pVTZ+d OPT=(TS,calcfc,noeigentest) IOP(2/17=4) Freq=noraman\n\n$inputfile_stripped.w1ts\n\n";
}
else{
$header ="\%chk=$inputfile_stripped.w1ts.chk\n\#RB3LYP/cc-pVTZ+d OPT=(TS,calcfc,noeigentest) IOP(2/17=4) Freq=noraman\n\n$inputfile_stripped.w1ts\n\n";
}
$footer ="\n";
}
elsif($job =~ /w1opt/i ){
@mult=split(/\s+/,$cm);
if ($mult[1] != 1){
$header ="\%chk=$inputfile_stripped.w1opt.chk\n\#UB3LYP/cc-pVTZ+d OPT IOP(2/17=4)\n\n$inputfile_stripped.w1opt\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.w1opt.chk\n\#UB3LYP/cc-pVTZ+d SCF=Tight pseudo=read guess=read geom=check Freq=noraman\n\n$inputfile_stripped.w1opt\n\n$cm\n\n";
}
else{
$header ="\%chk=$inputfile_stripped.w1opt.chk\n\#RB3LYP/cc-pVTZ+d OPT IOP(2/17=4)\n\n$inputfile_stripped.w1opt\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.w1opt.chk\n\#RB3LYP/cc-pVTZ+d SCF=Tight pseudo=read guess=read geom=check Freq=noraman\n\n$inputfile_stripped.w1opt\n\n$cm\n\n";
}
$footer ="\n";
}
elsif($job =~ /optcrs/i ){
print "$inputfile_stripped\n";
$level = &promptUser(" What method do you want to use?","UB3LYP");
$solvent = &promptUser(" What is the solvent you want to use (toluene,etac,h2o,ch3cn,dmso,acetone,dcle,benzene)?","dcle");
if ($solvent eq "toluene"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAKS\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "tol";
}
elsif ($solvent eq "benzene"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAKS\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "bzn";
}
elsif ($solvent eq "dcle"){
$scrf = "CPCM,Solvent=DiChloroEthane,Read";
$radiiline = "RADII=UAKS\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "dcle";
}
elsif ($solvent eq "acetone"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAKS\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "actn";
}
elsif ($solvent eq "dmso"){
$scrf = "CPCM,Solvent=DiMethylSulfoxide,Read";
$radiiline = "RADII=UAKS\nAlpha=1.35\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "dmso";
}
elsif ($solvent eq "etac"){
$scrf = "CPCM,Solvent=DiethylEther,Read";
$radiiline = "RADII=UAKS\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "DENSITY=0.00613\nRSOLV=2.734\nEPS=5.9867\nVMOL=98.5\n";
$nm = "etac"
}
elsif ($solvent eq "h2o"){
$scrf = "PCM,Solvent=water,Read";
$radiiline = "RADII=UAKS\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "h2o"
}
elsif ($solvent eq "ch3cn"){
$scrf = "CPCM,Solvent=CH3CN,Read";
$radiiline = "RADII=UAKS\nAlpha=1.45\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "acn"
}
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.optcrs.$nm.chk\n\#$level/$basis 6D IOP(2/17=4) OPT=(TS,calcfc,noeigentest,maxcyc=200) SCF=Tight SCRF=($scrf) INT(grid=ultrafine)\n\n$inputfile_stripped.optcrs.$nm\n\n";
$footer ="$radiiline$nonelec$solvnline\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.optcrs.$nm.chk\n\#$level/$basis 6D SCF=Tight Freq=Noraman IOP(2/17=4) SCRF=($scrf) INT(grid=ultrafine) guess=read geom=check\n\n$inputfile_stripped.optcrs.$nm\n\n$cm\n\n";
}
else{
$header ="\%chk=$inputfile_stripped.optcrs.$nm.chk\n\#$level/$basis 6D IOP(2/17=4) OPT SCF=Tight SCRF=($scrf) INT(grid=ultrafine)\n\n$inputfile_stripped.optcrs.$nm\n\n";
$footer ="";
}
$footer =${footer}."$radiiline$nonelec$solvnline\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.optcrs.$nm.chk\n\#$level/$basis 6D SCF=Tight IOP(2/17=4) SCRF=($scrf,dovac,self) INT(grid=ultrafine) guess=read geom=check\n\n$inputfile_stripped.optcrs.$nm\n\n$cm\n\n$radiiline$nonelec$solvnline\n\n";
}
elsif($job =~ /uahf/i ){
print "$inputfile_stripped\n";
$level = "UHF";
$solvent = &promptUser(" What is the solvent you want to use (toluene,etac,h2o,ch3cn,dmso,acetone,dcle)?","toluene");
if ($solvent eq "toluene"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAHF\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "tol";
}
elsif ($solvent eq "dcle"){
$scrf = "CPCM,Solvent=DiChloroEthane,Read";
$radiiline = "RADII=UAHF\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "dcle";
}
elsif ($solvent eq "acetone"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAHF\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "actn";
}
elsif ($solvent eq "dmso"){
$scrf = "CPCM,Solvent=DiMethylSulfoxide,Read";
$radiiline = "RADII=UAHF\nAlpha=1.35\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "dmso";
}
elsif ($solvent eq "etac"){
$scrf = "CPCM,Solvent=DiethylEther,Read";
$radiiline = "RADII=UAHF\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "DENSITY=0.00613\nRSOLV=2.734\nEPS=5.9867\nVMOL=98.5\n";
$nm = "etac"
}
elsif ($solvent eq "h2o"){
$scrf = "PCM,Solvent=water,Read";
$radiiline = "RADII=UAHF\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "h2o"
}
elsif ($solvent eq "ch3cn"){
$scrf = "CPCM,Solvent=CH3CN,Read";
$radiiline = "RADII=UAHF\nAlpha=1.45\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "acn"
}
$header ="\%chk=$inputfile_stripped.uahf.$nm.chk\n\#$level/$basis 6D IOP(2/17=4) SCF=Tight SCRF=($scrf,dovac,self) \n\n$inputfile_stripped.uahf.$nm\n\n";
$footer ="$radiiline$nonelec$solvnline\n\n";
}
elsif($job =~ /spcrs/i ){
$level = &promptUser(" What method do you want to use?","UB3LYP");
$solvent = &promptUser(" What is the solvent you want to use (toluene,etac,h2o,ch3cn)?","h2o");
if ($solvent eq "toluene"){
$scrf = "CPCM,Solvent=$solvent,Read";
$radiiline = "RADII=UAKS\nAlpha=1.3\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "tol";
}
elsif ($solvent eq "etac"){
$scrf = "CPCM,Solvent=DiethylEther,Read";
$radiiline = "RADII=UAKS\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "DENSITY=0.00613\nRSOLV=2.734\nEPS=5.9867\nVMOL=98.5\n";
$nm = "etac"
}
elsif ($solvent eq "h2o"){
$scrf = "PCM,Solvent=water,Read";
$radiiline = "RADII=UAKS\nAlpha=1.2\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "h2o"
}
elsif ($solvent eq "ch3cn"){
$scrf = "CPCM,Solvent=CH3CN,Read";
$radiiline = "RADII=UAKS\nAlpha=1.45\n";
$nonelec = "Cav\nDis\nRep\n";
$solvnline = "";
$nm = "acn"
}
$header ="\%chk=$inputfile_stripped.spcrs.$nm.chk\n\#$level/$basis 6D IOP(2/17=4) SCF=Tight SCRF=($scrf,dovac,self) INT(grid=ultrafine)\n\n$inputfile_stripped.spcrs.$nm\n\n";
$footer ="$radiiline$nonelec$solvnline\n\n";
}
elsif($job =~ /smd/i ){
$solvn = &promptUser(" Which solvent do you want to use?","toluene");
if($solvn =~ /water/ ){
$nm ="h2o";
}
elsif($solvn =~ /toluene/ ){
$nm ="tol";
}
# else (
# $sn = &promptUser(" Which filename ext do you want ot use for this solvent?");
# }
$level = &promptUser(" Which level of theory do you want to use?","M062X");
$opttype1 = &promptUser(" Do you want to optimise the geometries?",N);
if($opttype1 =~ /N/ ){
$header ="\%chk=$inputfile_stripped.smd.$nm.chk\n\#$level/$basis 6D SCF=Tight IOP(2/17=4) SCRF=(Read,dovac,self,SMD,Solvent=$solvn) INT(grid=ultrafine)\n\n$inputfile_stripped.smd\n\n";
$footer ="surface=sas\nrsolv=0\n\n\n";
}
else{
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.smd.chk\n\#$level/$basis 6D IOP(2/17=4) OPT=(TS,calcfc,noeigentest,maxcyc=200) SCF=Tight SCRF=(SMD,Solvent=$solvn,Read) INT(grid=ultrafine)\n\n$inputfile_stripped.smd\n\n";
}
else{
$header ="\%chk=$inputfile_stripped.smd.chk\n\#$level/$basis 6D IOP(2/17=4) OPT SCF=Tight SCRF=(SMD,Solvent=$solvn,Read) INT(grid=ultrafine)\n\n$inputfile_stripped.smd\n\n";
}
$footer ="surface=sas\nrsolv=0\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.smd.chk\n\#$level/$basis 6D SCF=Tight IOP(2/17=4) SCRF=(Read,dovac,self,SMD,Solvent=$solvn) INT(grid=ultrafine) guess=read geom=check\n\n$inputfile_stripped.smd\n\n$cm\n\nsurface=sas\nrsolv=0\n\n\n";
}
}
elsif($job =~ /b3sp/i ){
$header ="\%chk=$inputfile_stripped.b3sp.chk\n\#B3LYP/$basis 6D IOP(2/17=4) INT(grid=ultrafine) SCF=Tight\n\n$inputfile_stripped.b3lyp.singlepoint\n\n";
$footer ="";
}
# elsif($job =~ /uahf/i ){
# $header ="\%chk=$inputfile_stripped.uahf.chk\n\#UHF/$basis 6D SCRF=(CPCM,Solvent=water,Read) OPT int(Grid=Ultrafine) IOP(2/17=4)\n\n$inputfile_stripped.uahf\n\n";
# $footer ="Radii=UAHF\nAlpha=1.2\nRep\nDis\nCav\n\n";
# $footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.uahf.chk\n\#UHF/$basis 6D SCRF=(CPCM,Solvent=water,Read,dovac,self) IOP(2/17=4) int(Grid=Ultrafine) guess=read geom=check\n\n$inputfile_stripped.uahf\n\n$cm\n\nRadii=UAHF\nAlpha=1.2\nRep\nDis\nCav\n\n";
# }
elsif($job =~ /sphf/i ){
$level = &promptUser(" What level of theory do you want to use?","ROHF");
$header ="\%chk=$inputfile_stripped.sphf.chk\n\#$level/gen 6D SCF=Tight\n\n$inputfile_stripped.sphf\n\n";
$footer ="@/$HOME/Basis/$genbasis.gbs/N\n\n";
}
elsif($job =~ /vol/i ){
$header ="\%chk=$inputfile_stripped.vol.chk\n\#UHF/gen 6D SCRF=(CPCM,Solvent=water,Read) Volume int(Grid=Ultrafine) \n\n$inputfile_stripped.uahf\n\n";
$footer ="@/$HOME/Basis/$genbasis.gbs/N\n\nRadii=UAHF\nAlpha=1.4\nRep\nDis\nCav\n\n";
}
elsif($job =~ /oi/i ){
$level = &promptUser(" What level of theory do you want to use?","UHF");
if($level =~ /UHF/ ){
$ln ="uhf";
}
elsif($level =~ /M06/ ){
$ln ="m06";
}
else{
$ln = &promptUser(" Enter subtitle for the theory");
}
$basis = &promptUser(" Which basis do you want to use?","STO-3G");
if($basis =~ /STO/ ){
$bn ="sto";
}
elsif($basis =~ /6-31/ ){
$bn ="gbs";
}
else{
$bn = &promptUser(" Enter subtitle for the basis");
}
$header ="\%chk=$inputfile_stripped.oi.$ln.$bn.chk\n\#P $level/$basis SCF=Tight FormCheck Pop=Full Nosymm IOP(3/33=1) \n\n$inputfile_stripped.oi.$ln.$bn\n\n";
$footer ="\n\n";
}
elsif($job =~ /dens/i ){
$level = &promptUser(" What level of theory do you want to use?","MP2");
if($level =~ /MP2/ ){
$ln ="mp2";
}
else{
$ln = &promptUser(" Enter subtitle for the theory");
}
$basis = &promptUser(" Which basis do you want to use?","aug-cc-pVTZ");
$header ="\%chk=$inputfile_stripped.dens.$ln.chk\n\#P $level/$basis SCF=Tight FormCheck Density=current \n\n$inputfile_stripped.dens.$ln\n\n";
$footer ="\n\n";
}
elsif($job =~ /ts1/i ){
$header ="\%chk=$inputfile_stripped.ts1.chk\n\#UHF/$basis 6D SCRF=(CPCM,Solvent=water,Read) IOP(2/17=4) OPT=(Cartesian,TS,calcfc,noeigentest,maxcyc=200) int(Grid=Ultrafine)\n\n$inputfile_stripped.ts1\n\n";
$footer ="Radii=UAHF\nAlpha=1.4\nRep\nDis\nCav\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.ts1.chk\n\#UHF/$basis 6D SCRF=(CPCM,Solvent=water,Read,dovac,self) IOP(2/17=4) int(Grid=Ultrafine) guess=read geom=check\n\n$inputfile_stripped.ts1\n\n$cm\n\nRadii=UAHF\nAlpha=1.4\nRep\nDis\nCav\n\n";
}
elsif($job =~ /cbsrad/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.cbsrad.chk\n\#B3LYP/6-31G(d) Freq=Noraman \n\n$inputfile_stripped.geometry\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.cbsrad.chk\n\#QCISD(fc)/6-31G(d) OPT=(TS,readfc,noeigentest,maxcyc=200) guess=tcheck geom=allcheck \n\n$inputfile_stripped.geometry\n\n$cm\n\n\n--Link1--\n";
}
else {
$header ="\%chk=$inputfile_stripped.cbsrad.chk\n\#QCISD(fc)/6-31G(d) OPT \n\n$inputfile_stripped.geometry\n\n";
$footer ="\n--Link1--\n";
}
$footer =${footer}."\%chk=$inputfile_stripped.cbsrad.chk\n\#QCISD(fc)/6-31G(d) guess=tcheck geom=allcheck Freq=noraman\n\n$inputfile_stripped.frequency\n\n$cm\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.cbsrad.chk\n\#CCSD(T,T1Diag,fc)/6-31+G(d') guess=tcheck geom=allcheck\n\n$inputfile_stripped.cbs-rad\n\n$cm\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.cbsrad.chk\n\#MP4(SDQ,fc)/CBSB4 guess=tcheck geom=allcheck\n\n$inputfile_stripped.cbs-rad\n\n$cm\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.cbsrad.chk\n\#MP2(fc)/CBSB3 CBSExtrapolate=(NMin=10,MinPop) guess=tcheck geom=allcheck\n\n$inputfile_stripped.cbs-rad\n\n$cm\n\n";
}
elsif($job =~ /qb3/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.qb3.chk\n\# CBS-QB3 OPT=(TS,calcfc,noeigentest,maxcyc=200) \n\n$inputfile_stripped CBS-QB3\n\n";
$footer ="\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.qb3.chk\n\# CBS-QB3 \n\n$inputfile_stripped CBS-QB3\n\n";
$footer ="\n\n";
}
}
elsif($job =~ /cbs4m/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.cbs4m.chk\n\# CBS-4M OPT=(TS,calcfc,noeigentest,maxcyc=200) \n\n$inputfile_stripped CBS-4M\n\n";
$footer ="\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.cbs4m.chk\n\# CBS-4M \n\n$inputfile_stripped CBS-4M\n\n";
$footer ="\n\n";
}
}
elsif($job =~ /gcc/i ){
$header ="\%chk=$inputfile_stripped.gcc.chk\n\#UCCSD(T,T1Diag)/aug-cc-pVTZ SCF=Tight\n\n$inputfile_stripped.geometry\n\n";
$footer ="\n\n";
# $header ="\%chk=$inputfile_stripped.gcc.chk\n\#UCCSD(T,T1Diag)/gen 6D INT(grid=ultrafine) SCF=Tight\n\n$inputfile_stripped.geometry\n\n";
# $footer ="@/$HOME/Basis/$genbasis.gbs/N\n\n";
}
# elsif($job =~ /dcc/i ){
# $header ="\%chk=$inputfile_stripped.dcc.chk\n\#CCSD(T,T1Diag)/aug-cc-pVTZ INT(grid=ultrafine) SCF=Tight\n\n$inputfile_stripped ccsd(t) with dunning's basis set \n\n";
# $footer ="\n";
# }
elsif($job =~ /fullg3/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.fullg3.chk\n\#G3 OPT=(TS,calcfc,noeigentest,maxcyc=200)\n\n$inputfile_stripped G3\n\n";
$footer ="\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.fullg3.chk\n\#G3 \n\n$inputfile_stripped G3\n\n";
$footer ="\n\n";
}
}
elsif($job =~ /fullg4/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.fullg4.chk\n\#G4 OPT=(TS,calcfc,noeigentest,maxcyc=200)\n\n$inputfile_stripped G4\n\n";
$footer ="\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.fullg4.chk\n\#G4 \n\n$inputfile_stripped G4\n\n";
$footer ="\n\n";
}
}
elsif($job =~ /g4mp26x/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.g4mp26x.chk\n\# BMK/6-31+G(2df,p) Opt=(TS,calcfc,noeigentest,maxcyc=250) \n\n$inputfile_stripped G4MP2-6x by Chan & Radom\n\n";
$footer ="\n";
}
else {
$header ="\%chk=$inputfile_stripped.g4mp26x.chk\n\# BMK/6-31+G(2df,p) Opt \n\n$inputfile_stripped G4MP2-6x by Chan & Radom\n\n";
$footer ="\n";
}
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.g4mp26x.chk\n\# Geom=AllCheck Guess=Read BMK/6-31+G(2df,p) Freq\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.g4mp26x.chk\n\# Geom=AllCheck Guess=Read CCSD(T,T1Diag,FrzG4)/GTBas1\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.g4mp26x.chk\n\# Geom=AllCheck Guess=Read MP2(FrzG4)/GTMP2LargeXP\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.g4mp26x.chk\n\# Geom=AllCheck Guess=Read HF/GFHFB3\n\n";
$footer =${footer}."\n--Link1--\n\%chk=$inputfile_stripped.g4mp26x.chk\n\# Geom=AllCheck Guess=Read HF/GFHFB4\n\n";
}
elsif($job =~ /mdbs/i ){
$jobtype = &promptUser(" Do you want to optimise the geometry?",N);
$nm ="mdbs";
if($jobtype =~ /Y/ ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.$nm.chk\n\# M062X/aug-cc-pVTZ SCF=Tight Int(Grid=Ultrafine) OPT=(TS,calcfc,noeigentest,maxcyc=200) IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.$nm.chk\n\# M062X/aug-cc-pVTZ SCF=Tight Int(Grid=Ultrafine) Freq=Noraman geom=check guess=read IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n$cm\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.$nm.chk\n\# M062X/aug-cc-pVTZ SCF=Tight Int(Grid=Ultrafine) OPT IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.$nm.chk\n\# M062X/aug-cc-pVTZ SCF=Tight Int(Grid=Ultrafine) Freq=Noraman geom=check guess=read IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n$cm\n\n";
}
}
else {
$nm ="mdbs.sp";
$freqtype = &promptUser(" Do you want to calculate the frequencies?",N);
if($freqtype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.$nm.chk\n\# M062X/aug-cc-pVTZ SCF=Tight Int(Grid=Ultrafine) Freq=Noraman IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n";
$footer ="\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.$nm.chk\n\# M062X/6-311+G(3df,2p) SCF=Tight Int(Grid=Ultrafine) IOP(2/17=4)\n\n$inputfile_stripped.$nm\n\n";
$footer ="\n\n";
}
}
}
elsif($job =~ /mpw/i ){
$basis = &promptUser(" What basis do you want to use?","6-311+G(3df,2p)");
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.mpw.chk\n\# MPWB95/$basis 6D IOp(3/76=0560004400) SCF=Tight Int(Grid=Ultrafine) OPT=(TS,calcfc,noeigentest,maxcyc=200)\n\n$inputfile_stripped.mpw\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.mpw.chk\n\# MPWB95/$basis 6D IOp(3/76=0560004400) SCF=Tight Int(Grid=Ultrafine) Freq=Noraman guess=read geom=check\n\n$inputfile_stripped.mpw\n\n$cm\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.mpw.chk\n\# MPWB95/$basis 6D IOp(3/76=0560004400) SCF=Tight Int(Grid=Ultrafine) OPT \n\n$inputfile_stripped.mpw\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.mpw.chk\n\# MPWB95/$basis 6D IOp(3/76=0560004400) SCF=Tight Int(Grid=Ultrafine) Freq=Noraman guess=read geom=check\n\n$inputfile_stripped.mpw\n\n$cm\n\n";
}
}
elsif($job =~ /bmk/i ){
$basis="6-31+G(2df,p)";
$opttype1 = &promptUser(" Do you want to optimise the geometry?",N);
if($opttype1 =~ /Y/ ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.bmk.chk\n\#BMK/$basis IOp(2/17=4) SCF=Tight Int(Grid=Ultrafine) OPT=(TS,calcfc,noeigentest,maxcyc=200)\n\n$inputfile_stripped.bmk\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.bmk.chk\n\#BMK/$basis IOp(2/17=4) SCF=Tight Int(Grid=Ultrafine) Freq=Noraman guess=read geom=check\n\n$inputfile_stripped.bmk\n\n$cm\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.bmk.chk\n\#BMK/$basis IOp(2/17=4) SCF=Tight Int(Grid=Ultrafine) OPT \n\n$inputfile_stripped.bmk\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.bmk.chk\n\#BMK/$basis IOp(2/17=4) SCF=Tight Int(Grid=Ultrafine) Freq=Noraman guess=read geom=check\n\n$inputfile_stripped.bmk\n\n$cm\n\n";
}
}
else {
$freqtype = &promptUser(" Do you want to do frequencies?",N);
if($freqtype =~ /Y/ ){
$freq ="Freq=Noraman";
}
else{
$freq ="";
}
$header ="\%chk=$inputfile_stripped.bmk.chk\n\#BMK/$basis IOp(2/17=4) SCF=Tight Int(Grid=Ultrafine) $freq \n\n$inputfile_stripped.bmk\n\n";
$footer ="";
}
}
elsif($job =~ /rmp2/i ){
$header ="\%chk=$inputfile_stripped.rmp2.chk\n\#ROMP2/6-311+G(3df,2p) SCF=tight\n\n$inputfile_stripped.rmponiom\n\n";
$footer ="";
}
elsif($job =~ /ump2/i ){
$header ="\%chk=$inputfile_stripped.ump2.chk\n\#UMP2/6-311+G(3df,2p) SCF=tight\n\n$inputfile_stripped.umponiom\n\n";
$footer ="";
}
elsif($job =~ /usmp2/i ){
$header ="\%chk=$inputfile_stripped.usmp2.chk\n\#UHF/6-31G* SCF=tight\n\n$inputfile_stripped.umpsoniom\n\n";
$footer ="\n\n--Link1--\n\%chk=$inputfile_stripped.usmp2.chk\n\#UMP2/aug-cc-pVDZ SCF=tight guess=read geom=allcheck \n\n$inputfile_stripped.umpsoniom\n\n";
}
elsif($job =~ /ulmp2/i ){
$header ="\%chk=$inputfile_stripped.ulmp2.chk\n\#UHF/6-31G* SCF=tight\n\n$inputfile_stripped.umploniom\n\n";
$footer ="\n\n--Link1--\n\%chk=$inputfile_stripped.ulmp2.chk\n\#UMP2/aug-cc-pVTZ SCF=tight guess=read geom=allcheck \n\n$inputfile_stripped.umploniom\n\n";
}
elsif($job =~ /optm/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.chk\n\#M062X/gen 6D SCF=Tight INT(grid=ultrafine) OPT=(TS,calcfc,noeigentest,maxcyc=250) IOP(2/17=4)\n\n$inputfile_stripped.freq\n\n";
$footer ="@/$HOME/Basis/$genbasis.gbs/N\n\n\n\n--Link1--\n\%chk=$inputfile_stripped.chk\n\#M062X/gen 6D SCF=Tight INT(Grid=Ultrafine) guess=read geom=check Freq=noraman IOP(2/17=4)\n\n$inputfile_stripped.freq\n\n$cm\n\n@/$HOME/Basis/$genbasis.gbs/N\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.chk\n\#M062X/gen 6D SCF=Tight INT(grid=ultrafine) OPT IOP(2/17=4) \n\n$inputfile_stripped.freq\n\n";
$footer ="@/$HOME/Basis/$genbasis.gbs/N\n\n\n\n--Link1--\n\%chk=$inputfile_stripped.chk\n\#M062X/gen 6D SCF=Tight guess=read IOP(2/17=4) INT(Grid=Ultrafine) geom=check Freq=noraman\n\n$inputfile_stripped.freq\n\n$cm\n\n@/$HOME/Basis/$genbasis.gbs/N\n\n";
}
}
elsif($job =~ /freqm/i ){
$frqnc = &promptUser(" Do you want to calculate the frequencies? ",N);
if($frqnc =~ /N/ ){
$frqnc = " ";}
else{
$frqnc = "Freq=Noraman";}
$header ="\%chk=$inputfile_stripped.chk\n\#M062X/gen 6D SCF=Tight INT(grid=ultrafine) $frqnc IOP(2/17=4) \n\n$inputfile_stripped.freq\n\n";
$footer ="@/$HOME/Basis/$genbasis.gbs/N\n\n";
}
elsif($job =~ /mp2opt/i ){
$opttype = &promptUser(" Is it a TS?",N);
if($opttype =~ /Y/ ){
$header ="\%chk=$inputfile_stripped.mp2opt.chk\n\#MP2(Full)/aug-cc-pVDZ OPT=(TS,calcfc,noeigentest,maxcyc=200) \n\n$inputfile_stripped.mp2opt MP2 optimisation\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.mp2opt.chk\n\#MP2(Full)/aug-cc-pVDZ guess=read geom=check Freq=noraman\n\n$inputfile_stripped MP2 frequencies\n\n$cm\n\n";
}
else {
$header ="\%chk=$inputfile_stripped.mp2opt.chk\n\#MP2(Full)/aug-cc-pVDZ OPT \n\n$inputfile_stripped.mp2opt optimisation\n\n";
$footer ="\n--Link1--\n\%chk=$inputfile_stripped.mp2opt.chk\n\#MP2(Full)/aug-cc-pVDZ guess=read geom=check Freq=noraman\n\n$inputfile_stripped MP2 frequencies\n\n$cm\n\n";
}
}
elsif($job =~ /xyz/i ){
if ($inputfile =~ /\.out$/){
@xyz = split(/\n/,$stripped_geometry);
$header ="$#xyz\n";
$stripped_geometry =~ s/,/ /g;
}
else{
if ($iszmat){
$header = "";
}
else{
@xyz = split(/\n/,$stripped_geometry);
$header ="$#xyz\n";
}
}
$footer ="";
}
elsif($job =~ /ar/){
$header =" 1\\1\\GINC";
$stripped_geometry = striparc($inputfile,1)."@";
$footer ="";
}
$footer = ${footer}."\n";
$finaldeck = ${header}.${stripped_geometry}."\n".${footer};
if($job =~ /w1opt/i) {writedeck($finaldeck,$inputfile_stripped.".w1opt.com");}
elsif($job =~ /w1ts/i) {writedeck($finaldeck,$inputfile_stripped.".w1ts.com");}
elsif($job =~ /cbsrad/i) { writedeck($finaldeck,$inputfile_stripped.".cbsrad.com"); }
elsif($job =~ /qb3/i) { writedeck($finaldeck,$inputfile_stripped.".qb3.com"); }
elsif($job =~ /cbs4m/i) { writedeck($finaldeck,$inputfile_stripped.".cbs4m.com"); }
elsif($job =~ /gcc/i) { writedeck($finaldeck,$inputfile_stripped.".gcc.com"); }
elsif($job =~ /dcc/i) { writedeck($finaldeck,$inputfile_stripped.".dcc.com"); }
elsif($job =~ /fullg3/i) { writedeck($finaldeck,$inputfile_stripped.".fullg3.com"); }
elsif($job =~ /fullg4/i) { writedeck($finaldeck,$inputfile_stripped.".fullg4.com"); }
elsif($job =~ /g4mp26x/i) { writedeck($finaldeck,$inputfile_stripped.".g4mp26x.com"); }
elsif($job =~ /mdbs/i) { writedeck($finaldeck,$inputfile_stripped.".$nm.com"); }
elsif($job =~ /bmk/i) { writedeck($finaldeck,$inputfile_stripped.".bmk.com"); }
elsif($job =~ /mpw/i) { writedeck($finaldeck,$inputfile_stripped.".mpw.com"); }
elsif($job =~ /rmp2/i) {writedeck($finaldeck,$inputfile_stripped.".rmp2.com");}
elsif($job =~ /ump2/i) {writedeck($finaldeck,$inputfile_stripped.".ump2.com");}
elsif($job =~ /usmp2/i) {writedeck($finaldeck,$inputfile_stripped.".usmp2.com");}
elsif($job =~ /ulmp2/i) {writedeck($finaldeck,$inputfile_stripped.".ulmp2.com");}
elsif($job =~ /optm/i) { writedeck($finaldeck,$inputfile_stripped.".com"); }
elsif($job =~ /freqm/i) { writedeck($finaldeck,$inputfile_stripped.".com"); }
elsif($job =~ /mp2opt/i) { writedeck($finaldeck,$inputfile_stripped.".mp2opt.com"); }
elsif($job =~ /b3sp/i) {writedeck($finaldeck,$inputfile_stripped.".b3sp.com");}
elsif($job =~ /uahf/i) {writedeck($finaldeck,$inputfile_stripped.".uahf.$nm.com");}
elsif($job =~ /sphf/i) {writedeck($finaldeck,$inputfile_stripped.".sphf.com");}
elsif($job =~ /vol/i) {writedeck($finaldeck,$inputfile_stripped.".vol.com");}
elsif($job =~ /oi/i) {writedeck($finaldeck,$inputfile_stripped.".oi.$ln.$bn.com");}
elsif($job =~ /dens/i) {writedeck($finaldeck,$inputfile_stripped.".dens.$ln.com");}
elsif($job =~ /ts1/i) {writedeck($finaldeck,$inputfile_stripped.".ts1.com");}
elsif($job =~ /smd/i) {writedeck($finaldeck,$inputfile_stripped.".smd.$nm.com");}
elsif($job =~ /optcrs/i) {writedeck($finaldeck,$inputfile_stripped.".optcrs.$nm.com");}
elsif($job =~ /spcrs/i) {writedeck($finaldeck,$inputfile_stripped.".spcrs.$nm.com");}
elsif($job =~ /xyz/i) {writedeck($finaldeck,$inputfile_stripped.".xyz");}
elsif($job =~ /ar/i) {writedeck($finaldeck,$inputfile_stripped.".ar");}
}
if ($output_type eq "gamess"){
if($job =~ /mrpt2/i) {
$header =" \$contrl $mult scftyp=mcscf mplevl=2 \$end\n \$BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 DIFFSP=.F. \$END\n \$SYSTEM TIMLIM=172800 MWORDS=100 PARALL=.false. \$END\n \$GUESS guess=moread $norb \$end\n$det";}
elsif($job =~ /mrsad/i) {
$header =" \$contrl $mult runtyp=SADPOINT scftyp=mcscf \$end\n \$BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 DIFFSP=.F. \$END\n \$SYSTEM TIMLIM=172800 MEMDDI=1 MWORDS=100 PARALL=.false. \$END\n \$GUESS guess=moread norb=XX \$end\n \$STATPT HESS=calc \$end\n \$det ncore=XX nels=X nact=X \$end\n \$DATA\n".${data}." \$END\n";}
elsif($job =~ /mropt/i) {
$header =" \$contrl $mult runtyp=OPTIMIZE scftyp=mcscf \$end\n \$BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 DIFFSP=.F. \$END\n \$SYSTEM TIMLIM=172800 MEMDDI=1 MWORDS=100 PARALL=.false. \$END\n \$GUESS guess=moread norb=XX \$end\n \$det ncore=XX nels=X nact=X \$end\n \$DATA\n".${data}." \$END\n";}
elsif($job =~ /mrhess/i) {
$header =" \$contrl $mult runtyp=HESSIAN scftyp=mcscf \$end\n \$BASIS GBASIS=N31 NGAUSS=6 NDFUNC=1 DIFFSP=.F. \$END\n \$SYSTEM TIMLIM=172800 MEMDDI=10 MWORDS=100 PARALL=.false. \$END\n \$GUESS guess=moread $norb \$end\n \$STATPT HESS=calc \$end\n$det";}
else{
$header ="";
}
$finaldeck = ${header}.${stripped_geometry}."\n";
if($job =~ /mruhf/i) {writedeck($finaldeck,$inputfile_stripped.".uhfna.inp");}
elsif($job =~ /mrsad/i) {$inputfile_stripped = stripname($inputfile_stripped,"\.uhfna");
writedeck($finaldeck,$inputfile_stripped.".sad.inp");}
elsif($job =~ /mropt/i) {
$inputfile_stripped = stripname($inputfile_stripped,"\.uhfna"); # strip .inp from $inputfilename
writedeck($finaldeck,$inputfile_stripped.".opt.inp");}
elsif($job =~ /mrpt2/i) {
$inputfile_stripped = stripname($inputfile_stripped,"\.opt"); # strip .inp from $inputfilename
$inputfile_stripped = stripname($inputfile_stripped,"\.sad"); # strip .inp from $inputfilename
writedeck($finaldeck,$inputfile_stripped.".mrpt2.inp");}
elsif($job =~ /mrhess/i) {
$inputfile_stripped = stripname($inputfile_stripped,"\.opt"); # strip .inp from $inputfilename
$inputfile_stripped = stripname($inputfile_stripped,"\.sad"); # strip .inp from $inputfilename
writedeck($finaldeck,$inputfile_stripped.".hess.inp");}
}
#if ($output_type eq "qchem"){
# $finaldeck = "\$rem\n\tJOBTYP\t\t\t\tOPT\n\tEXCHANGE\t\t\tEDF1\n\tBASIS\t\t\t\t$basis\n\tXC_GRID\t\t\t\t000100000194\n\tGEOM_OPT_TOL_ENERGY 1\n\tGEOM_OPT_TOL_DISPLACEMENT 1\n\tGEOM_OPT_TOL_GRADIENT 1\n\$end\n\n";
# $finaldeck = ${finaldeck}."\$molecule\n";
# $cm = getcm("$stripped_geometry");
# $finaldeck = ${finaldeck}.${stripped_geometry};
# $finaldeck = ${finaldeck}."\$end\n";
# writedeck($finaldeck,$inputfile_stripped.".in");
#}
if ($output_type eq "qchem"){
if ($job =~ /qhf/i){
$finaldeck = "\$molecule\n";
$cm = getcm("$stripped_geometry");
$finaldeck = ${finaldeck}.${stripped_geometry};
$finaldeck = ${finaldeck}."\$end\n";
($c,$m)=split(/[ \t]+/,$cm);
$basis = &promptUser(" Which basis set do you want to use?","aug-cc-pVDZ");
if ($m eq "1"){
$unrest = "\tUNRESTRICTED\t\t0\n";}
else {
$unrest = "\tUNRESTRICTED\t\t1\n";}
$finaldeck = ${finaldeck}."\$rem\n\tEXCHANGE\t\t\tHF\n\tBASIS\t\t\t\t$basis\n$unrest\tAO2MO_DISK\t\t\t5000\n\tMEM_STATIC\t\t\t2500\n\tMEM_TOTAL\t\t\t4000\n\tMAX_SCF_CYCLES\t\t100\n\tSCF_ALGORITHM\t\tDM\n\tSCF_CONVERGENCE\t\t5\n\tSCF_PRINT\t\t\t1\n\tGUI\t\t\t\t\t2\n";
$finaldeck = ${finaldeck}."\$end\n\n";
writedeck($finaldeck,$inputfile_stripped.".qhf.in");
}
if ($job =~ /qec/i){
print "$inputfile_stripped\n" ;
$finaldeck = "\$molecule\n";
$cm = getcm("$stripped_geometry");
$finaldeck = ${finaldeck}.${stripped_geometry};
$finaldeck = ${finaldeck}."\$end\n\n";
($c,$m)=split(/[ \t]+/,$cm);
$detch = &promptUser(" Is it a detached point charge modelling?",Y);
if ($detch =~ /Y/){
$crg = &promptUser(" Specify the charge you want to use ","-1");
if ($m eq "1"){
$unrest = "\tUNRESTRICTED\t\t0\n";
$scfalg = "\tSCF_ALGORITHM\t\tDIIS\n";}
else {
$unrest = "\tUNRESTRICTED\t\t1\n";
$scfalg = "\tSCF_ALGORITHM\t\tDIIS\n"; }
}
else{
$crg = " ";
if ($m eq "1"){
$unrest = "\tUNRESTRICTED\t\t0\n";
$scfalg = "\tSCF_ALGORITHM\t\tDM\n";}
else {
$unrest = "\tUNRESTRICTED\t\t1\n";
$scfalg = "\tSCF_ALGORITHM\t\tGDM\n"; }
}
$basis = &promptUser(" Which basis set do you want to use?","6-31+G*");
$dohf = &promptUser(" Do you want to run HF before DFT? ",Y);
if ($dohf =~ /Y/){
$finaldeck = ${finaldeck}."\$rem\n\tJOBTYPE\t\t\t\tSP\n\tEXCHANGE\t\t\tHF\n\tBASIS\t\t\t\t$basis\n$unrest\tAO2MO_DISK\t\t\t5000\n\tMEM_STATIC\t\t\t2500\n\tMEM_TOTAL\t\t\t4000\n\tMAX_SCF_CYCLES\t\t100\n$scfalg\tSCF_CONVERGENCE\t\t5\n\tSCF_PRINT\t\t\t1\n";
$finaldeck = ${finaldeck}."\$end\n\n\n";
$finaldeck = ${finaldeck}."\@@@\n";
$finaldeck = ${finaldeck}."\$molecule\nread\n";
$finaldeck = ${finaldeck}."\$end\n\n\n";
}
else{
}
$finaldeck = ${finaldeck}."\$rem\n\tJOBTYPE\t\t\t\tSP\n\tEXCHANGE\t\t\tM062X\n\tBASIS\t\t\t\t$basis\n$unrest\tAO2MO_DISK\t\t\t5000\n\tMEM_STATIC\t\t\t2500\n\tMEM_TOTAL\t\t\t4000\n\tMAX_SCF_CYCLES\t\t100\n$scfalg\tSCF_CONVERGENCE\t\t5\n\tSCF_PRINT\t\t\t1\n\tGUI\t\t\t\t\t2\n\tIGDESP\t\t\t\t0\n";
$finaldeck = ${finaldeck}."\$end\n\n";
if ($detch =~ /Y/){
$finaldeck = ${finaldeck}."\$external_charges\n\t$crg\n";
$finaldeck = ${finaldeck}."\$end\n\n";
writedeck($finaldeck,$inputfile_stripped.".qec.in");
}
else{
writedeck($finaldeck,$inputfile_stripped.".m062x.in");
}
}
if($job =~ /rim/i) {
$finaldeck = "\$molecule\n";
$cm = getcm("$stripped_geometry");
$finaldeck = ${finaldeck}.${stripped_geometry};
$finaldeck = ${finaldeck}."\$end\n";
($c,$m)=split(/[ \t]+/,$cm);
countqchem($inputfile);
print "$natoms heavyatoms\n";
if ($natoms <=10) {
$dfs = "5000";
$mst = "3500";
$mtot = "4000";
}
elsif ($natoms <=25) {
$dfs = "7000";
$mst = "4500";
$mtot = "6000";
}
else {
$dfs = "8000";
$mst = "7500";
$mtot = "9000";
}
# $dfs = "58000";
if ($m eq "1"){
$guess2 = "";
$unrest = "";
$basis2 = "\tBASIS2\t\t\t\t6-31G*\n";
$scfalg = "DM";
}