forked from CCPupp/EMP-Fortran
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsomer.py
More file actions
182 lines (159 loc) · 5.44 KB
/
Copy pathIsomer.py
File metadata and controls
182 lines (159 loc) · 5.44 KB
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
import math
##########################################################################
#common variables
tau = 1
#2D arrays? Here I'm creating the arrays for this method, but we'll be importing
#it from other methods later.
drrho = [[0 for x in range(250)] for y in range(15)]
drrhoh = [[0 for x in range(250)] for y in range(16)]
fjh = [[0 for x in range (250)] for y in range (16)]
q = [[0 for x in range (250)] for y in range (16)]
qh = [(0 for x in range (250)] for y in range (16)]
rho = [[0 for x in range(250)] for y in range(15)]
rhoh = [[0 for x in range(250)] for y in range(16)]
#common arrays?
r[250]
aaiso[50]
coniso[5]
eergi[10]
egiso[10]
exki[5]
fciso[10]
ffiso[10]
fregi[10]
rerg[50]
rgisoi[10]
rootki[5]
soriso[5]
ciso = 1
conj = 1
conq = 1
niso =20 #final value for first do/while loop
ngrpi = 1
ndr = 20 #final value for second do/while loop
nt = 20 #final value for third do/while loop
ngroup = 20 #final value for fourth do/while loop
##########################################################################
tiso = tau - ciso
if tiso < 0:
return
rtiso = math.sqrt(tiso)
l = 1
while l <= niso:
exki[l] = math.exp(-tiso*dii[l])
rtkii[l] = math.sqrt(tiso*dii[l])
scriso[l] = ai[l]*exxi[l]
l += 1
i=1
j=1
k=1
l=1
while i < ndr:
ri = 1/r[i]
r2i = ri * ri
cj = conj * r2i
cq = conq * r2i
while j < nt:
cur = 0.0
qrh = 0.0
cqh = cq * rhoh[i][j]
avrad = drrhoh[i][j] * ri
while k < ngroup:
gmfp = drrhoh[i][j] * rgisoi[k]
emfp = math.exp(-gmfp)
facto = fciso[k] + ffiso[k] * gmfp
consj = cj * rergi[k] * emfp
consq = cqh * eergi[k] * emfp
aj = avrad * 20550000 * math.sqrt(gmfp)
ah = (1.186 - 0.062 * egiso[k]) *aj
fkj = factor * 10000/(1.0+bbiso[k]*gmfp)
fkq = facto * 10000/(1.1+aaiso[k]*gmfp)
exfkj = math.sqrt(-rtiso*fkj)
exkfg = math.sqrt(-rtiso*fkq)
while l < niso:
cifkj = rootki[l] * fkj
cifkg = rootki[l] * fkq
xj1 = cifkj * 0.5
xq1 = cifkq *0.5
cixj = xj1**2 #xj1 squared
cixq = xq1**2 #xq1 squared
excixj = math.exp(-cixj)
excixq = math.exp(cixq)
daj = exfkj - exki[l]
daq = exfkq - exki[l]
daj = aj * coniso[l] * daj
daq = ah * coniso[l] * daq
dbj = cifkj * exki[l] * excixj * aj * coniso[l]
dbq = cifkq * exki[l] * excixg * ah * coniso[l]
xj2 = rtkii[l] - xj1
xq2 = rtkii[l] - xq1
#if (xj2) 40, 50, 60
#go to 40 if neg, go to 50 if 0, go to 60 if positive
if xj2 < 0:
xj2 = -xj2
convj = daj + dbj * (self.dawson(xj1) - dawson (xj2)) #CALLING DAWSON FUNCTIONS. wasn't sure where these would be, so I'm just calling self.METHODNAME
elif xj2 == 0:
convj = daj + dbj * self.dawson(xj1)
elif xj2 > 0:
convj = daj + dbj * self.dawson(xj1) + dawson (xj2)
if xq2 < 0:
xq2 = -xq2
convq = daq + dbq * (self.dawson(xq1) - dawson(xq2))
elif xq2 == 0:
convq = daq + dbq * self.dawson(xq1)
elif xq2 > 0:
convq = daq + dbq * (self.dawson(xq1) + self.dawson(xq2))
cur = (convj + soriso[l]) * consj * fregi[k] + cur
qrh = (convq + soriso[l]) * consq * fregi[k] + qrh
l += 1
#end while loop l
k += 1
#end while loop k
fjh[i][j] = cur + fjh[i][j]
qh[i][j] = qrh + qh[i][j]
j += 1
#end while loop j
j=1
k=1
l=1
while j <= ntm1: #once this is done this should take you near the end of the program (210)
qrg = 0.0
cqg = cq * rho[i][j]
avrad = drrho[i][j] * ri
while k <= ngrpi:
gmfp = drrho[i][j] * rgisoi[k]
facto = fciso[k] + ffiso[k] + gmfp
consg = cqg * eergi[k] * exp(-gmfp)
ag = avrad * (1.186 - 0.062 * egiso[k]) * 20550000 * math.sqrt(gmfp)
fkg = facto * 10000/(1.1+aaiso[k] * gmfp)
exfkg = math.exp(-rtiso * fkg)
while l < niso:
cifkg = rootki[l] * fkg
xg1 = cifkg * 0.5
cixg = xg1**2
excixg = math.exp(-cixg)
dag = exfkg - exki[l]
dag = ag * coniso[l] * dag
dbg = cifkg * exki[l] * excixg * ag * coniso[l]
xg2 = rtkii[l] - xg1
#if (xg2) 150, 160, 170
#go to 150 if neg, go to 160 if 0, go to 170 if positive
if xg2 < 0:
xg2 = -xg2
convg = dag + dbg * (self.dawson(xg1) - dawson(xg2))
elif xg2 == 0:
convg = dag + dbg * self.dawson(xg1)
elif xg2 > 0:
convg = dag + dbg * (self.dawson(xg1) + self.dawson(xg2))
#end if/else
qrg = (convg + soriso[l]) * consg * fregi[k] + qrg
l += 1
#end while loop l
k += 1
#end while loop k
q[i][j] = qrg + q[i][j]
j += 1
#end while loop j
i += 1
#end while loop i
return