Commit 28f5b60b authored by Matthias Redies's avatar Matthias Redies

fix indentation

parent c4d3502a
......@@ -5,107 +5,101 @@
!--------------------------------------------------------------------------------
MODULE m_vgen
USE m_juDFT
USE m_juDFT
CONTAINS
!> FLAPW potential generator
!! The full potential is generated by the following main steps:
!! * generation of Coulomb potential
!! * copy of VCoul to both spins
!! * generation of XC potential
!! In addition, the rotation of the density in the noco case and some scaling is done
!! In results we store:
!! TE_VCOUL : charge density-coulomb potential integral
!! TE_VEFF: charge density-effective potential integral
!! TE_EXC : charge density-ex-corr.energy density integral
SUBROUTINE vgen(hybrid,field,input,xcpot,DIMENSION,atoms,sphhar,stars,vacuum,sym,&
obsolete,cell,oneD,sliceplot,mpi,results,noco,den,vTot,vx,vCoul)
USE m_types
USE m_rotate_int_den_to_local
USE m_bfield
USE m_vgen_coulomb
USE m_vgen_xcpot
USE m_vgen_finalize
!> FLAPW potential generator
!! The full potential is generated by the following main steps:
!! * generation of Coulomb potential
!! * copy of VCoul to both spins
!! * generation of XC potential
!! In addition, the rotation of the density in the noco case and some scaling is done
!! In results we store:
!! TE_VCOUL : charge density-coulomb potential integral
!! TE_VEFF: charge density-effective potential integral
!! TE_EXC : charge density-ex-corr.energy density integral
SUBROUTINE vgen(hybrid,field,input,xcpot,DIMENSION,atoms,sphhar,stars,vacuum,sym,&
obsolete,cell,oneD,sliceplot,mpi,results,noco,den,vTot,vx,vCoul)
USE m_types
USE m_rotate_int_den_to_local
USE m_bfield
USE m_vgen_coulomb
USE m_vgen_xcpot
USE m_vgen_finalize
#ifdef CPP_MPI
USE m_mpi_bc_potden
USE m_mpi_bc_potden
#endif
IMPLICIT NONE
TYPE(t_results), INTENT(INOUT) :: results
CLASS(t_xcpot), INTENT(IN) :: xcpot
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_obsolete), INTENT(IN) :: obsolete
TYPE(t_sliceplot), INTENT(IN) :: sliceplot
TYPE(t_input), INTENT(IN) :: input
TYPE(t_field), INTENT(INOUT) :: field !efield can be modified
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_stars), INTENT(IN) :: stars
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_sphhar), INTENT(IN) :: sphhar
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_potden), INTENT(INOUT) :: den
TYPE(t_potden), INTENT(INOUT) :: vTot,vx,vCoul
TYPE(t_potden) :: workden,denRot
if (mpi%irank==0) WRITE (6,FMT=8000)
8000 FORMAT (/,/,t10,' p o t e n t i a l g e n e r a t o r',/)
CALL vTot%resetPotDen()
CALL vCoul%resetPotDen()
CALL vx%resetPotDen()
ALLOCATE(vx%pw_w,mold=vTot%pw)
IMPLICIT NONE
TYPE(t_results), INTENT(INOUT) :: results
CLASS(t_xcpot), INTENT(IN) :: xcpot
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_obsolete), INTENT(IN) :: obsolete
TYPE(t_sliceplot), INTENT(IN) :: sliceplot
TYPE(t_input), INTENT(IN) :: input
TYPE(t_field), INTENT(INOUT) :: field !efield can be modified
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_stars), INTENT(IN) :: stars
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_sphhar), INTENT(IN) :: sphhar
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_potden), INTENT(INOUT) :: den
TYPE(t_potden), INTENT(INOUT) :: vTot,vx,vCoul
TYPE(t_potden) :: workden,denRot
if (mpi%irank==0) WRITE (6,FMT=8000)
8000 FORMAT (/,/,t10,' p o t e n t i a l g e n e r a t o r',/)
CALL vTot%resetPotDen()
CALL vCoul%resetPotDen()
CALL vx%resetPotDen()
ALLOCATE(vx%pw_w,mold=vTot%pw)
#ifndef CPP_OLDINTEL
ALLOCATE(vTot%pw_w,mold=vTot%pw)
ALLOCATE(vTot%pw_w,mold=vTot%pw)
#else
ALLOCATE( vTot%pw_w(size(vTot%pw,1),size(vTot%pw,2)) )
ALLOCATE( vTot%pw_w(size(vTot%pw,1),size(vTot%pw,2)) )
#endif
ALLOCATE(vCoul%pw_w(SIZE(den%pw,1),1))
ALLOCATE(vCoul%pw_w(SIZE(den%pw,1),1))
CALL workDen%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,0)
CALL workDen%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,0)
!sum up both spins in den into workden
CALL den%sum_both_spin(workden)
!sum up both spins in den into workden
CALL den%sum_both_spin(workden)
CALL vgen_coulomb(1,mpi,dimension,oneD,input,field,vacuum,sym,stars,cell,sphhar,atoms,workden,vCoul,results)
CALL vgen_coulomb(1,mpi,dimension,oneD,input,field,vacuum,sym,stars,cell,sphhar,atoms,workden,vCoul,results)
CALL vCoul%copy_both_spin(vTot)
vCoul%mt(:,:,:,input%jspins)=vCoul%mt(:,:,:,1)
CALL vCoul%copy_both_spin(vTot)
vCoul%mt(:,:,:,input%jspins)=vCoul%mt(:,:,:,1)
IF (noco%l_noco) THEN
CALL denRot%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,0)
denRot=den
CALL rotate_int_den_to_local(dimension,sym,stars,atoms,sphhar,vacuum,cell,input,noco,oneD,denRot)
ENDIF
IF (noco%l_noco) THEN
CALL denRot%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,0)
denRot=den
CALL rotate_int_den_to_local(dimension,sym,stars,atoms,sphhar,vacuum,cell,input,noco,oneD,denRot)
ENDIF
CALL vgen_xcpot(hybrid,input,xcpot,dimension,atoms,sphhar,stars,vacuum,sym,&
obsolete,cell,oneD,sliceplot,mpi,noco,den,denRot,vTot,vx,results)
!ToDo, check if this is needed for more potentials as well...
CALL vgen_finalize(atoms,stars,vacuum,sym,noco,input,vTot,denRot)
DEALLOCATE(vcoul%pw_w)
CALL vgen_xcpot(hybrid,input,xcpot,dimension,atoms,sphhar,stars,vacuum,sym,&
obsolete,cell,oneD,sliceplot,mpi,noco,den,denRot,vTot,vx,results)
!ToDo, check if this is needed for more potentials as well...
CALL vgen_finalize(atoms,stars,vacuum,sym,noco,input,vTot,denRot)
DEALLOCATE(vcoul%pw_w)
CALL bfield(input,noco,atoms,field,vTot)
CALL bfield(input,noco,atoms,field,vTot)
#ifdef CPP_MPI
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vTot)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vCoul)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vx)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vTot)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vCoul)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,vx)
#endif
END SUBROUTINE vgen
END SUBROUTINE vgen
END MODULE m_vgen
......@@ -6,164 +6,163 @@
MODULE m_types_misc
IMPLICIT NONE
!*************************************************************
! This module contains definitions for all kind of types
!*************************************************************
! Type for the HF total energy
TYPE t_energy_hf
REAL :: valence
REAL :: core
END TYPE t_energy_hf
TYPE prodtype
INTEGER :: l1,l2,n1,n2
END TYPE prodtype
TYPE t_hybdat
INTEGER :: lmaxcd,maxindxc
REAL, ALLOCATABLE :: gridf(:,:) !alloc in util.F
INTEGER , ALLOCATABLE:: nindxc(:,:) !alloc in eigen_HF_init
INTEGER,ALLOCATABLE :: lmaxc(:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: core1(:,:,:,:),core2(:,:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: eig_c(:,:,:) !alloc in eigen_HF_init
INTEGER , ALLOCATABLE:: kveclo_eig(:,:) !alloc in eigen_HF_setup
INTEGER :: maxfac
REAL, ALLOCATABLE :: sfac(:),fac(:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: gauntarr(:,:,:,:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: bas1(:,:,:,:),bas2(:,:,:,:) !alloc in eigen_HF_init
REAL , ALLOCATABLE :: bas1_MT(:,:,:),drbas1_MT(:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: prodm(:,:,:,:) !alloc in eigen_HF_setup
TYPE(PRODTYPE),ALLOCATABLE :: prod(:,:,:) !alloc in eigen_HF_setup
INTEGER, ALLOCATABLE :: pntgptd(:) !alloc in eigen_HF_setup
INTEGER, ALLOCATABLE :: pntgpt(:,:,:,:) !alloc in eigen_HF_setup
INTEGER,ALLOCATABLE :: nindxp1(:,:)
END TYPE t_hybdat
TYPE t_results
REAL, ALLOCATABLE :: force(:,:,:) !< Forces calculated on all atoms (for each spin)
REAL, ALLOCATABLE :: force_old(:,:) !< Forces on all atoms from last iteration
REAL :: ef !<Fermie energy
REAL :: seigc !<sum of the core eigenvalues
REAL :: seigsc !<weighted sum of the semi-core eigenvalues
REAL :: seigv !<weighted sum of the occupied valence eigenvalues
REAL :: seigscv !<sum of seigv and seigsc
REAL :: ts !<entropy contribution to the free energy
REAL :: te_vcoul !<charge density-coulomb potential integral
REAL :: te_veff !<charge density-effective potential integral
REAL :: te_exc !<charge density-ex-corr.energy density integral
REAL :: e_ldau !<total energy contribution of LDA+U
REAL :: tote
REAL :: last_distance
REAL :: bandgap
TYPE(t_energy_hf) :: te_hfex
REAL :: te_hfex_loc(2)
REAL, ALLOCATABLE :: w_iks(:,:,:)
REAL, ALLOCATABLE :: eig(:,:,:)
INTEGER, ALLOCATABLE :: neig(:,:) ! neig(nkpts,jspins) number of calculated eigenvalues for each k point, spin
CONTAINS
PROCEDURE,PASS :: init => results_init
END TYPE t_results
TYPE t_zMat
LOGICAL :: l_real
INTEGER :: nbasfcn
INTEGER :: nbands
REAL, ALLOCATABLE :: z_r(:,:) ! z_r(nbasfcn,nbands)
COMPLEX, ALLOCATABLE :: z_c(:,:) ! z_c(nbasfcn,nbands)
CONTAINS
PROCEDURE,PASS :: init => zMat_init
END TYPE t_zMat
TYPE t_hamOvlp
LOGICAL :: l_real
INTEGER :: matsize
REAL, ALLOCATABLE :: a_r(:), b_r(:)
COMPLEX, ALLOCATABLE :: a_c(:), b_c(:)
END TYPE t_hamOvlp
IMPLICIT NONE
!*************************************************************
! This module contains definitions for all kind of types
!*************************************************************
! Type for the HF total energy
TYPE t_energy_hf
REAL :: valence
REAL :: core
END TYPE t_energy_hf
TYPE prodtype
INTEGER :: l1,l2,n1,n2
END TYPE prodtype
TYPE t_hybdat
INTEGER :: lmaxcd,maxindxc
REAL, ALLOCATABLE :: gridf(:,:) !alloc in util.F
INTEGER , ALLOCATABLE:: nindxc(:,:) !alloc in eigen_HF_init
INTEGER,ALLOCATABLE :: lmaxc(:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: core1(:,:,:,:),core2(:,:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: eig_c(:,:,:) !alloc in eigen_HF_init
INTEGER , ALLOCATABLE:: kveclo_eig(:,:) !alloc in eigen_HF_setup
INTEGER :: maxfac
REAL, ALLOCATABLE :: sfac(:),fac(:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: gauntarr(:,:,:,:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: bas1(:,:,:,:),bas2(:,:,:,:) !alloc in eigen_HF_init
REAL , ALLOCATABLE :: bas1_MT(:,:,:),drbas1_MT(:,:,:) !alloc in eigen_HF_init
REAL, ALLOCATABLE :: prodm(:,:,:,:) !alloc in eigen_HF_setup
TYPE(PRODTYPE),ALLOCATABLE :: prod(:,:,:) !alloc in eigen_HF_setup
INTEGER, ALLOCATABLE :: pntgptd(:) !alloc in eigen_HF_setup
INTEGER, ALLOCATABLE :: pntgpt(:,:,:,:) !alloc in eigen_HF_setup
INTEGER,ALLOCATABLE :: nindxp1(:,:)
END TYPE t_hybdat
TYPE t_results
REAL, ALLOCATABLE :: force(:,:,:) !< Forces calculated on all atoms (for each spin)
REAL, ALLOCATABLE :: force_old(:,:) !< Forces on all atoms from last iteration
REAL :: ef !<Fermie energy
REAL :: seigc !<sum of the core eigenvalues
REAL :: seigsc !<weighted sum of the semi-core eigenvalues
REAL :: seigv !<weighted sum of the occupied valence eigenvalues
REAL :: seigscv !<sum of seigv and seigsc
REAL :: ts !<entropy contribution to the free energy
REAL :: te_vcoul !<charge density-coulomb potential integral
REAL :: te_veff !<charge density-effective potential integral
REAL :: te_exc !<charge density-ex-corr.energy density integral
REAL :: e_ldau !<total energy contribution of LDA+U
REAL :: tote
REAL :: last_distance
REAL :: bandgap
TYPE(t_energy_hf) :: te_hfex
REAL :: te_hfex_loc(2)
REAL, ALLOCATABLE :: w_iks(:,:,:)
REAL, ALLOCATABLE :: eig(:,:,:)
INTEGER, ALLOCATABLE :: neig(:,:) ! neig(nkpts,jspins) number of calculated eigenvalues for each k point, spin
CONTAINS
PROCEDURE,PASS :: init => results_init
END TYPE t_results
TYPE t_zMat
LOGICAL :: l_real
INTEGER :: nbasfcn
INTEGER :: nbands
REAL, ALLOCATABLE :: z_r(:,:) ! z_r(nbasfcn,nbands)
COMPLEX, ALLOCATABLE :: z_c(:,:) ! z_c(nbasfcn,nbands)
CONTAINS
PROCEDURE,PASS :: init => zMat_init
END TYPE t_zMat
TYPE t_hamOvlp
LOGICAL :: l_real
INTEGER :: matsize
REAL, ALLOCATABLE :: a_r(:), b_r(:)
COMPLEX, ALLOCATABLE :: a_c(:), b_c(:)
END TYPE t_hamOvlp
CONTAINS
SUBROUTINE zMat_init(thisZMat,l_real,nbasfcn,nbands)
SUBROUTINE zMat_init(thisZMat,l_real,nbasfcn,nbands)
IMPLICIT NONE
IMPLICIT NONE
CLASS(t_zMat), INTENT(INOUT) :: thisZMat
LOGICAL, INTENT(IN) :: l_real
INTEGER, INTENT(IN) :: nbasfcn,nbands
CLASS(t_zMat), INTENT(INOUT) :: thisZMat
LOGICAL, INTENT(IN) :: l_real
INTEGER, INTENT(IN) :: nbasfcn,nbands
thisZMat%l_real = l_real
thisZMat%nbasfcn = nbasfcn
thisZMat%nbands = nbands
thisZMat%l_real = l_real
thisZMat%nbasfcn = nbasfcn
thisZMat%nbands = nbands
IF (ALLOCATED(thisZMat%z_r)) DEALLOCATE(thisZMat%z_r)
IF (ALLOCATED(thisZMat%z_c)) DEALLOCATE(thisZMat%z_c)
IF (l_real) THEN
ALLOCATE(thisZMat%z_r(nbasfcn,nbands))
thisZMat%z_r = 0.0
ELSE
ALLOCATE(thisZMat%z_c(nbasfcn,nbands))
thisZMat%z_c = CMPLX(0.0,0.0)
END IF
IF (ALLOCATED(thisZMat%z_r)) DEALLOCATE(thisZMat%z_r)
IF (ALLOCATED(thisZMat%z_c)) DEALLOCATE(thisZMat%z_c)
IF (l_real) THEN
ALLOCATE(thisZMat%z_r(nbasfcn,nbands))
thisZMat%z_r = 0.0
ELSE
ALLOCATE(thisZMat%z_c(nbasfcn,nbands))
thisZMat%z_c = CMPLX(0.0,0.0)
END IF
END SUBROUTINE zMat_init
END SUBROUTINE zMat_init
SUBROUTINE results_init(thisResults,dimension,input,atoms,kpts,noco)
SUBROUTINE results_init(thisResults,dimension,input,atoms,kpts,noco)
USE m_types_setup
USE m_types_kpts
USE m_types_setup
USE m_types_kpts
IMPLICIT NONE
IMPLICIT NONE
CLASS(t_results), INTENT(INOUT) :: thisResults
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_noco), INTENT(IN) :: noco
INTEGER :: neigd2
thisResults%seigc = 0.0
thisResults%seigsc = 0.0
thisResults%seigv = 0.0
thisResults%seigscv = 0.0
thisResults%e_ldau = 0.0
thisResults%ts = 0.0
CLASS(t_results), INTENT(INOUT) :: thisResults
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_noco), INTENT(IN) :: noco
INTEGER :: neigd2
thisResults%seigc = 0.0
thisResults%seigsc = 0.0
thisResults%seigv = 0.0
thisResults%seigscv = 0.0
thisResults%e_ldau = 0.0
thisResults%ts = 0.0
thisResults%te_vcoul = 0.0
thisResults%te_veff = 0.0
thisResults%te_exc = 0.0
thisResults%te_hfex%valence = 0.0
thisResults%te_hfex%core = 0.0
thisResults%te_hfex_loc = 0.0
thisResults%tote = 0.0
thisResults%last_distance = -1.0
thisResults%bandgap = 0.0
thisResults%ef = 0.0
neigd2 = MIN(dimension%neigd,dimension%nbasfcn)
thisResults%te_vcoul = 0.0
thisResults%te_veff = 0.0
thisResults%te_exc = 0.0
thisResults%te_hfex%valence = 0.0
thisResults%te_hfex%core = 0.0
thisResults%te_hfex_loc = 0.0
thisResults%tote = 0.0
thisResults%last_distance = -1.0
thisResults%bandgap = 0.0
thisResults%ef = 0.0
neigd2 = MIN(dimension%neigd,dimension%nbasfcn)
! neigd2 = dimension%neigd
IF (noco%l_soc.AND.(.NOT.noco%l_noco)) neigd2 = 2*neigd2
ALLOCATE (thisResults%force(3,atoms%ntype,input%jspins))
ALLOCATE (thisResults%force_old(3,atoms%ntype))
ALLOCATE (thisResults%w_iks(neigd2,kpts%nkpt,input%jspins))
ALLOCATE (thisResults%neig(kpts%nkpt,input%jspins))
ALLOCATE (thisResults%eig(neigd2,kpts%nkpt,input%jspins))
thisResults%force = 0.0
thisResults%force_old = 0.0
thisResults%w_iks = 0.0
thisResults%neig = 0
thisResults%eig = 0.0
END SUBROUTINE results_init
IF (noco%l_soc.AND.(.NOT.noco%l_noco)) neigd2 = 2*neigd2
ALLOCATE (thisResults%force(3,atoms%ntype,input%jspins))
ALLOCATE (thisResults%force_old(3,atoms%ntype))
ALLOCATE (thisResults%w_iks(neigd2,kpts%nkpt,input%jspins))
ALLOCATE (thisResults%neig(kpts%nkpt,input%jspins))
ALLOCATE (thisResults%eig(neigd2,kpts%nkpt,input%jspins))
thisResults%force = 0.0
thisResults%force_old = 0.0
thisResults%w_iks = 0.0
thisResults%neig = 0
thisResults%eig = 0.0
END SUBROUTINE results_init
END MODULE m_types_misc
......@@ -12,111 +12,110 @@
!! In addition to overloading the t_xcpot datatype also mpi_bc_xcpot must be adjusted
!! for additional implementations.
MODULE m_types_xcpot
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
CONTAINS
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_MetaGGA=>xcpot_is_MetaGGA
PROCEDURE :: needs_grad=>xcpot_needs_grad
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_exc=>xcpot_get_exc
PROCEDURE,NOPASS :: alloc_gradients=>xcpot_alloc_gradients
END TYPE t_xcpot
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_MetaGGA=>xcpot_is_MetaGGA
PROCEDURE :: needs_grad=>xcpot_needs_grad
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_exc=>xcpot_get_exc
PROCEDURE,NOPASS :: alloc_gradients=>xcpot_alloc_gradients
END TYPE t_xcpot
TYPE t_gradients
!Naming convention:
!t,u,d as last letter for total,up,down
!agr for absolute value of gradient
!g2r for laplacien of gradient
!+??
REAL,ALLOCATABLE :: agrt(:),agru(:),agrd(:)
REAL,ALLOCATABLE :: g2ru(:),g2rd(:),gggrt(:)
REAL,ALLOCATABLE :: gggru(:),gzgr(:),g2rt(:)
REAL,ALLOCATABLE :: gggrd(:),grgru(:),grgrd(:)
!These are the contracted Gradients used in libxc
REAL,ALLOCATABLE :: sigma(:,:)
REAL,ALLOCATABLE :: vsigma(:,:)
REAL,ALLOCATABLE :: gr(:,:,:)
REAL,ALLOCATABLE :: laplace(:,:)
END TYPE t_gradients
TYPE t_gradients
!Naming convention:
!t,u,d as last letter for total,up,down
!agr for absolute value of gradient
!g2r for laplacien of gradient
!+??
REAL,ALLOCATABLE :: agrt(:),agru(:),agrd(:)
REAL,ALLOCATABLE :: g2ru(:),g2rd(:),gggrt(:)
REAL,ALLOCATABLE :: gggru(:),gzgr(:),g2rt(:)
REAL,ALLOCATABLE :: gggrd(:),grgru(:),grgrd(:)
!These are the contracted Gradients used in libxc
REAL,ALLOCATABLE :: sigma(:,:)
REAL,ALLOCATABLE :: vsigma(:,:)
REAL,ALLOCATABLE :: gr(:,:,:)
REAL,ALLOCATABLE :: laplace(:,:)
END TYPE t_gradients
CONTAINS
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_gga=.false.
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_MetaGGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_MetaGGA=.false.
END FUNCTION xcpot_is_MetaGGA
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_gga=.false.
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_MetaGGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_MetaGGA=.false.
END FUNCTION xcpot_is_MetaGGA
LOGICAL FUNCTION xcpot_needs_grad(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
LOGICAL FUNCTION xcpot_needs_grad(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_needs_grad= xcpot%is_gga() .or. xcpot%is_MetaGGA()
END FUNCTION xcpot_needs_grad
xcpot_needs_grad= xcpot%is_gga() .or. xcpot%is_MetaGGA()
END FUNCTION xcpot_needs_grad
LOGICAL FUNCTION xcpot_is_hybrid(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_hybrid=.FALSE.
END FUNCTION xcpot_is_hybrid
FUNCTION xcpot_get_exchange_weight(xcpot) RESULT(a_ex)
USE m_judft
IMPLICIT NONE