XClib - small changes in test and libxc threshold refinements

This commit is contained in:
fabrizio22 2021-10-12 18:28:13 +02:00
parent 8a9d3751ff
commit e5d3914db6
9 changed files with 182 additions and 143 deletions

View File

@ -13,7 +13,7 @@ cally if 'QE_ENABLE_TEST' is set to true (default).
---------------------- XC_INFO ----------------------------------- ---------------------- XC_INFO -----------------------------------
xc_info.x is a small serial program that provides infos on XC xc_info is a small serial program that provides infos on XC
functionals, both the ones from internal QE library and the ones functionals, both the ones from internal QE library and the ones
from Libxc. Just run the command: from Libxc. Just run the command:
@ -27,16 +27,26 @@ tell if they are currently usable in QE or not.
--------------------- XCLIB_TEST --------------------------------- --------------------- XCLIB_TEST ---------------------------------
xclib_test.x is a testing program for the XClib library routines. xclib_test is a testing program for the XClib library routines.
Due to the high number of available dfts (including those from Due to the high number of available dfts (including those from
the external library Libxc) and the different parallelization the external library Libxc) and the different parallelization
schemes available already or in experimental phase, this program schemes available already or in experimental phase, this program
is intended to be a tool that helps developers to maintain and is intended to be a tool that helps developers to maintain and
develop XClib by keeping an overview on the available options develop XClib by keeping an overview on all the available options
in order not to neglect any of them (which is hard to do (which cannot be covered by test-suite only).
by working with test-suite only). The program generates an xml file with a set of XC-output data
The program generates an xml file with a set of output data produced produced according to the input options and use it for later
according to the test input options. comparison with other differently generated sets of XC-output data.
It first calculates averages of the XC-output data over a large
arbitrary grid (the number of points can be modified by changing the
'npoints' parameter in the code) -this is a 'naive' way to compare
outputs over a large number of points without storing a large amount
of data, however more sophisticated estimates than the arithmetic
averages can be replaced in a second time with minimal effort (and
the grid itself too). Then the same program calculates the XC output
data over a selected number of grid points, including threshold
points and perform the comparison between xml data and current ones.
You can run the program by using commands like: You can run the program by using commands like:
./xclib_test.x < input_file [ serial ] ./xclib_test.x < input_file [ serial ]
@ -47,45 +57,46 @@ different purposes.
An example of input file content is the following: An example of input file content is the following:
&INPUT_NAMELIST &INPUT_NAMELIST
test='gen-benchmark' test='generate'
filename_xml='xctest_data.xml' filename_xml='xctest_data.xml'
dft='pbe' dft='pbe'
family='GGA' family='GGA'
nspin=1 polarization='unpolarized'
xc_derivative=.FALSE. xc_derivative=.FALSE.
/ /
The following options have to be set: The following input options have to be set (capital or lowercase is the same):
- test: 'gen-benchmark' generates the xml file with the benchmark set - test: The 'GENERATE' option generates the xml file with the benchmark set
of XClib output data. 'exe-benchmark' calculates a set of of XClib output data. The 'EXECUTE' option calculates a set of
XClib output data and compares it with the one in the xml file. XClib output data and compares it with the one previously stored
in the xml file.
- filename_xml: the name of the xml file. - filename_xml: the name of the xml file.
- dft: the input functional. Besides the specific functionals, three - dft: the input functional. Besides the specific functionals, three
other options are available: other options are available:
- 'all_terms' spans all the available single term functionals - 'ALL_TERMS' spans all the available single term functionals
of QE (e.g. LDA exchange, LDA correlation, GGA exchange, ...); of QE (e.g. LDA exchange, LDA correlation, GGA exchange, ...);
- 'all_short' spans all the full dfts (identified by the 'shortnames') - 'ALL_SHORT' spans all the full dfts (identified by the 'shortnames')
available in XClib, e.g. LDA, PBESOL, PW86PBE, etc. available in XClib, e.g. LDA, PBESOL, PW86PBE, etc.
- 'all_libxc' spans all the available Libxc functionals. Those - 'ALL_LIBXC' spans all the available Libxc functionals. Those
that are not usable in the current QE version will be skipped that are not usable in the current QE version will be skipped
with a notice. with a notice.
- family: the dft family (needed in order to distinguish those few cases - family: the dft family (needed in order to distinguish those few cases
where LDA terms have the same name of the GGA ones, e.g. B3LP). where LDA terms have the same name of the GGA ones, e.g. B3LP).
If dft='all_...' then input family will be ignored. If dft='ALL_...' then input family will be ignored.
- polarization: 'unpolarized', 'polarized', 'both'. - polarization: 'UNPOLARIZED', 'POLARIZED', 'BOTH'.
- xc_derivative: if .TRUE. calculates the derivative terms (needed, - xc_derivative: if .TRUE. calculates the derivative terms (needed,
for example, by linear response code) instead of for example, by linear response code) instead of
the ordinary energy+potential output. the ordinary energy&potential output.
- show_time: if .TRUE. stores WALL time spent by xc-routines during - show_time: if .TRUE. stores WALL time spent by xc-routines during
'gen-' test and shows increment (in percentage) during 'GENERATE' test and shows increment (in percentage) during
'exe-' test. 'EXECUTE' test.
Obviously the program can be used to compare QE and Libxc functionals, Obviously the program can be used to compare QE and Libxc functionals,
to check differences from one version to another or to check differences to check differences from one version to another or to check differences

View File

@ -1107,7 +1107,7 @@ CONTAINS
IF ( family==XC_FAMILY_HYB_GGA .OR. family==XC_FAMILY_HYB_MGGA ) THEN IF ( family==XC_FAMILY_HYB_GGA .OR. family==XC_FAMILY_HYB_MGGA ) THEN
exx_fraction = xc_f03_hyb_exx_coef( xc_func(iid) ) exx_fraction = xc_f03_hyb_exx_coef( xc_func(iid) )
ishybrid = ( exx_fraction /= 0.d0 ) ishybrid = ( exx_fraction /= 0.d0 )
ENDIF ENDIF
! !
n_ext_params(iid) = xc_f03_func_info_get_n_ext_params( xc_info(iid) ) n_ext_params(iid) = xc_f03_func_info_get_n_ext_params( xc_info(iid) )
#if (XC_MAJOR_VERSION<=5) #if (XC_MAJOR_VERSION<=5)

View File

@ -223,19 +223,25 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
! !
IF (rhotot(ir) < small) CYCLE IF (rhotot(ir) < small) CYCLE
zeta_s = (rho_in(ir,1) - rho_in(ir,2)) / rhotot(ir) zeta_s = (rho_in(ir,1) - rho_in(ir,2)) / rhotot(ir)
IF (ABS(zeta_s) > 1.0_DP) CYCLE IF (ABS(zeta_s) >= 1.0_DP) CYCLE
! !
! ... exchange ! ... exchange
! !
rs = ( pi34 / (2.0_DP * rho_in(ir,1)) )**third IF ( rho_in(ir,1)>small ) THEN
CALL slater( rs, ex_s, vx_s ) rs = ( pi34 / (2.0_DP * rho_in(ir,1)) )**third
CALL slater( rs, ex_s, vx_s )
dmuxc(ir,1,1) = vx_s / (3.0_DP * rho_in(ir,1))
ELSE
ex_s=0.d0 ; vx_s=0.d0
ENDIF
! !
dmuxc(ir,1,1) = vx_s / (3.0_DP * rho_in(ir,1)) IF ( rho_in(ir,2)>small ) THEN
! rs = ( pi34 / (2.0_DP * rho_in(ir,2)) )**third
rs = ( pi34 / (2.0_DP * rho_in(ir,2)) )**third CALL slater( rs, ex_s, vx_s )
CALL slater( rs, ex_s, vx_s ) dmuxc(ir,2,2) = vx_s / (3.0_DP * rho_in(ir,2))
! ELSE
dmuxc(ir,2,2) = vx_s / (3.0_DP * rho_in(ir,2)) ex_s=0.d0 ; vx_s=0.d0
ENDIF
! !
! ... correlation ! ... correlation
! !
@ -267,7 +273,7 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
(zeta_s**2 - 1.0_DP) * cc (zeta_s**2 - 1.0_DP) * cc
dmuxc(ir,1,2) = dmuxc(ir,2,1) dmuxc(ir,1,2) = dmuxc(ir,2,1)
dmuxc(ir,2,2) = dmuxc(ir,2,2) + aa - (1.0_DP + zeta_s) * bb + & dmuxc(ir,2,2) = dmuxc(ir,2,2) + aa - (1.0_DP + zeta_s) * bb + &
(1.0_DP + zeta_s)**2 * cc (1.0_DP + zeta_s)**2 * cc
ENDDO ENDDO
! !
ELSE ELSE
@ -289,8 +295,8 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
! !
! ... THRESHOLD STUFF AND dr(:) ! ... THRESHOLD STUFF AND dr(:)
dr(:) = 0.0_DP dr(:) = 0.0_DP
zeta(:) = 0.0_dp zeta(:) = 0.0_DP
zeta_eff(:) = 0.0_dp zeta_eff(:) = 0.0_DP
DO ir = 1, length DO ir = 1, length
IF (rhotot(ir) > small) THEN IF (rhotot(ir) > small) THEN
zeta_s = (rho_in(ir,1) - rho_in(ir,2)) / rhotot(ir) zeta_s = (rho_in(ir,1) - rho_in(ir,2)) / rhotot(ir)
@ -299,8 +305,8 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
! smaller zeta ! smaller zeta
zeta_eff(ir) = SIGN( MIN( ABS(zeta_s), (1.0_DP-2.0_DP*dz(ir)) ), zeta_s ) zeta_eff(ir) = SIGN( MIN( ABS(zeta_s), (1.0_DP-2.0_DP*dz(ir)) ), zeta_s )
dr(ir) = MIN( 1.E-6_DP, 1.E-4_DP * rhotot(ir) ) dr(ir) = MIN( 1.E-6_DP, 1.E-4_DP * rhotot(ir) )
IF (ABS(zeta_s) > 1.0_DP) THEN IF (ABS(zeta_s) >= 1.0_DP) THEN
rhotot(ir) = 0.d0 ; dr(ir) = 0.d0 ! e.g. vx=vc=0.0 rhotot(ir) = 0._DP ; dr(ir) = 0._DP ! e.g. vx=vc=0.0
ENDIF ENDIF
ENDIF ENDIF
ENDDO ENDDO

View File

@ -1,6 +1,6 @@
&INPUT_NAMELIST &INPUT_NAMELIST
test='exe-benchmark' test='execute'
filename_xml='xctest.xml' filename_xml='xctest_data.xml'
dft='all_terms' dft='all_terms'
family= '' family= ''
polarization='both' polarization='both'

View File

@ -1,6 +1,6 @@
&INPUT_NAMELIST &INPUT_NAMELIST
test='gen-benchmark' test='generate'
filename_xml='xctest.xml' filename_xml='xctest_data.xml'
dft='all_terms' dft='all_terms'
family= '' family= ''
polarization= 'both' polarization= 'both'

View File

