2 ! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3 ! This file is distributed under the terms of the GNU Lesser General Public
4 ! License. See the file COPYING for license details.
9 subroutine rdirac(n
,l
,k
,np
,nr
,r
,vr
,eval
,g0
,f0
)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! n : principal quantum number (in,integer)
12 ! l : quantum number l (in,integer)
13 ! k : quantum number k (l or l+1) (in,integer)
14 ! np : order of predictor-corrector polynomial (in,integer)
15 ! nr : number of radial mesh points (in,integer)
16 ! r : radial mesh (in,real(nr))
17 ! vr : potential on radial mesh (in,real(nr))
18 ! eval : eigenvalue without rest-mass energy (inout,real)
19 ! g0 : major component of the radial wavefunction (out,real(nr))
20 ! f0 : minor component of the radial wavefunction (out,real(nr))
22 ! Finds the solution to the radial Dirac equation for a given potential $v(r)$
23 ! and quantum numbers $n$, $k$ and $l$. The method involves integrating the
24 ! equation using the predictor-corrector method and adjusting $E$ until the
25 ! number of nodes in the wavefunction equals $n-l-1$. The calling routine must
26 ! provide an initial estimate for the eigenvalue. Note that the arrays
27 ! {\tt g0} and {\tt f0} represent the radial functions multiplied by $r$.
30 ! Created September 2002 (JKD)
35 integer, intent(in
) :: n
36 integer, intent(in
) :: l
37 integer, intent(in
) :: k
38 integer, intent(in
) :: np
39 integer, intent(in
) :: nr
40 real(8), intent(in
) :: r(nr
)
41 real(8), intent(in
) :: vr(nr
)
42 real(8), intent(inout
) :: eval
43 real(8), intent(out
) :: g0(nr
)
44 real(8), intent(out
) :: f0(nr
)
46 integer, parameter :: maxit
=2000
47 integer kpa
,it
,nn
,ir
,irm
,nnd
,nndp
48 ! energy convergence tolerance
49 real(8), parameter :: eps
=1.d
-10
52 real(8) g1(nr
),f1(nr
),fr(nr
),gr(nr
),cf(3,nr
)
55 write(*,'("Error(rdirac): k <= 0 : ",I8)') k
61 write(*,'("Error(rdirac): incompatible n and k : ",2I8)') n
,k
65 if ((k
.eq
.n
).and
.(l
.ne
.k
-1)) then
67 write(*,'("Error(rdirac): incompatible n, k and l : ",3I8)') n
,k
,l
73 else if (k
.eq
.l
+1) then
77 write(*,'("Error(rdirac): incompatible l and k : ",2I8)') l
,k
84 ! integrate the Dirac equation
85 call rdiracdme(0,kpa
,eval
,np
,nr
,r
,vr
,nn
,g0
,g1
,f0
,f1
)
86 ! check the number of nodes
94 if ((nnd
.ne
.0).or
.(nndp
.ne
.0)) then
95 if (nnd
*nndp
.le
.0) then
103 if (de
.lt
.eps
*(abs(eval
)+1.d0
)) goto 20
106 write(*,'("Error(rdirac): maximum iterations exceeded")')
110 ! find effective infinity and set wavefunction to zero after that point
114 if ((g0(ir
-1)*g0(ir
).lt
.0.d0
).or
.(g1(ir
-1)*g1(ir
).lt
.0.d0
)) irm
=ir
120 if ((f0(ir
-1)*f0(ir
).lt
.0.d0
).or
.(f1(ir
-1)*f1(ir
).lt
.0.d0
)) irm
=ir
125 fr(ir
)=g0(ir
)**2+f0(ir
)**2
127 call fderiv(-1,nr
,r
,fr
,gr
,cf
)
133 write(*,'("Error(rdirac): zero wavefunction")')