Replace erf with qe_erf.

This commit is contained in:
Ye Luo 2020-10-19 11:17:46 -05:00
parent ce51ea4c5d
commit 0715e36731
3 changed files with 13 additions and 6 deletions

View File

@ -421,7 +421,8 @@ qe_add_executable(qe_pp_st_ef_exe ${sources})
set_target_properties(qe_pp_st_ef_exe PROPERTIES OUTPUT_NAME ef.x)
target_link_libraries(qe_pp_st_ef_exe
PRIVATE
QE::OpenMP_Fortran)
QE::OpenMP_Fortran
QE::Modules)
###########################################################
# dos_sp.x
@ -435,9 +436,10 @@ set(sources
)
qe_add_executable(qe_pp_st_dos_exe ${sources})
set_target_properties(qe_pp_st_dos_exe PROPERTIES OUTPUT_NAME dos_sp.x)
target_link_libraries(qe_pp_st_ef_exe
target_link_libraries(qe_pp_st_dos_exe
PRIVATE
QE::OpenMP_Fortran)
QE::OpenMP_Fortran
QE::Modules)
###########################################################
# fermi_int_0.x

View File

@ -163,6 +163,7 @@
double precision function sumk (et,nbnd,nks,wk,degauss,ngauss,ee)
!$ use omp_lib
use kinds
implicit none
@ -177,6 +178,8 @@
integer :: i, j, ik, n, ni
real(dp), external :: qe_erf
sqrtpm1 = 1.0d0/1.77245385090551602729d0
sumk = 0.d0
@ -203,7 +206,7 @@
do i=1,nbnd
do ik=1,nks
x = (ee-et(i,ik))/degauss/dsqrt(2.d0)
fd = 0.5d0 * (1.d0 + erf(x) )
fd = 0.5d0 * (1.d0 + qe_erf(x) )
sumk = sumk + wk(ik) * fd
end do
end do
@ -217,7 +220,7 @@
do ik=1,nks
!
x = (ee-et(i,ik))/degauss/dsqrt(2.d0)
fd = 0.5d0 * (1.d0 + erf(x) )
fd = 0.5d0 * (1.d0 + qe_erf(x) )
hd = 0.d0
arg = min (200.d0, x**2)
hp = exp ( - arg)

View File

@ -26,15 +26,17 @@
!
!
double precision function w1gauss(x,ngauss)
use kinds
implicit none
double precision, intent(in) :: x
integer, intent(in) :: ngauss
real(dp), external :: qe_erf
! ngauss=0 (gaussian smearing)
! ngauss=1 FD
if ( ngauss .eq. 0 ) then
w1gauss = 0.5d0 * ( 1.d0 + erf( x * sqrtpm1 ) )
w1gauss = 0.5d0 * ( 1.d0 + qe_erf( x * sqrtpm1 ) )
else if ( ngauss .eq. 1 ) then
w1gauss = 1.d0 / ( exp(-x) + 1.d0)
end if