@ -18,7 +18,7 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss )
USE constants_l, ONLY: e2 USE constants_l, ONLY: e2
USE kind_l, ONLY: DP USE kind_l, ONLY: DP
USE dft_setting_params, ONLY: igcx, igcc, is_libxc, rho_threshold_gga, & USE dft_setting_params, ONLY: igcx, igcc, is_libxc, rho_threshold_gga, &
grho_threshold_gga grho_threshold_gga, rho_threshold_lda
USE qe_drivers_d_gga USE qe_drivers_d_gga
#if defined(__LIBXC) #if defined(__LIBXC)
#include "xc_version.h" #include "xc_version.h"
@ -135,8 +135,6 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss )
ENDIF ENDIF
ENDIF ENDIF
! !
IF (ANY(is_libxc(3:4))) DEALLOCATE( rho_lbxc, sigma )
!
dvxc_rr = 0._DP dvxc_rr = 0._DP
dvxc_sr = 0._DP dvxc_sr = 0._DP
dvxc_ss = 0._DP dvxc_ss = 0._DP
@ -149,14 +147,14 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss )
! !
IF ( sp == 1 ) THEN IF ( sp == 1 ) THEN
! !
ALLOCATE( sigma(length) ) IF (.NOT. ALLOCATED(sigma)) THEN
sigma(:) = g_in(:,1,1)**2 + g_in(:,2,1)**2 + g_in(:,3,1)**2 ALLOCATE( sigma(length) )
sigma(:) = g_in(:,1,1)**2 + g_in(:,2,1)**2 + g_in(:,3,1)**2
ENDIF
! !
CALL dgcxc_unpol( length, r_in(:,1), sigma, vrrx(:,1), vsrx(:,1), vssx(:,1), & CALL dgcxc_unpol( length, r_in(:,1), sigma, vrrx(:,1), vsrx(:,1), vssx(:,1), &
vrrc(:,1), vsrc(:,1), vssc ) vrrc(:,1), vsrc(:,1), vssc )
! !
DEALLOCATE( sigma )
!
ELSEIF ( sp == 2 ) THEN ELSEIF ( sp == 2 ) THEN
! !
ALLOCATE( vrzc(length,sp) ) ALLOCATE( vrzc(length,sp) )
@ -180,17 +178,24 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss )
! !
ENDIF ENDIF
! !
IF ( is_libxc(3) ) THEN DO k = 1, length
dvxc_rr(:,1,1) = dvxc_rr(:,1,1) + e2 * v2rho2_x(:) IF ( rho_lbxc(k) > small .AND. SQRT(ABS(sigma(k))) > small ) THEN
dvxc_sr(:,1,1) = dvxc_sr(:,1,1) + e2 * v2rhosigma_x(:)*2._DP IF ( is_libxc(3) ) THEN
dvxc_ss(:,1,1) = dvxc_ss(:,1,1) + e2 * v2sigma2_x(:)*4._DP IF ( rho_lbxc(k)>rho_threshold_lda ) THEN
ENDIF dvxc_rr(k,1,1) = dvxc_rr(k,1,1) + e2 * v2rho2_x(k)
! dvxc_sr(k,1,1) = dvxc_sr(k,1,1) + e2 * v2rhosigma_x(k)*2._DP
IF ( is_libxc(4) ) THEN ENDIF
dvxc_rr(:,1,1) = dvxc_rr(:,1,1) + e2 * v2rho2_c(:) dvxc_ss(k,1,1) = dvxc_ss(k,1,1) + e2 * v2sigma2_x(k)*4._DP
dvxc_sr(:,1,1) = dvxc_sr(:,1,1) + e2 * v2rhosigma_c(:)*2._DP ENDIF
dvxc_ss(:,1,1) = dvxc_ss(:,1,1) + e2 * v2sigma2_c(:)*4._DP IF ( is_libxc(4) ) THEN
ENDIF IF ( rho_lbxc(k)>rho_threshold_lda ) THEN
dvxc_rr(k,1,1) = dvxc_rr(k,1,1) + e2 * v2rho2_c(k)
dvxc_sr(k,1,1) = dvxc_sr(k,1,1) + e2 * v2rhosigma_c(k)*2._DP
ENDIF
dvxc_ss(k,1,1) = dvxc_ss(k,1,1) + e2 * v2sigma2_c(k)*4._DP
ENDIF
ENDIF
ENDDO
! !
ELSEIF ( sp == 2 ) THEN ELSEIF ( sp == 2 ) THEN
! !
@ -270,7 +275,10 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss )
! !
DEALLOCATE( v2rho2_c, v2rhosigma_c, v2sigma2_c ) DEALLOCATE( v2rho2_c, v2rhosigma_c, v2sigma2_c )
! !
ENDIF ENDIF
!
IF (ANY(is_libxc(3:4))) DEALLOCATE( rho_lbxc )
IF (ALLOCATED(sigma) ) DEALLOCATE( sigma )
! !
ENDIF ENDIF
! !

View File

@ -62,7 +62,7 @@ SUBROUTINE xc_gcx_( length, ns, rho, grho, ex, ec, v1x, v2x, v1c, v2c, v2c_ud )
REAL(DP), PARAMETER :: pi34 = 0.6203504908994_DP REAL(DP), PARAMETER :: pi34 = 0.6203504908994_DP
! !
LOGICAL :: POLARIZED LOGICAL :: POLARIZED
INTEGER :: pol_unpol, eflag INTEGER :: pol_unpol
#if (XC_MAJOR_VERSION > 4) #if (XC_MAJOR_VERSION > 4)
INTEGER(8) :: lengthxc INTEGER(8) :: lengthxc
#else #else
@ -166,9 +166,12 @@ SUBROUTINE xc_gcx_( length, ns, rho, grho, ex, ec, v1x, v2x, v1c, v2c, v2c_ud )
! !
IF (.NOT. POLARIZED) THEN IF (.NOT. POLARIZED) THEN
DO k = 1, length DO k = 1, length
ec(k) = ec_lxc(k) * rho_lxc(k) * SIGN(1.0_DP, rho(k,1)) IF ( rho_lxc(k) > rho_threshold_lda ) THEN
v1c(k,1) = vc_rho(k) ec(k) = ec_lxc(k) * rho_lxc(k) * SIGN(1.0_DP, rho(k,1))
v2c(k,1) = vc_sigma(k)*2.d0 v1c(k,1) = vc_rho(k)
ENDIF
IF ( rho_lxc(k)>small .AND. SQRT(ABS(sigma(k)))>small ) &
v2c(k,1) = vc_sigma(k)*2.d0
ENDDO ENDDO
ELSE ELSE
DO k = 1, length DO k = 1, length
@ -264,9 +267,12 @@ SUBROUTINE xc_gcx_( length, ns, rho, grho, ex, ec, v1x, v2x, v1c, v2c, v2c_ud )
! !
IF (.NOT. POLARIZED) THEN IF (.NOT. POLARIZED) THEN
DO k = 1, length DO k = 1, length
ex(k) = ex_lxc(k) * rho_lxc(k) * SIGN(1.0_DP, rho(k,1)) xlda_up = 1.0_DP ; xgga_up = 1.0_DP
v1x(k,1) = vx_rho(k) IF ( rho_lxc(k) <= rho_threshold_lda ) xlda_up = 0.0_DP
v2x(k,1) = vx_sigma(k)*2.d0 IF ( rho_lxc(k)<=small .OR. SQRT(ABS(sigma(k)))<=small ) xgga_up = 0.0_DP
ex(k) = ex_lxc(k) * rho_lxc(k) * SIGN(1.0_DP, rho(k,1)) *xlda_up
v1x(k,1) = vx_rho(k)*xlda_up
v2x(k,1) = vx_sigma(k)*2.d0*xgga_up
ENDDO ENDDO
ELSE ELSE
DO k = 1, length DO k = 1, length

View File

