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
8889da81
Commit
8889da81
authored
May 09, 2018
by
Daniel Wortmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small bugfixes. GGA from libxc still broken
parent
fb32fce4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
types/types_xcpot_libxc.F90
types/types_xcpot_libxc.F90
+4
-4
xc-pot/libxc_postprocess_gga.f90
xc-pot/libxc_postprocess_gga.f90
+5
-5
No files found.
types/types_xcpot_libxc.F90
View file @
8889da81
...
@@ -111,9 +111,7 @@ CONTAINS
...
@@ -111,9 +111,7 @@ CONTAINS
ALLOCATE
(
vxc_tmp
(
SIZE
(
vxc
,
2
),
SIZE
(
vxc
,
1
)));
vxc_tmp
=
0.0
ALLOCATE
(
vxc_tmp
(
SIZE
(
vxc
,
2
),
SIZE
(
vxc
,
1
)));
vxc_tmp
=
0.0
ALLOCATE
(
vx_tmp
(
SIZE
(
vx
,
2
),
SIZE
(
vx
,
1
)));
vx_tmp
=
0.0
ALLOCATE
(
vx_tmp
(
SIZE
(
vx
,
2
),
SIZE
(
vx
,
1
)));
vx_tmp
=
0.0
IF
(
xcpot
%
is_gga
())
THEN
IF
(
xcpot
%
is_gga
())
THEN
CALL
judft_error
(
"libxc GGA not implemented yet"
)
IF
(
.NOT.
PRESENT
(
grad
))
CALL
judft_error
(
"Bug: You called get_vxc for a GGA potential without providing derivatives"
)
IF
(
.NOT.
PRESENT
(
grad
))
CALL
judft_error
(
"Bug: You called get_vxc for a GGA potential without providing derivatives"
)
ALLOCATE
(
grad
%
vsigma
,
mold
=
grad
%
sigma
)
CALL
xc_f03_gga_vxc
(
xcpot
%
xc_func_x
,
SIZE
(
rh
,
1
),
TRANSPOSE
(
rh
),
grad
%
sigma
,
vx_tmp
,
grad
%
vsigma
)
CALL
xc_f03_gga_vxc
(
xcpot
%
xc_func_x
,
SIZE
(
rh
,
1
),
TRANSPOSE
(
rh
),
grad
%
sigma
,
vx_tmp
,
grad
%
vsigma
)
IF
(
xcpot
%
func_id_c
>
0
)
THEN
IF
(
xcpot
%
func_id_c
>
0
)
THEN
ALLOCATE
(
vsigma
,
mold
=
grad
%
sigma
)
ALLOCATE
(
vsigma
,
mold
=
grad
%
sigma
)
...
@@ -170,10 +168,12 @@ CONTAINS
...
@@ -170,10 +168,12 @@ CONTAINS
INTEGER
,
INTENT
(
IN
)
::
jspins
,
ngrid
INTEGER
,
INTENT
(
IN
)
::
jspins
,
ngrid
TYPE
(
t_gradients
),
INTENT
(
INOUT
)::
grad
TYPE
(
t_gradients
),
INTENT
(
INOUT
)::
grad
!For libxc we only need the sigma array...
!For libxc we only need the sigma array...
IF
(
ALLOCATED
(
grad
%
sigma
))
DEALLOCATE
(
grad
%
sigma
,
grad
%
gr
)
IF
(
ALLOCATED
(
grad
%
sigma
))
DEALLOCATE
(
grad
%
sigma
,
grad
%
gr
,
grad
%
laplace
,
grad
%
vsigma
)
ALLOCATE
(
grad
%
sigma
(
MERGE
(
1
,
3
,
jspins
==
1
),
ngrid
))
ALLOCATE
(
grad
%
sigma
(
MERGE
(
1
,
3
,
jspins
==
1
),
ngrid
))
ALLOCATE
(
grad
%
gr
(
3
,
ngrid
,
jspins
))
ALLOCATE
(
grad
%
gr
(
3
,
ngrid
,
jspins
))
ALLOCATE
(
grad
%
laplace
(
ngrid
,
jspins
))
ALLOCATE
(
grad
%
vsigma
,
mold
=
grad
%
sigma
)
END
SUBROUTINE
xcpot_alloc_gradients
END
SUBROUTINE
xcpot_alloc_gradients
...
...
xc-pot/libxc_postprocess_gga.f90
View file @
8889da81
...
@@ -25,11 +25,11 @@ CONTAINS
...
@@ -25,11 +25,11 @@ CONTAINS
n_sigma
=
MERGE
(
1
,
3
,
SIZE
(
v_xc
,
2
)
==
1
)
!Number of contracted gradients in libxc 1 for non-spin-polarized, 3 otherwise
n_sigma
=
MERGE
(
1
,
3
,
SIZE
(
v_xc
,
2
)
==
1
)
!Number of contracted gradients in libxc 1 for non-spin-polarized, 3 otherwise
nsp
=
SIZE
(
v_xc
,
1
)
!no of points
nsp
=
SIZE
(
v_xc
,
1
)
!no of points
ALLOCATE
(
vsigma
(
nsp
,
n_sigma
),
vsigma_mt
(
atoms
%
jri
(
n
),
0
:
atoms
%
lmax
(
n
)
,
n_sigma
))
ALLOCATE
(
vsigma
(
nsp
,
n_sigma
),
vsigma_mt
(
atoms
%
jri
(
n
),
0
:
sphhar
%
nlhd
,
n_sigma
))
vsigma
=
TRANSPOSE
(
grad
%
vsigma
)
!create a (nsp,n_sigma) matrix
vsigma
=
TRANSPOSE
(
grad
%
vsigma
)
!create a (nsp,n_sigma) matrix
CALL
mt_from_grid
(
atoms
,
sphhar
,
nsp
,
n
,
n_sigma
,
vsigma
,
vsigma_mt
)
CALL
mt_from_grid
(
atoms
,
sphhar
,
nsp
/
atoms
%
jmtd
,
n
,
n_sigma
,
vsigma
,
vsigma_mt
)
ALLOCATE
(
grad_sigma
%
gr
(
3
,
nsp
,
n_sigma
))
ALLOCATE
(
grad_sigma
%
gr
(
3
,
nsp
,
n_sigma
))
CALL
mt_to_grid
(
atoms
,
sphhar
,
vsigma_mt
,
nsp
,
n_sigma
,
n
,
.TRUE.
,
grad
=
grad_sigma
)
CALL
mt_to_grid
(
atoms
,
sphhar
,
vsigma_mt
,
nsp
/
atoms
%
jmtd
,
n_sigma
,
n
,
.TRUE.
,
grad
=
grad_sigma
)
CALL
libxc_postprocess_gga
(
vsigma
,
grad
,
grad_sigma
,
v_xc
)
CALL
libxc_postprocess_gga
(
vsigma
,
grad
,
grad_sigma
,
v_xc
)
END
SUBROUTINE
libxc_postprocess_gga_mt
END
SUBROUTINE
libxc_postprocess_gga_mt
...
@@ -56,7 +56,7 @@ CONTAINS
...
@@ -56,7 +56,7 @@ CONTAINS
CALL
pw_from_grid
(
xcpot
,
stars
,
.FALSE.
,
vsigma
,
vsigma_g
)
CALL
pw_from_grid
(
xcpot
,
stars
,
.FALSE.
,
vsigma
,
vsigma_g
)
ALLOCATE
(
grad_sigma
%
gr
(
3
,
nsp
,
n_sigma
))
ALLOCATE
(
grad_sigma
%
gr
(
3
,
nsp
,
n_sigma
))
CALL
pw_to_grid
(
xcpot
,
3
,
.false.
,
stars
,
cell
,
vsigma_g
,
grad_sigma
)
CALL
pw_to_grid
(
xcpot
,
n_sigma
,
.false.
,
stars
,
cell
,
vsigma_g
,
grad_sigma
)
CALL
libxc_postprocess_gga
(
vsigma
,
grad
,
grad_sigma
,
v_xc
)
CALL
libxc_postprocess_gga
(
vsigma
,
grad
,
grad_sigma
,
v_xc
)
...
@@ -72,7 +72,7 @@ CONTAINS
...
@@ -72,7 +72,7 @@ CONTAINS
INTEGER
::
i
INTEGER
::
i
IF
(
SIZE
(
v_xc
,
2
)
==
1
)
THEN
!Single spin
IF
(
SIZE
(
v_xc
,
2
)
==
1
)
THEN
!Single spin
DO
i
=
1
,
SIZE
(
v_xc
,
1
)
!loop over points
DO
i
=
1
,
SIZE
(
v_xc
,
1
)
!loop over points
v_xc
(
i
,
1
)
=
v_xc
(
i
,
1
)
-
dot_PRODUCT
(
grad_sigma
%
gr
(:,
i
,
1
),
grad
%
gr
(:,
i
,
1
))
-
vsigma
(
i
,
1
)
*
grad
%
laplace
(
i
,
1
)
v_xc
(
i
,
1
)
=
v_xc
(
i
,
1
)
-
2
*
dot_PRODUCT
(
grad_sigma
%
gr
(:,
i
,
1
),
grad
%
gr
(:,
i
,
1
))
-2
*
vsigma
(
i
,
1
)
*
grad
%
laplace
(
i
,
1
)
)
ENDDO
ENDDO
ELSE
!two spins
ELSE
!two spins
DO
i
=
1
,
SIZE
(
v_xc
,
1
)
!loop over points
DO
i
=
1
,
SIZE
(
v_xc
,
1
)
!loop over points
...
...
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