Xc functl module
From OctopusWiki
Contents |
Introduction
Types
xc_functl_type
integer :: family integer :: id integer :: spin_channels integer(POINTER_SIZE) :: conf integer(POINTER_SIZE) :: info
The integer family may take one of the four following families:
- XC_FAMILY_LDA = 1 - For LDA functionals.
- XC_FAMILY_GGA = 2 - For GGA functionals.
- XC_FAMILY_MGGA = 3 - For MGGA functionals.
- XC_FAMILY_OEP = 4 - For OEP functionals (i.e. orbital dependent functionals).
This value is set in either the xc_functl_init_exchange and xc_functl_init_correlation, depending on the functional requested, read from the input file, and which in turns sets the id integer identifier.
The integer id is the identifier for the functional. Note that it does not fully identify the exchange and correlation functional - SIC corrections can be added to, for example, one LDA functional. This possibility is handled in the xc module. The values that this variable can take are defined in libxc.
The spin_channels integer may be one, in case the calculation is of spin-unpolarized type (i.e. restricted to paired electrons in closed shells), or two, in case the calculation is spin-polarized, or it is a two-spinors like calculation.
The integer(POINTER_SIZE), conf, and info are the pointers needed to use the subroutines in the libxc module.
Subroutines
xc_functl_init_exchange
type(xc_functl_type), intent(out) :: functl integer, intent(in) :: spin_channels
This subroutine initializes one xc_functl_type structure (argument functl), so that it holds information about one exchange functional. Its only input is spin_channels - which is used to fill in functl%spin_channels, whereas the rest of the needed information is obtained through the input file.
The input file variable XFunctional is read, and used to fill in functl%id. According to its value functl%family is then set by the code. The values given in the input file for XFunctional must then be any of the accepted values for functl%id - in the exchange case. Some mnemonic variables are provided in the SHARE/octopus/variables directory.
Besides filling the xc_functl_type structure functl, the main task of this subroutine is to call either xc_lda_init, xc_gga_init or xc_mgga_init in module libxc.
xc_functl_init_correlation
type(xc_functl_type), intent(out) :: functl integer, intent(in) :: spin_channels
This subroutine initializes one xc_functl_type structure (argument functl), so that it holds information about one correlation functional. Its only input is spin_channels - which is used to fill in functl%spin_channels, whereas the rest of the needed information is obtained through the input file.
The input file variable CFunctional is read, and used to fill in functl%id. According to its value functl%family is then set by the code. The values given in the input file for CFunctional must then be any of the accepted values for functl%id - in the correlation case. Some mnemonic variables are provided in the SHARE/octopus/variables directory.
Besides filling the xc_functl_type structure functl, the main task of this subroutine is to call either xc_lda_init, xc_gga_init, or xc_mgga_init in libxc.
xc_functl_write_info
type(xc_functl_type), intent(in) :: functl integer, intent(in) :: iunit
It outputs to the file opened in unit iunit information about the functional initialized in functl.
xc_functl_end
type(xc_functl_type), intent(inout) :: functl
This subroutine does the necessary cleaning of a xc_fucntl_type variable that is not going to be used any more.

