Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fleur
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
54
Issues
54
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
fleur
fleur
Commits
777ec7f5
Commit
777ec7f5
authored
Oct 02, 2018
by
Matthias Redies
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implements split scheme
parent
3fb9ce80
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
99 deletions
+95
-99
global/constants.f90
global/constants.f90
+7
-7
main/cdngen.F90
main/cdngen.F90
+2
-2
types/types_xcpot.F90
types/types_xcpot.F90
+17
-12
types/types_xcpot_inbuild.F90
types/types_xcpot_inbuild.F90
+7
-16
types/types_xcpot_libxc.F90
types/types_xcpot_libxc.F90
+1
-1
xc-pot/metagga.F90
xc-pot/metagga.F90
+61
-61
No files found.
global/constants.f90
View file @
777ec7f5
...
...
@@ -20,13 +20,13 @@ MODULE m_constants
REAL
,
PARAMETER
::
eVac0Default_const
=
-0.25
CHARACTER
(
len
=
9
),
PARAMETER
::
version_const
=
'fleur 27'
INTEGER
,
PARAMETER
::
POTDEN_TYPE_OTHER
=
0
! POTDEN_TYPE <= 0 ==> undefined
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTTOT
=
1
! 0 < POTDEN_TYPE <= 1000 ==> potential
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTCOUL
=
2
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTX
=
3
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTYUK
=
4
INTEGER
,
PARAMETER
::
POTDEN_TYPE_kin
EnergyDen
=
5
INTEGER
,
PARAMETER
::
POTDEN_TYPE_DEN
=
1001
! 1000 < POTDEN_TYPE ==> density
INTEGER
,
PARAMETER
::
POTDEN_TYPE_OTHER
=
0
! POTDEN_TYPE <= 0 ==> undefined
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTTOT
=
1
! 0 < POTDEN_TYPE <= 1000 ==> potential
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTCOUL
=
2
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTX
=
3
INTEGER
,
PARAMETER
::
POTDEN_TYPE_POTYUK
=
4
INTEGER
,
PARAMETER
::
POTDEN_TYPE_
EnergyDen
=
5
INTEGER
,
PARAMETER
::
POTDEN_TYPE_DEN
=
1001
! 1000 < POTDEN_TYPE ==> density
CHARACTER
(
2
),
DIMENSION
(
0
:
103
),
PARAMETER
::
namat_const
=
(/&
'va'
,
' H'
,
'He'
,
'Li'
,
'Be'
,
' B'
,
' C'
,
' N'
,
' O'
,
' F'
,
'Ne'
,&
...
...
main/cdngen.F90
View file @
777ec7f5
...
...
@@ -95,7 +95,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
CALL
orbcomp
%
init
(
input
,
banddos
,
dimension
,
atoms
,
kpts
)
CALL
outDen
%
init
(
stars
,
atoms
,
sphhar
,
vacuum
,
input
%
jspins
,
noco
%
l_noco
,
POTDEN_TYPE_DEN
)
CALL
EnergyDen
%
init
(
stars
,
atoms
,
sphhar
,
vacuum
,
input
%
jspins
,
noco
%
l_noco
,
POTDEN_TYPE_
kin
EnergyDen
)
CALL
EnergyDen
%
init
(
stars
,
atoms
,
sphhar
,
vacuum
,
input
%
jspins
,
noco
%
l_noco
,
POTDEN_TYPE_EnergyDen
)
IF
(
mpi
%
irank
==
0
)
CALL
openXMLElementNoAttributes
(
'valenceDensity'
)
...
...
@@ -114,7 +114,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
! calculate kinetic energy density for MetaGGAs
if
(
xcpot
%
exc_is_metagga
())
then
CALL
calc_kinEnergyDen
(
eig_id
,
mpi
,
kpts
,
noco
,
input
,
banddos
,
cell
,
outDen
,
atoms
,
enpara
,
stars
,&
vacuum
,
DIMENSION
,
sphhar
,
sym
,
vTot
,
oneD
,
results
,
xcpot
%
kin
EnergyDen
)
vacuum
,
DIMENSION
,
sphhar
,
sym
,
vTot
,
oneD
,
results
,
EnergyDen
)
endif
IF
(
mpi
%
irank
==
0
)
THEN
...
...
types/types_xcpot.F90
View file @
777ec7f5
...
...
@@ -14,15 +14,10 @@
MODULE
m_types_xcpot
IMPLICIT
NONE
PRIVATE
PUBLIC
::
t_xcpot
,
t_gradients
,
t_RS_potden
PUBLIC
::
t_xcpot
,
t_gradients
TYPE
t_RS_potden
REAL
,
ALLOCATABLE
::
is
(:,:),
mt
(:,:)
END
TYPE
t_RS_potden
TYPE
,
ABSTRACT
::
t_xcpot
REAL
::
gmaxxc
TYPE
(
t_RS_potden
)
::
kinEnergyDen
CONTAINS
PROCEDURE
::
vxc_is_LDA
=>
xcpot_vxc_is_LDA
PROCEDURE
::
exc_is_LDA
=>
xcpot_exc_is_LDA
...
...
@@ -109,6 +104,7 @@ CONTAINS
END
FUNCTION
xcpot_get_exchange_weight
SUBROUTINE
xcpot_get_vxc
(
xcpot
,
jspins
,
rh
,
vxc
,
vx
,
grad
)
USE
m_judft
IMPLICIT
NONE
CLASS
(
t_xcpot
),
INTENT
(
IN
)
::
xcpot
...
...
@@ -118,20 +114,29 @@ CONTAINS
!---> xc potential
REAL
,
INTENT
(
OUT
)
::
vxc
(:,:),
vx
(:,:)
TYPE
(
t_gradients
),
OPTIONAL
,
INTENT
(
INOUT
)::
grad
vxc
=
0.0
vx
=
0.0
call
juDFT_error
(
"Can't use XC-parrent class"
)
END
SUBROUTINE
xcpot_get_vxc
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
)
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
,
kinEnergyDen
)
USE
m_types_misc
USE
,
INTRINSIC
::
IEEE_ARITHMETIC
IMPLICIT
NONE
CLASS
(
t_xcpot
),
INTENT
(
IN
)
::
xcpot
INTEGER
,
INTENT
(
IN
)
::
jspins
CLASS
(
t_xcpot
),
INTENT
(
IN
)
::
xcpot
INTEGER
,
INTENT
(
IN
)
::
jspins
!--> charge density
REAL
,
INTENT
(
IN
)
::
rh
(:,:)
REAL
,
INTENT
(
IN
)
::
rh
(:,:)
!--> kinetic energy density
!---> xc energy density
REAL
,
INTENT
(
OUT
)
::
exc
(:)
TYPE
(
t_gradients
),
OPTIONAL
,
INTENT
(
IN
)::
grad
REAL
,
INTENT
(
OUT
)
::
exc
(:)
TYPE
(
t_gradients
),
OPTIONAL
,
INTENT
(
IN
)
::
grad
REAL
,
INTENT
(
IN
),
OPTIONAL
::
kinEnergyDen
(:,:)
exc
=
0.0
call
juDFT_error
(
"Can't use XC-parrent class"
)
END
SUBROUTINE
xcpot_get_exc
SUBROUTINE
xcpot_alloc_gradients
(
ngrid
,
jspins
,
grad
)
...
...
types/types_xcpot_inbuild.F90
View file @
777ec7f5
...
...
@@ -265,7 +265,7 @@ CONTAINS
END
SUBROUTINE
xcpot_get_vxc
!***********************************************************************
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
)
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
,
kinEnergyDen
)
!***********************************************************************
USE
m_xcxal
,
ONLY
:
excxal
USE
m_xcwgn
,
ONLY
:
excwgn
...
...
@@ -277,23 +277,14 @@ CONTAINS
USE
m_excpw91
USE
m_excepbe
IMPLICIT
NONE
!c
!c---> running mode parameters
!c
CLASS
(
t_xcpot_inbuild
),
INTENT
(
IN
)
::
xcpot
INTEGER
,
INTENT
(
IN
)
::
jspins
!c
!c---> charge density
!c
REAL
,
INTENT
(
IN
)
::
rh
(:,:)
!c
!c---> xc energy density
!c
REAL
,
INTENT
(
OUT
)
::
exc
(:)
CLASS
(
t_xcpot_inbuild
),
INTENT
(
IN
)
::
xcpot
INTEGER
,
INTENT
(
IN
)
::
jspins
REAL
,
INTENT
(
IN
)
::
rh
(:,:)
REAL
,
INTENT
(
OUT
)
::
exc
(:)
TYPE
(
t_gradients
),
OPTIONAL
,
INTENT
(
IN
)
::
grad
REAL
,
INTENT
(
IN
),
OPTIONAL
::
kinEnergyDen
(:,:)
! optional arguments for GGA
TYPE
(
t_gradients
),
OPTIONAL
,
INTENT
(
IN
)::
grad
!c
!c ---> local scalars
INTEGER
::
ngrid
...
...
types/types_xcpot_libxc.F90
View file @
777ec7f5
...
...
@@ -259,7 +259,7 @@ CONTAINS
END
SUBROUTINE
xcpot_get_vxc
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
,
kinEnergyDen
)
SUBROUTINE
xcpot_get_exc
(
xcpot
,
jspins
,
rh
,
exc
,
grad
,
kinEnergyDen
)
IMPLICIT
NONE
CLASS
(
t_xcpot_libxc
),
INTENT
(
IN
)
::
xcpot
INTEGER
,
INTENT
(
IN
)
::
jspins
...
...
xc-pot/metagga.F90
View file @
777ec7f5
...
...
@@ -4,7 +4,7 @@
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE
m_metagga
PUBLIC
::
calc_EnergyDen
,
t_RS_potden
PUBLIC
::
calc_EnergyDen
PRIVATE
::
calc_EnergyDen_auxillary_weights
,
subtract_RS
,
multiply_RS
INTERFACE
OPERATOR
(
-
)
...
...
@@ -51,18 +51,18 @@ CONTAINS
TYPE
(
t_potden
),
INTENT
(
in
)
::
vTot
TYPE
(
t_oneD
),
INTENT
(
in
)
::
oneD
TYPE
(
t_results
),
INTENT
(
in
)
::
results
TYPE
(
t_RS_potden
),
INTENT
(
inout
)
::
kinEnergyDen
REAL
,
INTENT
(
inout
)
::
kinEnergyDen
(:,:)
! local vars
TYPE
(
t_potden
)
::
EnergyDen
TYPE
(
t_RS_potden
)
::
den_RS
,
EnergyDen_RS
,
vTot_RS
TYPE
(
t_potden
)
::
EnergyDen
REAL
::
den_RS
(:,:),
EnergyDen_RS
(:,:),
vTot_RS
(:,:)
CALL
calc_EnergyDen
(
eig_id
,
mpi
,
kpts
,
noco
,
input
,
banddos
,
cell
,
atoms
,
enpara
,
stars
,
&
vacuum
,
DIMENSION
,
sphhar
,
sym
,
vTot
,
oneD
,
results
,
EnergyDen
)
CALL
transform_to_grid
(
input
,
noco
,
sym
,
stars
,
cell
,
den
,
atoms
,
sphhar
,
EnergyDen
,
vTot
,
den_RS
,
EnergyDen_RS
,
vTot_RS
)
!
CALL transform_to_grid(input, noco, sym, stars, cell, den, atoms, sphhar, EnergyDen, vTot, den_RS, EnergyDen_RS, vTot_RS)
kinEnergyDen
=
EnergyDen_RS
-
vTot_RS
*
den_RS
#else
...
...
@@ -167,64 +167,64 @@ CONTAINS
ENDDO
END
SUBROUTINE
calc_EnergyDen_auxillary_weights
SUBROUTINE
transform_to_grid
(
input
,
noco
,
sym
,
stars
,
cell
,
den
,
atoms
,
sphhar
,
EnergyDen
,
vTot
,
den_RS
,
EnergyDen_RS
,
vTot_RS
)
USE
m_types_potden
USE
m_types_setup
USE
m_types_xcpot_libxc
USE
m_types_xcpot
USE
m_juDFT_stop
USE
m_pw_tofrom_grid
USE
m_mt_tofrom_grid
!
SUBROUTINE transform_to_grid(input, noco, sym, stars, cell, den, atoms, sphhar, EnergyDen, vTot, den_RS, EnergyDen_RS, vTot_RS)
!
USE m_types_potden
!
USE m_types_setup
!
USE m_types_xcpot_libxc
!
USE m_types_xcpot
!
USE m_juDFT_stop
!
USE m_pw_tofrom_grid
!
USE m_mt_tofrom_grid
IMPLICIT
NONE
!
IMPLICIT NONE
TYPE
(
t_potden
),
INTENT
(
in
)
::
den
,
EnergyDen
,
vTot
TYPE
(
t_input
),
INTENT
(
in
)
::
input
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_atoms
),
INTENT
(
in
)
::
atoms
TYPE
(
t_sphhar
),
INTENT
(
in
)
::
sphhar
TYPE
(
t_RS_potden
),
INTENT
(
out
)
::
den_RS
,
EnergyDen_RS
,
vTot_RS
! could be changed to a real-space type
!local vars
TYPE
(
t_xcpot_libxc
)
::
aux_xcpot
TYPE
(
t_gradients
)
::
tmp_grad
INTEGER
,
PARAMETER
::
id_corr
=
9
,
id_exch
=
1
INTEGER
::
nsp
,
n
!make some auxillary xcpot, that is not a GGA (we don't need gradients)
CALL
aux_xcpot
%
init
(
input
%
jspins
,
id_exch
,
id_corr
,
id_exch
,
id_corr
)
IF
(
aux_xcpot
%
vxc_is_gga
())
CALL
juDFT_error
(
"aux_xcpot must not be GGA"
,
&
hint
=
"choose id_corr and id_exch correctly"
)
! interstitial part
CALL
init_pw_grid
(
aux_xcpot
,
stars
,
sym
,
cell
)
CALL
pw_to_grid
(
aux_xcpot
,
input
%
jspins
,
noco
%
l_noco
,
stars
,
cell
,
den
%
pw
,
tmp_grad
,
den_RS
%
is
)
CALL
pw_to_grid
(
aux_xcpot
,
input
%
jspins
,
noco
%
l_noco
,
stars
,
cell
,
EnergyDen
%
pw
,
tmp_grad
,
EnergyDen_RS
%
is
)
CALL
pw_to_grid
(
aux_xcpot
,
input
%
jspins
,
noco
%
l_noco
,
stars
,
cell
,
vTot
%
pw
,
tmp_grad
,
vTot_RS
%
is
)
CALL
finish_pw_grid
()
! muffin tins
nsp
=
(
atoms
%
lmaxd
+1
+
MOD
(
atoms
%
lmaxd
+1
,
2
))
*
(
2
*
atoms
%
lmaxd
+1
)
CALL
init_mt_grid
(
nsp
,
input
%
jspins
,
atoms
,
sphhar
,
aux_xcpot
,
sym
)
DO
n
=
1
,
atoms
%
ntype
CALL
mt_to_grid
(
aux_xcpot
,
input
%
jspins
,
atoms
,
sphhar
,
den
%
mt
(:,
0
:,
n
,:),
&
nsp
,
n
,
tmp_grad
,
den_RS
%
mt
)
CALL
mt_to_grid
(
aux_xcpot
,
input
%
jspins
,
atoms
,
sphhar
,
EnergyDen
%
mt
(:,
0
:,
n
,:),
&
nsp
,
n
,
tmp_grad
,
EnergyDen_RS
%
mt
)
CALL
mt_to_grid
(
aux_xcpot
,
input
%
jspins
,
atoms
,
sphhar
,
vTot
%
mt
(:,
0
:,
n
,:),
&
nsp
,
n
,
tmp_grad
,
vTot_RS
%
mt
)
ENDDO
CALL
finish_mt_grid
()
END
SUBROUTINE
transform_to_grid
!
TYPE(t_potden), INTENT(in) :: den, EnergyDen, vTot
!
TYPE(t_input), INTENT(in) :: input
!
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_atoms), INTENT(in) :: atoms
!
TYPE(t_sphhar), INTENT(in) :: sphhar
!REAL(:,:), INTENT(out)
:: den_RS, EnergyDen_RS, vTot_RS ! could be changed to a real-space type
!
!
local vars
!
TYPE(t_xcpot_libxc) ::aux_xcpot
!
TYPE(t_gradients) :: tmp_grad
!
INTEGER, PARAMETER :: id_corr = 9, id_exch = 1
!
INTEGER :: nsp, n
!
!
make some auxillary xcpot, that is not a GGA (we don't need gradients)
!
CALL aux_xcpot%init(input%jspins, id_exch, id_corr, id_exch, id_corr)
!
IF(aux_xcpot%vxc_is_gga()) CALL juDFT_error("aux_xcpot must not be GGA", &
!
hint="choose id_corr and id_exch correctly")
!
!
interstitial part
!
CALL init_pw_grid(aux_xcpot,stars,sym,cell)
!
CALL pw_to_grid(aux_xcpot, input%jspins, noco%l_noco, stars, cell, den%pw, tmp_grad, den_RS%is)
!
CALL pw_to_grid(aux_xcpot, input%jspins, noco%l_noco, stars, cell, EnergyDen%pw, tmp_grad, EnergyDen_RS%is)
!
CALL pw_to_grid(aux_xcpot, input%jspins, noco%l_noco, stars, cell, vTot%pw, tmp_grad, vTot_RS%is)
!
CALL finish_pw_grid()
!
!
muffin tins
!
nsp=(atoms%lmaxd+1+MOD(atoms%lmaxd+1,2))*(2*atoms%lmaxd+1)
!
CALL init_mt_grid(nsp,input%jspins,atoms,sphhar,aux_xcpot,sym)
!
DO n = 1,atoms%ntype
!
CALL mt_to_grid(aux_xcpot, input%jspins, atoms, sphhar, den%mt(:,0:,n,:), &
!
nsp, n, tmp_grad, den_RS%mt)
!
CALL mt_to_grid(aux_xcpot, input%jspins, atoms, sphhar, EnergyDen%mt(:,0:,n,:), &
!
nsp, n, tmp_grad, EnergyDen_RS%mt)
!
CALL mt_to_grid(aux_xcpot, input%jspins, atoms, sphhar, vTot%mt(:,0:,n,:), &
!
nsp, n, tmp_grad, vTot_RS%mt)
!
ENDDO
!
CALL finish_mt_grid()
!
END SUBROUTINE transform_to_grid
FUNCTION
subtract_RS
(
rs1
,
rs2
)
RESULT
(
rs_out
)
USE
m_types_xcpot
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment