TABLE OF CONTENTS


ABINIT/functionals_pwscf.F90 [ Modules ]

[ Top ] [ Modules ]

NAME

  functionals_pwscf

FUNCTION

 This module contains data defining the DFT functional in use
 and a number of functions and subroutines to manage them.
 Data are PRIVATE and are accessed and set only by function calls.
 Basic drivers to compute XC quantities are also included.

 imported into abinit by MJV 20/6/2009

COPYRIGHT

 Copyright (C) 2004 PWSCF group
 This file is distributed under the terms of the
 GNU General Public License. See the file `License'
 in the root directory of the present distribution,
 or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

CHILDREN

SOURCE

 29 !
 30 !-------------------------------------------------------------------
 31 
 32 #if defined HAVE_CONFIG_H
 33 #include "config.h"
 34 #endif
 35 
 36 module funct_pwscf
 37 !-------------------------------------------------------------------
 38 !  
 39 !  setting routines:   set_dft_from_name (previously which_dft)
 40 !                      set_dft_from_indices
 41 !                      enforce_input_dft
 42 !                      start_exx
 43 !                      stop_exx
 44 !  retrive functions:  get_dft_name
 45 !                      get_iexch
 46 !                      get_icorr
 47 !                      get_igcx
 48 !                      get_igcc
 49 !                      get_exx_fraction
 50 !                      dft_name
 51 !                      write_dft_name
 52 !  logical functions:  dft_is_gradient
 53 !                      dft_is_meta
 54 !                      dft_is_hybrid
 55 !                      exx_is_active
 56 !
 57 !  XC computation drivers: xc, xc_spin, gcxc, gcx_spin, gcc_spin, gcc_spin_more
 58 !  derivatives of XC computation drivers: dmxc, dmxc_spin, dmxc_nc
 59 !
 60   use flib_pwscf
 61 
 62   IMPLICIT NONE
 63   PRIVATE
 64   SAVE
 65   ! subroutines/functions managing dft name and indices
 66   PUBLIC  :: set_dft_from_indices, set_dft_from_name
 67   PUBLIC  :: enforce_input_dft, write_dft_name, dft_name
 68   PUBLIC  :: get_dft_name, get_iexch, get_icorr, get_igcx, get_igcc
 69   PUBLIC  :: dft_is_gradient, dft_is_meta, dft_is_hybrid
 70   ! additional subroutines/functions for hybrid functionale
 71   PUBLIC  :: start_exx, stop_exx, get_exx_fraction, exx_is_active
 72   !
 73   ! PRIVATE variables defining the DFT functional
 74   !
 75   PRIVATE :: dft, iexch, icorr, igcx, igcc
 76   PRIVATE :: discard_input_dft
 77   PRIVATE :: isgradient, ismeta, ishybrid
 78   PRIVATE :: exx_fraction, exx_started
 79   !PRIVATE :: dft_shortname
 80   !
 81   character (len=50) :: dft = 'not set'
 82   !character (len=4)  :: dft_shortname = ' '
 83   !
 84   ! dft is the exchange-correlation functional, described by
 85   ! any nonconflicting combination of the following keywords
 86   ! (case-insensitive):
 87   !
 88   ! Exchange:    "nox"    none                           iexch=0
 89   !              "sla"    Slater (alpha=2/3)             iexch=1 (default)
 90   !              "sl1"    Slater (alpha=1.0)             iexch=2
 91   !              "rxc"    Relativistic Slater            iexch=3
 92   !              "oep"    Optimized Effective Potential  iexch=4
 93   !              "hf"     Hartree-Fock                   iexch=5
 94   !              "pb0x"   PBE0                           iexch=6
 95   !
 96   ! Correlation: "noc"    none                           icorr=0
 97   !              "pz"     Perdew-Zunger                  icorr=1 (default)
 98   !              "vwn"    Vosko-Wilk-Nusair              icorr=2
 99   !              "lyp"    Lee-Yang-Parr                  icorr=3
100   !              "pw"     Perdew-Wang                    icorr=4
101   !              "wig"    Wigner                         icorr=5
102   !              "hl"     Hedin-Lunqvist                 icorr=6
103   !              "obz"    Ortiz-Ballone form for PZ      icorr=7
104   !              "obw"    Ortiz-Ballone form for PW      icorr=8
105   !              "gl"     Gunnarson-Lunqvist             icorr=9
106   !
107   ! Gradient Correction on Exchange:
108   !              "nogx"   none                           igcx =0 (default)
109   !              "b88"    Becke88 (beta=0.0042)          igcx =1
110   !              "ggx"    Perdew-Wang 91                 igcx =2
111   !              "pbx"    Perdew-Burke-Ernzenhof exch    igcx =3
112   !              "rpb"    revised PBE by Zhang-Yang      igcx =4
113   !              "hcth"   Cambridge exch, Handy et al    igcx =5
114   !              "optx"   Handy's exchange functional    igcx =6
115   !              "meta"   meta-gga                       igcx =7
116   !              "pb0x"   PBE0                           igcx =8
117   !
118   ! Gradient Correction on Correlation:
119   !              "nogc"   none                           igcc =0 (default)
120   !              "p86"    Perdew86                       igcc =1
121   !              "ggc"    Perdew-Wang 91 corr.           igcc =2
122   !              "blyp"   Lee-Yang-Parr                  igcc =3
123   !              "pbc"    Perdew-Burke-Ernzenhof corr    igcc =4
124   !              "hcth"   Cambridge corr, Handy et al    igcc =5
125   !              "meta"   meta-gga                       igcc =6
126   !
127   ! Special cases (dft_shortnames):
128   !              "bp"   = "b88+p86"         = Becke-Perdew grad.corr.
129   !              "pw91" = "pw +ggx+ggc"     = PW91 (aka GGA)
130   !              "blyp" = "sla+b88+lyp+blyp"= BLYP
131   !              "pbe"  = "sla+pw+pbx+pbc"  = PBE
132   !              "revpbe"="sla+pw+rpb+pbc"  = revPBE (Zhang-Yang)
133   !              "hcth" = "nox+noc+hcth+hcth"=HCTH/120
134   !              "olyp" = "nox+lyp+optx+blyp" !!! UNTESTED !!!
135   !
136   ! References:
137   !              pz      J.P.Perdew and A.Zunger, PRB 23, 5048 (1981) [[cite:Perdew1981]]
138   !              vwn     S.H.Vosko, L.Wilk, M.Nusair, Can.J.Phys. 58,1200(1980) [[cite:Vosko1980]]
139   !              wig     E.P.Wigner, Trans. Faraday Soc. 34, 67 (1938) [[cite:Wigner1938]]
140   !              hl      L.Hedin and B.I.Lundqvist, J. Phys. C4, 2064 (1971) [[cite:Hedin1971]]
141   !              gl      O.Gunnarsson and B.I.Lundqvist, PRB 13, 4274 (1976) [[cite:Gunnarsson1976]]
142   !              pw      J.P.Perdew and Y.Wang, PRB 45, 13244 (1992) [[cite:Perdew1992a]]
143   !              obpz    G.Ortiz and P.Ballone, PRB 50, 1391 (1994) [[cite:Ortiz1994]]
144   !              obpw    as above
145   !              b88     A.D.Becke, PRA 38, 3098 (1988) [[cite:Becke1988]]
146   !              p86     J.P.Perdew, PRB 33, 8822 (1986) [[cite:Perdew1986]] 
147   !              pbe     J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996) [[cite:Perdew1996]]
148   !              pw91    J.P.Perdew and Y. Wang, PRB 46, 6671 (1992) [[cite:Perdew1992]]
149   !              blyp    C.Lee, W.Yang, R.G.Parr, PRB 37, 785 (1988) [[cite:Lee1988]]
150   !              hcth    Hamprecht et al, JCP 109, 6264 (1998) [[cite:Hamprecht1998]]
151   !              olyp    Handy and Cohen, JCP 116, 5411 (2002) [[cite:Handy2002]]
152   !              revPBE  Zhang and Yang, PRL 80, 890 (1998) [[cite:Zhang1998]]
153   !              oep
154 
155   integer, parameter:: notset = -1
156   !
157   integer :: iexch = notset
158   integer :: icorr = notset
159   integer :: igcx  = notset
160   integer :: igcc  = notset
161   real(8):: exx_fraction = 0.0d0
162   logical :: isgradient  = .false.
163   logical :: ismeta      = .false.
164   logical :: ishybrid    = .false.
165   logical :: exx_started = .false.
166 
167   logical :: discard_input_dft = .false.
168   !
169   ! internal indices for exchange-correlation
170   !    iexch: type of exchange
171   !    icorr: type of correlation
172   !    igcx:  type of gradient correction on exchange
173   !    igcc:  type of gradient correction on correlation
174   !
175   !    ismeta: .TRUE. if gradient correction is of meta-gga type
176   !    ishybrid: .TRUE. if the xc finctional is an HF+DFT hybrid like
177   !              PBE0 or B3LYP or HF itself
178   !
179   ! see comments above and routine "set_dft_from_name" below 
180   !
181   ! data
182   integer :: nxc, ncc, ngcx, ngcc
183   parameter (nxc = 7, ncc =10, ngcx = 9, ngcc = 7)
184   character (len=4) :: exc, corr
185   character (len=4) :: gradx, gradc
186   dimension exc (0:nxc), corr (0:ncc), gradx (0:ngcx), gradc (0: ngcc)
187 
188   data exc / 'NOX', 'SLA', 'SL1', 'RXC', 'OEP', 'HF', 'PB0X', 'B3LP' /
189   data corr / 'NOC', 'PZ', 'VWN', 'LYP', 'PW', 'WIG', 'HL', 'OBZ', &
190               'OBW', 'GL' , 'B3LP' /
191   data gradx / 'NOGX', 'B88', 'GGX', 'PBX',  'RPB', 'HCTH', 'OPTX', 'META', 'PB0X', 'B3LP'  /
192   data gradc / 'NOGC', 'P86', 'GGC', 'BLYP', 'PBC', 'HCTH', 'META', 'B3LP' /
193 
194 CONTAINS

functionals_pwscf/dft_is_gradient [ Functions ]

[ Top ] [ Functions ]

NAME

 dft_is_gradient

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

844   !-----------------------------------------------------------------------
845   function dft_is_gradient ()
846 
847 
848 !This section has been created automatically by the script Abilint (TD).
849 !Do not modify the following lines by hand.
850 #undef ABI_FUNC
851 #define ABI_FUNC 'dft_is_gradient'
852 !End of the abilint section
853 
854      logical :: dft_is_gradient
855      dft_is_gradient = isgradient
856      return
857   end function dft_is_gradient

functionals_pwscf/dft_is_hybrid [ Functions ]

[ Top ] [ Functions ]

NAME

 dft_is_hybrid

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

908   !-----------------------------------------------------------------------
909   function dft_is_hybrid ()
910 
911 
912 !This section has been created automatically by the script Abilint (TD).
913 !Do not modify the following lines by hand.
914 #undef ABI_FUNC
915 #define ABI_FUNC 'dft_is_hybrid'
916 !End of the abilint section
917 
918      logical :: dft_is_hybrid
919      dft_is_hybrid = ishybrid
920      return
921   end function dft_is_hybrid

functionals_pwscf/dft_is_meta [ Functions ]

[ Top ] [ Functions ]

NAME

 dft_is_meta

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

876   !-----------------------------------------------------------------------
877   function dft_is_meta ()
878 
879 
880 !This section has been created automatically by the script Abilint (TD).
881 !Do not modify the following lines by hand.
882 #undef ABI_FUNC
883 #define ABI_FUNC 'dft_is_meta'
884 !End of the abilint section
885 
886      logical :: dft_is_meta
887      dft_is_meta = ismeta
888      return
889   end function dft_is_meta

functionals_pwscf/dft_name [ Functions ]

[ Top ] [ Functions ]

NAME

 dft_name

FUNCTION

 convert the four indices iexch, icorr, igcx, igcc
 into user-readable strings

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

1001   !---------------------------------------------------------------------
1002   subroutine dft_name(iexch_, icorr_, igcx_, igcc_, longname_, shortname_)
1003   !---------------------------------------------------------------------
1004 
1005 !This section has been created automatically by the script Abilint (TD).
1006 !Do not modify the following lines by hand.
1007 #undef ABI_FUNC
1008 #define ABI_FUNC 'dft_name'
1009 !End of the abilint section
1010 
1011   implicit none
1012   integer iexch_, icorr_, igcx_, igcc_
1013   character (len=4) :: shortname_
1014   character (len=20):: longname_
1015   !
1016   if (iexch_==1.and.igcx_==0.and.igcc_==0) then
1017      shortname_ = corr(icorr_)
1018   else if (iexch_==1.and.icorr_==3.and.igcx_==1.and.igcc_==3) then
1019      shortname_ = 'BLYP'
1020   else if (iexch_==1.and.icorr_==1.and.igcx_==1.and.igcc_==0) then
1021      shortname_ = 'B88'
1022   else if (iexch_==1.and.icorr_==1.and.igcx_==1.and.igcc_==1) then
1023      shortname_ = 'BP'
1024   else if (iexch_==1.and.icorr_==4.and.igcx_==2.and.igcc_==2) then
1025      shortname_ = 'PW91'
1026   else if (iexch_==1.and.icorr_==4.and.igcx_==3.and.igcc_==4) then
1027      shortname_ = 'PBE'
1028   else if (iexch_==6.and.icorr_==4.and.igcx_==8.and.igcc_==4) then
1029      shortname_ = 'PBE0'
1030   else
1031      shortname_ = ' '
1032   end if
1033   write(longname_,'(4a5)') exc(iexch_),corr(icorr_),gradx(igcx_),gradc(igcc_)
1034   
1035   return
1036 end subroutine dft_name

functionals_pwscf/enforce_input_dft [ Functions ]

[ Top ] [ Functions ]

NAME

 enforce_input_dft

FUNCTION

 translates a string containing the exchange-correlation name
 into internal indices and force any subsequent call to set_dft_from_name
 to return without changing them

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

506   !-----------------------------------------------------------------------
507   subroutine enforce_input_dft (dft_)
508   !
509     use defs_basis, only : std_out,std_out_default
510     use flib_pwscf
511 
512 !This section has been created automatically by the script Abilint (TD).
513 !Do not modify the following lines by hand.
514 #undef ABI_FUNC
515 #define ABI_FUNC 'enforce_input_dft'
516 !End of the abilint section
517 
518     implicit none
519     ! input
520     character(len=*) :: dft_
521     ! data
522 
523      call set_dft_from_name (dft_)
524      if (dft == 'not set') then
525        call errore('enforce_input_dft','cannot fix unset dft',1)
526      end if
527      discard_input_dft = .true.
528 
529      write(std_out,'(/,5x,a)') "!!! XC functional enforced from input :"
530      call write_dft_name
531      write(std_out,'(5x,a)') "!!! Any further DFT definition will be discarded"
532      write(std_out,'(5x,a)') "!!! Please, verify this is what you really want !"
533 
534      return
535   end subroutine enforce_input_dft

functionals_pwscf/exx_is_active [ Functions ]

[ Top ] [ Functions ]

NAME

 exx_is_active

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

622   function exx_is_active ()
623 
624 
625 !This section has been created automatically by the script Abilint (TD).
626 !Do not modify the following lines by hand.
627 #undef ABI_FUNC
628 #define ABI_FUNC 'exx_is_active'
629 !End of the abilint section
630 
631      logical exx_is_active
632      exx_is_active = exx_started
633   end function exx_is_active

functionals_pwscf/get_dft_name [ Functions ]

[ Top ] [ Functions ]

NAME

 get_dft_name

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

812   !-----------------------------------------------------------------------
813   function get_dft_name ()
814 
815 
816 !This section has been created automatically by the script Abilint (TD).
817 !Do not modify the following lines by hand.
818 #undef ABI_FUNC
819 #define ABI_FUNC 'get_dft_name'
820 !End of the abilint section
821 
822      character (len=50) :: get_dft_name
823      get_dft_name = dft
824      return
825   end function get_dft_name

functionals_pwscf/get_exx_fraction [ Functions ]

[ Top ] [ Functions ]

NAME

 get_exx_fraction

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

780   !-----------------------------------------------------------------------
781   function get_exx_fraction ()
782 
783 
784 !This section has been created automatically by the script Abilint (TD).
785 !Do not modify the following lines by hand.
786 #undef ABI_FUNC
787 #define ABI_FUNC 'get_exx_fraction'
788 !End of the abilint section
789 
790      real(8):: get_exx_fraction
791      get_exx_fraction = exx_fraction
792      return
793   end function get_exx_fraction

functionals_pwscf/get_icorr [ Functions ]

[ Top ] [ Functions ]

NAME

 get_icorr

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

684   !-----------------------------------------------------------------------
685   function get_icorr ()
686 
687 
688 !This section has been created automatically by the script Abilint (TD).
689 !Do not modify the following lines by hand.
690 #undef ABI_FUNC
691 #define ABI_FUNC 'get_icorr'
692 !End of the abilint section
693 
694      integer get_icorr
695      get_icorr = icorr
696      return
697   end function get_icorr

functionals_pwscf/get_iexch [ Functions ]

[ Top ] [ Functions ]

NAME

 get_iexch

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

652   !-----------------------------------------------------------------------
653   function get_iexch ()
654 
655 
656 !This section has been created automatically by the script Abilint (TD).
657 !Do not modify the following lines by hand.
658 #undef ABI_FUNC
659 #define ABI_FUNC 'get_iexch'
660 !End of the abilint section
661 
662      integer get_iexch
663      get_iexch = iexch
664      return
665   end function get_iexch

functionals_pwscf/get_igcc [ Functions ]

[ Top ] [ Functions ]

NAME

 get_igcc

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

748   !-----------------------------------------------------------------------
749   function get_igcc ()
750 
751 
752 !This section has been created automatically by the script Abilint (TD).
753 !Do not modify the following lines by hand.
754 #undef ABI_FUNC
755 #define ABI_FUNC 'get_igcc'
756 !End of the abilint section
757 
758      integer get_igcc
759      get_igcc = igcc
760      return
761   end function get_igcc

functionals_pwscf/get_igcx [ Functions ]

[ Top ] [ Functions ]

NAME

 get_igcx

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

716   !-----------------------------------------------------------------------
717   function get_igcx ()
718 
719 
720 !This section has been created automatically by the script Abilint (TD).
721 !Do not modify the following lines by hand.
722 #undef ABI_FUNC
723 #define ABI_FUNC 'get_igcx'
724 !End of the abilint section
725 
726      integer get_igcx
727      get_igcx = igcx
728      return
729   end function get_igcx

functionals_pwscf/set_auxiliary_flags [ Functions ]

[ Top ] [ Functions ]

NAME

 set_auxiliary_flags

FUNCTION

 set logical flags describing the complexity of the xc functional
 define the fraction of exact exchange used by hybrid fuctionals

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

420   !-----------------------------------------------------------------------
421   subroutine set_auxiliary_flags
422   !-----------------------------------------------------------------------
423 
424     use flib_pwscf
425 
426 !This section has been created automatically by the script Abilint (TD).
427 !Do not modify the following lines by hand.
428 #undef ABI_FUNC
429 #define ABI_FUNC 'set_auxiliary_flags'
430 !End of the abilint section
431 
432     isgradient =  (igcx > 0) .or. (igcc > 0) 
433     ismeta     =  (igcx == 7) .or. (igcx == 6 )
434 
435     ! PBE0
436     IF ( iexch==6 .or. igcx==8 ) exx_fraction = 0.25d0
437     ! HF or OEP
438     IF ( iexch==4 .or. iexch==5 ) exx_fraction = 1.0d0
439     !B3LYP
440     IF ( matches( 'B3LP',dft ) ) exx_fraction = 0.2d0
441     ishybrid = ( exx_fraction /= 0.0d0 )
442 
443     return
444   end subroutine set_auxiliary_flags

functionals_pwscf/set_dft_from_indices [ Functions ]

[ Top ] [ Functions ]

NAME

 set_dft_from_indices

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

940   !-----------------------------------------------------------------------
941   subroutine set_dft_from_indices(iexch_,icorr_,igcx_,igcc_)
942 
943     use defs_basis, only : std_out,std_out_default
944     use flib_pwscf
945 
946 !This section has been created automatically by the script Abilint (TD).
947 !Do not modify the following lines by hand.
948 #undef ABI_FUNC
949 #define ABI_FUNC 'set_dft_from_indices'
950 !End of the abilint section
951 
952     implicit none
953      integer :: iexch_, icorr_, igcx_, igcc_
954      if ( discard_input_dft ) return
955      if (iexch == notset) iexch = iexch_
956      if (iexch /= iexch_) then
957         write(std_out,*) iexch, iexch_
958         call errore('set_dft',' conflicting values for iexch',1)
959      end if
960      if (icorr == notset) icorr = icorr_
961      if (icorr /= icorr_) then
962         write(std_out,*) icorr, icorr_
963         call errore('set_dft',' conflicting values for icorr',1)
964      end if
965      if (igcx  == notset) igcx = igcx_
966      if (igcx /= igcx_) then
967         write(std_out,*) igcx, igcx_
968         call errore('set_dft',' conflicting values for igcx',1)
969      end if
970      if (igcc  == notset) igcc = igcc_
971      if (igcc /= igcc_) then
972         write(std_out,*) igcc, igcc_
973         call errore('set_dft',' conflicting values for igcc',1)
974      end if
975      dft = exc (iexch) //'-'//corr (icorr) //'-'//gradx (igcx) //'-' &
976            &//gradc (igcc)
977      ! write(std_out,'(a)') dft
978      call set_auxiliary_flags
979      return
980   end subroutine set_dft_from_indices

functionals_pwscf/set_dft_from_name [ Functions ]

[ Top ] [ Functions ]

NAME

 set_dft_from_name

FUNCTION

 translates a string containing the exchange-correlation name
 into internal indices iexch, icorr, igcx, igcc

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

215   !-----------------------------------------------------------------------
216   subroutine set_dft_from_name( dft_ )
217   !-----------------------------------------------------------------------
218 
219     use flib_pwscf
220 
221 !This section has been created automatically by the script Abilint (TD).
222 !Do not modify the following lines by hand.
223 #undef ABI_FUNC
224 #define ABI_FUNC 'set_dft_from_name'
225 !End of the abilint section
226 
227     implicit none
228     ! input
229     character(len=*)               :: dft_
230     ! local
231     integer :: len, l, i
232     character (len=50):: dftout
233     !
234     !
235     ! if 
236     !
237     if ( discard_input_dft ) return
238     !
239     ! convert to uppercase
240     len = len_trim(dft_)
241     dftout = ' '
242     do l = 1, len
243        dftout (l:l) = capital (dft_(l:l) )
244     enddo
245 
246     !  exchange
247     iexch = notset
248     do i = 0, nxc
249        if (matches (exc (i), dftout) ) then
250          call set_dft_value (iexch, i)
251        end if
252     enddo
253 
254     !  correlation
255     icorr = notset
256     do i = 0, ncc
257        if (matches (corr (i), dftout) ) then
258          call set_dft_value (icorr, i)
259        end if
260     enddo
261 
262     !  gradient correction, exchange
263     igcx = notset
264     do i = 0, ngcx
265        if (matches (gradx (i), dftout) ) then
266          call set_dft_value (igcx, i)
267        end if
268     enddo
269 
270     !  gradient correction, correlation
271     igcc = notset
272     do i = 0, ngcc
273        if (matches (gradc (i), dftout) ) then
274          call set_dft_value (igcc, i)
275        end if
276     enddo
277 
278     ! special case : BLYP => B88 for gradient correction on exchange
279     if (matches ('BLYP', dftout) ) then
280       call set_dft_value (igcx, 1)
281     end if
282 
283     ! special case : revPBE
284     if (matches ('REVPBE', dftout) ) then
285        call set_dft_value (icorr,4)
286        call set_dft_value (igcx, 4)
287        call set_dft_value (igcc, 4)
288     else if (matches('RPBE',dftout)) then
289          call errore('set_dft_from_name', &
290      &   'RPBE (Hammer-Hansen-Norskov) not implemented (revPBE is)',1)
291    else if (matches ('PBE0', dftout) ) then
292     ! special case : PBE0
293        call set_dft_value (iexch,6)
294        call set_dft_value (icorr,4)
295        call set_dft_value (igcx, 8)
296        call set_dft_value (igcc, 4)
297    else if (matches ('PBE', dftout) ) then
298     ! special case : PBE
299        call set_dft_value (icorr,4)
300        call set_dft_value (igcx, 3)
301        call set_dft_value (igcc, 4)
302    endif
303 
304     if (matches ('PBC', dftout) ) then
305     ! special case : PBC  = PW + PBC 
306        call set_dft_value (icorr,4)
307        call set_dft_value (igcc, 4)
308     endif
309 
310     ! special case : BP = B88 + P86
311     if (matches ('BP', dftout) ) then
312        call set_dft_value (igcx, 1)
313        call set_dft_value (igcc, 1)
314     endif
315 
316     ! special case : PW91 = GGX + GGC
317     if (matches ('PW91', dftout) ) then
318        call set_dft_value (igcx, 2)
319        call set_dft_value (igcc, 2)
320     endif
321 
322     ! special case : HCTH already contains LDA exchange and correlation
323 
324     if (matches('HCTH',dftout)) then
325        call set_dft_value(iexch,0)
326        call set_dft_value(icorr,0)
327     end if
328 
329     ! special case : OPTX already contains LDA exchange
330      
331     if (matches('OPTX',dftout)) then
332        call set_dft_value(iexch,0)
333     end if
334 
335     ! special case : OLYP = OPTX + LYP
336 
337     if (matches('OLYP',dftout)) then
338        call set_dft_value(iexch,0)
339        call set_dft_value(icorr,3)
340        call set_dft_value(igcx,6)
341        call set_dft_value(igcc,3)
342     end if
343     !
344     ! ... special case : TPSS meta-GGA Exc
345     !
346     IF ( matches( 'TPSS', dftout ) ) THEN
347        !
348        CALL set_dft_value( iexch, 1 )
349        CALL set_dft_value( icorr, 4 )
350        CALL set_dft_value( igcx,  7 )
351        CALL set_dft_value( igcc,  6 )
352        !
353     END IF
354     !
355     ! ... special cases : OEP and HF need not GC part (nor LDA...)
356     !                     and include no correlation by default
357     !
358     IF ( matches( 'OEP', dftout ) .OR. matches( 'HF', dftout )) THEN
359        !
360        CALL set_dft_value( igcx,  0 )
361        if (icorr == notset) then
362          call set_dft_value (icorr, 0)
363        end if
364        !
365     END IF
366 
367 
368     if (igcx == 6) &
369          call errore('set_dft_from_name','OPTX untested! please test',-igcx)
370     ! Default value: Slater exchange
371     if (iexch == notset) then
372       call set_dft_value (iexch, 1)
373     end if
374 
375     ! Default value: Perdew-Zunger correlation
376     if (icorr == notset) then
377       call set_dft_value (icorr, 1)
378     end if
379 
380     ! Default value: no gradient correction on exchange
381     if (igcx == notset) then
382       call set_dft_value (igcx, 0)
383     end if
384 
385     ! Default value: no gradient correction on correlation
386     if (igcc == notset) then
387       call set_dft_value (igcc, 0)
388     end if
389 
390     dft = dftout
391 
392     dftout = exc (iexch) //'-'//corr (icorr) //'-'//gradx (igcx) //'-' &
393          &//gradc (igcc)
394 
395     call set_auxiliary_flags
396 
397     return
398   end subroutine set_dft_from_name

functionals_pwscf/set_dft_value [ Functions ]

[ Top ] [ Functions ]

NAME

 set_dft_value

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

463   !-----------------------------------------------------------------------
464   subroutine set_dft_value (m, i)
465   !-----------------------------------------------------------------------
466     use flib_pwscf
467 
468 !This section has been created automatically by the script Abilint (TD).
469 !Do not modify the following lines by hand.
470 #undef ABI_FUNC
471 #define ABI_FUNC 'set_dft_value'
472 !End of the abilint section
473 
474     implicit none
475     integer :: m, i
476     ! local
477 
478     if ( m /= notset .and. m /= i) &
479          call errore ('set_dft_value', 'two conflicting matching values', 1)
480     m = i
481     return
482 
483   end subroutine set_dft_value

functionals_pwscf/start_exx [ Functions ]

[ Top ] [ Functions ]

NAME

 start_exx

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

555   subroutine start_exx 
556 
557     use flib_pwscf
558 
559 !This section has been created automatically by the script Abilint (TD).
560 !Do not modify the following lines by hand.
561 #undef ABI_FUNC
562 #define ABI_FUNC 'start_exx'
563 !End of the abilint section
564 
565      if (.not. ishybrid) &
566         call errore('start_exx','dft is not hybrid, wrong call',1)
567      exx_started = .true.
568   end subroutine start_exx

functionals_pwscf/stop_exx [ Functions ]

[ Top ] [ Functions ]

NAME

 stop_exx

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

588   !-----------------------------------------------------------------------
589   subroutine stop_exx 
590 
591     use flib_pwscf
592 
593 !This section has been created automatically by the script Abilint (TD).
594 !Do not modify the following lines by hand.
595 #undef ABI_FUNC
596 #define ABI_FUNC 'stop_exx'
597 !End of the abilint section
598 
599      if (.not. ishybrid) &
600         call errore('stop_exx','dft is not hybrid, wrong call',1)
601      exx_started = .false.
602   end subroutine stop_exx

functionals_pwscf/write_dft_name [ Functions ]

[ Top ] [ Functions ]

NAME

 write_dft_name

FUNCTION

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

1056 subroutine write_dft_name
1057 !-----------------------------------------------------------------------
1058    use defs_basis, only : std_out,std_out_default
1059 
1060 !This section has been created automatically by the script Abilint (TD).
1061 !Do not modify the following lines by hand.
1062 #undef ABI_FUNC
1063 #define ABI_FUNC 'write_dft_name'
1064 !End of the abilint section
1065 
1066    implicit none
1067 
1068    !write(std_out,'(5X,"Exchange-correlation      = ",A, &
1069    !     &  " (",4I1,")")') TRIM( dft ), iexch, icorr, igcx, igcc
1070 
1071    write(std_out,'(5X,a,A,a,4I1,a)') "Exchange-correlation      = ", TRIM( dft ), " (", iexch, icorr, igcx, igcc, ")"
1072    return
1073 end subroutine write_dft_name
1074 
1075 
1076 end module funct_pwscf