SpectraRust/tlusty/extracted/wn.f
2026-03-19 14:05:33 +08:00

42 lines
1.0 KiB
Fortran

function wn(xn,a,ane,z)
c
c evaluation of the occupation probablities for a hydrogenic ion
c using eqs (4.26), and (4.39) of Hummer,Mihalas Ap.J. 331, 794, 1988.
c approximate evaluation of Q(beta) - Hummer
c
c Input: xn - real number corresponding to quantum number n
c a - correlation parameter
c ane - electron density
c z - ionic charge
c
INCLUDE 'IMPLIC.FOR'
INCLUDE 'BASICS.FOR'
parameter (p1=0.1402,p2=0.1285,p3=un,p4=3.15,p5=4.)
parameter (tkn=3.01,ckn=5.33333333,cb0=8.59d14)
parameter (f23=-2./3.)
c
cb=cb0*bergfc
c
c evaluation of k(n)
c
if(xn.le.tkn) then
xkn=un
else
xn1=un/(xn+un)
xkn=ckn*xn*xn1*xn1
end if
c
c evaluation of beta
c
beta=cb*z*z*z*xkn/(xn*xn*xn*xn)*exp(f23*log(ane))
c
c approximate expression for Q(beta)
c
x=exp(p4*log(un+p3*a))
c1=p1*(x+p5*(z-un)*a*a*a)
c2=p2*x
f=(c1*beta*beta*beta)/(un+c2*beta*sqrt(beta))
wn=f/(un+f)
return
end