Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
the derivative of utility_wgauss: an approximation to the delta function
(n>=0) : derivative of the corresponding Methfessel-Paxton utility_wgauss
(n=-1 ): derivative of cold smearing:
1/sqrt(pi)exp(-(x-1/sqrt(2))2)(2-sqrt(2)*x)
(n=-99): derivative of Fermi-Dirac function: 0.5/(1.0+cosh(x))
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
function utility_w0gauss_vec(x,n,error,comm)result(res)!-----------------------------------------------------------------------! Stepan Tsirkin: a vectorized version of the outine, gets x as an array.!!! the derivative of utility_wgauss: an approximation to the delta function!!!! (n>=0) : derivative of the corresponding Methfessel-Paxton utility_wgauss!!!! (n=-1 ): derivative of cold smearing:!! 1/sqrt(pi)*exp(-(x-1/sqrt(2))**2)*(2-sqrt(2)*x)!!!! (n=-99): derivative of Fermi-Dirac function: 0.5/(1.0+cosh(x))!use w90_constants,only:dp,piuse w90_error,only:w90_error_type,set_error_input,set_error_allocimplicit none! argumentstype(w90_error_type),allocatable,intent(out)::errorreal(kind=dp),intent(in)::x(:)real(kind=dp),allocatable::res(:),arg(:)!! *output*: the value of the function!! *input*: the point where to compute the functioninteger::n!! *input*: the order of the smearing functiontype(w90_comm_type),intent(in)::comminteger::ierr! local variablesreal(kind=dp)::sqrtpm1allocate(res(size(x)),stat=ierr)if(ierr/=0)then call set_error_alloc(error,'Error in allocating res in utility_w0gauss_vec',comm)return end if allocate(arg(size(x)),stat=ierr)if(ierr/=0)then call set_error_alloc(error,'Error in allocating arg in utility_w0gauss_vec',comm)return end ifsqrtpm1=1.0_dp/sqrt(pi)if(n.eq.-99)then call set_error_input(error,'utility_w0gauss_vec not implemented for n == 99',comm)return end if! cold smearing (Marzari-Vanderbilt)if(n.eq.-1)then call set_error_input(error,'utility_w0gauss_vec not implemented for n == -1',comm)return end if if(n.gt.10.or.n.lt.0)then call set_error_input(error,'utility_w0gauss higher order smearing is untested and unstable',comm)return end if! Methfessel-Paxtonarg=min(200.0_dp,x**2)res=exp(-arg)*sqrtpm1if(n.eq.0)then return else call set_error_input(error,'utility_w0gauss_vec not implemented for n >0 ',comm)return end if end function utility_w0gauss_vec