Commit eb35c2e9 authored by Miriam Hinzen's avatar Miriam Hinzen

Use Constant ImagUnit also in SphBessel Module

parent cb805565
...@@ -55,10 +55,9 @@ module m_SphBessel ...@@ -55,10 +55,9 @@ module m_SphBessel
! modernised and extended by M. Hinzen (2016) ! modernised and extended by M. Hinzen (2016)
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
use m_constants, only: ImagUnit
implicit none implicit none
complex, parameter :: CI = (0.0, 1.0)
interface SphBessel interface SphBessel
module procedure SphBesselComplex, SphBesselReal module procedure SphBesselComplex, SphBesselReal
...@@ -105,7 +104,7 @@ contains ...@@ -105,7 +104,7 @@ contains
end do EXPANSION end do EXPANSION
jl(l) = jl(l) * zj jl(l) = jl(l) * zj
nl(l) = -nl(l) * zn nl(l) = -nl(l) * zn
hl(l) = jl(l) + nl(l) * CI hl(l) = jl(l) + nl(l) * ImagUnit
zj = zj * z / ( rl + 3.0 ) zj = zj * z / ( rl + 3.0 )
zn = zn / z * ( rl + 1.0 ) zn = zn / z * ( rl + 1.0 )
end do SERIAL_L_LOOP end do SERIAL_L_LOOP
...@@ -120,12 +119,12 @@ contains ...@@ -120,12 +119,12 @@ contains
SERIAL_M_LOOP: do m = 0, l SERIAL_M_LOOP: do m = 0, l
hl(l) = hl(l) + (-1) ** m * rnm(l) hl(l) = hl(l) + (-1) ** m * rnm(l)
nl(l) = nl(l) + rnm(l) nl(l) = nl(l) + rnm(l)
rnm(l) = rnm(l) / ( m + 1.0 ) * ( l * ( l + 1 ) - m * ( m + 1 ) ) / ( CI * ( z + z ) ) rnm(l) = rnm(l) / ( m + 1.0 ) * ( l * ( l + 1 ) - m * ( m + 1 ) ) / ( ImagUnit * ( z + z ) )
end do SERIAL_M_LOOP end do SERIAL_M_LOOP
hl(l) = hl(l) * (-CI) ** l * exp( CI * z ) / ( CI * z ) hl(l) = hl(l) * (-ImagUnit) ** l * exp( ImagUnit * z ) / ( ImagUnit * z )
nl(l) = nl(l) * CI ** l * exp( -CI * z ) / ( -CI * z ) nl(l) = nl(l) * ImagUnit ** l * exp( -ImagUnit * z ) / ( -ImagUnit * z )
jl(l) = ( hl(l) + nl(l) ) / 2.0 jl(l) = ( hl(l) + nl(l) ) / 2.0
nl(l) = ( hl(l) - jl(l) ) * (-CI) nl(l) = ( hl(l) - jl(l) ) * (-ImagUnit)
end if end if
end do PARALLEL_L_LOOP end do PARALLEL_L_LOOP
...@@ -165,11 +164,11 @@ contains ...@@ -165,11 +164,11 @@ contains
integer :: l integer :: l
call SphBesselComplex( il, nl, kl, CI * z, lmax ) call SphBesselComplex( il, nl, kl, ImagUnit * z, lmax )
do l = 0, lmax do l = 0, lmax
il(l) = (-CI) ** l * il(l) il(l) = (-ImagUnit) ** l * il(l)
kl(l) = - CI ** l * kl(l) kl(l) = - ImagUnit ** l * kl(l)
end do end do
end subroutine ModSphBesselComplex end subroutine ModSphBesselComplex
...@@ -185,11 +184,11 @@ contains ...@@ -185,11 +184,11 @@ contains
integer :: l integer :: l
call SphBesselComplex( il, nl, kl, CI * z, lmax ) call SphBesselComplex( il, nl, kl, ImagUnit * z, lmax )
do l = 0, lmax do l = 0, lmax
il(l) = (-CI) ** l * il(l) il(l) = (-ImagUnit) ** l * il(l)
kl(l) = - CI ** l * kl(l) kl(l) = - ImagUnit ** l * kl(l)
end do end do
end subroutine ModSphBesselComplex2 end subroutine ModSphBesselComplex2
...@@ -207,12 +206,12 @@ contains ...@@ -207,12 +206,12 @@ contains
complex :: z complex :: z
z = CI * x z = ImagUnit * x
call SphBesselComplex( jl, nl, hl, z, lmax ) call SphBesselComplex( jl, nl, hl, z, lmax )
do l = 0, lmax do l = 0, lmax
il(l) = (-CI) ** l * jl(l) il(l) = (-ImagUnit) ** l * jl(l)
kl(l) = - CI ** l * hl(l) kl(l) = - ImagUnit ** l * hl(l)
end do end do
end subroutine ModSphBesselReal end subroutine ModSphBesselReal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment