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
52
Issues
52
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
e7322d58
Commit
e7322d58
authored
Apr 23, 2018
by
Daniel Wortmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved generation of ratated density into vgen, vmatgen into vgen_finalize, Bugfixes in MPI
parent
600aa2ad
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
359 additions
and
49 deletions
+359
-49
main/fleur.F90
main/fleur.F90
+4
-31
main/vgen.F90
main/vgen.F90
+13
-5
vgen/CMakeLists.txt
vgen/CMakeLists.txt
+1
-1
vgen/rotate_int_den_to_local.F90
vgen/rotate_int_den_to_local.F90
+324
-0
vgen/vgen_finalize.F90
vgen/vgen_finalize.F90
+8
-2
vgen/vgen_xcpot.F90
vgen/vgen_xcpot.F90
+0
-1
vgen/vmatgen.f90
vgen/vmatgen.f90
+9
-9
No files found.
main/fleur.F90
View file @
e7322d58
...
...
@@ -98,7 +98,7 @@ CONTAINS
TYPE
(
t_coreSpecInput
)
::
coreSpecInput
TYPE
(
t_wann
)
::
wann
TYPE
(
t_potden
)
::
vTot
,
vx
,
vCoul
,
vTemp
TYPE
(
t_potden
)
::
inDen
,
outDen
,
inDenRot
TYPE
(
t_potden
)
::
inDen
,
outDen
CLASS
(
t_forcetheo
),
ALLOCATABLE
::
forcetheo
! .. Local Scalars ..
...
...
@@ -147,7 +147,6 @@ CONTAINS
! Initialize and load inDen density (start)
CALL
inDen
%
init
(
stars
,
atoms
,
sphhar
,
vacuum
,
input
%
jspins
,
noco
%
l_noco
,
POTDEN_TYPE_DEN
)
CALL
inDenRot
%
init
(
stars
,
atoms
,
sphhar
,
vacuum
,
input
%
jspins
,
noco
%
l_noco
,
POTDEN_TYPE_DEN
)
archiveType
=
CDN_ARCHIVE_TYPE_CDN1_const
IF
(
noco
%
l_noco
)
archiveType
=
CDN_ARCHIVE_TYPE_NOCO_const
...
...
@@ -175,7 +174,6 @@ CONTAINS
it
=
it
+
1
IF
(
mpi
%
irank
.EQ.
0
)
CALL
openXMLElementFormPoly
(
'iteration'
,(/
'numberForCurrentRun'
,
'overallNumber '
/)&
,(/
it
,
inden
%
iter
/),
RESHAPE
((/
19
,
13
,
5
,
5
/),(/
2
,
2
/)))
inDenRot
=
inDen
!!$ !+t3e
!!$ IF (input%alpha.LT.10.0) THEN
...
...
@@ -195,19 +193,6 @@ CONTAINS
! ----> potential generator
!
!---> pk non-collinear
!---> reload the density matrix from file rhomat_in
!---> calculate spin-up and -down density for USE in the
!---> potential generator and store the direction of
!---> magnetization on file dirofmag
IF
(
noco
%
l_noco
)
THEN
CALL
timestart
(
"gen. spin-up and -down density"
)
CALL
rhodirgen
(
DIMENSION
,
sym
,
stars
,
atoms
,
sphhar
,&
vacuum
,
cell
,
input
,
noco
,
oneD
,
inDenRot
)
CALL
timestop
(
"gen. spin-up and -down density"
)
ENDIF
!---> pk non-collinear
reap
=
.NOT.
obsolete
%
disp
input
%
total
=
.TRUE.
ENDIF
!mpi%irank.eq.0
...
...
@@ -217,7 +202,6 @@ CONTAINS
#ifdef CPP_MPI
CALL
mpi_bc_potden
(
mpi
,
stars
,
sphhar
,
atoms
,
input
,
vacuum
,
oneD
,
noco
,
inDen
)
CALL
mpi_bc_potden
(
mpi
,
stars
,
sphhar
,
atoms
,
input
,
vacuum
,
oneD
,
noco
,
inDenRot
)
#endif
...
...
@@ -246,20 +230,9 @@ CONTAINS
CALL
timestart
(
"generation of potential"
)
CALL
vgen
(
hybrid
,
field
,
input
,
xcpot
,
DIMENSION
,
atoms
,
sphhar
,
stars
,
vacuum
,&
sym
,
obsolete
,
cell
,
oneD
,
sliceplot
,
mpi
,
results
,
noco
,
inDen
,
inDenRot
,
vTot
,
vx
,
vCoul
)
sym
,
obsolete
,
cell
,
oneD
,
sliceplot
,
mpi
,
results
,
noco
,
inDen
,
vTot
,
vx
,
vCoul
)
CALL
timestop
(
"generation of potential"
)
IF
(
mpi
%
irank
.EQ.
0
)
THEN
!---> pk non-collinear
!---> generate the four component matrix potential from spin up
!---> and down potentials and direction of the magnetic field
IF
(
noco
%
l_noco
)
THEN
CALL
timestart
(
"generation of potential-matrix"
)
CALL
vmatgen
(
stars
,
atoms
,
sphhar
,
vacuum
,
sym
,
input
,
oneD
,
inDenRot
,
vTot
)
CALL
timestop
(
"generation of potential-matrix"
)
ENDIF
!
ENDIF
! mpi%irank.eq.0
...
...
@@ -278,7 +251,7 @@ CONTAINS
CALL
enpara
%
update
(
mpi
,
atoms
,
vacuum
,
input
,
vToT
)
CALL
eigen
(
mpi
,
stars
,
sphhar
,
atoms
,
obsolete
,
xcpot
,&
sym
,
kpts
,
DIMENSION
,
vacuum
,
input
,
cell
,
enpara
,
banddos
,
noco
,
oneD
,
hybrid
,&
it
,
eig_id
,
results
,
inDen
Rot
,
vTemp
,
vx
)
it
,
eig_id
,
results
,
inDen
,
vTemp
,
vx
)
vTot
%
mmpMat
=
vTemp
%
mmpMat
!!$ eig_idList(pc) = eig_id
CALL
timestop
(
"eigen"
)
...
...
main/vgen.F90
View file @
e7322d58
...
...
@@ -7,7 +7,7 @@ MODULE m_vgen
USE
m_juDFT
CONTAINS
SUBROUTINE
vgen
(
hybrid
,
field
,
input
,
xcpot
,
DIMENSION
,
atoms
,
sphhar
,
stars
,&
vacuum
,
sym
,
obsolete
,
cell
,
oneD
,
sliceplot
,
mpi
,
results
,
noco
,
den
,
denRot
,
vTot
,
vx
,
vCoul
)
vacuum
,
sym
,
obsolete
,
cell
,
oneD
,
sliceplot
,
mpi
,
results
,
noco
,
den
,
vTot
,
vx
,
vCoul
)
! ***********************************************************
! FLAPW potential generator *
! ***********************************************************
...
...
@@ -17,6 +17,7 @@ CONTAINS
! TE_VEFF: charge density-effective potential integral
! TE_EXC : charge density-ex-corr.energy density integral
! ***********************************************************
USE
m_rotate_int_den_to_local
USE
m_bfield
USE
m_vgen_coulomb
USE
m_vgen_xcpot
...
...
@@ -43,11 +44,11 @@ CONTAINS
TYPE
(
t_cell
),
INTENT
(
IN
)
::
cell
TYPE
(
t_sphhar
),
INTENT
(
IN
)
::
sphhar
TYPE
(
t_atoms
),
INTENT
(
IN
)
::
atoms
TYPE
(
t_potden
),
INTENT
(
INOUT
)
::
den
,
denRot
TYPE
(
t_potden
),
INTENT
(
INOUT
)
::
den
TYPE
(
t_potden
),
INTENT
(
INOUT
)
::
vTot
,
vx
,
vCoul
! ..
TYPE
(
t_potden
)
::
workden
TYPE
(
t_potden
)
::
workden
,
denRot
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'
,
/
)
...
...
@@ -68,11 +69,18 @@ CONTAINS
CALL
vCoul
%
copy_both_spin
(
vTot
)
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
,
vT
ot
)
CALL
vgen_finalize
(
atoms
,
stars
,
vacuum
,
sym
,
noco
,
input
,
vTot
,
denR
ot
)
DEALLOCATE
(
vcoul
%
pw_w
,
vx
%
pw_w
)
...
...
vgen/CMakeLists.txt
View file @
e7322d58
...
...
@@ -30,7 +30,7 @@ vgen/vgen_xcpot.F90
vgen/vgen_finalize.F90
vgen/prp_xcfft_map.f90
vgen/psqpw.F90
vgen/r
hodirgen.f
90
vgen/r
otate_int_den_to_local.F
90
vgen/vintcz.f90
vgen/visxc.f90
vgen/visxcg.f90
...
...
vgen/rotate_int_den_to_local.F90
0 → 100644
View file @
e7322d58
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE
m_rotate_int_den_to_local
USE
m_juDFT
!**********************************************************************
! This subroutine calculates the spin-up and -down density, in the INT-region,
! e.i. it take the non-colinear density and rotates it locally into the
! spin-frame that make it spin-diagonal.
! The rotated density is needed to calculate the potential-energy integrals
! in vgen_xcpot. For accuracy reasons, the magnetisation for the potential
! itself is regeneated from the unrotated densities.
! In addition this routine stores the angle used in the rotation.
! These angles are needed in vgen->vgen_finalize->vmatgen to rotate the up- and down-
! potentials back to the global frame. DW 2018
! Based on rhodirgen by
! Philipp Kurz 99/11/01
!**********************************************************************
CONTAINS
SUBROUTINE
rotate_int_den_to_local
(
DIMENSION
,
sym
,
stars
,
atoms
,
sphhar
,
vacuum
,&
cell
,
input
,
noco
,
oneD
,
den
)
!******** ABBREVIATIONS ***********************************************
! ifft3 : size of the 3d real space mesh
! ifft2 : size of the 2d real space mesh
! rpw : diagonal components of the density matrix (rho_11 ,
! rho_22)
! later interstitial spin-up and -down density
! all stored in terms of 3d-stars
! ris : first components of the density matrix
! later interstitial spin-up and -down density and
! direction of magnetic field (theta and phi)
! all stored on real space mesh
!**********************************************************************
USE
m_constants
USE
m_fft2d
USE
m_fft3d
USE
m_types
IMPLICIT
NONE
TYPE
(
t_dimension
),
INTENT
(
IN
)
::
DIMENSION
TYPE
(
t_noco
),
INTENT
(
IN
)
::
noco
TYPE
(
t_oneD
),
INTENT
(
IN
)
::
oneD
TYPE
(
t_input
),
INTENT
(
IN
)
::
input
TYPE
(
t_vacuum
),
INTENT
(
IN
)
::
vacuum
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
! .. Local Scalars ..
INTEGER
iden
,
jspin
,
ivac
,
ifft2
,
ifft3
INTEGER
imz
,
ityp
,
iri
,
ilh
,
imesh
,
iq2
,
iq3
REAL
rho_11
,
rho_22
,
rho_21r
,
rho_21i
,
rhotot
,
magmom
,
phi
REAL
rho_up
,
rho_down
,
mx
,
my
,
mz
,
eps
,
vz_r
,
vz_i
,
rziw
,
theta
! ..
! .. Local Arrays ..
REAL
,
ALLOCATABLE
::
rz
(:,:,:)
REAL
,
ALLOCATABLE
::
rvacxy
(:,:,:,:),
ris
(:,:),
fftwork
(:)
! ..
eps
=
1.0e-20
!
!---> initialize arrays for the density matrix
!
ifft3
=
27
*
stars
%
mx1
*
stars
%
mx2
*
stars
%
mx3
IF
(
input
%
film
)
THEN
ifft2
=
9
*
stars
%
mx1
*
stars
%
mx2
IF
(
oneD
%
odi
%
d1
)
ifft2
=
9
*
stars
%
mx3
*
oneD
%
odi
%
M
ELSE
ifft2
=
0
END
IF
IF
(
ALLOCATED
(
den
%
phi_pw
))
THEN
DEALLOCATE
(
den
%
phi_pw
,
den
%
phi_vacz
,
den
%
phi_vacxy
)
DEALLOCATE
(
den
%
theta_pw
,
den
%
theta_vacz
,
den
%
theta_vacxy
)
ENDIF
ALLOCATE
(
den
%
phi_pw
(
ifft3
),
den
%
theta_pw
(
ifft3
))
ALLOCATE
(
den
%
phi_vacz
(
vacuum
%
nmzd
,
2
),
den
%
theta_vacz
(
vacuum
%
nmzd
,
2
))
ALLOCATE
(
den
%
phi_vacxy
(
ifft2
,
vacuum
%
nmzxyd
,
2
),
den
%
theta_vacxy
(
ifft2
,
vacuum
%
nmzxyd
,
2
))
ALLOCATE
(
ris
(
ifft3
,
4
),
fftwork
(
ifft3
))
!---> fouriertransform the diagonal part of the density matrix
!---> in the interstitial, den%pw, to real space (ris)
DO
iden
=
1
,
2
CALL
fft3d
(
ris
(:,
iden
),
fftwork
,
den
%
pw
(:,
iden
),
stars
,
+1
)
ENDDO
!---> fouriertransform the off-diagonal part of the density matrix
CALL
fft3d
(
ris
(:,
3
),
ris
(:,
4
),
den
%
pw
(:,
3
),
stars
,
+1
)
!test
! DO iden=1,4
! write(*,*)'iden=',iden
! write(*,8500)(ris(imesh,iden),imesh=0,ifft3-1)
! enddo
!test
!---> calculate the charge and magnetization density on the
!---> real space mesh
DO
imesh
=
1
,
ifft3
rho_11
=
ris
(
imesh
,
1
)
rho_22
=
ris
(
imesh
,
2
)
rho_21r
=
ris
(
imesh
,
3
)
rho_21i
=
ris
(
imesh
,
4
)
mx
=
2
*
rho_21r
my
=
-2
*
rho_21i
mz
=
(
rho_11
-
rho_22
)
magmom
=
SQRT
(
mx
**
2
+
my
**
2
+
mz
**
2
)
rhotot
=
rho_11
+
rho_22
rho_up
=
(
rhotot
+
magmom
)/
2
rho_down
=
(
rhotot
-
magmom
)/
2
IF
(
ABS
(
mz
)
.LE.
eps
)
THEN
theta
=
pi_const
/
2
ELSEIF
(
mz
.GE.
0.0
)
THEN
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
ELSE
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
+
pi_const
ENDIF
IF
(
ABS
(
mx
)
.LE.
eps
)
THEN
IF
(
ABS
(
my
)
.LE.
eps
)
THEN
phi
=
0.0
ELSEIF
(
my
.GE.
0.0
)
THEN
phi
=
pi_const
/
2
ELSE
phi
=
-
pi_const
/
2
ENDIF
ELSEIF
(
mx
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
ELSE
IF
(
my
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
+
pi_const
ELSE
phi
=
ATAN
(
my
/
mx
)
-
pi_const
ENDIF
ENDIF
! write(36,'(i4,2f12.6)') mod(imesh,33),rho_11,rho_22
ris
(
imesh
,
1
)
=
rho_up
ris
(
imesh
,
2
)
=
rho_down
den
%
theta_pw
(
imesh
)
=
theta
den
%
phi_pw
(
imesh
)
=
phi
ENDDO
DO
jspin
=
1
,
input
%
jspins
fftwork
=
0.0
CALL
fft3d
(
ris
(:,
jspin
),
fftwork
,
den
%
pw
(:,
jspin
),
stars
,
-1
)
ENDDO
IF
(
.NOT.
input
%
film
)
RETURN
!Now the vacuum part starts
ALLOCATE
(
rvacxy
(
ifft2
,
vacuum
%
nmzxyd
,
2
,
4
))
ALLOCATE
(
rz
(
vacuum
%
nmzd
,
2
,
2
))
!---> fouriertransform the diagonal part of the density matrix
!---> in the vacuum, rz & rxy, to real space (rvacxy)
DO
iden
=
1
,
2
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
rziw
=
0.0
IF
(
oneD
%
odi
%
d1
)
THEN
CALL
judft_error
(
"oneD not implemented"
,
calledby
=
"rhodirgen"
)
!CALL fft2d(oneD%k3,odi%M,odi%n2d,rvacxy(0,imz,ivac,iden),fftwork,&
! den%vacz(imz,ivac,iden),rziw,den%vacxy(imz,1,ivac,iden),&
! vacuum,odi%nq2,odi%kimax2,1,&
! & %igf,odl%pgf,odi%nst2)
ELSE
CALL
fft2d
(
stars
,
rvacxy
(:,
imz
,
ivac
,
iden
),
fftwork
,&
den
%
vacz
(
imz
,
ivac
,
iden
),
rziw
,
den
%
vacxy
(
imz
,
1
,
ivac
,
iden
),&
vacuum
%
nmzxyd
,
1
)
ENDIF
ENDDO
ENDDO
ENDDO
!---> fouriertransform the off-diagonal part of the density matrix
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
rziw
=
0.0
vz_r
=
den
%
vacz
(
imz
,
ivac
,
3
)
vz_i
=
den
%
vacz
(
imz
,
ivac
,
4
)
IF
(
oneD
%
odi
%
d1
)
THEN
CALL
judft_error
(
"oneD not implemented"
,
calledby
=
"rhodirgen"
)
!CALL fft2d(oneD%k3,odi%M,odi%n2d,&
! rvacxy(0,imz,ivac,3),rvacxy(0,imz,ivac,4),&
! vz_r,vz_i,den%vacxy(imz,1,ivac,3),&
! vacuum,odi%nq2,odi%kimax2,1,&
! & %igf,odl%pgf,odi%nst2)
ELSE
CALL
fft2d
(
stars
,
rvacxy
(:,
imz
,
ivac
,
3
),
rvacxy
(:,
imz
,
ivac
,
4
),&
vz_r
,
vz_i
,
den
%
vacxy
(
imz
,
1
,
ivac
,
3
),
vacuum
%
nmzxyd
,
1
)
ENDIF
ENDDO
ENDDO
!---> calculate the four components of the matrix potential on
!---> real space mesh
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
DO
imesh
=
1
,
ifft2
rho_11
=
rvacxy
(
imesh
,
imz
,
ivac
,
1
)
rho_22
=
rvacxy
(
imesh
,
imz
,
ivac
,
2
)
rho_21r
=
rvacxy
(
imesh
,
imz
,
ivac
,
3
)
rho_21i
=
rvacxy
(
imesh
,
imz
,
ivac
,
4
)
mx
=
2
*
rho_21r
my
=
-2
*
rho_21i
mz
=
(
rho_11
-
rho_22
)
magmom
=
SQRT
(
mx
**
2
+
my
**
2
+
mz
**
2
)
rhotot
=
rho_11
+
rho_22
rho_up
=
(
rhotot
+
magmom
)/
2
rho_down
=
(
rhotot
-
magmom
)/
2
IF
(
ABS
(
mz
)
.LE.
eps
)
THEN
theta
=
pi_const
/
2
ELSEIF
(
mz
.GE.
0.0
)
THEN
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
ELSE
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
+
pi_const
ENDIF
IF
(
ABS
(
mx
)
.LE.
eps
)
THEN
IF
(
ABS
(
my
)
.LE.
eps
)
THEN
phi
=
0.0
ELSEIF
(
my
.GE.
0.0
)
THEN
phi
=
pi_const
/
2
ELSE
phi
=
-
pi_const
/
2
ENDIF
ELSEIF
(
mx
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
ELSE
IF
(
my
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
+
pi_const
ELSE
phi
=
ATAN
(
my
/
mx
)
-
pi_const
ENDIF
ENDIF
rvacxy
(
imesh
,
imz
,
ivac
,
1
)
=
rho_up
rvacxy
(
imesh
,
imz
,
ivac
,
2
)
=
rho_down
den
%
theta_vacxy
(
imesh
,
imz
,
ivac
)
=
theta
den
%
phi_vacxy
(
imesh
,
imz
,
ivac
)
=
phi
ENDDO
ENDDO
DO
imz
=
vacuum
%
nmzxyd
+1
,
vacuum
%
nmzd
rho_11
=
den
%
vacz
(
imz
,
ivac
,
1
)
rho_22
=
den
%
vacz
(
imz
,
ivac
,
2
)
rho_21r
=
den
%
vacz
(
imz
,
ivac
,
3
)
rho_21i
=
den
%
vacz
(
imz
,
ivac
,
4
)
mx
=
2
*
rho_21r
my
=
-2
*
rho_21i
mz
=
(
rho_11
-
rho_22
)
magmom
=
SQRT
(
mx
**
2
+
my
**
2
+
mz
**
2
)
rhotot
=
rho_11
+
rho_22
rho_up
=
(
rhotot
+
magmom
)/
2
rho_down
=
(
rhotot
-
magmom
)/
2
IF
(
ABS
(
mz
)
.LE.
eps
)
THEN
theta
=
pi_const
/
2
ELSEIF
(
mz
.GE.
0.0
)
THEN
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
ELSE
theta
=
ATAN
(
SQRT
(
mx
**
2
+
my
**
2
)/
mz
)
+
pi_const
ENDIF
IF
(
ABS
(
mx
)
.LE.
eps
)
THEN
IF
(
ABS
(
my
)
.LE.
eps
)
THEN
phi
=
0.0
ELSEIF
(
my
.GE.
0.0
)
THEN
phi
=
pi_const
/
2
ELSE
phi
=
-
pi_const
/
2
ENDIF
ELSEIF
(
mx
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
ELSE
IF
(
my
.GE.
0.0
)
THEN
phi
=
ATAN
(
my
/
mx
)
+
pi_const
ELSE
phi
=
ATAN
(
my
/
mx
)
-
pi_const
ENDIF
ENDIF
den
%
vacz
(
imz
,
ivac
,
1
)
=
rho_up
den
%
vacz
(
imz
,
ivac
,
2
)
=
rho_down
den
%
theta_vacz
(
imz
,
ivac
)
=
theta
den
%
phi_vacz
(
imz
,
ivac
)
=
phi
ENDDO
ENDDO
!---> Fouriertransform the matrix potential back to reciprocal space
DO
jspin
=
1
,
input
%
jspins
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
fftwork
=
0.0
IF
(
oneD
%
odi
%
d1
)
THEN
call
judft_error
(
"oneD not implemented"
,
calledby
=
"rhodirgen"
)
!CALL fft2d(oneD%k3,odi%M,odi%n2d,&
! rvacxy(0,imz,ivac,jspin),fftwork,&
! den%vacz(imz,ivac,jspin),rziw,den%vacxy(imz,1,ivac,jspin),&
! vacuum,odi%nq2,odi%kimax2,-1,&
! & %igf,odl%pgf,odi%nst2)
ELSE
CALL
fft2d
(
stars
,
rvacxy
(:,
imz
,
ivac
,
jspin
),
fftwork
,&
den
%
vacz
(
imz
,
ivac
,
jspin
),
rziw
,
den
%
vacxy
(
imz
,
1
,
ivac
,
jspin
),&
vacuum
%
nmzxyd
,
-1
)
END
IF
ENDDO
ENDDO
ENDDO
RETURN
END
SUBROUTINE
rotate_int_den_to_local
END
MODULE
m_rotate_int_den_to_local
vgen/vgen_finalize.F90
View file @
e7322d58
...
...
@@ -6,13 +6,16 @@
MODULE
m_vgen_finalize
USE
m_juDFT
CONTAINS
SUBROUTINE
vgen_finalize
(
atoms
,
stars
,
vacuum
,
sym
,
noco
,
vT
ot
)
SUBROUTINE
vgen_finalize
(
atoms
,
stars
,
vacuum
,
sym
,
noco
,
input
,
vTot
,
denR
ot
)
! ***********************************************************
! FLAPW potential generator *
! ***********************************************************
! some rescaling is done here
! ***********************************************************
! in noco case vmatgen is called to generate 2x2 int-potential
! **********************************************************
USE
m_constants
USE
m_vmatgen
USE
m_types
IMPLICIT
NONE
TYPE
(
t_vacuum
),
INTENT
(
IN
)
::
vacuum
...
...
@@ -20,7 +23,8 @@ CONTAINS
TYPE
(
t_sym
),
INTENT
(
IN
)
::
sym
TYPE
(
t_stars
),
INTENT
(
IN
)
::
stars
TYPE
(
t_atoms
),
INTENT
(
IN
)
::
atoms
TYPE
(
t_potden
),
INTENT
(
INOUT
)
::
vTot
TYPE
(
t_input
),
INTENT
(
IN
)
::
input
TYPE
(
t_potden
),
INTENT
(
INOUT
)
::
vTot
,
denRot
! ..
! .. Local Scalars ..
INTEGER
i
,
js
,
n
...
...
@@ -42,6 +46,8 @@ CONTAINS
ENDDO
ENDDO
DEALLOCATE
(
vtot
%
pw_w
)
ELSEIF
(
noco
%
l_noco
)
THEN
CALL
vmatgen
(
stars
,
atoms
,
vacuum
,
sym
,
input
,
denRot
,
vtot
)
ENDIF
!Copy first vacuum into second vacuum if this was not calculated before
...
...
vgen/vgen_xcpot.F90
View file @
e7322d58
...
...
@@ -167,7 +167,6 @@ CONTAINS
CALL
timestart
(
"Vxc in MT"
)
END
IF
#ifdef CPP_MPI
CALL
MPI_BCAST
(
input
%
efield
%
vslope
,
1
,
MPI_DOUBLE_COMPLEX
,
0
,
mpi
%
mpi_comm
,
ierr
)
CALL
MPI_BCAST
(
den
%
mt
,
atoms
%
jmtd
*
(
1
+
sphhar
%
nlhd
)
*
atoms
%
ntype
*
dimension
%
jspd
,
MPI_DOUBLE_PRECISION
,
0
,
mpi
%
mpi_comm
,
ierr
)
#endif
IF
(
xcpot
%
is_gga
())
THEN
...
...
vgen/vmatgen.f90
View file @
e7322d58
...
...
@@ -23,7 +23,7 @@ MODULE m_vmatgen
! Philipp Kurz 99/11/01
!**********************************************************************
CONTAINS
SUBROUTINE
vmatgen
(
stars
,
atoms
,
sphhar
,
vacuum
,
sym
,
input
,
oneD
,
den
,
v
)
SUBROUTINE
vmatgen
(
stars
,
atoms
,
vacuum
,
sym
,
input
,
den
,
v
)
!******** ABBREVIATIONS ***********************************************
! ifft3 : size of the 3d real space mesh
...
...
@@ -41,12 +41,11 @@ CONTAINS
USE
m_fft3d
USE
m_types
IMPLICIT
NONE
TYPE
(
t_oneD
),
INTENT
(
IN
)
::
oneD
!
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE
(
t_input
),
INTENT
(
IN
)
::
input
TYPE
(
t_vacuum
),
INTENT
(
IN
)
::
vacuum
TYPE
(
t_sym
),
INTENT
(
IN
)
::
sym
TYPE
(
t_stars
),
INTENT
(
IN
)
::
stars
TYPE
(
t_sphhar
),
INTENT
(
IN
)
::
sphhar
TYPE
(
t_atoms
),
INTENT
(
IN
)
::
atoms
TYPE
(
t_potden
),
INTENT
(
IN
)
::
den
TYPE
(
t_potden
),
INTENT
(
INOUT
)::
v
...
...
@@ -121,8 +120,8 @@ CONTAINS
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
vziw
=
0.0
IF
(
oneD
%
odi
%
d1
)
THEN
!
IF (oneD%odi%d1) THEN
IF
(
.FALSE.
)
THEN
CALL
judft_error
(
"oneD not implemented"
,
calledby
=
"vmatgen"
)
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
...
...
@@ -174,8 +173,8 @@ CONTAINS
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
fftwork
=
0.0
IF
(
oneD
%
odi
%
d1
)
THEN
!
IF (oneD%odi%d1) THEN
IF
(
.FALSE.
)
THEN
CALL
judft_error
(
"oneD not implemented"
,
calledby
=
"vmatgen"
)
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
...
...
@@ -194,7 +193,8 @@ CONTAINS
DO
ivac
=
1
,
vacuum
%
nvac
DO
imz
=
1
,
vacuum
%
nmzxyd
fftwork
=
0.0
IF
(
oneD
%
odi
%
d1
)
THEN
!IF (oneD%odi%d1) THEN
IF
(
.FALSE.
)
THEN
CALL
judft_error
(
"oneD not implemented"
,
calledby
=
"vmatgen"
)
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
...
...
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