line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chemistry::ESPT::Glib; |
2
|
|
|
|
|
|
|
require Exporter; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
5
|
|
|
|
|
|
|
our @EXPORT = qw(rparser); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Chemistry::ESPT::Glib - Gaussian library module |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Chemistry::ESPT::Glib; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
rparser($object); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This module contains subroutines for analzing Gaussian files. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=begin comment |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
### Version History ### |
28
|
|
|
|
|
|
|
0.01 rparser(jobtype) |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
### To Do ### |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=end comment |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SUBROUTINES |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Subroutine parameters denoted by [] are optional. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=over 10 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item B |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Gaussian route line parser. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=back |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# parse the route line |
49
|
|
|
|
|
|
|
sub rparser { |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# grab the object to store data in |
52
|
0
|
|
|
0
|
1
|
|
my $gauss = shift; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# grab keywords |
55
|
0
|
|
|
|
|
|
my @keywords = split /(?{ROUTE}; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# keyword regexpressions |
58
|
0
|
|
|
|
|
|
my @bases = ("gen", "[ceopst346]+-[1-3]+[\+]*g", "d95v*", "shc", "lanl","tz", "(?:aug-)*cc-pv[dqt56]z"); |
59
|
0
|
|
|
|
|
|
push @bases, ("sv", "sdd", "midix", "epr", "ugbs", "mtsmall", "dg[dtz]+vp", "6-31g"); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my @exchange = ("h*f*[sb](?:handh)*", "xa(?:lpha)*", "pw91", "mpw", "g96", "m*pbe", "o", "vsxc"); |
62
|
0
|
|
|
|
|
|
push @exchange, ( "hcth", "tpss", "lsda"); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my @jobtypes = ("sp", "opt","ts", "freq", "irc(?:max)*", "scan", "polar", "admp", "bomd", "force"); |
65
|
0
|
|
|
|
|
|
push @jobtypes, ("stable", "volume", "density=check", "guess=only", "rearchive", "mixed", "saddle"); |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my @theories = ("amber", "dreiding", "uff","[cimz]+ndo", "am1", "pm3m*", "hf","mp[2-5]"); |
68
|
0
|
|
|
|
|
|
push @theories, ("ci", "cc[ds]{1,2}", "qci", "g[1-3]", "cbs", "w1", "cas", "gvb", "sac-ci"); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# parsing |
71
|
0
|
|
|
|
|
|
KEY: foreach (@keywords) { |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# save to KEYWORDS |
74
|
0
|
|
|
|
|
|
push @{$gauss->{KEYWORDS}}, $_; |
|
0
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# print options |
77
|
0
|
0
|
|
|
|
|
next KEY if (/^#[npt]*\Z/ ); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# Job Type |
80
|
|
|
|
|
|
|
# SP runs using theory/basis notation |
81
|
0
|
0
|
0
|
|
|
|
$gauss->{JOBTYPE} = "SP" if ( /.+\/.+/ && $gauss->get("JOBTYPE") eq "undef" ); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# OPT-SP runs using theory/basis//theory/basis notation |
84
|
0
|
0
|
0
|
|
|
|
$gauss->{JOBTYPE} = "OPT SP" if ( /.+\/.+\/\/.+\/.+/ && $gauss->get("JOBTYPE") eq "undef" ); |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
J: foreach my $jt (@jobtypes) { |
87
|
0
|
0
|
|
|
|
|
if ( /^([fp]*$jt)/ ) { |
88
|
0
|
|
|
|
|
|
my $tmp = $1; |
89
|
|
|
|
|
|
|
# account for Opt Freq runs |
90
|
0
|
0
|
0
|
|
|
|
if ( $gauss->{COMPLETE} == 0 && ($gauss->{JOBTYPE} =~ /OPT/ ) ) { |
91
|
0
|
|
|
|
|
|
$gauss->{JOBTYPE} = join " ", $gauss->{JOBTYPE}, uc($tmp); |
92
|
0
|
|
|
|
|
|
next KEY; |
93
|
|
|
|
|
|
|
} else { |
94
|
0
|
|
|
|
|
|
$gauss->{JOBTYPE} = uc($tmp); |
95
|
0
|
|
|
|
|
|
next KEY; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# theory |
101
|
0
|
|
|
|
|
|
T: foreach my $theory (@theories) { |
102
|
0
|
0
|
|
|
|
|
if ( /^((?:[ur]*)$theory[a-b0-9\(\)]*)\/*/ ) { |
103
|
0
|
|
|
|
|
|
$gauss->{THEORY} = uc($1); |
104
|
0
|
0
|
|
|
|
|
next KEY unless ( /\// ); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# keywords with options |
109
|
0
|
0
|
|
|
|
|
next KEY if ( /[=\(](?![1-3dpf,]{1,7}\))/ ); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# functional |
112
|
0
|
|
|
|
|
|
F: foreach my $functional (@exchange) { |
113
|
0
|
0
|
|
|
|
|
if ( /^((?:[ur])*$functional(?:[13]*)t*[belmnpsvwy125-9]*)\/*/ ) { |
114
|
0
|
|
|
|
|
|
$gauss->{THEORY} = "DFT"; |
115
|
0
|
|
|
|
|
|
$gauss->{FUNCTIONAL} = uc($1); |
116
|
0
|
|
|
|
|
|
$gauss->{FUNCTIONAL} =~ s/AND/and/; |
117
|
0
|
0
|
|
|
|
|
next KEY unless ( /\// ); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
# basis set |
121
|
0
|
|
|
|
|
|
B: foreach my $basis (@bases) { |
122
|
0
|
0
|
|
|
|
|
if ( /\/*($basis(?:.*))/ ) { |
123
|
0
|
|
|
|
|
|
$gauss->{BASIS} = uc($1); |
124
|
|
|
|
|
|
|
# enumerate the * & ** notation |
125
|
0
|
|
|
|
|
|
$gauss->{BASIS} =~ s/\*\*/(d,p)/; |
126
|
0
|
|
|
|
|
|
$gauss->{BASIS} =~ s/\*/(d)/; |
127
|
0
|
0
|
|
|
|
|
next KEY unless ( /\// ); |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
} |
132
|
0
|
0
|
|
|
|
|
print "Gaussian job type = ", $gauss->{JOBTYPE}, "\n" if $gauss->{DEBUG} >= 1; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
1; |
136
|
|
|
|
|
|
|
__END__ |