From 452905f76b895a4fe0bb44a61a781d2f633ad025 Mon Sep 17 00:00:00 2001 From: giannozz Date: Fri, 14 Aug 2015 19:47:08 +0000 Subject: [PATCH] erf and erfc replaced by qe_erf, qe_erfc, as in the rest of QE git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11676 c92efa57-630b-4861-b058-cf58834340f0 --- Modules/fft_base.f90 | 2 +- Modules/generate_function.f90 | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Modules/fft_base.f90 b/Modules/fft_base.f90 index 3e0406c23..6eb91aa93 100644 --- a/Modules/fft_base.f90 +++ b/Modules/fft_base.f90 @@ -845,7 +845,7 @@ SUBROUTINE cgather_sym_many( f_in, f_out, nbnd, nbnd_proc, start_nbnd_proc ) ! ! ... Written by A. Dal Corso ! - ! ... This routine generalizes cgather_sym, receiveng nbnd complex + ! ... This routine generalizes cgather_sym, receiving nbnd complex ! ... distributed functions and collecting nbnd_proc(dfftp%mype+1) ! ... functions in each processor. ! ... start_nbnd_proc(dfftp%mype+1), says where the data for each processor diff --git a/Modules/generate_function.f90 b/Modules/generate_function.f90 index 12b52e842..6cb3a04fc 100644 --- a/Modules/generate_function.f90 +++ b/Modules/generate_function.f90 @@ -548,6 +548,7 @@ CONTAINS REAL( DP ) :: f1, f2 REAL( DP ) :: r( 3 ), s( 3 ) REAL( DP ), ALLOCATABLE :: rholocal ( : ) + REAL( DP ), EXTERNAL :: qe_erfc ! inv_nr1 = 1.D0 / DBLE( dfftp%nr1 ) inv_nr2 = 1.D0 / DBLE( dfftp%nr2 ) @@ -610,7 +611,7 @@ CONTAINS dist = SQRT(SUM( r * r )) arg = ( dist * alat - width ) / spread ! - rholocal( ir ) = ERFC(arg) + rholocal( ir ) = qe_erfc(arg) ! END DO ! @@ -664,6 +665,7 @@ CONTAINS REAL( DP ) :: scale, dist, arg, length, chargeanalytic, chargelocal REAL( DP ) :: r( 3 ), s( 3 ) REAL( DP ), ALLOCATABLE :: gradrholocal ( :, : ) + REAL( DP ), EXTERNAL :: qe_erfc ! inv_nr1 = 1.D0 / DBLE( dfftp%nr1 ) inv_nr2 = 1.D0 / DBLE( dfftp%nr2 ) @@ -732,7 +734,7 @@ CONTAINS arg = ( dist * alat - width ) / spread ! gradrholocal( :, ir ) = EXP( - arg**2 ) * r(:) / dist - chargelocal = chargelocal + ERFC(arg) + chargelocal = chargelocal + qe_erfc(arg) ! END DO ! @@ -914,6 +916,7 @@ CONTAINS REAL(DP) :: f1 = 0.0_DP , f2 = 0.0_DP REAL(DP) :: t, invt + REAL( DP ), EXTERNAL :: qe_erf IF ( spread .LT. tol .OR. width .LT. tol ) THEN WRITE(stdout,*)'ERROR: wrong parameters of erfc function',spread,width @@ -921,7 +924,7 @@ CONTAINS ENDIF t = spread / width invt = width / spread - f1 = ( 1.D0 + erf(invt) ) / 2.D0 ! f1 is close to one for t-->0 + f1 = ( 1.D0 + qe_erf(invt) ) / 2.D0 ! f1 is close to one for t-->0 f2 = exp(-(invt)**2) / 2.D0 / sqrtpi ! f2 is close to zero for t-->0 SELECT CASE ( dim ) CASE ( 0 )