Skip to content

Commit

Permalink
roll back to libxc 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziyang HU committed Jan 8, 2022
1 parent 50131de commit 6d8d37b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
18 changes: 3 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Prerequisites

* Python3

* LibXC library with f90 interface (tested with version 5.1.6, version 4.x does
* LibXC library with f90 interface (tested with version 4.3.4, version 5.x does
not work due to inteface changes in LibXC)


Expand All @@ -32,15 +32,11 @@ Building the code

Follow the usual CMake build workflow:

* Configure the project, specify your compiler (e.g. ``gfortran``, ``ifort``, etc), the install
* Configure the project, specify your compiler (e.g. ``gfortran``), the install
location (e.g. ``$HOME/opt/skprogs``) and the build directory
(e.g. ``_build``)::

FC=gfortran cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/skprogs -DCMAKE_Fortran_FLAGS=-fopenmp -B _build .

or::

FC=ifort cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/skprogs -DCMAKE_Fortran_FLAGS=-qopenmp -B _build .
FC=gfortran cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/skprogs -B _build .

If libXC is installed in a non-standard location, you may need to specify
either the ``CMAKE_PREFIX_PATH`` environment variable (if libXC was built with
Expand All @@ -51,18 +47,10 @@ Follow the usual CMake build workflow:
PKG_CONFIG_PATH=FOLDER_WITH_LIBXC_PC_FILES FC=gfortran cmake [...]

or::

CMAKE_PREFIX_PATH=YOUR_LIBXC_INSTALL_FOLDER FC=ifort cmake [...]
PKG_CONFIG_PATH=FOLDER_WITH_LIBXC_PC_FILES FC=ifort cmake [...]


* If the configuration was successful, build the code ::

cmake --build _build -- -j


* If the build was successful, install the code ::

cmake --install _build
Expand Down
16 changes: 5 additions & 11 deletions slateratom/lib/dft.f90
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ subroutine density_grid(p,max_l,num_alpha,poly_order,alpha,num_mesh_points,&
real(dp) :: rhotot,rhodiff,drhotot,ddrhotot,drhodiff,ddrhodiff
integer :: ii,jj,kk,ll,mm,oo
integer(c_size_t) :: nn
!type(xc_f90_pointer_t) :: xcfunc_x, xcfunc_c, xcinfo
type(xc_f90_func_t) :: xcfunc_x, xcfunc_c
type(xc_f90_func_info_t) :: xcinfo
type(xc_f90_pointer_t) :: xcfunc_x, xcfunc_c, xcinfo
real(dp), allocatable :: tmprho(:,:), ex(:), ec(:), vx(:,:), vc(:,:)
real(dp), allocatable :: tmpsigma(:,:), vxsigma(:,:), vcsigma(:,:)
real(dp), allocatable :: tmpv(:), tmpv2(:)
Expand All @@ -79,15 +77,11 @@ subroutine density_grid(p,max_l,num_alpha,poly_order,alpha,num_mesh_points,&

if (xcnr==0) return
if (xcnr == 2) then
call xc_f90_func_init(xcfunc_x, XC_LDA_X, XC_POLARIZED)
xcinfo = xc_f90_func_get_info(xcfunc_x)
call xc_f90_func_init(xcfunc_c, XC_LDA_C_PW, XC_POLARIZED)
xcinfo = xc_f90_func_get_info(xcfunc_x)
call xc_f90_func_init(xcfunc_x, xcinfo, XC_LDA_X, XC_POLARIZED)
call xc_f90_func_init(xcfunc_c, xcinfo, XC_LDA_C_PW, XC_POLARIZED)
elseif (xcnr == 3) then
call xc_f90_func_init(xcfunc_x, XC_GGA_X_PBE, XC_POLARIZED)
xcinfo = xc_f90_func_get_info(xcfunc_x)
call xc_f90_func_init(xcfunc_c, XC_GGA_C_PBE, XC_POLARIZED)
xcinfo = xc_f90_func_get_info(xcfunc_x)
call xc_f90_func_init(xcfunc_x, xcinfo, XC_GGA_X_PBE, XC_POLARIZED)
call xc_f90_func_init(xcfunc_c, xcinfo, XC_GGA_C_PBE, XC_POLARIZED)
end if

do ii=1,num_mesh_points
Expand Down

0 comments on commit 6d8d37b

Please sign in to comment.