I have a batch file as shown below. The file is under development and thus
not finished yet.
My problem is that a test run now has been running for two hours and still
not finished.
The data file is huge (once you get the permission you can find the data
file "02_hit08.par" here:
http://www.cfa.harvard.edu/HITRAN/HITRAN2008/HITRAN2008/By-Molecule/Uncompressed-files/).
I attach a small test portion of the file.
Can I make the data reading faster? Or is there a way to speed up
calculations (I don't need exact numbers)? Or what else can I do better?
Yours,
Poul Riis
atfil:openr("c:/atmodat/co2test.par")$
c:299792458$
k:1.3806504E-23$
h:6.62606895E-34$
g:9.82$
p0:101325$
Oj:40e6$
Rj:Oj/%pi/2$
T0:273.15$
Tj:T0+15$
kI:2*%pi*(k*Tj/(h*c))^4*h*c*c$
I(z):=kI*z^3/(exp(z)-1)$
U(x):=exp(-x)-x*incomplete_gamma(0,x)$
NA:6.02214179e23$
sigmab:5.6704E-8$
sigma0:Mluft*g/(Na*alfa*p0)*10000$
Mluft:0.029$
alfa:385e-6$
lambda0:h*c/(k*Tj)*100$
sum:0$
fleredata:true$
ndat:1$
linje:readline(datfil)$
enoverlambdaold:eval_string(substring(linje,4,16))$
sigmaold:eval_string(substring(linje,16,26))$
zold:lambda0*enoverlambdaold$
Izold:I(zold)$
xnsigmaold:sigmaold/sigma0$
undslipold:U(xnsigmaold)$
print("sigma0 = ",sigma0," cm^2")$
print("Tj = ",Tj," K")$
print("Ij = ",sigmab*Tj^4," W/m^2")$
print("alfa = ",alfa)$
while fleredata do
block(linje:readline(datfil),
if linje=false then
block(fleredata:false,print("slut"))
else
block(ndat:ndat+1,enoverlambda:eval_string(substring(linje,4,16)),sigma:eval_string(substring(linje,16,26)),
z:lambda0*enoverlambda,Iz:I(z),
xnsigma:sigma/sigma0,undslip:U(xnsigma),
sum:sum+(Izold+Iz)*(z-zold)/2,
enoverlambdaold:enoverlambda,sigmaold:sigma,Izold:Iz,undslipold:undslip))$
print("Ther were ",ndat," data.")$
-------------- next part --------------
A non-text attachment was scrubbed...
Name: co2test.par
Type: application/octet-stream
Size: 2590 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20091013/5b34ec7b/attachment.obj