Commit df91b524 authored by Daniel Wortmann's avatar Daniel Wortmann

Refactoring of xcpot data type:

-removing of variable icorr, use of member-functions instead
-removal of icorrkeys module
-removal of hybridmix module
-cleanup at several places
parent 663597ac
......@@ -42,14 +42,14 @@ global/constants.f inpgen/element.f inpgen/atom_input.f inpgen/crystal.f inpgen/
inpgen/atom_sym.f inpgen/generator.f inpgen/read_record.f inpgen/soc_or_ssdw.f inpgen/symproperties.f
inpgen/bravais_symm.f inpgen/set_atom_core.f inpgen/spg_gen.f global/triang.f
inpgen/closure.f inpgen/lapw_input.f inpgen/struct_input.f inpgen/write_struct.f
global/hybridmix.f io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f
io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f
global/sort.f init/kptgen_hybrid.f init/od_kptsgen.f init/bravais.f init/divi.f init/brzone.f
init/kptmop.f init/kpttet.f init/bandstr1.F init/ordstar.f init/fulstar.f init/kprep.f
init/tetcon.f init/kvecon.f
)
set(inpgen_F90 io/xsf_io.f90
global/types.F90 global/types_rcmat.F90 global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90
global/types.F90 global/types_rcmat.F90 global/types_xcpot.F90 global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 io/w_inpXML.f90 init/julia.f90 global/utility.F90
init/compile_descr.F90 io/xmlOutput.F90 init/brzone2.f90)
......
......@@ -86,7 +86,7 @@ CONTAINS
TYPE(t_hybrid) :: hybrid_temp
TYPE(t_oneD) :: oneD_temp
TYPE(t_wann) :: wann_temp
LOGICAL :: l_kpts_temp, l_gga_temp
LOGICAL :: l_kpts_temp
INTEGER :: numSpecies
INTEGER :: div(3)
INTEGER, ALLOCATABLE :: xmlElectronStates(:,:)
......@@ -236,7 +236,7 @@ CONTAINS
banddos_temp,dimension_temp,cell_temp,sym_temp,xcpot_temp,noco_temp,Jij_temp,&
oneD_temp,hybrid_temp,kpts_temp,enpara_temp,wann_temp,noel_temp,&
namex_temp,relcor_temp,a1_temp,a2_temp,a3_temp,scale_temp,dtild_temp,xmlElectronStates,&
xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType,l_kpts_temp,l_gga_temp)
xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType,l_kpts_temp)
numSpecies = SIZE(speciesRepAtomType)
filename = 'inp_new.xml'
input_temp%l_f = input%l_f
......
......@@ -2,8 +2,6 @@ set(fleur_F77 ${fleur_F77}
global/constants.f
global/differ.f
global/fitchk.f
global/hybridmix.f
global/icorrkeys.f
global/nmat_rot.f
global/od_cylbes.f
global/od_phasy.f
......@@ -30,5 +28,6 @@ global/qfix.f90
global/radflo.F90
global/types.F90
global/types_rcmat.F90
global/types_xcpot.F90
global/utility.F90
)
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_hybridmix
IMPLICIT NONE
REAL, PARAMETER :: amix_pbe0 = 0.25
REAL, PARAMETER :: amix_hse = 0.25
REAL, PARAMETER :: omega_hse = 0.11
REAL, PARAMETER :: amix_hf = 1.00
CONTAINS
! functions for variable HSE functional
! if a value for x is given, aMix is overwritten
! return the current value of aMix
REAL FUNCTION aMix_VHSE(x) RESULT (res)
REAL, INTENT(IN), OPTIONAL :: x
REAL, SAVE :: aMix = aMix_HSE
IF ( PRESENT(x) ) aMix = x
res = aMix
END FUNCTION aMix_VHSE
! if a value for x is given, omega is overwritten
! return the current value of omega
REAL FUNCTION omega_VHSE(x) RESULT (res)
REAL, INTENT(IN), OPTIONAL :: x
REAL, SAVE :: omega = omega_HSE
IF ( PRESENT(x) ) omega = x
res = omega
END FUNCTION omega_VHSE
END MODULE m_hybridmix
MODULE m_icorrkeys
INTEGER, PARAMETER :: icorr_exx = -3
INTEGER, PARAMETER :: icorr_pbe0 = 12
INTEGER, PARAMETER :: icorr_hf = -2
!HSE, hybrid exchange functional: J. Chem. Phys. 118, 8207 (2003)
INTEGER, PARAMETER :: icorr_hse = 13
! only local part of HSE
INTEGER, PARAMETER :: icorr_hseloc = 14
! hybrid functional similar to HSE but with variable screening and mixing parameter
INTEGER, PARAMETER :: icorr_vhse = 15
CONTAINS
FUNCTION get_exchange_weight(icorr) result(a_ex)
USE m_hybridmix
USE m_judft
IMPLICIT NONE
INTEGER,INTENT(IN)::icorr
REAL a_ex
SELECT CASE (icorr)
CASE (icorr_pbe0)
a_ex = amix_pbe0
CASE (icorr_hf )
a_ex = amix_hf
CASE ( icorr_hse)
a_ex = aMix_HSE
CASE (icorr_vhse )
a_ex = aMix_VHSE()
CASE DEFAULT
call judft_error('xc functional can not be identified')
END SELECT
END FUNCTION
END MODULE m_icorrkeys
......@@ -6,6 +6,7 @@
MODULE m_types
USE m_types_rcmat
USE m_types_xcpot
!*************************************************************
! This module contains definitions for all kind of types
!*************************************************************
......@@ -526,14 +527,6 @@ MODULE m_types
REAL :: phi
END TYPE t_noco
TYPE t_xcpot
INTEGER :: icorr,igrd
INTEGER,ALLOCATABLE :: icorr_mt(:)
REAL :: gmaxxc
INTEGER :: krla !relativistic corrections
END TYPE t_xcpot
TYPE t_input
LOGICAL :: strho
LOGICAL :: cdinf
......
MODULE m_types_xcpot
IMPLICIT NONE
PRIVATE
CHARACTER(len=4),PARAMETER:: xc_names(19)=[&
'l91 ','x-a ','wign','mjw ','hl ','bh ','vwn ','pz ', &
'pw91','pbe ','rpbe','Rpbe','wc ','PBEs', &
'hse ','vhse','lhse','exx ','hf ']
LOGICAL,PARAMETER:: priv_gga(19)=[&
.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,&
.TRUE.,.TRUE.,.TRUE.,.FALSE.,.FALSE.]
LOGICAL,PARAMETER:: priv_hybrid(19)=[&
.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.]
REAL, PARAMETER :: amix_pbe0 = 0.25
REAL, PARAMETER :: amix_hse = 0.25
REAL, PARAMETER :: amix_hf = 1.00
INTEGER,PARAMETER:: ILLEGAL_XCPOT=0
TYPE t_xcpot
INTEGER,PRIVATE :: icorr
INTEGER,ALLOCATABLE :: icorr_mt(:)
REAL :: gmaxxc
INTEGER :: krla !relativistic corrections
CONTAINS
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE,NOPASS :: from_name=>xcpot_from_name
PROCEDURE :: init=>xcpot_init
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: is_name=>xcpot_is_name
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
END TYPE t_xcpot
PUBLIC t_xcpot,ILLEGAL_XCPOT
CONTAINS
PURE INTEGER FUNCTION xcpot_from_name(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN) :: name
INTEGER :: n
xcpot_from_name=ILLEGAL_XCPOT
DO n=1,SIZE(xc_names)
IF (TRIM(ADJUSTL(name))==TRIM(xc_names(n))) xcpot_from_name=n
ENDDO
END FUNCTION xcpot_from_name
SUBROUTINE xcpot_init(xcpot,namex,relcor)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
CHARACTER(len=*),INTENT(IN) :: namex
LOGICAL,INTENT(IN) :: relcor
xcpot%icorr=xcpot%from_name(namex)
xcpot%krla=MERGE(1,0,relcor)
END SUBROUTINE xcpot_init
PURE LOGICAL FUNCTION xcpot_is_name(xcpot,name)
CLASS(t_xcpot),INTENT(IN):: xcpot
CHARACTER(len=*),INTENT(IN) :: name
xcpot_is_name=(xcpot%icorr/=ILLEGAL_XCPOT.AND.xcpot%icorr==xcpot_from_name(name))
END FUNCTION xcpot_is_name
ELEMENTAL LOGICAL FUNCTION xcpot_is_gga(xcpot,icorr)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
INTEGER,OPTIONAL,INTENT(IN):: icorr
IF (PRESENT(icorr)) THEN
xcpot_is_gga=priv_gga(icorr)
ELSE
xcpot_is_gga=priv_gga(xcpot%icorr)
ENDIF
END FUNCTION xcpot_is_gga
ELEMENTAL LOGICAL FUNCTION xcpot_is_hybrid(xcpot,icorr)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
INTEGER,OPTIONAL,INTENT(IN):: icorr
IF (PRESENT(icorr)) THEN
xcpot_is_hybrid=priv_hybrid(icorr)
ELSE
xcpot_is_hybrid=priv_hybrid(xcpot%icorr)
ENDIF
END FUNCTION xcpot_is_hybrid
FUNCTION xcpot_get_exchange_weight(xcpot) RESULT(a_ex)
USE m_judft
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
REAL:: a_ex
a_ex=-1
IF (xcpot%is_name("pbe0")) a_ex=amix_pbe0
IF (xcpot%is_name("hf")) a_ex=amix_hf
IF (xcpot%is_name("hse")) a_ex=amix_hse
IF (xcpot%is_name("vhse")) a_ex=amix_hse
IF (a_ex==-1) CALL judft_error('xc functional can not be identified')
END FUNCTION xcpot_get_exchange_weight
END MODULE m_types_xcpot
......@@ -45,8 +45,6 @@ MODULE m_add_vnonlocal
USE m_symmetrizeh
USE m_wrapper
USE m_hsefunctional ,ONLY: exchange_vccvHSE,exchange_ccccHSE
USE m_hybridmix
USE m_icorrkeys
USE m_types
USE m_io_hybrid
IMPLICIT NONE
......@@ -77,7 +75,7 @@ MODULE m_add_vnonlocal
!
! initialize weighting factor for HF exchange part
!
a_ex=get_exchange_weight(xcpot%icorr)
a_ex=xcpot%get_exchange_weight()
v_x%l_real=hamovlp%l_real
......
......@@ -44,7 +44,6 @@ CONTAINS
USE m_util , ONLY : sphbessel,intgrf,intgrf_init, harmonicsr,primitivef
USE m_hsefunctional, ONLY : change_coulombmatrix
USE m_wrapper
USE m_icorrkeys
USE m_io_hybrid
USE m_types
......@@ -1127,7 +1126,7 @@ CONTAINS
1 DEALLOCATE (qnrm,pqnrm)
CALL cpu_TIME(time1)
IF ( xcpot%icorr == icorr_hse .OR. xcpot%icorr == icorr_vhse ) THEN
IF ( xcpot%is_name("hse") .OR. xcpot%is_name("vhse")) THEN
!
! The HSE functional is realized subtracting erf/r from
! the normal Coulomb matrix
......
......@@ -69,7 +69,6 @@
USE m_mpi_tags
#endif
USE m_io_hybrid
USE m_icorrkeys
USE m_kp_perturbation
USE m_types
IMPLICIT NONE
......@@ -324,7 +323,7 @@ endif
! are Fourier transformed, so that the exchange can be calculated
! in Fourier space
#ifndef CPP_NOSPMVEC
IF ( xcpot%icorr == icorr_hse .OR. xcpot%icorr == icorr_vhse ) THEN
IF ( xcpot%is_name("hse") .OR. xcpot%is_name("vhse") ) THEN
iband1 = hybrid%nobd(nkqpt)
exch_vv = exch_vv + dynamic_hse_adjustment(&
atoms%rmsh,atoms%rmt,atoms%dx,atoms%jri,atoms%jmtd,kpts%bkf(:,ikpt0),ikpt0,kpts%nkptf,&
......@@ -418,7 +417,7 @@ endif
! valence-valence-valence-valence exchange
IF ( xcpot%icorr .NE. icorr_hse .AND. xcpot%icorr .NE. icorr_vhse ) THEN ! no gamma point correction needed for HSE functional
IF ( (.not.xcpot%is_name("hse")) .AND. (.not.xcpot%is_name("vhse")) ) THEN ! no gamma point correction needed for HSE functional
IF( zero_order .and. .not. ibs_corr ) THEN
WRITE(6,'(A)') ' Take zero order terms into account.'
ELSE IF( zero_order .and. ibs_corr ) THEN
......
......@@ -10,14 +10,13 @@
MODULE m_hsefunctional
USE m_judft
IMPLICIT NONE
#ifdef __PGI
REAL,EXTERNAL ::erfc
#endif
! Constant omega of the HSE exchange functional
! REAL, PARAMETER :: omega_HSE = 0.11
REAL, PARAMETER :: omega_HSE = 0.11
! Mixing parameter of HSE and PBE exchange
! REAL, PARAMETER :: aMix_HSE = 0.25
! Constant for the maximum number of G points
INTEGER, PARAMETER :: maxNoGPts = 50
......@@ -69,8 +68,7 @@ CONTAINS
! d2Fx_ds2 - second derivative with respect to s
SUBROUTINE calculateEnhancementFactor(kF, s_inp, F_x, dFx_Ds, d2Fx_Ds2, dFx_dkF, d2Fx_dsdkF)
USE m_hybridmix
IMPLICIT NONE
REAL, INTENT(IN) :: kF, s_inp
......@@ -120,7 +118,7 @@ CONTAINS
! Calculate different helper variables
r1_kF = 1.0 / kF
omega_kF = omega_VHSE() * r1_kF
omega_kF = omega_hse * r1_kF !was omega_VHSE()
omega_kF_Sqr = omega_kF * omega_kF
! calculate the functions H and F in [3] and its derivatives
......@@ -975,7 +973,6 @@ CONTAINS
potential,muffintin,interstitial)
USE m_constants
USE m_hybridmix
USE m_olap, ONLY : gptnorm
USE m_util, ONLY : sphbessel,pure_intgrf,intgrf_init,intgrf_out,NEGATIVE_EXPONENT_WARNING,NEGATIVE_EXPONENT_ERROR
......@@ -1040,7 +1037,7 @@ CONTAINS
sVol = SQRT(vol)
r4Pi_sVol = r4Pi / sVol
r4Pi_Vol = r4Pi / Vol
omega = omega_VHSE()
omega = omega_hse!omega_VHSE()
r1_omega2 = 1.0 / omega**2
r1_4omega2 = 0.25 * r1_omega2
pi_omega2 = pi_const * r1_omega2
......@@ -1309,7 +1306,6 @@ CONTAINS
potential, fourier_trafo)
USE m_constants
USE m_hybridmix
USE m_util, ONLY : sphbessel,pure_intgrf,intgrf_init,intgrf_out,NEGATIVE_EXPONENT_WARNING,NEGATIVE_EXPONENT_ERROR
USE m_trafo, ONLY : symmetrize
......@@ -1403,7 +1399,7 @@ CONTAINS
sVol = SQRT(vol)
r4Pi_sVol = r4Pi / sVol
r4Pi_Vol = r4Pi / Vol
omega = omega_VHSE()
omega = omega_hse!omega_VHSE()
r1_omega2 = 1.0 / omega**2
r1_4omega2 = 0.25 * r1_omega2
pi_omega2 = pi_const * r1_omega2
......@@ -2599,8 +2595,7 @@ CONTAINS
FUNCTION calculate_coefficients(rmsh,lmax,ncut,fac) RESULT (d_ln)
USE m_constants
USE m_hybridmix
IMPLICIT NONE
REAL, INTENT(IN) :: rmsh(:)
......@@ -2631,7 +2626,7 @@ CONTAINS
r1_spi = 1.0 / SQRT( pi_const )
! Calculate x and x^2 and the functions erfc(x) and exp(x^2)
rx = omega_VHSE() * rmsh
rx = omega_HSe * rmsh
x2 = rx**2
erfc_x = erfc(rx)
exp_x2 = EXP(-x2)
......
......@@ -54,8 +54,6 @@ MODULE m_hsfock
USE m_symmetrizeh
USE m_wrapper
USE m_hsefunctional ,ONLY: exchange_vccvHSE,exchange_ccccHSE
USE m_hybridmix
USE m_icorrkeys
USE m_types
USE m_io_hybrid
IMPLICIT NONE
......@@ -133,7 +131,7 @@ MODULE m_hsfock
!
! initialize weighting factor for HF exchange part
!
a_ex=get_exchange_weight(xcpot%icorr)
a_ex=xcpot%get_exchange_weight()
! write k1,k2,k3 in gpt
......@@ -205,7 +203,7 @@ MODULE m_hsfock
! calculate contribution from the core states to the HF exchange
IF ( xcpot%icorr.eq.icorr_hse .OR. xcpot%icorr.eq.icorr_vhse ) THEN
IF ( xcpot%is_name("hse") .OR. xcpot%is_name("vhse") ) THEN
#ifdef CPP_NEVER
CALL exchange_vccvHSE(&
& nk,atoms,&
......
......@@ -11,7 +11,6 @@ CONTAINS
USE m_eig66_io
USE m_apws
USE m_io_hybrid
USE m_icorrkeys
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
......@@ -49,7 +48,7 @@ CONTAINS
!Check if new non-local potential shall be generated
hybrid%l_subvxc = ( hybrid%l_hybrid.AND.xcpot%icorr /= icorr_exx )
hybrid%l_subvxc = ( hybrid%l_hybrid.AND..not.xcpot%is_name("exx") )
!If this is the first iteration loop we can not calculate a new
!non-local potential
IF (.NOT.ALLOCATED(v%pw)) THEN
......
......@@ -40,7 +40,6 @@ CONTAINS
USE m_util, ONLY : intgrf_init,intgrf,rorderpf
USE m_read_core
USE m_wrapper
USE m_icorrkeys
USE m_eig66_io
USE m_types
IMPLICIT NONE
......@@ -127,7 +126,7 @@ CONTAINS
IF ( mpi%irank == 0 ) WRITE(6,'(//A,I2,A)') '### subroutine: mixedbasis ###'
exx = ( xcpot%icorr .EQ. icorr_exx )
exx = xcpot%is_name("exx")
if (exx) call judft_error("EXX is not implemented in this version",calledby='mixedbasis.F90')
! Deallocate arrays which might have been allocated in a previous run of this subroutine
......
......@@ -12,8 +12,6 @@ CONTAINS
USE m_radflo
USE m_radfun
USE m_abcof3
USE m_icorrkeys
USE m_hybridmix
USE m_types
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
......@@ -532,18 +530,8 @@ CONTAINS
END IF ! if any atoms%llo
!initialize weighting factor
IF( xcpot%icorr .EQ. icorr_hf) THEN
a_ex = amix_hf
ELSE IF( xcpot%icorr .EQ. icorr_pbe0 ) THEN
a_ex = amix_pbe0
ELSE IF ( xcpot%icorr .EQ. icorr_hse ) THEN
a_ex = aMix_HSE
ELSE IF ( xcpot%icorr .EQ. icorr_vhse ) THEN
a_ex = aMix_VHSE()
ELSE
STOP 'subvxc: error icorr'
END IF
a_ex=xcpot%get_exchange_weight()
IF (hamovlp%l_real) THEN
DO i=1,hamovlp%matsize
hamovlp%a_r(i) = hamovlp%a_r(i) - a_ex*REAL(vxc(i))
......
......@@ -99,7 +99,6 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
CALL MPI_BCAST(oneD%odd%nn2d,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
!CALL MPI_BCAST(obsolete%nwdd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(jij%nqptd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(xcpot%igrd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
IF (mpi%irank.NE.0) THEN
IF(ALLOCATED(atoms%neq)) DEALLOCATE(atoms%neq)
......@@ -191,7 +190,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(hybrid%select1(4,atoms%ntype),hybrid%lcutm1(atoms%ntype))
ALLOCATE(hybrid%lcutwf(atoms%ntype))
IF (xcpot%igrd.NE.0) THEN
IF (xcpot%is_gga()) THEN
ALLOCATE (stars%ft2_gfx(0:dimension%nn2d-1),stars%ft2_gfy(0:dimension%nn2d-1))
ALLOCATE (oneD%pgft1x(0:oneD%odd%nn2d-1),oneD%pgft1xx(0:oneD%odd%nn2d-1),&
oneD%pgft1xy(0:oneD%odd%nn2d-1),&
......@@ -206,7 +205,6 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(atoms%namex(atoms%ntype))
ALLOCATE(atoms%relcor(atoms%ntype))
ALLOCATE(atoms%icorr(atoms%ntype))
ALLOCATE(atoms%igrd(atoms%ntype))
ALLOCATE(atoms%krla(atoms%ntype))
atoms%namex = ''
atoms%icorr = -99
......
......@@ -37,7 +37,6 @@
USE m_constants
USE m_types
USE m_inv3
USE m_icorrkeys
USE m_setlomap
IMPLICIT NONE
! ..
......@@ -218,70 +217,60 @@
f12.6,/,2x, 'the area of the two-dimensional unit cell=',f12.6)
WRITE (6,FMT=8120) namex,relcor
8120 FORMAT (1x,'exchange-correlation: ',a4,2x,a12,1x,'correction')
xcpot%icorr = -99
! l91: lsd(igrd=0) with dsprs=1.d-19 in pw91.
IF (namex.EQ.'exx ') xcpot%icorr = icorr_exx
IF (namex.EQ.'hf ') xcpot%icorr = icorr_hf
IF (namex.EQ.'l91 ') xcpot%icorr = -1
IF (namex.EQ.'x-a ') xcpot%icorr = 0
IF (namex.EQ.'wign') xcpot%icorr = 1
IF (namex.EQ.'mjw') xcpot%icorr = 2
IF (namex.EQ.'hl') xcpot%icorr = 3
IF (namex.EQ.'bh') xcpot%icorr = 3
IF (namex.EQ.'vwn') xcpot%icorr = 4
IF (namex.EQ.'pz') xcpot%icorr = 5
IF (namex.EQ.'pw91') xcpot%icorr = 6
! pbe: easy_pbe [Phys.Rev.Lett. 77, 3865 (1996)]
! rpbe: rev_pbe [Phys.Rev.Lett. 80, 890 (1998)]
! Rpbe: Rev_pbe [Phys.Rev.B 59, 7413 (1999)]
IF (namex.EQ.'pbe') xcpot%icorr = 7
IF (namex.EQ.'rpbe') xcpot%icorr = 8
IF (namex.EQ.'Rpbe') xcpot%icorr = 9
IF (namex.EQ.'wc') xcpot%icorr = 10
! wc: Wu & Cohen, [Phys.Rev.B 73, 235116 (2006)]
IF (namex.EQ.'PBEs') xcpot%icorr = 11
! PBEs: PBE for solids ( arXiv:0711.0156v2 )
IF (namex.EQ.'pbe0') xcpot%icorr = icorr_pbe0
! hse: Heyd, Scuseria, Ernzerhof, JChemPhys 118, 8207 (2003)
IF (namex.EQ.'hse ') xcpot%icorr = icorr_hse
IF (namex.EQ.'vhse') xcpot%icorr = icorr_vhse
! local part of HSE
IF (namex.EQ.'lhse') xcpot%icorr = icorr_hseloc
IF (xcpot%icorr == -99) THEN
WRITE(6,*) 'Name of XC-potential not recognized. Use one of:'
WRITE(6,*) 'x-a,wign,mjw,hl,bh,vwn,pz,l91,pw91,pbe,rpbe,Rpbe,wc,PBEs,pbe0,hf,hse,lhse'
CALL juDFT_error("Wrong name of XC-potential!",calledby="inped")
ENDIF
xcpot%igrd = 0
IF (xcpot%icorr.GE.6) xcpot%igrd = 1
xcpot%krla = 0
IF (relcor.EQ.'relativistic') THEN
xcpot%krla = 1
IF (xcpot%igrd.EQ.1) THEN
WRITE(6,'(18a,a4)') 'Use XC-potential: ',namex
WRITE(6,*) 'only without relativistic corrections !'
CALL juDFT_error ("relativistic corrections + GGA not implemented" ,calledby ="inped")
ENDIF
ENDIF
IF (xcpot%icorr.EQ.0) WRITE(6,*) 'WARNING: using X-alpha for XC!'
IF (xcpot%icorr.EQ.1) WRITE(6,*) 'INFO : using Wigner for XC!'
IF ((xcpot%icorr.EQ.2).AND.(namex.NE.'mjw')) WRITE(6,*) 'CAUTION: using MJW(BH) for XC!'
!+guta
IF ((xcpot%icorr.EQ.-1).OR.(xcpot%icorr.GE.6)) THEN
CALL xcpot%init(namex,relcor.EQ.'relativistic')
!!$ xcpot%icorr = -99
!!$
!!$ ! l91: lsd(igrd=0) with dsprs=1.d-19 in pw91.
!!$ IF (namex.EQ.'exx ') xcpot%icorr = icorr_exx
!!$ IF (namex.EQ.'hf ') xcpot%icorr = icorr_hf
!!$ IF (namex.EQ.'l91 ') xcpot%icorr = -1
!!$ IF (namex.EQ.'x-a ') xcpot%icorr = 0
!!$ IF (namex.EQ.'wign') xcpot%icorr = 1
!!$ IF (namex.EQ.'mjw') xcpot%icorr = 2
!!$ IF (namex.EQ.'hl') xcpot%icorr = 3
!!$ IF (namex.EQ.'bh') xcpot%icorr = 3
!!$ IF (namex.EQ.'vwn') xcpot%icorr = 4
!!$ IF (namex.EQ.'pz') xcpot%icorr = 5
!!$ IF (namex.EQ.'pw91') xcpot%icorr = 6
!!$ ! pbe: easy_pbe [Phys.Rev.Lett. 77, 3865 (1996)]
!!$ ! rpbe: rev_pbe [Phys.Rev.Lett. 80, 890 (1998)]
!!$ ! Rpbe: Rev_pbe [Phys.Rev.B 59, 7413 (1999)]
!!$ IF (namex.EQ.'pbe') xcpot%icorr = 7
!!$ IF (namex.EQ.'rpbe') xcpot%icorr = 8
!!$ IF (namex.EQ.'Rpbe') xcpot%icorr = 9
!!$ IF (namex.EQ.'wc') xcpot%icorr = 10
!!$ ! wc: Wu & Cohen, [Phys.Rev.B 73, 235116 (2006)]
!!$ IF (namex.EQ.'PBEs') xcpot%icorr = 11
!!$ ! PBEs: PBE for solids ( arXiv:0711.0156v2 )
!!$ IF (namex.EQ.'pbe0') xcpot%icorr = icorr_pbe0
!!$ ! hse: Heyd, Scuseria, Ernzerhof, JChemPhys 118, 8207 (2003)
!!$ IF (namex.EQ.'hse ') xcpot%icorr = icorr_hse
!!$ IF (namex.EQ.'vhse') xcpot%icorr = icorr_vhse
!!$ ! local part of HSE
!!$ IF (namex.EQ.'lhse') xcpot%icorr = icorr_hseloc
!!$
!!$ IF (xcpot%icorr == -99) THEN
!!$ WRITE(6,*) 'Name of XC-potential not recognized. Use one of:'
!!$ WRITE(6,*) 'x-a,wign,mjw,hl,bh,vwn,pz,l91,pw91,pbe,rpbe,Rpbe,wc,PBEs,pbe0,hf,hse,lhse'
!!$ CALL juDFT_error("Wrong name of XC-potential!",calledby="inped")
!!$ ENDIF
!!$ xcpot%krla = 0
!!$ IF (relcor.EQ.'relativistic') THEN
!!$ xcpot%krla = 1
!!$
!!$ ENDIF
!!$ IF (xcpot%icorr.EQ.0) WRITE(6,*) 'WARNING: using X-alpha for XC!'
!!$ IF (xcpot%icorr.EQ.1) WRITE(6,*) 'INFO : using Wigner for XC!'
!!$ IF ((xcpot%icorr.EQ.2).AND.(namex.NE.'mjw')) WRITE(6,*) 'CAUTION: using MJW(BH) for XC!'
!!$
!!$ !+guta
!!$ IF ((xcpot%icorr.EQ.-1).OR.(xcpot%icorr.GE.6)) THEN
IF (xcpot%is_gga()) THEN
obsolete%ndvgrd = MAX(obsolete%ndvgrd,3)
IF ((xcpot%igrd.NE.0).AND.(xcpot%igrd.NE.1)) THEN
WRITE (6,*) 'selecting l91 or pw91 as XC-Potental you should'
WRITE (6,*) ' have 2 lines like this in your inp-file:'
WRITE (6,*) 'igrd=1,lwb=F,ndvgrd=4,idsprs=0,chng= 1.000E-16'
WRITE (6,*) 'iggachk=1,idsprs0=1,idsprsl=1,idsprsi=1,idsprsv=1'
CALL juDFT_error("igrd =/= 0 or 1",calledby ="inped")
ENDIF
! iggachk: removed; triggered via idsprs (see below)
! idsprs-0(mt,l=0),-l(nmt),-i(interstitial),-v(vacuum)
......@@ -289,9 +278,9 @@
! idsprs set to be zero.
WRITE (16,FMT=8122) xcpot%igrd,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
WRITE (16,FMT=8122) 1,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
WRITE (16,'(/)')
WRITE (6,FMT=8122) xcpot%igrd,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
WRITE (6,FMT=8122) 1,obsolete%lwb,obsolete%ndvgrd,0,obsolete%chng
WRITE (6,'(/)')
8122 FORMAT ('igrd=',i1,',lwb=',l1,',ndvgrd=',i1,',idsprs=',i1, ',chng=',d10.3)
......@@ -378,10 +367,9 @@
!
! check muffin tin radii
!
l_gga = .FALSE.
IF (xcpot%icorr.GE.6) l_gga = .TRUE.
l_gga= xcpot%is_gga()
l_test = .TRUE. ! only checking, dont use new parameters
CALL chkmt(atoms,input,vacuum,cell,oneD, l_gga,noel,l_test, kmax1,dtild,dvac1,lmax1,jri1,rmt1,dx1)
CALL chkmt(atoms,input,vacuum,cell,oneD,l_gga,noel,l_test, kmax1,dtild,dvac1,lmax1,jri1,rmt1,dx1)
WRITE (6,FMT=8180) cell%volint
8180 FORMAT (13x,' volume of interstitial region=',f12.6)
......
......@@ -38,7 +38,7 @@
oneD%igfft1(0:oneD%odd%nn2d-1,1:2) = 0
oneD%pgfft1(0:oneD%odd%nn2d-1) = 0.
IF (xcpot%igrd.NE.0) THEN
IF (xcpot%is_gga()) THEN
! ALLOCATE ( odg%pgfx(0:odg%nn2d-1),
! & odg%pgfy(0:odg%nn2d-1),
! & odg%pgfxx(0:odg%nn2d-1),
......@@ -125,7 +125,7 @@
oneD%pgfft1(i-1) = 1.
ENDDO
IF (xcpot%igrd.NE.0) THEN
IF (xcpot%is_gga()) THEN
DO i = 1,oneD%odd%nq2