--- /local/caliste/abinit-6.0.0-caliste/src/10_defs/defs_basis.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/10_defs/defs_basis.F90	2010-01-19 17:33:56.000000000 +0100
@@ -24,7 +24,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 module defs_basis
--- /local/caliste/abinit-6.0.0-caliste/src/10_defs/defs_datatypes.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/10_defs/defs_datatypes.F90	2010-01-19 17:33:56.000000000 +0100
@@ -74,10 +74,10 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
-#include "abi_common.h"
+!#include "abi_common.h"
 
 module defs_datatypes
 
@@ -181,35 +181,35 @@
   real(dp) :: tphysel              ! Physical temperature of electrons.
   real(dp) :: tsmear               ! Temperature of smearing.
 
-  integer,pointer :: istwfk(:)   SET2NULL
+  integer,pointer :: istwfk(:)   
   ! istwfk(nkpt)
   ! Storage mode at each k point.
 
-  integer,pointer :: nband(:)  SET2NULL
+  integer,pointer :: nband(:)  
   ! nband(nkpt*nsppol)
   ! Number of bands at each k point and spin-polarisation.
 
-  integer,pointer :: npwarr(:)   SET2NULL
+  integer,pointer :: npwarr(:)   
   ! npwarr(nkpt)
   ! Number of plane waves at each k point.
 
-  real(dp),pointer :: kptns(:,:)  SET2NULL
+  real(dp),pointer :: kptns(:,:)  
   ! kptns(3,nkpt)
   ! k-point vectors.
 
-  real(dp),pointer :: eig(:,:,:)   SET2NULL
+  real(dp),pointer :: eig(:,:,:)   
   ! eig(mband,nkpt,nsppol)
   ! Eigenvalues of each band.
 
-  real(dp),pointer :: occ(:,:,:)   SET2NULL
+  real(dp),pointer :: occ(:,:,:)   
   ! occ(mband,nkpt,nsppol)
   ! occupation of each band.
 
-  real(dp),pointer :: doccde(:,:,:)   SET2NULL
+  real(dp),pointer :: doccde(:,:,:)   
   ! doccde(mband,nkpt,nsppol)
   ! derivative of the occupation of each band wrt energy (needed for RF).
 
-  real(dp),pointer :: wtk(:)  SET2NULL
+  real(dp),pointer :: wtk(:)  
   ! wtk(nkpt)
   ! weight of each k point, normalized to one.
 
@@ -648,19 +648,19 @@
 
 ! Integer arrays
 
-  integer, pointer :: atindx(:)    SET2NULL
+  integer, pointer :: atindx(:)    
    ! atindx(natom)
    ! index table for atoms (see scfcv.f)
 
-  integer, pointer :: atindx1(:)   SET2NULL
+  integer, pointer :: atindx1(:)   
    ! atindx1(natom)
    ! index table for atoms, inverse of atindx (see scfcv.f)
 
-  integer, pointer :: gbound(:,:)  SET2NULL
+  integer, pointer :: gbound(:,:)  
    ! gbound(2*mgfft+8,2)
    ! G sphere boundary
 
-  integer, pointer :: indlmn(:,:,:)  SET2NULL
+  integer, pointer :: indlmn(:,:,:)  
    ! indlmn(6,lmnmax,ntypat)
    ! For each type of psp,
    ! array giving l,m,n,lm,ln,spin for i=ln  (if useylm=0)
@@ -676,7 +676,7 @@
    ! G vector coordinates with respect to reciprocal lattice translations
    ! This component was taken away : CPU time problem !
 
-  integer, pointer :: nattyp(:)  SET2NULL
+  integer, pointer :: nattyp(:)  
    ! nattyp(ntypat)
    ! # of atoms of each type
 
@@ -691,12 +691,12 @@
    ! governs the choice of the algorithm for non-local operator
    ! same as dtset%nloalg
 
-  integer, pointer :: pspso(:)  SET2NULL
+  integer, pointer :: pspso(:)  
    ! pspso(ntypat)
    ! For each type of psp, 1 if no spin-orbit component is taken
    ! into account, 2 if a spin-orbit component is used
 
-  integer, pointer :: typat(:)  SET2NULL
+  integer, pointer :: typat(:)  
    ! typat(natom)
    ! type of each atom
 
@@ -707,7 +707,7 @@
 
 ! Real (real(dp)) arrays
 
-  real(dp), pointer :: ekb(:,:,:)   SET2NULL
+  real(dp), pointer :: ekb(:,:,:)   
    ! ekb(dimekb1,dimekb2,nspinor**2)
    !  ->Norm conserving : (Real) Kleinman-Bylander energies (hartree)
    !          for number of basis functions (l,n) (lnmax)
@@ -725,7 +725,7 @@
    !             in the place of dimekb1=lnmax.
    ! %ekb is spin dependent in the case of PAW calculations.
 
-  real(dp), pointer :: sij(:,:)   SET2NULL
+  real(dp), pointer :: sij(:,:)   
    ! sij(dimekb1,ntypat*usepaw) = overlap matrix for paw calculation
 
 ! real(dp), pointer :: ffnl(:,:,:,:)
@@ -747,11 +747,11 @@
   real(dp) :: kpoint(3)
    ! dimensionless k point coordinates wrt reciprocal lattice vectors. (k-dependent).
 
-  real(dp), pointer :: phkxred(:,:)  SET2NULL
+  real(dp), pointer :: phkxred(:,:)  
    ! phkxred(2,natom)
    ! phase factors exp(2 pi k.xred) (k-dependent)
 
-  real(dp), pointer :: ph1d(:,:)   SET2NULL
+  real(dp), pointer :: ph1d(:,:)   
    ! ph1d(2,3*(2*mgfft+1)*natom)
    ! 1-dim phase arrays for structure factor (see getph.f).
 
@@ -765,7 +765,7 @@
    ! local potential in real space, on the augmented fft grid
    ! This component was taken away : CPU time problem !
 
-  real(dp),pointer :: xred(:,:)  SET2NULL
+  real(dp),pointer :: xred(:,:)  
    ! xred(3,natom)
    ! reduced coordinates of atoms (dimensionless)
 
@@ -827,40 +827,40 @@
   integer :: nwvlarr(2)    ! nwvlarr(2) array holding the number of wavelets for each resolution.
 
   ! MG: nullifying the pointers renders the object undefined, maybe intent(out) somewhere?
-  integer, pointer :: istwfk(:)   !SET2NULL 
+  integer, pointer :: istwfk(:)   ! 
   ! input variable istwfk(nkpt)
 
-  integer, pointer :: lmn_size(:)   !SET2NULL
+  integer, pointer :: lmn_size(:)   !
   ! lmn_size(npsp) from psps
 
-  integer, pointer :: nband(:)      !SET2NULL
+  integer, pointer :: nband(:)      !
   ! input variable nband(nkpt*nsppol)
 
-  integer, pointer :: npwarr(:)     !SET2NULL
+  integer, pointer :: npwarr(:)     !
   ! npwarr(nkpt) array holding npw for each k point
 
-  integer, pointer :: pspcod(:)    !SET2NULL
+  integer, pointer :: pspcod(:)    !
   ! pscod(npsp) from psps
 
-  integer, pointer :: pspdat(:)   !SET2NULL
+  integer, pointer :: pspdat(:)   !
   ! psdat(npsp) from psps
 
-  integer, pointer :: pspso(:)    !SET2NULL
+  integer, pointer :: pspso(:)    !
   ! pspso(npsp) from psps
 
-  integer, pointer :: pspxc(:)    !SET2NULL
+  integer, pointer :: pspxc(:)    !
   ! pspxc(npsp) from psps
 
-  integer, pointer :: so_psp(:)   !SET2NULL
+  integer, pointer :: so_psp(:)   !
   ! input variable so_psp(npsp)
 
-  integer, pointer :: symafm(:)   !SET2NULL
+  integer, pointer :: symafm(:)   !
   ! input variable symafm(nsym)
 
-  integer, pointer :: symrel(:,:,:)    !SET2NULL
+  integer, pointer :: symrel(:,:,:)    !
   ! input variable symrel(3,3,nsym)
 
-  integer, pointer :: typat(:)    !SET2NULL
+  integer, pointer :: typat(:)    !
   ! input variable typat(natom)
 
   real(dp) :: ecut                  ! input variable
@@ -877,38 +877,38 @@
   real(dp) :: qptn(3)               ! the wavevector, in case of a perturbation
   real(dp) :: rprimd(3,3)           ! EVOLVING variables
 
-  real(dp), pointer :: kptns(:,:)   !SET2NULL
+  real(dp), pointer :: kptns(:,:)   !
   ! input variable kptns(3,nkpt)
 
-  real(dp), pointer :: occ(:)       !SET2NULL
+  real(dp), pointer :: occ(:)       !
   ! EVOLVING variable occ(bantot)
 
-  real(dp), pointer :: tnons(:,:)   !SET2NULL 
+  real(dp), pointer :: tnons(:,:)   ! 
   ! input variable tnons(3,nsym)
 
-  real(dp), pointer :: wtk(:)       !SET2NULL
+  real(dp), pointer :: wtk(:)       !
   ! weight of kpoints wtk(nkpt)
 
-  real(dp), pointer :: xred(:,:)    !SET2NULL
+  real(dp), pointer :: xred(:,:)    !
   ! EVOLVING variable xred(3,natom)
 
-  real(dp), pointer :: zionpsp(:)   ! SET2NULL
+  real(dp), pointer :: zionpsp(:)   ! 
   ! zionpsp(npsp) from psps
 
-  real(dp), pointer :: znuclpsp(:)  ! SET2NULL
+  real(dp), pointer :: znuclpsp(:)  ! 
   ! znuclpsp(npsp) from psps
   ! Note the difference between znucl and znuclpsp !
 
-  real(dp), pointer :: znucltypat(:)  !SET2NULL
+  real(dp), pointer :: znucltypat(:)  !
   ! znucltypat(ntypat) from alchemy
 
   character(len=6) :: codvsn              
   ! version of the code
 
-  character(len=132), pointer :: title(:)  !SET2NULL
+  character(len=132), pointer :: title(:)  !
   ! title(npsp) from psps
 
-  type(pawrhoij_type), pointer :: pawrhoij(:)  !SET2NULL
+  type(pawrhoij_type), pointer :: pawrhoij(:)  !
   ! EVOLVING variable, only for paw
 
 !Should make a list of supplementary infos
@@ -2286,38 +2286,38 @@
 
 ! Integer arrays
 
-  integer, pointer :: algalch(:)   SET2NULL
+  integer, pointer :: algalch(:)   
    ! algalch(ntypalch)
    ! For each type of pseudo atom, the algorithm to mix the pseudopotentials
 
