~albertog/libgridxc/no-globals

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
GridXC library

This directory contains, as a self-contained package, the source code
of the GridXC library, originally (as SiestaXC) part of the SIESTA
distribution. SiestaXC was coded by Jose Soler.

GridXC provides routines to calculate the exchange and correlation
energy and potential in spherical (i.e. an atom) or periodic systems,
using a variety of LDA and GGA functionals, as well as the van der
Waals DFT functionals of Dion et al (PRL 92, 246401 (2004)), Lee et al
(PRB 82, 081101 (2010)), Klimes et al (JPCM 22, 022201 (2009)), and
Vydrov and VanVoorhis (JCP 133, 244103 (2010)) implemented as
described by Roman-Perez and Soler (PRL 103, 096102 (2009))

See src/gridxc.F90 for how to call the GridXC library routines

To compile the library:

* Create a building directory at the top level. For example:

  mkdir Gfortran
  
* Create a fortran.mk file along the lines of the sample provided in
  the 'extra' directory and put it in the building directory.

*  Type, from the building directory

      sh ../src/config.sh

* Type

      make

  then, optionally:

      make PREFIX=/path/to/installation install

* For MPI operation:

      make clean
      make FC=mpif90 WITH_MPI=1 
      make PREFIX=/path/to/installation install

  assuming that your MPI installation includes a mpif90 wrapper compiler.
  This is the easiest option. If it does not, you will have to define
  the MPI_INCFLAGS variable in the fortran.mk file, and possibly other things.

  (it is suggested to install two versions of gridxc, serial and parallel)

* To include libxc support, define the LIBXC_ROOT variable in the fortran.mk
  file pointing to the top of your libxc installation. You need a libxc.mk
  file there, like that in the extra directory. If you cannot place it there,
  define the variable LIBXC_MK_FILE_DIR to point to the directory containing
  a copy of this file.

To use GridXC in your program:
   
*) Provide handlers for several routines which are called from internal modules
   in GridXC. A simple version is in extra/handlers.f90.

*) Include in your makefile $(GRIDXC_ROOT)/gridxc.mk, where GRIDXC_ROOT points to
   the root of your installation of libGridXC. This will define the symbols:
   
     $(GRIDXC_INCFLAGS)
     $(GRIDXC_LIBS)

   that can be used to have the compiler search the right places for
   the appropriate modules and libraries.  If any module name
   conflicts with your main program you will have to edit and change
   the conflicting module names in either your program (or tell us, to try to
   fix the GridXC library...)


   Alberto Garcia
   albertog@icmab.es