@ -207,10 +207,10 @@ SUBROUTINE xc_metagcx( length, ns, np, rho, grho, tau, ex, ec, v1x, v2x, v3x, v1
CALL xc_f03_func_set_dens_threshold( xc_func(6), rho_threshold_mgga ) CALL xc_f03_func_set_dens_threshold( xc_func(6), rho_threshold_mgga )
IF (libxc_flags(6,0)==1) THEN IF (libxc_flags(6,0)==1) THEN
CALL xc_f03_mgga_exc_vxc( xc_func(6), lengthxc, rho_lxc(1), sigma(1), lapl_rho(1), tau_lxc(1), & CALL xc_f03_mgga_exc_vxc( xc_func(6), lengthxc, rho_lxc(1), sigma(1), lapl_rho(1), tau_lxc(1), &
ec_lxc(1), vc_rho(1), vc_sigma(1), vlapl_rho(1), vc_tau(1) ) ec_lxc(1), vc_rho(1), vc_sigma(1), vlapl_rho(1), vc_tau(1) )
ELSE ELSE
CALL xc_f03_mgga_vxc( xc_func(6), lengthxc, rho_lxc(1), sigma(1), lapl_rho(1), tau_lxc(1), & CALL xc_f03_mgga_vxc( xc_func(6), lengthxc, rho_lxc(1), sigma(1), lapl_rho(1), tau_lxc(1), &
vc_rho(1), vc_sigma(1), vlapl_rho(1), vc_tau(1) ) vc_rho(1), vc_sigma(1), vlapl_rho(1), vc_tau(1) )
ec_lxc = 0.d0 ec_lxc = 0.d0
ENDIF ENDIF
! !

View File

@ -11,9 +11,9 @@ PROGRAM xclib_test
!========================================================================== !==========================================================================
!! Testing program for xc\_lib library in QE: !! Testing program for xc\_lib library in QE:
! !
!! * gen-benchmark: stores a set of dft benchmark data on xml file; !! * generate: stores a set of dft benchmark data on xml file;
!! * exe-benchmark: runs XClib to calculate data and compare them !! * execute: runs XClib to calculate data and compare them
!! to benchamrk data in xml file. !! to benchamrk data in xml file.
! !
!! Choices: !! Choices:
! !
@ -46,9 +46,9 @@ PROGRAM xclib_test
#if defined(__LIBXC) #if defined(__LIBXC)
#include "xc_version.h" #include "xc_version.h"
USE xc_f03_lib_m USE xc_f03_lib_m
USE dft_setting_params, ONLY: xc_func, xc_info, xc_kind_error, libxc_flags USE dft_setting_params, ONLY: xc_info, xc_kind_error, libxc_flags
#endif #endif
USE dft_setting_params, ONLY: is_libxc, exx_fraction USE dft_setting_params, ONLY: is_libxc
USE dft_setting_routines, ONLY: capital USE dft_setting_routines, ONLY: capital
! !
USE qe_dft_list, ONLY: nxc, ncc, ngcx, ngcc, nmeta, n_dft, & USE qe_dft_list, ONLY: nxc, ncc, ngcx, ngcc, nmeta, n_dft, &
@ -66,7 +66,7 @@ PROGRAM xclib_test
#endif #endif
! !
#if defined(__LIBXC) #if defined(__LIBXC)
INTEGER :: major, minor, micro, fkind, n_ext INTEGER :: major, minor, micro, fkind
#endif #endif
! !
INTEGER :: mype, npes, comm, ntgs, root INTEGER :: mype, npes, comm, ntgs, root
@ -79,15 +79,15 @@ PROGRAM xclib_test
! !
!-------- Grid dim vars -------------------- !-------- Grid dim vars --------------------
INTEGER, PARAMETER :: npoints=90000 INTEGER, PARAMETER :: npoints=90000
INTEGER :: nr, nnr, nrpe, nnr_b, nnr_int, nnrbt INTEGER :: nr, nnr, nrpe, nnr_b, nnrbt
INTEGER :: nnrit, nnrbit, nskip
INTEGER :: is, is_min, is_max INTEGER :: is, is_min, is_max
! !
!-------- Input vars ----------------------- !-------- Input vars -----------------------
CHARACTER(LEN=30) :: test, family, fam_init, xc_kind CHARACTER(LEN=15) :: test, family, fam_init
CHARACTER(LEN=30) :: dft, dft_init, xmldft, xmlfamily CHARACTER(LEN=30) :: dft, dft_init, xc_kind, xmldft, xmlfamily
CHARACTER(LEN=30) :: polarization, xmlpolarization CHARACTER(LEN=30) :: polarization, xmlpolarization
CHARACTER(LEN=15) :: input_err='' CHARACTER(LEN=15) :: input_err_where=''
CHARACTER(LEN=40) :: input_err=''
LOGICAL :: xc_derivative, xmlxc_derivative, show_time LOGICAL :: xc_derivative, xmlxc_derivative, show_time
! !
!---------- DFT infos ------------------------- !---------- DFT infos -------------------------
@ -112,11 +112,10 @@ PROGRAM xclib_test
REAL(DP) :: fact REAL(DP) :: fact
REAL(DP) :: aver_thresh = 10.E-8 !^^--- to optimize REAL(DP) :: aver_thresh = 10.E-8 !^^--- to optimize
! !
!---------- Indexes --------------------------- !---------- Loop indexes ---------------------------
INTEGER :: id, ii, ns, np, ipol, ithr, nthr, iip, iout, & INTEGER :: id, ii, ns, np, nthr, iip, iout, iaverout, iavernull, l
iaverout, iavernull, l
! !
!---------- XClib input vars ------------------ !---------- XC-input vars ------------------
REAL(DP), ALLOCATABLE :: rho(:,:), rho_tz(:,:) REAL(DP), ALLOCATABLE :: rho(:,:), rho_tz(:,:)
REAL(DP), ALLOCATABLE :: grho(:,:,:), grh(:,:,:) REAL(DP), ALLOCATABLE :: grho(:,:,:), grh(:,:,:)
REAL(DP), ALLOCATABLE :: tau(:,:) REAL(DP), ALLOCATABLE :: tau(:,:)
@ -240,6 +239,9 @@ PROGRAM xclib_test
! !
READ( stdin, input_namelist ) READ( stdin, input_namelist )
! !
DO i = 1, LEN_TRIM(test)
test(i:i) = capital( test(i:i) )
ENDDO
DO i = 1, LEN_TRIM(dft) DO i = 1, LEN_TRIM(dft)
dft(i:i) = capital( dft(i:i) ) dft(i:i) = capital( dft(i:i) )
ENDDO ENDDO
@ -251,7 +253,7 @@ PROGRAM xclib_test
ENDDO ENDDO
IF ( dft(1:4)=='ALL_' ) family = 'ALL' IF ( dft(1:4)=='ALL_' ) family = 'ALL'
! !
IF ( test(1:4)=='gen-' ) THEN IF ( test=='GENERATE' ) THEN
! !
iunpun = xml_open_file( "./"//TRIM(filename_xml) ) iunpun = xml_open_file( "./"//TRIM(filename_xml) )
IF ( iunpun == -1 ) RETURN IF ( iunpun == -1 ) RETURN
@ -263,18 +265,18 @@ PROGRAM xclib_test
CALL add_attr( "SPIN", polarization ) CALL add_attr( "SPIN", polarization )
CALL xmlw_writetag( "HEADER", "" ) CALL xmlw_writetag( "HEADER", "" )
! !
ELSEIF ( test(1:4)=='exe-' ) THEN ELSEIF ( TRIM(test)=='EXECUTE' ) THEN
! !
INQUIRE( FILE = filename_xml, exist=found ) INQUIRE( FILE = filename_xml, exist=found )
IF (.NOT. found ) THEN IF (.NOT. found ) THEN
ierr=1 ierr=1
CALL xclib_infomsg( 'xclib_test', 'xml data file not found' ) CALL xclib_error( 'xclib_test', 'xml data file not found' )
ENDIF ENDIF
! !
iun = xml_open_file( filename_xml ) iun = xml_open_file( filename_xml )
IF ( iun==-1 ) THEN IF ( iun==-1 ) THEN
ierr=2 ierr=2
CALL xclib_infomsg( 'xclib_test', 'xml data file not readable' ) CALL xclib_error( 'xclib_test', 'xml data file not readable' )
ENDIF ENDIF
! !
CALL xmlr_opentag( "XCTEST-DATA-SET" ) CALL xmlr_opentag( "XCTEST-DATA-SET" )
@ -285,20 +287,25 @@ PROGRAM xclib_test
CALL get_attr( "VXC_DERIVATIVE", xmlxc_derivative ) CALL get_attr( "VXC_DERIVATIVE", xmlxc_derivative )
CALL get_attr( "SPIN", xmlpolarization ) CALL get_attr( "SPIN", xmlpolarization )
! !
IF ( dft(1:4)=='all_' .AND. TRIM(dft) /= TRIM(xmldft) ) input_err = 'dft' IF ( dft(1:4)=='ALL_' .AND. TRIM(dft)/=TRIM(xmldft) ) input_err_where = 'dft'
IF ( xmlxc_derivative .NEQV. xc_derivative ) input_err = 'xc_derivative' IF ( TRIM(xmlpolarization)/='BOTH' .AND. polarization/=xmlpolarization ) &
IF ( TRIM(xmlpolarization) /= 'BOTH'.AND.polarization /= xmlpolarization ) & input_err_where = 'polarization'
input_err = 'polarization' IF ( xmlxc_derivative .NEQV. xc_derivative ) input_err_where = 'xc_derivative'
IF ( TRIM(input_err) /= '' ) THEN IF ( TRIM(input_err_where) /= '' ) THEN
WRITE(stdout,*) 'ERROR: input mismatch in: ', TRIM(input_err) input_err = 'Input mismatch in: '
STOP WRITE(input_err(20:35), '(a)') input_err_where
CALL xclib_error( 'xclib_test', input_err, 1 )
ENDIF ENDIF
IF ( TRIM(family) /= TRIM(xmlfamily) ) THEN IF ( TRIM(family) /= TRIM(xmlfamily) ) THEN
WRITE(stdout,*) 'WARNING: input mismatch in FAMILY. The one in the xml file& WRITE(stdout,*) 'WARNING: input mismatch in FAMILY. The one in the xml &
&will be considered only.' &file will be considered only.'
family = xmlfamily family = xmlfamily
ENDIF ENDIF
! !
ELSE
!
CALL xclib_error( 'xclib_test', 'Wrong input test.', 2 )
!
ENDIF ENDIF
ENDIF ENDIF
! !
@ -347,7 +354,7 @@ PROGRAM xclib_test
proc2node(i) = ii proc2node(i) = ii
ENDDO ENDDO
! !
IF ( mype == root .AND. test/='gen-benchmark' ) THEN IF ( mype == root .AND. test/='GENERATE' ) THEN
WRITE(stdout,*) ; WRITE(stdout,*) ' --- XC_LIB TESTING PROGRAM --- ' WRITE(stdout,*) ; WRITE(stdout,*) ' --- XC_LIB TESTING PROGRAM --- '
WRITE(stdout,*) WRITE(stdout,*)
WRITE(stdout,*) 'Node list:' WRITE(stdout,*) 'Node list:'
@ -378,17 +385,16 @@ PROGRAM xclib_test
ELSEIF (TRIM(polarization)=='BOTH' ) THEN ELSEIF (TRIM(polarization)=='BOTH' ) THEN
is_min = 1 ; is_max = 2 is_min = 1 ; is_max = 2
ELSE ELSE
WRITE(stdout,*) 'ERROR: unrecognized input polarization.' CALL xclib_error( 'xclib_test', 'Wrong input polarization.', 3 )
STOP
ENDIF ENDIF
! !
fam_init = family fam_init = family
dft_init = dft dft_init = dft
! !
n_qe_func = 1 n_qe_func = 1
IF (dft=='ALL_TERMS') n_qe_func = nxc+ncc+ngcx+ngcc+nmeta+5 IF (TRIM(dft)=='ALL_TERMS') n_qe_func = nxc+ncc+ngcx+ngcc+nmeta+5
IF (dft=='ALL_SHORT') n_qe_func = n_dft IF (TRIM(dft)=='ALL_SHORT') n_qe_func = n_dft
IF (dft=='ALL_LIBXC') n_qe_func = 999 IF (TRIM(dft)=='ALL_LIBXC') n_qe_func = 999
! !
! ... check QE and Libxc versions used for storing and the current ones ! ... check QE and Libxc versions used for storing and the current ones
! !
@ -400,17 +406,14 @@ PROGRAM xclib_test
WRITE(libxc_version(3:3), '(i1)') minor WRITE(libxc_version(3:3), '(i1)') minor
WRITE(libxc_version(5:5), '(i1)') micro WRITE(libxc_version(5:5), '(i1)') micro
#else #else
IF (dft=='ALL_LIBXC') THEN IF (dft=='ALL_LIBXC') CALL xclib_error( 'xclib_test','Libxc library not linked.',4 )
WRITE(stdout,*) 'ERROR: Libxc library not linked.'
STOP
ENDIF
#endif #endif
IF ( test=='gen-benchmark' ) THEN IF ( TRIM(test)=='GENERATE' ) THEN
CALL xmlw_opentag( "QE_Libxc_VERSION_TEST" ) CALL xmlw_opentag( "QE_Libxc_VERSION_TEST" )
CALL xmlw_writetag( "QE_version", version_number ) CALL xmlw_writetag( "QE_version", version_number )
CALL xmlw_writetag( "Libxc_version", libxc_version ) CALL xmlw_writetag( "Libxc_version", libxc_version )
CALL xmlw_closetag() CALL xmlw_closetag()
ELSEIF ( test=='exe-benchmark' ) THEN ELSEIF ( TRIM(test)=='EXECUTE' ) THEN
CALL xmlr_opentag( "QE_Libxc_VERSION_TEST" ) CALL xmlr_opentag( "QE_Libxc_VERSION_TEST" )
CALL xmlr_readtag( "QE_version", gen_version ) CALL xmlr_readtag( "QE_version", gen_version )
CALL xmlr_readtag( "Libxc_version", libxc_gen_version ) CALL xmlr_readtag( "Libxc_version", libxc_gen_version )
@ -428,7 +431,7 @@ PROGRAM xclib_test
! ... main loop over functionals to test ! ... main loop over functionals to test
! !
DO id = 1, n_qe_func DO id = 1, n_qe_func
DO is = is_min, is_max DO is = is_min, is_max
! !
time = 0.d0 time = 0.d0
ns = is ns = is
@ -473,12 +476,14 @@ PROGRAM xclib_test
! !
! ... skipped cases (some need further checks) ! ... skipped cases (some need further checks)
! !
IF ( TRIM(dft)=='xxxx' .OR. & IF ( TRIM(dft)=='xxxx' .OR. TRIM(dft)=='NONE' ) THEN
TRIM(dft)=='NONE' .OR. & IF (mype==root) CALL print_test_status( skipped )
TRIM(dft)=='META' .OR. & CYCLE
ENDIF
IF ( TRIM(dft)=='META' .OR. &
TRIM(dft)=='PZ+META' .OR. & TRIM(dft)=='PZ+META' .OR. &
TRIM(dft)=='PBE+META' ) THEN TRIM(dft)=='PBE+META' ) THEN
IF (mype==root) CALL print_test_status( skipped ) IF (mype==root .AND. .NOT.xc_derivative) CALL print_test_status( skipped )
CYCLE CYCLE
ENDIF ENDIF
#if !defined(__LIBXC) #if !defined(__LIBXC)
@ -500,7 +505,7 @@ PROGRAM xclib_test
! !
CALL xclib_set_dft_from_name( dft ) CALL xclib_set_dft_from_name( dft )
! !
LDA = .FALSE. ; GGA = .FALSE. ; MGGA= .FALSE. LDA = .FALSE. ; GGA = .FALSE. ; MGGA = .FALSE.
! !
iexch1 = xclib_get_ID('LDA','EXCH') iexch1 = xclib_get_ID('LDA','EXCH')
icorr1 = xclib_get_ID('LDA','CORR') icorr1 = xclib_get_ID('LDA','CORR')
@ -524,6 +529,11 @@ PROGRAM xclib_test
CALL xclib_finalize_libxc() CALL xclib_finalize_libxc()
CYCLE CYCLE
ENDIF ENDIF
IF ( xc_derivative .AND. ANY(libxc_flags(:,2)==0) ) THEN
CALL print_test_status( skipped )
CALL xclib_finalize_libxc()
CYCLE
ENDIF
! !
IF (dft_init=='ALL_LIBXC') THEN IF (dft_init=='ALL_LIBXC') THEN
fkind=-10 fkind=-10
@ -540,7 +550,7 @@ PROGRAM xclib_test
ENDIF ENDIF
ENDIF ENDIF
#else #else
IF (xclib_dft_is_libxc('ANY')) THEN IF (xclib_dft_is_libxc( 'ANY' )) THEN
CALL print_test_status( skipped3 ) CALL print_test_status( skipped3 )
CYCLE CYCLE
ENDIF ENDIF
@ -618,13 +628,14 @@ PROGRAM xclib_test
np = 1 np = 1
IF (ns==2) np = 3 IF (ns==2) np = 3
! !
! ... number of averages to calculate
IF (.NOT.xc_derivative) THEN IF (.NOT.xc_derivative) THEN
IF ( LDA ) naver = ns+1 IF ( LDA ) naver = ns+1
IF ( LDA .AND. TRIM(xc_kind)=='XC') naver = 2*ns+2 IF ( LDA .AND. TRIM(xc_kind)=='XC') naver = 2*ns+2
IF ( GGA .AND. TRIM(xc_kind)=='X') naver = 2*ns+1 IF ( GGA .AND. TRIM(xc_kind)=='X' ) naver = 2*ns+1
IF ( GGA .AND. TRIM(xc_kind)=='C') naver = 3*ns+np IF ( GGA .AND. TRIM(xc_kind)=='C' ) naver = 3*ns+np
IF ( GGA .AND. TRIM(xc_kind)=='XC') naver = 4*ns+np IF ( GGA .AND. TRIM(xc_kind)=='XC') naver = 4*ns+np
IF ( MGGA ) naver = 8 IF ( MGGA ) naver = 6*ns+2
ELSE ELSE
IF ( LDA ) naver = np IF ( LDA ) naver = np
IF ( GGA ) naver = 3*np IF ( GGA ) naver = 3*np
@ -670,7 +681,7 @@ PROGRAM xclib_test
! !
! ... dft2 output / benchmark data arrays ! ... dft2 output / benchmark data arrays
! !
IF ( test == 'exe-benchmark' ) THEN IF ( TRIM(test)=='EXECUTE' ) THEN
IF (.NOT. xc_derivative) ALLOCATE( ex2(nnrbt), ec2(nnrbt) ) IF (.NOT. xc_derivative) ALLOCATE( ex2(nnrbt), ec2(nnrbt) )
! !
IF ( LDA .OR. GGA ) THEN IF ( LDA .OR. GGA ) THEN
@ -703,7 +714,7 @@ PROGRAM xclib_test
! !
nlen1 = LEN(TRIM(dft)) nlen1 = LEN(TRIM(dft))
nlen2 = LEN(TRIM(family)) nlen2 = LEN(TRIM(family))
IF ( dft_init=='ALL_TERMS' .OR. dft_init(1:4)/='ALL_') THEN IF ( dft_init=='ALL_TERMS' .OR. dft_init(1:4)/='ALL_' ) THEN
WRITE(xc_data(9:8+nlen1),'(a)') dft(1:nlen1) WRITE(xc_data(9:8+nlen1),'(a)') dft(1:nlen1)
WRITE(xc_data(14:13+nlen2),'(a)') family(1:nlen2) WRITE(xc_data(14:13+nlen2),'(a)') family(1:nlen2)
IF (is==1) WRITE(xc_data(18:30),'(a)') 'UNP' IF (is==1) WRITE(xc_data(18:30),'(a)') 'UNP'
@ -716,7 +727,7 @@ PROGRAM xclib_test
! !
! ... read data set from xml file ! ... read data set from xml file
! !
IF (test=='exe-benchmark' .AND. mype==root) THEN IF (test=='EXECUTE' .AND. mype==root) THEN
CALL xmlr_opentag( TRIM(xc_data), tag_err ) CALL xmlr_opentag( TRIM(xc_data), tag_err )
IF (tag_err==0) THEN IF (tag_err==0) THEN
CALL xmlr_readtag( "time_tot", time_tot2 ) CALL xmlr_readtag( "time_tot", time_tot2 )
@ -888,7 +899,7 @@ PROGRAM xclib_test
! !
! --- THRESHOLD POINTS --- ! --- THRESHOLD POINTS ---
! !
IF (mype==root .AND. test(5:13)=='benchmark') THEN IF (mype==root) THEN
rho(nnr_b+1,1) = thresh_lda/3.0_DP rho(nnr_b+1,1) = thresh_lda/3.0_DP
IF (.NOT. POLARIZED) rho_tz(nnr_b+1,1) = rho(nnr_b+1,1) IF (.NOT. POLARIZED) rho_tz(nnr_b+1,1) = rho(nnr_b+1,1)
IF ( POLARIZED ) THEN IF ( POLARIZED ) THEN
@ -1028,7 +1039,7 @@ PROGRAM xclib_test
! !
! ... store data set in xml file ! ... store data set in xml file
! !
IF (test=='gen-benchmark' .AND. mype==root) THEN IF (TRIM(test)=='GENERATE' .AND. mype==root) THEN
CALL xmlw_opentag( TRIM(xc_data) ) CALL xmlw_opentag( TRIM(xc_data) )
CALL xmlw_writetag( "time_tot", time_tot1 ) CALL xmlw_writetag( "time_tot", time_tot1 )
IF (.NOT. xc_derivative) THEN IF (.NOT. xc_derivative) THEN
@ -1284,7 +1295,7 @@ PROGRAM xclib_test
ENDDO ENDDO
ENDIF ENDIF
! !
IF ( test(1:4)=='exe-' ) THEN IF ( TRIM(test)=='EXECUTE' ) THEN
IF (iout+iaverout/=0) CALL print_test_status( failed ) IF (iout+iaverout/=0) CALL print_test_status( failed )
IF (iout+iaverout==0) THEN IF (iout+iaverout==0) THEN
IF (iavernull/=naver) CALL print_test_status( passed ) IF (iavernull/=naver) CALL print_test_status( passed )
@ -1336,7 +1347,7 @@ PROGRAM xclib_test
! !
! ... set2 output / benchmark data arrays ! ... set2 output / benchmark data arrays
! !
IF ( test == 'exe-benchmark' ) THEN IF ( TRIM(test)=='EXECUTE' ) THEN
IF (.NOT. xc_derivative) DEALLOCATE( ex2, ec2 ) IF (.NOT. xc_derivative) DEALLOCATE( ex2, ec2 )
! !
IF ( LDA .OR. GGA ) THEN IF ( LDA .OR. GGA ) THEN
@ -1365,8 +1376,8 @@ PROGRAM xclib_test
ENDDO ! end of main loop over dfts ENDDO ! end of main loop over dfts
! !
IF (mype==root) THEN IF (mype==root) THEN
IF (test(1:4)=='exe-') CALL xmlr_closetag() IF (TRIM(test)=='EXECUTE' ) CALL xmlr_closetag()
IF (test(1:4)=='gen-') CALL xmlw_closetag() IF (TRIM(test)=='GENERATE') CALL xmlw_closetag()
! !
CALL xml_closefile( ) CALL xml_closefile( )
ENDIF ENDIF
@ -1375,15 +1386,12 @@ PROGRAM xclib_test
402 FORMAT('rho(up,down): ',F17.14,4x,F17.14) 402 FORMAT('rho(up,down): ',F17.14,4x,F17.14)
! !
501 FORMAT('grho2: ',F17.14) 501 FORMAT('grho2: ',F17.14)
502 FORMAT('grho2(uu,dd): ',F17.14,4x,F17.14)
503 FORMAT('grho2(uu,ud,dd): ',F17.14,4x,F17.14,4x,F17.14) 503 FORMAT('grho2(uu,ud,dd): ',F17.14,4x,F17.14,4x,F17.14)
! !
601 FORMAT('tau: ',F17.14) 601 FORMAT('tau: ',F17.14)
602 FORMAT('tau(up,down): ',F17.14,4x,F17.14) 602 FORMAT('tau(up,down): ',F17.14,4x,F17.14)
! !
909 FORMAT('grid-point: ',I5,' of ',I5) 909 FORMAT('grid-point: ',I5,' of ',I5)
910 FORMAT('threshold-point: ',I4,' of ',I4)
911 FORMAT(' TOTAL VALUES OVER ',I5,' POINTS')
! !
DEALLOCATE( proc_name ) DEALLOCATE( proc_name )
DEALLOCATE( node_name ) DEALLOCATE( node_name )
@ -1513,10 +1521,10 @@ PROGRAM xclib_test
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
SUBROUTINE evxc_stats( what, xc_1, aver ) SUBROUTINE evxc_stats( what, xc_1, aver )
!------------------------------------------------------------------------ !------------------------------------------------------------------------
!! If test=exe-benchmark calculates difference between total energy !! If test=execute calculates difference between total energy
!! and potential calculated over npoints k-points and values taken from !! and potential calculated over npoints k-points and values taken from
!! benchmark data file. !! benchmark data file.
!! If test=gen-benchmark calculates the total energy and potential !! If test=generate calculates the total energy and potential
!! over npoints k-points. !! over npoints k-points.
! !
IMPLICIT NONE IMPLICIT NONE
@ -1541,7 +1549,7 @@ PROGRAM xclib_test
IF (what(1:1)=='V') thr = diff_thr_vmgga IF (what(1:1)=='V') thr = diff_thr_vmgga
ENDIF ENDIF
! !
!IF (mype==root .AND. TRIM(test)=='exe-benchmark') THEN !IF (mype==root .AND. TRIM(test)=='EXECUTE') THEN
! WRITE(stdout,*) " " ! WRITE(stdout,*) " "
! IF ( POLARIZED .AND. what(1:1)/='E' ) WRITE(stdout,*) TRIM(what) ! IF ( POLARIZED .AND. what(1:1)/='E' ) WRITE(stdout,*) TRIM(what)
!ENDIF !ENDIF
@ -1558,7 +1566,7 @@ PROGRAM xclib_test
#endif #endif
! !
IF ( .NOT. POLARIZED .OR. what(1:1)=='E' ) THEN IF ( .NOT. POLARIZED .OR. what(1:1)=='E' ) THEN
IF (mype==root .AND. test(1:4)=='exe-') CALL print_aver( what, xc_aver(:,1), aver(1) ) IF (mype==root .AND. TRIM(test)=='EXECUTE') CALL print_aver( what, xc_aver(:,1), aver(1) )
ELSE ELSE
xc_aver(1,2) = SUM(xc_1(1:nnr,2))/npoints xc_aver(1,2) = SUM(xc_1(1:nnr,2))/npoints
! !
@ -1579,18 +1587,18 @@ PROGRAM xclib_test
v2c_ud1_aver(1) = aver_recu v2c_ud1_aver(1) = aver_recu
#endif #endif
! !
IF (mype==root .AND. test(1:4)=='exe-') CALL print_aver( what, & IF (mype==root .AND. TRIM(test)=='EXECUTE') CALL print_aver( what, &
v2c_ud1_aver, v2c_aver(1,3), 'cross' ) v2c_ud1_aver, v2c_aver(1,3), 'cross' )
ENDIF ENDIF
! !
IF (mype==root .AND. test(1:4)=='exe-') THEN IF (mype==root .AND. TRIM(test)=='EXECUTE') THEN
CALL print_aver( what, xc_aver(:,1), aver(1), 'up' ) CALL print_aver( what, xc_aver(:,1), aver(1), 'up' )
CALL print_aver( what, xc_aver(:,2), aver(2), 'down' ) CALL print_aver( what, xc_aver(:,2), aver(2), 'down' )
ENDIF ENDIF
! !
ENDIF ENDIF
! !
IF (test=='gen-benchmark') THEN IF (TRIM(test)=='GENERATE') THEN
aver = xc_aver(1,:) aver = xc_aver(1,:)
IF (TRIM(what)=='V2c'.AND.GGA.AND.ns==2) v2c_aver(1,3)=v2c_ud1_aver(1) IF (TRIM(what)=='V2c'.AND.GGA.AND.ns==2) v2c_aver(1,3)=v2c_ud1_aver(1)
ENDIF ENDIF
@ -1630,8 +1638,8 @@ PROGRAM xclib_test
#endif #endif
! !
IF ( .NOT. POLARIZED ) THEN IF ( .NOT. POLARIZED ) THEN
IF (mype==root .AND. test(1:4)=='exe-') CALL print_aver( what, & IF (mype==root .AND. TRIM(test)=='EXECUTE') CALL print_aver( what, &
dxc_aver(1:nnr_b,1), aver(1) ) dxc_aver(1:nnr_b,1), aver(1) )
ELSE ELSE
dxc_aver(1,2) = SUM(dxc_qe(1:nnr,1,2))/DBLE(npoints) dxc_aver(1,2) = SUM(dxc_qe(1:nnr,1,2))/DBLE(npoints)
! !
@ -1650,7 +1658,7 @@ PROGRAM xclib_test
dxc_aver(1:1,3) = aver_rec dxc_aver(1:1,3) = aver_rec
#endif #endif
! !
IF (mype==root .AND. test(1:4)=='exe-') THEN IF (mype==root .AND. TRIM(test)=='EXECUTE') THEN
CALL print_aver( what, dxc_aver(:,1), aver(1), 'up-up' ) CALL print_aver( what, dxc_aver(:,1), aver(1), 'up-up' )
CALL print_aver( what, dxc_aver(:,2), aver(2), 'up-down' ) CALL print_aver( what, dxc_aver(:,2), aver(2), 'up-down' )
CALL print_aver( what, dxc_aver(:,3), aver(3), 'down-down' ) CALL print_aver( what, dxc_aver(:,3), aver(3), 'down-down' )
@ -1658,7 +1666,7 @@ PROGRAM xclib_test
! !
ENDIF ENDIF
! !
IF (test=='gen-benchmark') aver(1:np) = dxc_aver(1,:) IF (TRIM(test)=='GENERATE') aver(1:np) = dxc_aver(1,:)
! !
RETURN RETURN
! !
@ -1735,7 +1743,7 @@ PROGRAM xclib_test
CHARACTER(LEN=115) :: test_output_exe CHARACTER(LEN=115) :: test_output_exe
INTEGER :: j, id_term INTEGER :: j, id_term
! !
IF (test=='gen-benchmark') THEN IF (TRIM(test)=='GENERATE') THEN
test_output_gen = '' test_output_gen = ''
IF (dft_init=='ALL_TERMS') THEN IF (dft_init=='ALL_TERMS') THEN
DO j = 1, 6 DO j = 1, 6
@ -1752,7 +1760,7 @@ PROGRAM xclib_test
WRITE(test_output_gen(19:54), '(a)') TRIM(dft) WRITE(test_output_gen(19:54), '(a)') TRIM(dft)
WRITE(test_output_gen(56:),'(a)') TRIM(status) WRITE(test_output_gen(56:),'(a)') TRIM(status)
WRITE(stdout,*) test_output_gen WRITE(stdout,*) test_output_gen
ELSEIF (test=='exe-benchmark') THEN ELSEIF (TRIM(test)=='EXECUTE') THEN
test_output_exe = '' test_output_exe = ''
IF (dft_init=='ALL_TERMS') THEN IF (dft_init=='ALL_TERMS') THEN
DO j = 1, 6 DO j = 1, 6