-  integer, pointer :: indlmn(:,:,:)  SET2NULL
+  integer, pointer :: indlmn(:,:,:)  
    ! indlmn(6,lmnmax,ntypat)
    ! For each type of psp,
    ! array giving l,m,n,lm,ln,spin for i=ln  (if useylm=0)
    !                                or i=lmn (if useylm=1)
 
-  integer, pointer :: pspdat(:)  SET2NULL
+  integer, pointer :: pspdat(:)  
    ! pspdat(ntypat)
    ! For each type of psp, the date of psp generation, as given by the psp file
 
-  integer, pointer :: pspcod(:)  SET2NULL
+  integer, pointer :: pspcod(:)  
    ! pspcod(npsp)
    ! For each type of psp, the format -or code- of psp generation,
    !  as given by the psp file
 
-  integer, pointer :: pspso(:)  SET2NULL
+  integer, pointer :: pspso(:)  
    ! pspso(ntypat)
    ! For each type of psp, 1 if no spin-orbit component is taken
    ! into account, 2 if a spin-orbit component is used
 
-  integer, pointer :: pspxc(:)   SET2NULL
+  integer, pointer :: pspxc(:)   
    ! pspxc(ntypat)
    ! For each type of psp, the XC functional that was used to generate it,
    ! as given by the psp file
 
 ! Real (real(dp)) arrays
 
-  real(dp), pointer :: ekb(:,:)  SET2NULL
+  real(dp), pointer :: ekb(:,:)  
    ! ekb(dimekb,ntypat*(1-usepaw))
    !  ->NORM-CONSERVING PSPS ONLY:
    !    (Real) Kleinman-Bylander energies (hartree)
@@ -2329,37 +2329,37 @@
    !             dimekb=lnmax*(lnmax+1)/2
    !             in the place of dimekb=lmnmax.
 
-  real(dp), pointer :: ffspl(:,:,:,:)  SET2NULL
+  real(dp), pointer :: ffspl(:,:,:,:)  
    ! ffspl(mqgrid_ff,2,lnmax,ntypat)
    ! Gives, on the radial grid, the different non-local projectors,
    ! in both the norm-conserving case, and the PAW case
 
-  real(dp), pointer :: mixalch(:,:)  SET2NULL
+  real(dp), pointer :: mixalch(:,:)  
    ! mixalch(npspalch,ntypalch)
    ! Mixing coefficients to generate alchemical pseudo atoms
 
-  real(dp), pointer :: qgrid_ff(:)  SET2NULL
+  real(dp), pointer :: qgrid_ff(:)  
    ! qgrid_ff(mqgrid_ff)
    ! The coordinates of all the points of the radial grid for the nl form factors
 
-  real(dp), pointer :: qgrid_vl(:)  SET2NULL
+  real(dp), pointer :: qgrid_vl(:)  
    ! qgrid_vl(mqgrid_vl)
    ! The coordinates of all the points of the radial grid for the local part of psp
 
-  real(dp), pointer :: vlspl(:,:,:)  SET2NULL
+  real(dp), pointer :: vlspl(:,:,:)  
    ! vlspl(mqgrid_vl,2,ntypat)
    ! Gives, on the radial grid, the local part of each type of psp.
 
-  real(dp), pointer :: dvlspl(:,:,:)  SET2NULL
+  real(dp), pointer :: dvlspl(:,:,:)  
    ! dvlspl(mqgrid_vl,2,ntypat)
    ! Gives, on the radial grid, the first derivative of the local
    ! part of each type of psp (computed when the flag 'vlspl_recipSpace' is true).
 
-  real(dp), pointer :: xcccrc(:)  SET2NULL
+  real(dp), pointer :: xcccrc(:)  
    ! xcccrc(ntypat)
    ! Gives the maximum radius of the pseudo-core charge, for each type of psp.
 
-  real(dp), pointer :: xccc1d(:,:,:)  SET2NULL
+  real(dp), pointer :: xccc1d(:,:,:)  
    ! xccc1d(n1xccc*(1-usepaw),6,ntypat)
    ! Norm-conserving psps only
    ! The component xccc1d(n1xccc,1,ntypat) is the pseudo-core charge
@@ -2367,31 +2367,31 @@
    ! xccc1d(n1xccc,ideriv,ntypat) give the ideriv-th derivative of the
    ! pseudo-core charge with respect to the radial distance.
 
-  real(dp), pointer :: zionpsp(:)  SET2NULL
+  real(dp), pointer :: zionpsp(:)  
    ! zionpsp(npsp)
    ! For each pseudopotential, the ionic pseudo-charge
    ! (giving raise to a long-range coulomb potential)
 
-  real(dp), pointer :: ziontypat(:)  SET2NULL
+  real(dp), pointer :: ziontypat(:)  
    ! ziontypat(ntypat)
    !  For each type of atom (might be alchemy wrt psps), the ionic pseudo-charge
    ! (giving raise to a long-range coulomb potential)
 
-  real(dp), pointer :: znuclpsp(:)  SET2NULL
+  real(dp), pointer :: znuclpsp(:)  
    ! znuclpsp(npsp)
    ! The atomic number of each pseudopotential
 
-  real(dp), pointer :: znucltypat(:)  SET2NULL
+  real(dp), pointer :: znucltypat(:)  
    ! znucltypat(ntypat)
    ! The atomic number of each type of atom (might be alchemy wrt psps)
 
 ! Character arrays
 
-  character(len=fnlen), pointer :: filpsp(:)  SET2NULL
+  character(len=fnlen), pointer :: filpsp(:)  
    ! filpsp(ntypat)
    ! The filename of the pseudopotential
 
-  character(len=fnlen), pointer :: title(:)   SET2NULL
+  character(len=fnlen), pointer :: title(:)   
    ! title(ntypat)
    ! The content of first line read from the psp file
 
@@ -2807,11 +2807,11 @@
   real(dp) :: maxomega_r   ! Max frequency for spectral function.
   real(dp) :: scissor_ene  ! Scissor energy value. zero for None.
 
-  integer,pointer :: maxbnd(:)   SET2NULL
+  integer,pointer :: maxbnd(:)   
   ! maxbnd(nkcalc)
   ! Max band index considered in GW for this k-point.
 
-  integer,pointer :: minbnd(:)   SET2NULL
+  integer,pointer :: minbnd(:)   
   ! minbnd(nkcalc)
   ! Min band index considered in GW for this k-point.
 
@@ -2820,110 +2820,110 @@
   ! Diagonal matrix elements of the spectral function.
   ! Commented out, it can be calculated from the other quantities
 
-  real(dp),pointer :: degwgap(:,:)   SET2NULL
+  real(dp),pointer :: degwgap(:,:)   
   ! degwgap(nkibz,nsppol)
   ! Difference btw the QP and the KS optical gap.
 
-  real(dp),pointer :: egwgap(:,:)   SET2NULL
+  real(dp),pointer :: egwgap(:,:)   
   ! egwgap(nkibz,nsppol))
   ! QP optical gap at each k-point and spin.
 
-  real(dp),pointer :: en_qp_diago(:,:,:)   SET2NULL
+  real(dp),pointer :: en_qp_diago(:,:,:)   
   ! en_qp_diago(nbnds,nkibz,nsppol))
   ! QP energies obtained from the diagonalization of the Hermitian approximation to Sigma (QPSCGW)
 
-  real(dp),pointer :: e0(:,:,:)    SET2NULL
+  real(dp),pointer :: e0(:,:,:)    
   ! e0(nbnds,nkibz,nsppol)
   ! KS eigenvalues for each band, k-point and spin. In case of self-consistent?
 
-  real(dp),pointer :: e0gap(:,:)   SET2NULL
+  real(dp),pointer :: e0gap(:,:)   
   ! e0gap(nkibz,nsppol),
   ! KS gap at each k-point, for each spin.
 
-  real(dp),pointer :: omega_r(:)   SET2NULL
+  real(dp),pointer :: omega_r(:)   
   ! omega_r(nomega_r)
   ! real frequencies used for the self energy.
 
-  real(dp),pointer :: xkcalc(:,:)  SET2NULL
+  real(dp),pointer :: xkcalc(:,:)  
   ! xkcalc(3,nkcalc)
   ! ! TODO this should be replaced by a table (nkibz)
   ! List of calculated k-points
 
