dens_3dcubic Function

public function dens_3dcubic(x, ts) result(dos)

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: x
real(kind=8), optional :: ts

Return Value real(kind=8)


Calls

proc~~dens_3dcubic~~CallsGraph proc~dens_3dcubic dens_3dcubic interface~quad quad proc~dens_3dcubic->interface~quad

Source Code

  function dens_3dcubic(x,ts) result(dos)
    real(8),intent(in) :: x
    real(8),optional   :: ts
    real(8)            :: ts_
    real(8)            :: wband,dos
    real(8)            :: a,b,e0,s
    real(8),parameter  :: pi=acos(-1d0)
    real(8)            :: ImG
    ts_  = 1d0 ;if(present(ts))ts_=ts
    e0   = 2d0*ts_
    wband= 3d0*e0
    dos  = 0d0
    s = abs(x)
    if(abs(x) > wband)return
    !
    a = 0d0
    if(s/e0 <= 1d0)then
       b = pi
    else
       b = acos(s/e0-2d0)
    endif
    call quad(func,a,b,result=ImG)
    dos = ImG/pi**3/e0
  contains
    !> F(p) = K(k1')
    !> k1'  = sqrt(1-k1**2)
    !> k1   = (s-cos(p))/2 = 1/k
    !> k    = 2/(s-cos(p))
    function func(p)
      real(8) :: p
      real(8) :: func
      real(8) :: k1,k1p
      k1  = (s-e0*cos(p))/2d0/e0
      k1p = sqrt(1d0-k1**2)
      func= EllipticK(k1p)
    end function func
  end function dens_3dcubic