TABLE OF CONTENTS
ABINIT/check_kxc [ Functions ]
NAME
check_kxc
FUNCTION
Given a XC functional (defined by ixc), check if Kxc (dVxc/drho) is avalaible.
COPYRIGHT
Copyright (C) 2012-2018 ABINIT group (MT) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt . For the initials of contributors, see ~abinit/doc/developers/contributors.txt.
INPUTS
ixc = internal code for xc functional optdriver=type of calculation (ground-state, response function, GW, ...)
OUTPUT
PARENTS
respfn,scfcv
CHILDREN
SOURCE
29 #if defined HAVE_CONFIG_H 30 #include "config.h" 31 #endif 32 33 #include "abi_common.h" 34 35 subroutine check_kxc(ixc,optdriver) 36 37 use defs_basis 38 use m_errors 39 use libxc_functionals 40 41 !This section has been created automatically by the script Abilint (TD). 42 !Do not modify the following lines by hand. 43 #undef ABI_FUNC 44 #define ABI_FUNC 'check_kxc' 45 !End of the abilint section 46 47 implicit none 48 49 !Arguments ------------------------------- 50 integer, intent(in) :: ixc,optdriver 51 52 !Local variables ------------------------- 53 logical :: kxc_available 54 character(len=500) :: msg 55 56 ! ********************************************************************* 57 58 kxc_available=.false. 59 60 if (ixc>=0) then 61 kxc_available=(ixc/=16.and.ixc/=17.and.ixc/=26.and.ixc/=27) 62 if (.not.kxc_available) then 63 write(msg,'(a,i0,3a)') & 64 & 'The selected XC functional (ixc=',ixc,')',ch10,& 65 & 'does not provide Kxc (dVxc/drho) !' 66 end if 67 else if (ixc==-406.or.ixc==-427.or.ixc==-428.or.ixc==-456)then 68 kxc_available=.true. 69 else ! ixc<0 and not one of the allowed hybrids 70 kxc_available=libxc_functionals_has_kxc() 71 if (.not.kxc_available) then 72 write(msg,'(a,i0,7a)') & 73 & 'The selected XC functional (ixc=',ixc,'):',ch10,& 74 & ' <<',trim(libxc_functionals_fullname()),'>>',ch10,& 75 & 'does not provide Kxc (dVxc/drho) !' 76 end if 77 end if 78 79 if (.not.kxc_available) then 80 write(msg,'(7a)') trim(msg),ch10,& 81 & 'However, with the current input options, ABINIT needs Kxc.',ch10,& 82 & '>Possible action:',ch10,& 83 & 'Change the XC functional in psp file or input file.' 84 if (optdriver==0) then 85 write(msg,'(13a)') trim(msg),ch10,& 86 & '>Possible action (2):',ch10,& 87 & 'If you are using density mixing for the SCF cycle',ch10,& 88 & '(iscf>=10, which is the default for PAW),',ch10,& 89 & 'change to potential mixing (iscf=7, for instance).',ch10,& 90 & '>Possible action (3):',ch10,& 91 & 'Switch to another value of densfor_pred (=5, for instance).' 92 end if 93 MSG_ERROR(msg) 94 end if 95 96 end subroutine check_kxc