-  real(dp),pointer :: sigxme(:,:,:)  SET2NULL
+  real(dp),pointer :: sigxme(:,:,:)  
   ! sigxme(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! Diagonal matrix elements of $\Sigma_x$ i.e $\<nks|\Sigma_x|nks\>$
 
-  real(dp),pointer :: vxcme(:,:,:)  SET2NULL
+  real(dp),pointer :: vxcme(:,:,:)  
   ! vxcme(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! $\<nks|v_{xc}[n_val]|nks\>$ matrix elements of vxc (valence-only contribution).
 
-  real(dp),pointer :: vUme(:,:,:)   SET2NULL
+  real(dp),pointer :: vUme(:,:,:)   
   ! vUme(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! $\<nks|v_{U}|nks\>$ for LDA+U.
 
-  complex(dpc),pointer :: degw(:,:,:)   SET2NULL
+  complex(dpc),pointer :: degw(:,:,:)   
   ! degw(b1gw:b2gw,nkibz,nsppol))
   ! Difference between the QP and the KS energies.
 
-  complex(dpc),pointer :: dsigmee0(:,:,:)  SET2NULL
+  complex(dpc),pointer :: dsigmee0(:,:,:)  
   ! dsigmee0(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! Derivative of $\Sigma_c(E)$ calculated at the KS eigenvalue.
 
-  complex(dpc),pointer :: egw(:,:,:)  SET2NULL
+  complex(dpc),pointer :: egw(:,:,:)  
   ! degw(nbnds,nkibz,nsppol))
   ! QP energies, $\epsilon_{nks}^{QP}$.
 
-  complex(dpc),pointer :: eigvec_qp(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: eigvec_qp(:,:,:,:)   
   ! eigvec_qp(nbnds,nbnds,nkibz,nsppol))
   ! Expansion of the QP amplitude in the KS basis set.
 
-  complex(dpc),pointer :: hhartree(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: hhartree(:,:,:,:)   
   ! hhartree(b1gw:b2gw,b1gw:b2gw,nkibz,nsppol*nsig_ab)
   ! $\<nks|T+v_H+v_{loc}+v_{nl}|mks\>$
 
-  complex(dpc),pointer :: sigcme(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigcme(:,:,:,:)   
   ! sigcme(b1gw:b2gw,nkibz,nomega_r,nsppol*nsig_ab))
   ! $\<nks|\Sigma_{c}(E)|nks\>$ at each nomega_r frequency
 
-  complex(dpc),pointer :: sigmee(:,:,:)  SET2NULL
+  complex(dpc),pointer :: sigmee(:,:,:)  
   ! sigmee(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! $\Sigma_{xc}E_{KS} + (E_{QP}- E_{KS})*dSigma/dE_KS
 
-  complex(dpc),pointer :: sigcmee0(:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigcmee0(:,:,:)   
   ! sigcmee0(b1gw:b2gw,nkibz,nsppol*nsig_ab))
   ! Diagonal mat. elements of $\Sigma_c(E)$ calculated at the KS energy $E_{KS}$
 
-  complex(dpc),pointer :: sigcmesi(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigcmesi(:,:,:,:)   
   ! sigcmesi(b1gw:b2gw,nkibz,nomega_i,nsppol*nsig_ab))
   ! Matrix elements of $\Sigma_c$ along the imaginary axis.
   ! Only used in case of analytical continuation.
 
-  complex(dpc),pointer :: sigcme4sd(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigcme4sd(:,:,:,:)   
   ! sigcme4sd(b1gw:b2gw,nkibz,nomega4sd,nsppol*nsig_ab))
   ! Diagonal matrix elements of \Sigma_c around the zeroth order eigenvalue (usually KS).
 
-  complex(dpc),pointer :: sigxcme(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigxcme(:,:,:,:)   
   ! sigxme(b1gw:b2gw,nkibz,nomega_r,nsppol*nsig_ab))
   ! $\<nks|\Sigma_{xc}(E)|nks\>$ at each real frequency frequency.
 
-  complex(dpc),pointer :: sigxcmesi(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigxcmesi(:,:,:,:)   
   ! sigxcmesi(b1gw:b2gw,nkibz,nomega_i,nsppol*nsig_ab))
   ! Matrix elements of $\Sigma_{xc}$ along the imaginary axis.
   ! Only used in case of analytical continuation.
 
-  complex(dpc),pointer :: sigxcme4sd(:,:,:,:)   SET2NULL
+  complex(dpc),pointer :: sigxcme4sd(:,:,:,:)   
   ! sigxcme4sd(b1gw:b2gw,nkibz,nomega4sd,nsppol*nsig_ab))
   ! Diagonal matrix elements of \Sigma_xc for frequencies around the zeroth order eigenvalues.
 
-  complex(dpc),pointer :: ze0(:,:,:)   SET2NULL
+  complex(dpc),pointer :: ze0(:,:,:)   
   ! ze0(b1gw:b2gw,nkibz,nsppol))
   ! renormalization factor. $(1-\dfrac{\partial\Sigma_c} {\partial E_{KS}})^{-1}$
 
-  complex(dpc),pointer :: omega_i(:)  SET2NULL
+  complex(dpc),pointer :: omega_i(:)  
   ! omegasi(nomega_i)
   ! Frequencies along the imaginary axis used for the analytical continuation.
 
-  complex(dpc),pointer :: omega4sd(:,:,:,:)  SET2NULL
+  complex(dpc),pointer :: omega4sd(:,:,:,:)  
   ! omega4sd(b1gw:b2gw,nkibz,nomega4sd,nsppol).
   ! Frequencies used to evaluate the Derivative of Sigma.
 
@@ -3036,27 +3036,27 @@
   character(len=80) :: title(2)
   ! Title describing the content of the file.
 
-  integer,pointer :: gvec(:,:)   SET2NULL
+  integer,pointer :: gvec(:,:)   
   ! gvec(3,npwe)
   ! G vectors in r.l.u.
 
-  real(dp),pointer :: qibz(:,:)  SET2NULL
+  real(dp),pointer :: qibz(:,:)  
   ! qibz(3,nqibz)
   ! q-points in r.l.u.
 
-  real(dp),pointer :: qlwl(:,:)  SET2NULL
+  real(dp),pointer :: qlwl(:,:)  
   ! qlwl(3,nqlwl)
   ! q-points for the long wave-length limit treatment (r.l.u)
 
-  complex(dpc),pointer :: lwing(:,:,:)  SET2NULL
+  complex(dpc),pointer :: lwing(:,:,:)  
   ! lwing(npwe,nomega,nqlwl)
   ! Lower wings for the different q"s -->0
 
-  complex(dpc),pointer :: omega(:)   SET2NULL
+  complex(dpc),pointer :: omega(:)   
   ! omega(nomega)
   ! All frequencies calculated both along the real and the imaginary axis.
 
-  complex(dpc),pointer :: uwing(:,:,:)   SET2NULL
+  complex(dpc),pointer :: uwing(:,:,:)   
   ! uwing(npwe,nomega,nqlwl)
   ! Upper wings for the different q"s -->0
 
@@ -3099,31 +3099,31 @@
   character(len=fnlen) :: fname          ! Name of the file from which epsm1 is read.
 
 !arrays
-  integer,pointer  :: gvec(:,:)   SET2NULL 
+  integer,pointer  :: gvec(:,:)    
   ! gvec(3,npwe)
   ! G-vectors used to describe the two-point function (r.l.u.).
 
-  real(dp),pointer :: qibz(:,:)  SET2NULL
+  real(dp),pointer :: qibz(:,:)  
   ! qibz(3,nqibz)
   ! q-points in reduced coordinates
 
-  real(dp),pointer :: qlwl(:,:) SET2NULL
+  real(dp),pointer :: qlwl(:,:) 
   ! qlwl(3,nqlwl)
   ! q-points used for the long wave-length limit treatment.
 
-  complex(gwpc),pointer :: epsm1(:,:,:,:)  SET2NULL
+  complex(gwpc),pointer :: epsm1(:,:,:,:)  
   ! epsm1(npwe,npwe,nomega,nqibz)
   ! Contains the two-point function $\epsilon_{G,Gp}(q,omega)$ in frequency and reciprocal space.
 
-  complex(dpc),pointer :: lwing(:,:,:)  SET2NULL
+  complex(dpc),pointer :: lwing(:,:,:)  
   ! lwing(npwe,nomega,nqlwl)
   ! Lower wings for the different q"s -->0
 
-  complex(dpc),pointer :: omega(:)  SET2NULL
+  complex(dpc),pointer :: omega(:)  
   ! omega(nomega)
   ! Frequencies used both along the real and the imaginary axis.
 
-  complex(dpc),pointer :: uwing(:,:,:)  SET2NULL
+  complex(dpc),pointer :: uwing(:,:,:)  
   ! uwing(npwe,nomega,nqlwl)
   ! Upper wings for the different q"s -->0
 
@@ -3158,7 +3158,7 @@
 ! declared in another part of ABINIT, that might need to take into account your modification.
 
   integer :: stat = 1 !$=JPT_ISPOINTER  =1
-  complex(gwpc),pointer :: datum(:,:)  SET2NULL 
+  complex(gwpc),pointer :: datum(:,:)   
  end type Jpt_gwpc_2D
 !!***
 
@@ -3183,7 +3183,7 @@
 ! declared in another part of ABINIT, that might need to take into account your modification.
 
   integer :: stat = 1 !$=JPT_ISPOINTER  =1
-  complex(gwpc),pointer :: datum(:,:,:)  SET2NULL
+  complex(gwpc),pointer :: datum(:,:,:)  
  end type Jpt_gwpc_3D
 !!***
 
@@ -3234,7 +3234,7 @@
    ! omegatw(npwc,dm2_otq,nqibz)
    ! Plasmon pole parameters $\tilde\omega_{G Gp}(q)$.
 
-   complex(gwpc),pointer :: eigpot(:,:,:)   SET2NULL
+   complex(gwpc),pointer :: eigpot(:,:,:)   
    ! eigpot(dm_eig,dm_eig,nqibz)
    ! Eigvectors of the symmetrized inverse dielectric matrix
  end type
--- /local/caliste/abinit-6.0.0-caliste/src/10_defs/defs_parameters.F90	2010-01-19 11:58:44.000000000 +0100
+++ src/10_defs/defs_parameters.F90	2010-01-19 17:33:56.000000000 +0100
@@ -29,7 +29,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 module defs_parameters
--- /local/caliste/abinit-6.0.0-caliste/src/14_hidewrite/wrtout.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/14_hidewrite/wrtout.F90	2010-01-19 17:33:57.000000000 +0100
@@ -120,94 +120,28 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
-subroutine wrtout(unit,msg,mode_paral)
-
- use defs_basis
-
-!This section has been created automatically by the script Abilint (TD).
-!Do not modify the following lines by hand.
- use interfaces_12_hide_mpi
- use interfaces_14_hidewrite, except_this_one => wrtout
-!End of the abilint section
-
- implicit none
-
-!Arguments ------------------------------------
- integer,intent(in) :: unit
- character(len=4),intent(in) :: mode_paral
- !character(len=500),intent(inout) :: msg
- character(len=*),intent(in) :: msg
-
-!Local variables-------------------------------
- integer :: rtnpos
- character(len=7) :: tag
- character(len=len(msg)) :: my_msg
- !character(len=550) :: string
- character(len=len(msg)+50) :: string
- !Variables introduced for MPI version
- integer,save :: master=0
- integer :: ierr,me,nproc
-
-!******************************************************************
-!BEGIN EXECUTABLE SECTION
-
-!Be careful with the coding  of the parallel case ...
-
-!MG: Be careful**2, me and nproc are defined in MPI_COMM_WORLD.
-!One should pass the MPI communicator 
-
-!Determine who I am
- call xmpi_me(me)
- call xmpi_nproc(nproc,ierr)
-
-!msg is not changed therefore we can pass literal strings as well.
- my_msg = msg
-
- if( (mode_paral=='COLL') .or. (nproc==1) ) then
-
-   if(me==master) then
-     call wrtout_myproc(unit, my_msg)
-   end if
-
- elseif(mode_paral=='PERS') then
-
-   if(me<10) then
-     write(tag,'("-P-000",i1)') me
-   elseif(me<100) then
-     write(tag,'("-P-00",i2)') me
-   elseif(me<1000) then
-     write(tag,'("-P-0",i3)') me
-   elseif(me<10000) then
-     write(tag,'("-P-",i4)') me
-   else
-     tag=' ######'
-   end if
-
-   rtnpos=index(my_msg,ch10)
-   do while(rtnpos/=0)
-     write(string,'(3a)') tag, ' ', my_msg(1:rtnpos-1)
-     write(unit,'(A)') trim(string)
-     my_msg=my_msg(rtnpos+1:len(my_msg))
-     rtnpos=index(my_msg,ch10)
-   end do
-   write(string, "(3a)") tag, ' ', my_msg
-   write(unit,'(A)') trim(string)
-
- elseif(mode_paral=='INIT') then
-
-   master=unit
-
- else
-   write(string,'(7a)')ch10,&
-&   '  wrtout: ERROR -',ch10,&
-&   '  Unknown write mode: ',mode_paral,ch10,&
-&   '  Continuing anyway ...'
-   write(unit, '(A)' ) trim(string)
-
- end if
-
+subroutine wrtout(unit,message,mode_paral)
+  use defs_basis
+  implicit none
+  include 'mpif.h'
+
+  !Arguments ------------------------------------
+  integer,intent(in) :: unit
+  character(len=4),intent(in) :: mode_paral
+  character(len=500),intent(inout) :: message
+
+  integer :: ierr, iproc
+
+  if (unit == ab_out) then
+     call MPI_COMM_RANK(MPI_COMM_WORLD,iproc,ierr)
+     if (trim(mode_paral) == "COLL") then
+        if (iproc == 0) write(*, "(A)") trim(message)
+     else
+        write(*, "(I03,2x,A)") iproc, trim(message)
+     end if
+  end if
 end subroutine wrtout
 !!***
--- /local/caliste/abinit-6.0.0-caliste/src/16_hideleave/leave_new.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/16_hideleave/leave_new.F90	2010-01-19 17:33:57.000000000 +0100
@@ -96,75 +96,17 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine leave_new(mode_paral)
 
- use defs_basis
- use m_build_info
-!no_abirules
-#if defined FC_NAG
- use f90_unix
-#endif
-
-!This section has been created automatically by the script Abilint (TD).
-!Do not modify the following lines by hand.
- use interfaces_12_hide_mpi
- use interfaces_14_hidewrite
- use interfaces_16_hideleave, except_this_one => leave_new
-!End of the abilint section
-
- implicit none
-
-!Arguments ------------------------------------
- character(len=4),intent(in) :: mode_paral
-
-!Local variables-------------------------------
- character(len=500) :: msg
- integer :: gl_check_bit,my_check_bit
- integer :: ierr,me,nproc,spaceComm
-
-! **********************************************************************
-
- write(msg, '(a,a)' ) ch10,' leave_new : decision taken to exit ...'
- call wrtout(std_out,msg,'PERS')
-
-!Determine who I am
- call xmpi_me(me)
- call xmpi_nproc(nproc,ierr)
- call xmpi_world(spaceComm)
-
- if( (mode_paral=='COLL') .or. (nproc==1) ) then
-
-   call xmpi_end(ierr)
-
-!  Dump configuration before exiting
-   call dump_config()
-
-   call leave_myproc()
-
- elseif(mode_paral=='PERS') then
-
-!  Synchronize
-   call xbarrier_mpi(spaceComm,ierr)
-   write(msg,'(a)' ) ' leave_new : synchronization done...'
-   call wrtout(std_out,msg,'PERS')
-
-!  There is a problem for me
-   my_check_bit=1
-
-!  Tell it to the others
-   call xsum_mpi(my_check_bit,gl_check_bit,spaceComm,ierr)
-
-!  Finally exit
-   write(msg, '(a)' ) ' leave_new : exiting...'
-   call wrtout(std_out,msg,'PERS')
-
-   call xmpi_end(ierr)
-   call leave_myproc()
+  implicit none
 
- end if
+  !Arguments ------------------------------------
+  character(len=4),intent(in) :: mode_paral
 
+  print *,mode_paral, 'exiting...'
+  stop
 end subroutine leave_new
 !!***
--- /local/caliste/abinit-6.0.0-caliste/src/18_timing/timab.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/18_timing/timab.F90	2010-01-19 17:33:57.000000000 +0100
@@ -78,13 +78,12 @@
 #define C_LONG_LONG INTEGER*8
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine timab(nn,option,tottim)
 
  use defs_basis
- use defs_time
 
 !This section has been created automatically by the script Abilint (TD).
 !Do not modify the following lines by hand.
@@ -104,119 +103,7 @@
  integer,intent(in) :: nn,option
  !arrays
  real(dp),intent(out) :: tottim(2)
-!Local variables-------------------------------
-
- !scalars
- real(dp) :: cpu,wall
- character(len=500) :: message
- C_FLOAT :: real_time, proc_time
- C_LONG_LONG :: flops1
-#if defined HAVE_PAPI
- character*(PAPI_MAX_STR_LEN) papi_errstr
- C_INT :: retval 
- C_FLOAT :: mflops1
-#endif
-! *************************************************************************
-
-!DEBUG
-!write(6,*)' timab : enter with  nn, option, timopt',nn,option,timopt
-!if(entry==5)stop
-!ENDDEBUG
-
- if (option==5) timopt=nn
-
-!If timopt was set to zero by a call with option=5, suppress
-!all action of this routine (might as well return at this point !)
- if(timopt/=0 .and. option/=5)then
-!  
-!  Check that nn lies in sensible bounds
-   if (nn<0.or.nn>mtim) then
-     write(message, '(a,a,a,a,i6,a,i8,a)' ) ch10,&
-&     ' timab: BUG -',ch10,&
-&     '  dim mtim=',mtim,' but input nn=',nn,'.'
-     call wrtout(std_out,message,'PERS')
-     call leave_new('PERS')
-   end if
-#ifdef HAVE_PAPI
-!  ie for all active options for time  
-!  if papi analysis has been selected or for initializing papi
-!  even if papi has not been choose 
-   if (option/=3.and.(papiopt==1.or.initpapiopt==1)) then 
-     initpapiopt=0
-     call PAPIf_flops(real_time, proc_time, flops1, mflops1, retval)
-     if (retval.NE.PAPI_OK) then
-       PRINT *, 'Problem to initialize papi high level inteface'
-       call papif_perror(retval,papi_errstr,retval)
-       PRINT *, 'Error code', papi_errstr
-     end if ! DEBUG
-!    PRINT *, 'flops  = ', flops1, 'mflops= ',  mflops1
-     if (flops1 >= HUGE(flops1)) then  
-       PRINT *, 'Mflops analysis : Number of floating point instruction Overflow '
-       flops(:)=-1            
-     end if
-   end if
-#else
-   flops1 = 0
-   proc_time = zero
-   real_time = zero
-#endif
-   
-   select case (option)
-     case (0)  ! Zero out all accumulators of time and init timers
-       acctim(:,:)=0.0d0
-       tzero(:,:)=0.0d0
-       ncount(:)=0
-       flops(:)=0
-       papi_acctim(:,:)=0. 
-       papi_accflops(:)=0. 
-       papi_tzero(:,:)=0. 
-
-     case (1)  ! Initialize timab for nn
-       call timein(cpu,wall)
-       tzero(1,nn)=cpu
-       tzero(2,nn)=wall
-       flops(nn)=flops1       ! Initialize megaflops for nn
-       papi_tzero(1,nn) = proc_time
-       papi_tzero(2,nn) = real_time
-
-     case (2)  ! Accumulate time for nn
-       call timein(cpu,wall)
-       acctim(1,nn)=acctim(1,nn)+cpu -tzero(1,nn)
-       acctim(2,nn)=acctim(2,nn)+wall-tzero(2,nn)
-!      accumulate time and flops for nn Difference entre 2 calls a Papif_flops 
-       papi_acctim(1,nn)=papi_acctim(1,nn)+ proc_time - papi_tzero(1,nn)
-       papi_acctim(2,nn)=papi_acctim(2,nn)+ real_time - papi_tzero(2,nn)
-       papi_accflops(nn)=papi_accflops(nn)+ flops1- flops(nn) 
-       ncount(nn)=ncount(nn)+1
-
-     case (3) ! Now use time_accu
-       write(message, '(a,a,a,a)' ) ch10,&
-&       ' timab: BUG -',ch10,&
-&       ' option 3 not valid (use time_accu).'
-       call wrtout(std_out,message,'PERS')
-       call leave_new('PERS')
-
-     case (4) ! Return elapsed time for nn (do not accumulate)
-       call timein(cpu,wall)
-       tottim(1)=cpu-tzero(1,nn)
-       tottim(2)=wall-tzero(2,nn)
-!      return ellapsed floating point operationfor nn (do not accumulate)
-       papi_tottim(1,nn)= proc_time - papi_tzero(1,nn)
-       papi_tottim(2,nn)= real_time - papi_tzero(2,nn)
-       papi_totflops(nn)= flops1- flops(nn) 
-
-       case default
-       write(message, '(a,a,a,a,i10,a)' ) ch10,&
-&       ' timab: BUG -',ch10,&
-&       '  Input option not valid, =',option,'.'
-       call wrtout(std_out,message,'PERS')
-       call leave_new('PERS')
-   end select 
- end if
-
-!DEBUG
-!write(6,*)' timab : exit '
-!ENDDEBUG
 
+ tottim = (/ 0.0_dp, 0.0_dp /)
 end subroutine timab
 !!***
--- /local/caliste/abinit-6.0.0-caliste/src/32_util/derfc.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/32_util/derfc.F90	2010-01-19 17:33:54.000000000 +0100
@@ -35,10 +35,10 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
-subroutine derfc(derfc_yy,yy)
+subroutine derfcf(derfc_yy,yy)
 
  use defs_basis
 
@@ -86,85 +86,387 @@
   real(dp) ::  res,xden,xi,xnum,xsq,xx
 
 !******************************************************************
-!BEGIN EXECUTABLE SECTION
+  !BEGIN EXECUTABLE SECTION
 
-!DEBUG
-!write(6,*)' imsl derfc routine '
-!stop
-!ENDDEBUG
+  !DEBUG
+  !write(6,*)' imsl derfc routine '
+  !stop
+  !ENDDEBUG
+
+  xx = yy
+  isw = 1
+  !Here change the sign of xx, and keep track of it thanks to isw
+  if (xx<0.0e0_dp) then
+     isw = -1
+     xx = -xx
+  end if
+
+  done=0
+
+  !Residual value, if yy < -6.375e0_dp
+  res=2.0e0_dp
+
+  !abs(yy) < .477, evaluate approximation for erfc
+  if (xx<0.477e0_dp) then
+     !xmin is a very small number
+     if (xx<xmin) then
+        res = xx*pp(3)/qq(3)
+     else
+        xsq = xx*xx
+        xnum = pp(4)*xsq+pp(5)
+        xden = xsq+qq(4)
+        do ii = 1,3
+           xnum = xnum*xsq+pp(ii)
+           xden = xden*xsq+qq(ii)
+        end do
+        res = xx*xnum/xden
+     end if
+     if (isw==-1) res = -res
+     res = 1.0e0_dp-res
+     done=1
+  end if
+
+  !.477 < abs(yy) < 4.0 , evaluate approximation for erfc
+  if (xx<=4.0e0_dp .and. done==0 ) then
+     xsq = xx*xx
+     xnum = p1(8)*xx+p1(9)
+     xden = xx+q1(8)
+     do ii=1,7
+        xnum = xnum*xx+p1(ii)
+        xden = xden*xx+q1(ii)
+     end do
+     res = xnum/xden
+     res = res* exp(-xsq)
+     if (isw.eq.-1) res = 2.0e0_dp-res
+     done=1
+  end if
+
+  !y > 13.3e0_dp
+  if (isw > 0 .and. xx > xbig .and. done==0 ) then
+     res = 0.0e0_dp
+     done=1
+  end if
+
+  !4.0 < yy < 13.3e0_dp  .or. -6.375e0_dp < yy < -4.0
+  !evaluate minimax approximation for erfc
+  if ( ( isw > 0 .or. xx < xlarge ) .and. done==0 ) then
+     xsq = xx*xx
+     xi = 1.0e0_dp/xsq
+     xnum= p2(5)*xi+p2(6)
+     xden = xi+q2(5)
+     do ii = 1,4
+        xnum = xnum*xi+p2(ii)
+        xden = xden*xi+q2(ii)
+     end do
+     res = (sqrpi+xi*xnum/xden)/xx
+     res = res* exp(-xsq)
+     if (isw.eq.-1) res = 2.0e0_dp-res
+  end if
+
+  !All cases have been investigated
+  derfc_yy = res
+
+end subroutine derfcf
+!!***
+
+!!****f* BigDFT/derf_ab
+!! FUNCTION
+!!   Error function in double precision
+!!
+!! SOURCE
+!!
+subroutine derf_ab(derf_yy,yy)
+
+ use defs_basis
+ implicit none
+ real(dp),intent(in) :: yy
+ real(dp),intent(out) :: derf_yy
+ integer          ::  done,ii,isw
+ real(dp), parameter :: &
+       ! coefficients for 0.0 <= yy < .477
+       &  pp(5)=(/ 113.8641541510502e0_dp, 377.4852376853020e0_dp,  &
+       &           3209.377589138469e0_dp, .1857777061846032e0_dp,  &
+       &           3.161123743870566e0_dp /)
+  real(dp), parameter :: &
+       &  qq(4)=(/ 244.0246379344442e0_dp, 1282.616526077372e0_dp,  &
+       &           2844.236833439171e0_dp, 23.60129095234412e0_dp/)
+  ! coefficients for .477 <= yy <= 4.0
+  real(dp), parameter :: &
+       &  p1(9)=(/ 8.883149794388376e0_dp, 66.11919063714163e0_dp,  &
+       &           298.6351381974001e0_dp, 881.9522212417691e0_dp,  &
+       &           1712.047612634071e0_dp, 2051.078377826071e0_dp,  &
+       &           1230.339354797997e0_dp, 2.153115354744038e-8_dp, &
+       &           .5641884969886701e0_dp /)
+  real(dp), parameter :: &
+       &  q1(8)=(/ 117.6939508913125e0_dp, 537.1811018620099e0_dp,  &
+       &           1621.389574566690e0_dp, 3290.799235733460e0_dp,  &
+       &           4362.619090143247e0_dp, 3439.367674143722e0_dp,  &
+       &           1230.339354803749e0_dp, 15.74492611070983e0_dp/)
+  ! coefficients for 4.0 < y,
+  real(dp), parameter :: &
+       &  p2(6)=(/ -3.603448999498044e-01_dp, -1.257817261112292e-01_dp,   &
+       &           -1.608378514874228e-02_dp, -6.587491615298378e-04_dp,   &
+       &           -1.631538713730210e-02_dp, -3.053266349612323e-01_dp/)
+  real(dp), parameter :: &
+       &  q2(5)=(/ 1.872952849923460e0_dp   , 5.279051029514284e-01_dp,    &
+       &           6.051834131244132e-02_dp , 2.335204976268692e-03_dp,    &
+       &           2.568520192289822e0_dp /)
+  real(dp), parameter :: &
+       &  sqrpi=.5641895835477563e0_dp, xbig=13.3e0_dp, xlarge=6.375e0_dp, xmin=1.0e-10_dp
+  real(dp) ::  res,xden,xi,xnum,xsq,xx
 
  xx = yy
  isw = 1
 !Here change the sign of xx, and keep track of it thanks to isw
  if (xx<0.0e0_dp) then
-   isw = -1
-   xx = -xx
+  isw = -1
+  xx = -xx
  end if
 
  done=0
 
 !Residual value, if yy < -6.375e0_dp
- res=2.0e0_dp
+ res=-1.0e0_dp
 
 !abs(yy) < .477, evaluate approximation for erfc
  if (xx<0.477e0_dp) then
-!  xmin is a very small number
-   if (xx<xmin) then
-     res = xx*pp(3)/qq(3)
-   else
-     xsq = xx*xx
-     xnum = pp(4)*xsq+pp(5)
-     xden = xsq+qq(4)
-     do ii = 1,3
-       xnum = xnum*xsq+pp(ii)
-       xden = xden*xsq+qq(ii)
-     end do
-     res = xx*xnum/xden
-   end if
-   if (isw==-1) res = -res
-   res = 1.0e0_dp-res
-   done=1
+! xmin is a very small number
+  if (xx<xmin) then
+   res = xx*pp(3)/qq(3)
+  else
+   xsq = xx*xx
+   xnum = pp(4)*xsq+pp(5)
+   xden = xsq+qq(4)
+   do ii = 1,3
+    xnum = xnum*xsq+pp(ii)
+    xden = xden*xsq+qq(ii)
+   end do
+   res = xx*xnum/xden
+  end if
+  if (isw==-1) res = -res
+  done=1
  end if
 
 !.477 < abs(yy) < 4.0 , evaluate approximation for erfc
  if (xx<=4.0e0_dp .and. done==0 ) then
-   xsq = xx*xx
-   xnum = p1(8)*xx+p1(9)
-   xden = xx+q1(8)
-   do ii=1,7
-     xnum = xnum*xx+p1(ii)
-     xden = xden*xx+q1(ii)
-   end do
-   res = xnum/xden
-   res = res* exp(-xsq)
-   if (isw.eq.-1) res = 2.0e0_dp-res
-   done=1
+  xsq = xx*xx
+  xnum = p1(8)*xx+p1(9)
+  xden = xx+q1(8)
+  do ii=1,7
+   xnum = xnum*xx+p1(ii)
+   xden = xden*xx+q1(ii)
+  end do
+  res = xnum/xden
+  res = res* exp(-xsq)
+  if (isw.eq.-1) then
+     res = res-1.0e0_dp
+  else
+     res=1.0e0_dp-res
+  end if
+  done=1
  end if
 
 !y > 13.3e0_dp
  if (isw > 0 .and. xx > xbig .and. done==0 ) then
-   res = 0.0e0_dp
-   done=1
+  res = 1.0e0_dp
+  done=1
  end if
 
 !4.0 < yy < 13.3e0_dp  .or. -6.375e0_dp < yy < -4.0
 !evaluate minimax approximation for erfc
  if ( ( isw > 0 .or. xx < xlarge ) .and. done==0 ) then
-   xsq = xx*xx
-   xi = 1.0e0_dp/xsq
-   xnum= p2(5)*xi+p2(6)
-   xden = xi+q2(5)
-   do ii = 1,4
-     xnum = xnum*xi+p2(ii)
-     xden = xden*xi+q2(ii)
-   end do
-   res = (sqrpi+xi*xnum/xden)/xx
-   res = res* exp(-xsq)
-   if (isw.eq.-1) res = 2.0e0_dp-res
+  xsq = xx*xx
+  xi = 1.0e0_dp/xsq
+  xnum= p2(5)*xi+p2(6)
+  xden = xi+q2(5)
+  do ii = 1,4
+   xnum = xnum*xi+p2(ii)
+   xden = xden*xi+q2(ii)
+  end do
+  res = (sqrpi+xi*xnum/xden)/xx
+  res = res* exp(-xsq)
+  if (isw.eq.-1) then
+     res = res-1.0e0_dp
+  else
+     res=1.0e0_dp-res
+  end if
  end if
 
 !All cases have been investigated
- derfc_yy = res
+ derf_yy = res
 
-end subroutine derfc
+end subroutine derf_ab
 !!***
--- /local/caliste/abinit-6.0.0-caliste/src/32_util/mati3inv.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/32_util/mati3inv.F90	2010-01-19 17:33:53.000000000 +0100
@@ -42,7 +42,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine mati3inv(mm,mit)
--- /local/caliste/abinit-6.0.0-caliste/src/32_util/matr3inv.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/32_util/matr3inv.F90	2010-01-19 17:33:53.000000000 +0100
@@ -35,7 +35,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine matr3inv(aa,ait)
--- /local/caliste/abinit-6.0.0-caliste/src/32_util/matrginv.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/32_util/matrginv.F90	2010-01-19 17:33:53.000000000 +0100
@@ -33,7 +33,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine matrginv(a,lda,n)
--- /local/caliste/abinit-6.0.0-caliste/src/32_util/wrap2_pmhalf.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/32_util/wrap2_pmhalf.F90	2010-01-19 17:33:54.000000000 +0100
@@ -33,7 +33,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine wrap2_pmhalf(num,red,shift)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/bldgrpaf.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/bldgrpaf.F90	2010-01-19 17:33:54.000000000 +0100
@@ -42,7 +42,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine bldgrpaf(msym,nogenaf,nsym,symafm,symrel,symrel_magn,tnons)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/bldgrp.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/bldgrp.F90	2010-01-19 17:33:55.000000000 +0100
@@ -44,7 +44,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine bldgrp(msym,nogen,nsym,symafm,symrel,tnons)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/bonds_lgth_angles.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/bonds_lgth_angles.F90	2010-01-19 17:33:55.000000000 +0100
@@ -43,7 +43,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine bonds_lgth_angles(coordn,fnameabo_app_geo,natom,ntypat,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/chkdilatmx.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/42_geometry/chkdilatmx.F90	2010-01-19 17:33:55.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine chkdilatmx(dilatmx,rprimd,rprimd_orig)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/chkgrp.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/chkgrp.F90	2010-01-19 17:33:55.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine chkgrp(nsym,symafm,symrel)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/chkorthsy.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/42_geometry/chkorthsy.F90	2010-01-19 17:33:55.000000000 +0100
@@ -41,7 +41,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine chkorthsy(gprimd,iout,nsym,rmet,rprimd,symrel)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/chkprimit.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/chkprimit.F90	2010-01-19 17:33:55.000000000 +0100
@@ -40,7 +40,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine chkprimit(chkprim,multi,nsym,symafm,symrel)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/gensymshub4.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/gensymshub4.F90	2010-01-19 17:33:55.000000000 +0100
@@ -45,7 +45,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine gensymshub4(genafm,msym,nsym,symafm,symrel,tnons)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/gensymshub.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/gensymshub.F90	2010-01-19 17:33:55.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine gensymshub(genafm,spgroup,spgroupma,shubnikov)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/gensymspgr.F90	2010-01-19 11:58:49.000000000 +0100
+++ src/42_geometry/gensymspgr.F90	2010-01-19 17:33:55.000000000 +0100
@@ -53,7 +53,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine gensymspgr(brvltt,msym,nsym,shubnikov,spgaxor,spgorig,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/getptgroupma.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/42_geometry/getptgroupma.F90	2010-01-19 17:33:55.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine getptgroupma(ptgroup,ptgroupha,ptgroupma)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/getspinrot.F90	2010-01-19 11:58:44.000000000 +0100
+++ src/42_geometry/getspinrot.F90	2010-01-19 17:33:55.000000000 +0100
@@ -42,7 +42,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine getspinrot(rprimd,spinrot,symrel_conv)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/gridgcart.F90	2010-01-19 11:58:49.000000000 +0100
+++ src/42_geometry/gridgcart.F90	2010-01-19 17:33:55.000000000 +0100
@@ -63,7 +63,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine gridgcart(gcart,gprimd,ngfft)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/holocell.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/holocell.F90	2010-01-19 17:33:55.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine holocell(cell_base,foundc,iholohedry)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/metric.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/metric.F90	2010-01-19 17:33:55.000000000 +0100
@@ -53,7 +53,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine metric(gmet,gprimd,iout,rmet,rprimd,ucvol)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/mkrdim.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/mkrdim.F90	2010-01-19 17:33:55.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine mkrdim(acell,rprim,rprimd)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/prtspgroup.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/prtspgroup.F90	2010-01-19 17:33:55.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine prtspgroup(bravais,genafm,iout,jdtset,ptgroupma,spgroup)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/ptgmadata.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/42_geometry/ptgmadata.F90	2010-01-19 17:33:55.000000000 +0100
@@ -34,7 +34,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine ptgmadata(ptgroupma,ptgrpmasb)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/smallprim.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/smallprim.F90	2010-01-19 17:33:55.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine smallprim(metmin,minim,rprimd)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/spgdata.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/spgdata.F90	2010-01-19 17:33:55.000000000 +0100
@@ -45,7 +45,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine spgdata(brvsb,intsb,intsbl,ptintsb,ptschsb,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/strainsym.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/strainsym.F90	2010-01-19 17:33:55.000000000 +0100
@@ -34,7 +34,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine strainsym(nsym,rprimd0,rprimd,rprimd_symm,symrel)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/strconv.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/strconv.F90	2010-01-19 17:33:55.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine strconv(frac,gprimd,cart)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/stresssym.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/stresssym.F90	2010-01-19 17:33:55.000000000 +0100
@@ -37,7 +37,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine stresssym(gprimd,nsym,stress,sym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/sym2cart.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/42_geometry/sym2cart.F90	2010-01-19 17:33:55.000000000 +0100
@@ -32,7 +32,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine sym2cart(gprimd,nsym,rprimd,symrel,symcart)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symanal.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symanal.F90	2010-01-19 17:33:55.000000000 +0100
@@ -47,7 +47,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symanal(bravais,chkprim,genafm,msym,nsym,ptgroupma,rprimd,spgroup,symafm,symrel,tnons,tolsym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symatm.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/symatm.F90	2010-01-19 17:33:55.000000000 +0100
@@ -69,7 +69,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symatm(indsym,natom,nsym,symrec,tnons,tolsym,typat,xred)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symaxes.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/symaxes.F90	2010-01-19 17:33:56.000000000 +0100
@@ -115,7 +115,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symaxes(center,iholohedry,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symbrav.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symbrav.F90	2010-01-19 17:33:56.000000000 +0100
@@ -40,7 +40,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symbrav(bravais,msym,nsym,ptgroup,rprimd,symrel,tolsym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symchk.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/symchk.F90	2010-01-19 17:33:56.000000000 +0100
@@ -42,7 +42,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symchk(difmin,eatom,natom,tratom,transl,trtypat,typat,xred)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symdet.F90	2010-01-19 11:58:49.000000000 +0100
+++ src/42_geometry/symdet.F90	2010-01-19 17:33:56.000000000 +0100
@@ -30,7 +30,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symdet(determinant,nsym,sym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symfind.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symfind.F90	2010-01-19 17:33:56.000000000 +0100
@@ -57,7 +57,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
  subroutine symfind(berryopt,efield,gprimd,jellslab,msym,natom,noncoll,nptsym,nsym,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symlatt.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symlatt.F90	2010-01-19 17:33:54.000000000 +0100
@@ -66,7 +66,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symlatt(bravais,msym,nptsym,ptsymrel,rprimd,tolsym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symlist_bcc.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symlist_bcc.F90	2010-01-19 17:33:56.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symlist_bcc(additional_info,nsym,n_axes,spgroup)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symlist_fcc.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symlist_fcc.F90	2010-01-19 17:33:56.000000000 +0100
@@ -37,7 +37,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symlist_fcc(nsym,n_axes,spgroup)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symlist_others.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/42_geometry/symlist_others.F90	2010-01-19 17:33:56.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symlist_others(brvltt,nsym,n_axes,spgroup)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symlist_prim.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/42_geometry/symlist_prim.F90	2010-01-19 17:33:56.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symlist_prim(additional_info,nsym,n_axes,spgroup)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symmultsg.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/42_geometry/symmultsg.F90	2010-01-19 17:33:56.000000000 +0100
@@ -37,7 +37,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symmultsg(nsym,symafm,symrel,tnons)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symplanes.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symplanes.F90	2010-01-19 17:33:56.000000000 +0100
@@ -91,7 +91,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symplanes(center,iholohedry,isym,isymrelconv,itnonsconv,type_axis)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symptgroup.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symptgroup.F90	2010-01-19 17:33:56.000000000 +0100
@@ -33,7 +33,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symptgroup(iholohedry,nsym,ptgroup,symrel)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symredcart.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/symredcart.F90	2010-01-19 17:33:56.000000000 +0100
@@ -35,7 +35,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symredcart(aprim,bprim,symcart,symred)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symrelrot.F90	2010-01-19 11:58:49.000000000 +0100
+++ src/42_geometry/symrelrot.F90	2010-01-19 17:33:56.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symrelrot(nsym,rprimd,rprimd_new,symrel,tolsym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symsgcube.F90	2010-01-19 11:58:49.000000000 +0100
+++ src/42_geometry/symsgcube.F90	2010-01-19 17:33:56.000000000 +0100
@@ -40,7 +40,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symsgcube(msym,nsym,shubnikov,spgaxor,spgorig,spgroup,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symsghexa.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/symsghexa.F90	2010-01-19 17:33:56.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symsghexa(brvltt,msym,nsym,shubnikov,spgaxor,spgorig,spgroup,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symsgmono.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/42_geometry/symsgmono.F90	2010-01-19 17:33:56.000000000 +0100
@@ -41,7 +41,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symsgmono(brvltt,msym,nsym,shubnikov,spgaxor,spgorig,spgroup,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symsgortho.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/symsgortho.F90	2010-01-19 17:33:56.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symsgortho(msym,nsym,shubnikov,spgaxor,spgorig,spgroup,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symsgtetra.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/42_geometry/symsgtetra.F90	2010-01-19 17:33:56.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symsgtetra(msym,nsym,shubnikov,spgaxor,spgorig,spgroup,&
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symspgr.F90	2010-01-19 12:14:21.000000000 +0100
+++ src/42_geometry/symspgr.F90	2010-01-19 17:33:56.000000000 +0100
@@ -64,7 +64,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symspgr(bravais,nsym,spgroup,symrel,tnons,tolsym)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/symzat.F90	2010-01-19 11:58:44.000000000 +0100
+++ src/42_geometry/symzat.F90	2010-01-19 17:33:56.000000000 +0100
@@ -47,7 +47,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symzat(indsym,natom,nsym,symrel,tnons,xred)
--- /local/caliste/abinit-6.0.0-caliste/src/42_geometry/xredxcart.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/42_geometry/xredxcart.F90	2010-01-19 17:33:56.000000000 +0100
@@ -54,7 +54,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xredxcart(natom,option,rprimd,xcart,xred)
--- /local/caliste/abinit-6.0.0-caliste/src/50_abitypes_defs/defs_abitypes.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/50_abitypes_defs/defs_abitypes.F90	2010-01-19 17:33:56.000000000 +0100
@@ -37,7 +37,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 module defs_abitypes
--- /local/caliste/abinit-6.0.0-caliste/src/56_recipspace/getkgrid.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_recipspace/getkgrid.F90	2010-01-19 17:33:54.000000000 +0100
@@ -58,7 +58,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine getkgrid(iout,iscf,kpt,kptopt,kptrlatt,kptrlen,&
--- /local/caliste/abinit-6.0.0-caliste/src/56_recipspace/smpbz.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_recipspace/smpbz.F90	2010-01-19 17:33:54.000000000 +0100
@@ -58,7 +58,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine smpbz(brav,iout,kptrlatt,mkpt,nkpt,nshiftk,option,shiftk,spkpt)
--- /local/caliste/abinit-6.0.0-caliste/src/56_recipspace/symkpt.F90	2010-01-19 11:58:44.000000000 +0100
+++ src/56_recipspace/symkpt.F90	2010-01-19 17:33:54.000000000 +0100
@@ -50,7 +50,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine symkpt(gmet,indkpt1,kptns,nkpt,nkpt1,nsym1,option,&
--- /local/caliste/abinit-6.0.0-caliste/src/56_recipspace/testkgrid.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_recipspace/testkgrid.F90	2010-01-19 17:33:54.000000000 +0100
@@ -58,7 +58,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine testkgrid(bravais,iout,kptrlatt,kptrlen,&
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/drivexc.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_xc/drivexc.F90	2010-01-19 17:33:56.000000000 +0100
@@ -107,7 +107,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine drivexc(exc,ixc,npts,nspden,order,rho_updn,vxc,ndvxc,ngr2,nd2vxc,nvxcdgr,   & !Mandatory arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/interfaces_56_xc.F90	2010-01-19 12:37:43.000000000 +0100
+++ src/56_xc/interfaces_56_xc.F90	2010-01-19 17:33:57.000000000 +0100
@@ -431,74 +431,74 @@
  end subroutine phase
 end interface
 
-interface
- subroutine rhohxc(dtset,enxc,gsqcut,izero,kxc,mpi_enreg,nfft,ngfft,&  
-  &  nhat,nhatdim,nhatgr,nhatgrdim,nkxc,nk3xc,nspden,n3xccc,option,rhog,rhor,rprimd,&  
-  &  strsxc,usexcnhat,vhartr,vxc,vxcavg,xccc3d,k3xc,&  
-  &  electronpositron,taug,taur) ! optional argument
-  use defs_basis
-  use defs_abitypes
-  use m_electronpositron
-  implicit none
-  integer,intent(in) :: izero
-  integer,intent(in) :: n3xccc
-  integer,intent(in) :: nfft
-  integer,intent(in) :: nhatdim
-  integer,intent(in) :: nhatgrdim
-  integer,intent(in) :: nk3xc
-  integer,intent(in) :: nkxc
-  integer,intent(in) :: nspden
-  integer,intent(in) :: option
-  integer,intent(in) :: usexcnhat
-  type(dataset_type),intent(in) :: dtset
-  type(electronpositron_type),pointer,optional :: electronpositron
-  real(dp),intent(out) :: enxc
-  real(dp),intent(in) :: gsqcut
-  type(mpi_type),intent(inout) :: mpi_enreg
-  real(dp),intent(out) :: vxcavg
-  integer,intent(in) :: ngfft(18)
-  real(dp),intent(out),optional :: k3xc(1:nfft,1:nk3xc)
-  real(dp),intent(out) :: kxc(nfft,nkxc)
-  real(dp),intent(in) :: nhat(nfft,nspden*nhatdim)
-  real(dp),intent(in) :: nhatgr(nfft,nspden,3*nhatgrdim)
-  real(dp),intent(in) :: rhog(2,nfft)
-  real(dp),intent(in) :: rhor(nfft,nspden)
-  real(dp),intent(in) :: rprimd(3,3)
-  real(dp),intent(out) :: strsxc(6)
-  real(dp),intent(in),optional :: taug(2,nfft*dtset%usekden)
-  real(dp),intent(in),optional :: taur(nfft,nspden*dtset%usekden)
-  real(dp),intent(out) :: vhartr(nfft)
-  real(dp),intent(out) :: vxc(nfft,nspden)
-  real(dp),intent(in) :: xccc3d(n3xccc)
- end subroutine rhohxc
-end interface
-
-interface
- subroutine rhohxcpositron(electronpositron,gprimd,kxcapn,mpi_enreg,nfft,ngfft,nkxc,nspden,n3xccc,&  
-  &  paral_kgb,rhor,strsxc,ucvol,vhartr,vxcapn,vxcavg,xccc3d)
-  use defs_basis
-  use defs_abitypes
-  use m_electronpositron
-  implicit none
-  integer,intent(in) :: n3xccc
-  integer,intent(in) :: nfft
-  integer,intent(in) :: nkxc
-  integer,intent(in) :: nspden
-  integer,intent(in) :: paral_kgb
-  type(electronpositron_type),pointer :: electronpositron
-  type(mpi_type),intent(inout) :: mpi_enreg
-  real(dp),intent(in) :: ucvol
-  real(dp),intent(out) :: vxcavg
-  integer,intent(in) :: ngfft(18)
-  real(dp),intent(in) :: gprimd(3,3)
-  real(dp),intent(out) :: kxcapn(nfft,nkxc)
-  real(dp),intent(in) :: rhor(nfft,nspden)
-  real(dp),intent(out) :: strsxc(6)
-  real(dp),intent(out) :: vhartr(nfft)
-  real(dp),intent(out) :: vxcapn(nfft,nspden)
-  real(dp),intent(in) :: xccc3d(n3xccc)
- end subroutine rhohxcpositron
-end interface
+!!$interface
+!!$ subroutine rhohxc(dtset,enxc,gsqcut,izero,kxc,mpi_enreg,nfft,ngfft,&  
+!!$  &  nhat,nhatdim,nhatgr,nhatgrdim,nkxc,nk3xc,nspden,n3xccc,option,rhog,rhor,rprimd,&  
+!!$  &  strsxc,usexcnhat,vhartr,vxc,vxcavg,xccc3d,k3xc,&  
+!!$  &  electronpositron,taug,taur) ! optional argument
+!!$  use defs_basis
+!!$  use defs_abitypes
+!!$  use m_electronpositron
+!!$  implicit none
+!!$  integer,intent(in) :: izero
+!!$  integer,intent(in) :: n3xccc
+!!$  integer,intent(in) :: nfft
+!!$  integer,intent(in) :: nhatdim
+!!$  integer,intent(in) :: nhatgrdim
+!!$  integer,intent(in) :: nk3xc
+!!$  integer,intent(in) :: nkxc
+!!$  integer,intent(in) :: nspden
+!!$  integer,intent(in) :: option
+!!$  integer,intent(in) :: usexcnhat
+!!$  type(dataset_type),intent(in) :: dtset
+!!$  type(electronpositron_type),pointer,optional :: electronpositron
+!!$  real(dp),intent(out) :: enxc
+!!$  real(dp),intent(in) :: gsqcut
+!!$  type(mpi_type),intent(inout) :: mpi_enreg
+!!$  real(dp),intent(out) :: vxcavg
+!!$  integer,intent(in) :: ngfft(18)
+!!$  real(dp),intent(out),optional :: k3xc(1:nfft,1:nk3xc)
+!!$  real(dp),intent(out) :: kxc(nfft,nkxc)
+!!$  real(dp),intent(in) :: nhat(nfft,nspden*nhatdim)
+!!$  real(dp),intent(in) :: nhatgr(nfft,nspden,3*nhatgrdim)
+!!$  real(dp),intent(in) :: rhog(2,nfft)
+!!$  real(dp),intent(in) :: rhor(nfft,nspden)
+!!$  real(dp),intent(in) :: rprimd(3,3)
+!!$  real(dp),intent(out) :: strsxc(6)
+!!$  real(dp),intent(in),optional :: taug(2,nfft*dtset%usekden)
+!!$  real(dp),intent(in),optional :: taur(nfft,nspden*dtset%usekden)
+!!$  real(dp),intent(out) :: vhartr(nfft)
+!!$  real(dp),intent(out) :: vxc(nfft,nspden)
+!!$  real(dp),intent(in) :: xccc3d(n3xccc)
+!!$ end subroutine rhohxc
+!!$end interface
+!!$
+!!$interface
+!!$ subroutine rhohxcpositron(electronpositron,gprimd,kxcapn,mpi_enreg,nfft,ngfft,nkxc,nspden,n3xccc,&  
+!!$  &  paral_kgb,rhor,strsxc,ucvol,vhartr,vxcapn,vxcavg,xccc3d)
+!!$  use defs_basis
+!!$  use defs_abitypes
+!!$  use m_electronpositron
+!!$  implicit none
+!!$  integer,intent(in) :: n3xccc
+!!$  integer,intent(in) :: nfft
+!!$  integer,intent(in) :: nkxc
+!!$  integer,intent(in) :: nspden
+!!$  integer,intent(in) :: paral_kgb
+!!$  type(electronpositron_type),pointer :: electronpositron
+!!$  type(mpi_type),intent(inout) :: mpi_enreg
+!!$  real(dp),intent(in) :: ucvol
+!!$  real(dp),intent(out) :: vxcavg
+!!$  integer,intent(in) :: ngfft(18)
+!!$  real(dp),intent(in) :: gprimd(3,3)
+!!$  real(dp),intent(out) :: kxcapn(nfft,nkxc)
+!!$  real(dp),intent(in) :: rhor(nfft,nspden)
+!!$  real(dp),intent(out) :: strsxc(6)
+!!$  real(dp),intent(out) :: vhartr(nfft)
+!!$  real(dp),intent(out) :: vxcapn(nfft,nspden)
+!!$  real(dp),intent(in) :: xccc3d(n3xccc)
+!!$ end subroutine rhohxcpositron
+!!$end interface
 
 interface
  subroutine size_dvxc(ixc,ndvxc,ngr2,nd2vxc,nspden,nvxcdgr,order)
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/invcb.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/56_xc/invcb.F90	2010-01-19 17:33:57.000000000 +0100
@@ -30,7 +30,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
  subroutine invcb(rhoarr,rspts,npts)
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/m_libxc_functionals.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_xc/m_libxc_functionals.F90	2010-01-19 18:26:28.000000000 +0100
@@ -25,7 +25,7 @@
 !!
 !! SOURCE
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 module libxc_functionals
@@ -39,14 +39,15 @@
 
   implicit none
 
-#if defined HAVE_LIBXC
   type libxc_functional
     private
     integer         :: family ! LDA, GGA, etc.
     integer         :: id     ! identifier
 
+#if defined HAVE_LIBXC
     type(xc_f90_pointer_t) :: conf ! the pointer used to call the library
     type(xc_f90_pointer_t) :: info ! information about the functional
+#endif
   end type libxc_functional
 
   type(libxc_functional) :: funcs(2)
@@ -56,6 +57,7 @@
 &      libxc_functionals_getvxc, &
 &      libxc_functionals_isgga, &
 &      libxc_functionals_ismgga, &
+&      libxc_functionals_exctXfac, &
 &      libxc_functionals_end
 
 contains
@@ -108,8 +110,14 @@
 
 ! *************************************************************************
 
-    funcs(1)%id = -ixc/1000
-    funcs(2)%id = -ixc - funcs(1)%id*1000
+#if defined HAVE_LIBXC
+    if (ixc < 0) then
+       funcs(1)%id = -ixc/1000
+       funcs(2)%id = -ixc - funcs(1)%id*1000
+    else
+       funcs(1)%id = 0
+       funcs(2)%id = 0
+    end if
 
     do i = 1, 2
       if (funcs(i)%id == 0) then
@@ -120,7 +128,7 @@
       ! Get XC functional family
       funcs(i)%family = xc_f90_family_from_id(funcs(i)%id)
       select case (funcs(i)%family)
-      case (XC_FAMILY_LDA, XC_FAMILY_GGA, XC_FAMILY_MGGA)
+      case (XC_FAMILY_LDA, XC_FAMILY_GGA, XC_FAMILY_MGGA, XC_FAMILY_HYB_GGA)
         call xc_f90_func_init(funcs(i)%conf,funcs(i)%info,funcs(i)%id,nspden)
       case default
         write(message, '(4a,i8,2a,i8,6a)' )ch10,&
@@ -134,10 +142,6 @@
         call leave_new('COLL')
       end select
 
-      if (funcs(i)%id == XC_LDA_C_XALPHA) then
-        call xc_f90_lda_c_xalpha_set_par(funcs(i)%conf,zero)
-      end if
-
       ! Dump functional information
       call xc_f90_info_name(funcs(i)%info,message)
       call wrtout(std_out,message,'COLL')
@@ -148,7 +152,13 @@
         call xc_f90_info_refs(funcs(i)%info,ii,str,message)
       end do
     end do
-
+#else
+    write(message, '(a,a,a,a)' ) ch10,&
+         & ' wvl_init_type_wfs : LibXC library is not compiled.', ch10, &
+         & '   Action, used the flag --enable-libxc when configuring.'
+    call wrtout(6,message,'COLL')
+    call leave_new('COLL')
+#endif
   end subroutine libxc_functionals_init
 !!***
 
@@ -177,12 +187,20 @@
     implicit none
 
     integer :: i
+    character(len=500) :: message
 
+#if defined HAVE_LIBXC
     do i = 1, 2
       if (funcs(i)%id == 0) cycle
       call xc_f90_func_end(funcs(i)%conf)
     end do
-
+#else
+    write(message, '(a,a,a,a)' ) ch10,&
+         & ' wvl_init_type_wfs : LibXC library is not compiled.', ch10, &
+         & '   Action, used the flag --enable-libxc when configuring.'
+    call wrtout(6,message,'COLL')
+    call leave_new('COLL')
+#endif
   end subroutine libxc_functionals_end
 !!*** 
 
@@ -213,18 +231,66 @@
 !Local variables-------------------------------
 
     logical :: libxc_functionals_isgga
+    character(len=500) :: message
 
 ! *************************************************************************
 
-    if (any(funcs%family == XC_FAMILY_GGA)) then
+#if defined HAVE_LIBXC
+    if (any(funcs%family == XC_FAMILY_GGA) .or. any(funcs%family == XC_FAMILY_HYB_GGA)) then
       libxc_functionals_isgga = .true.
     else
       libxc_functionals_isgga = .false.
     end if
-
+#else
+    libxc_functionals_isgga = .false.
+#endif
   end function libxc_functionals_isgga
 !!*** 
 
+!!****f* libxc_functionals/libxc_functionals_exctXfac
+!!
+!! FUNCTION
+!!
+!! INPUTS
+!!
+!! OUTPUT
+!! 
+!! PARENTS
+!!
+!! CHILDREN
+!!
+!! SOURCE
+
+  real(kind=8) function libxc_functionals_exctXfac()
+
+
+    implicit none
+
+!Arguments ------------------------------------
+
+!Local variables-------------------------------
+
+    logical :: libxc_functionals_needexctX
+    character(len=500) :: message
+
+! *************************************************************************
+
+#if defined HAVE_LIBXC
+    if (any(funcs%family == XC_FAMILY_HYB_GGA)) then
+       !factors for the exact exchange contribution of different hybrid functionals
+       if (any(funcs%id == XC_HYB_GGA_XC_PBEH)) then
+          libxc_functionals_exctXfac = 0.25d0 
+       end if
+    else
+      libxc_functionals_exctXfac = 0.d0
+    end if
+#else
+    libxc_functionals_exctXfac = 0.d0
+#endif
+
+  end function libxc_functionals_exctXfac
+!!*** 
+
 !!****f* libxc_functionals/libxc_functionals_ismgga
 !! NAME
 !!  libxc_functionals_ismgga
@@ -305,10 +371,11 @@
     integer  :: i, ipts
     real(dp) :: rhotmp(nspden), exctmp, sigma(3), vsigma(3), vxctmp(nspden)
     real(dp) :: lrhotmp(nspden), tautmp(nspden), vxclrhotmp(nspden), vxctautmp(nspden)
-!   character(len=500) :: message
+   character(len=500) :: message
 
 ! *************************************************************************
 
+#if defined HAVE_LIBXC
     ! Inititalize all relevant arrays to zero
     vxc=zero
     exc=zero
@@ -332,7 +399,7 @@
       else
         rhotmp(1:nspden) = rho(ipts,1:nspden)
       end if
-      if (any(funcs%family == XC_FAMILY_GGA)) then
+      if (libxc_functionals_isgga()) then
         sigma=zero
         if (nspden==1) then
           ! ABINIT passes |rho_up|^2 while Libxc needs |rho_tot|^2
@@ -365,6 +432,8 @@
             call xc_f90_lda_exc_vxc(funcs(i)%conf,1,rhotmp(1),exctmp,vxctmp(1))
           case (XC_FAMILY_GGA)
             call xc_f90_gga_exc_vxc(funcs(i)%conf,1,rhotmp(1),sigma(1),exctmp,vxctmp(1),vsigma(1))
+          case (XC_FAMILY_HYB_GGA)
+            call xc_f90_gga_exc_vxc(funcs(i)%conf,1,rhotmp(1),sigma(1),exctmp,vxctmp(1),vsigma(1))
           case (XC_FAMILY_MGGA)
             call xc_f90_mgga_exc_vxc(funcs(i)%conf,rhotmp(1),sigma(1),lrhotmp(1),&
                         tautmp(1),exctmp,vxctmp(1),vsigma(1),vxclrhotmp(1),vxctautmp(1))
@@ -380,19 +449,21 @@
           exctmp=zero
           select case (funcs(i)%family)
           case (XC_FAMILY_LDA)
-            call xc_f90_lda_vxc(funcs(i)%conf,1,rhotmp(1),vxctmp(1))
+             call xc_f90_lda_vxc(funcs(i)%conf,1,rhotmp(1),vxctmp(1))
           case (XC_FAMILY_GGA)
-            call xc_f90_gga_vxc(funcs(i)%conf,1,rhotmp(1),sigma(1),vxctmp(1),vsigma(1))
+             call xc_f90_gga_vxc(funcs(i)%conf,1,rhotmp(1),sigma(1),vxctmp(1),vsigma(1))
+          case (XC_FAMILY_HYB_GGA)
+             call xc_f90_gga_vxc(funcs(i)%conf,1,rhotmp(1),sigma(1),vxctmp(1),vsigma(1))
           case (XC_FAMILY_MGGA)
-            call xc_f90_mgga_vxc(funcs(i)%conf,rhotmp(1),sigma(1),lrhotmp(1),&
-                        tautmp(1),vxctmp(1),vsigma(1),vxclrhotmp(1),vxctautmp(1))
+             call xc_f90_mgga_vxc(funcs(i)%conf,rhotmp(1),sigma(1),lrhotmp(1),&
+                  tautmp(1),vxctmp(1),vsigma(1),vxclrhotmp(1),vxctautmp(1))
           end select
         end if
 
         exc(ipts) = exc(ipts) + exctmp
         vxc(ipts,1:nspden) = vxc(ipts,1:nspden) + vxctmp(1:nspden)
 
-        if (any(funcs%family == XC_FAMILY_GGA) .or. any(funcs%family == XC_FAMILY_MGGA)) then
+        if (libxc_functionals_isgga() .or. any(funcs%family == XC_FAMILY_MGGA)) then
           !Convert the quantities returned by Libxc to the ones needed by ABINIT
           if (nspden == 1) then
             vxcgr(ipts,3) = vxcgr(ipts,3) + vsigma(1)*two
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/size_dvxc.F90	2010-01-19 11:58:48.000000000 +0100
+++ src/56_xc/size_dvxc.F90	2010-01-19 17:33:57.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine size_dvxc(ixc,ndvxc,ngr2,nd2vxc,nspden,nvxcdgr,order)
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xchcth.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_xc/xchcth.F90	2010-01-19 17:33:57.000000000 +0100
@@ -57,7 +57,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xchcth(dvxcdgr,exci,grho2_updn,ixc,npts,nspden,&
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xchelu.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/56_xc/xchelu.F90	2010-01-19 17:33:57.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xchelu(exc,npt,order,rspts,vxc,dvxc)  ! dvxc is optional
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xclb.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/56_xc/xclb.F90	2010-01-19 17:33:57.000000000 +0100
@@ -45,11 +45,11 @@
 !!
 !! SOURCE
 !!$#if defined HAVE_CONFIG_H
-!!$#include "config.h"
+!!$#include "config.inc"
 !!$#endif
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xclb(grho2_updn,npts,nspden,rho_updn,vxci)
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xcpbe.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_xc/xcpbe.F90	2010-01-19 17:33:57.000000000 +0100
@@ -105,11 +105,11 @@
 !!
 !! SOURCE
 !!$#if defined HAVE_CONFIG_H
-!!$#include "config.h"
+!!$#include "config.inc"
 !!$#endif
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xcpbe(exci,npts,nspden,option,order,rho_updn,vxci,ndvxci,ngr2,nd2vxci, & !Mandatory Arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xcpzca.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/56_xc/xcpzca.F90	2010-01-19 17:33:57.000000000 +0100
@@ -39,7 +39,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xcpzca(exc,npt,order,rhor,rspts,vxc,&  !Mandatory arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xcspol.F90	2010-01-19 12:14:22.000000000 +0100
+++ src/56_xc/xcspol.F90	2010-01-19 17:33:57.000000000 +0100
@@ -70,7 +70,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xcspol(exc,npts,nspden,order,rspts,vxc,zeta,ndvxc,& !Mandatory arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xctetr.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/56_xc/xctetr.F90	2010-01-19 17:33:57.000000000 +0100
@@ -62,7 +62,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xctetr(exc,npt,order,rhor,rspts,vxc,& !Mandatory arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xcwign.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/56_xc/xcwign.F90	2010-01-19 17:33:57.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xcwign(exc,npt,order,rspts,vxc,& !Mandatory arguments
--- /local/caliste/abinit-6.0.0-caliste/src/56_xc/xcxalp.F90	2010-01-19 11:58:46.000000000 +0100
+++ src/56_xc/xcxalp.F90	2010-01-19 17:33:57.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xcxalp(exc,npt,order,rspts,vxc, dvxc)  ! dvxc is optional
--- /local/caliste/abinit-6.0.0-caliste/src/67_common/ewald.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/67_common/ewald.F90	2010-01-19 17:33:54.000000000 +0100
@@ -38,7 +38,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine ewald(eew,gmet,grewtn,natom,ntypat,rmet,typat,ucvol,xred,zion)
@@ -252,7 +252,7 @@
                    rmagn=sqrt(rsq)
                    arg=reta*rmagn
 !                  derfc is the real(dp) complementary error function
-                   call derfc(derfc_arg,arg)
+                   call derfcf(derfc_arg,arg)
                    term=derfc_arg/rmagn
                    sumr=sumr+zion(typat(ia))*zion(typat(ib))*term
                    term=zion(typat(ia))*zion(typat(ib))*&
--- /local/caliste/abinit-6.0.0-caliste/src/67_common/fconv.F90	2010-01-19 11:58:45.000000000 +0100
+++ src/67_common/fconv.F90	2010-01-19 17:33:54.000000000 +0100
@@ -58,7 +58,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine fconv(fcart,iatfix,iexit,itime,natom,ntime,&
--- /local/caliste/abinit-6.0.0-caliste/src/67_common/prtxvf.F90	2010-01-19 11:58:43.000000000 +0100
+++ src/67_common/prtxvf.F90	2010-01-19 17:33:54.000000000 +0100
@@ -36,7 +36,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine prtxvf(fcart,iatfix,iout,natom,prtvel,vel,xcart)
--- /local/caliste/abinit-6.0.0-caliste/src/72_geomoptim/xfpack.F90	2010-01-19 11:58:47.000000000 +0100
+++ src/72_geomoptim/xfpack.F90	2010-01-19 17:33:54.000000000 +0100
@@ -57,7 +57,7 @@
 !! SOURCE
 
 #if defined HAVE_CONFIG_H
-#include "config.h"
+#include "config.inc"
 #endif
 
 subroutine xfpack(acell,acell0,fred,natom,ndim,nsym,optcell,option,rprim,rprimd0,&


