51 logical :: apply = .false.
52 logical :: mixU = .false.
54 real(real64),
allocatable :: dtmp_occ(:,:), tmpU(:,:)
55 complex(real64),
allocatable :: ztmp_occ(:,:)
57 type(mixfield_t) :: mixfield_occ, mixfield_U
64 type(lda_u_t),
intent(in) :: this
65 type(namespace_t),
intent(in) :: namespace
66 type(lda_u_mixer_t),
intent(inout) :: mixer
67 type(mix_t),
intent(inout) :: smix
68 type(states_elec_t),
intent(in) :: st
75 dim1 = this%maxnorbs*this%maxnorbs*this%nspins*this%norbsets
78 if (this%intersite)
then
79 dim1 = dim1 + 2*this%maxnorbs*this%maxnorbs*this%nspins*this%norbsets*this%maxneighbors
85 mixer%realstates = .
true.
88 mixer%realstates = .false.
108 type(lda_u_t),
intent(in) :: this
109 type(lda_u_mixer_t),
intent(inout) :: mixer
110 type(states_elec_t),
intent(in) :: st
117 mixer%occsize = this%maxnorbs*this%maxnorbs*this%nspins*this%norbsets
119 mixer%occsize = mixer%occsize*2
120 if (this%intersite)
then
121 mixer%occsize = mixer%occsize + 2*this%maxnorbs*this%maxnorbs*this%nspins*this%norbsets*this%maxneighbors
126 safe_allocate(mixer%dtmp_occ(1:mixer%occsize, 1))
128 safe_allocate(mixer%ztmp_occ(1:mixer%occsize, 1))
132 safe_allocate(mixer%tmpU(1:this%norbsets, 1))
140 type(lda_u_mixer_t),
intent(inout) :: mixer
141 type(mix_t),
intent(inout) :: smix
143 if (.not. mixer%apply)
return
155 type(
mix_t),
intent(inout) :: smix
157 if (.not. mixer%apply)
return
160 safe_deallocate_a(mixer%dtmp_occ)
161 safe_deallocate_a(mixer%ztmp_occ)
162 safe_deallocate_a(mixer%tmpU)
165 if (mixer%mixU)
call mixfield_end(smix, mixer%mixfield_U)
172 type(
lda_u_t),
intent(in) :: this
178 if (mixer%realstates)
then
196 type(
lda_u_t),
intent(in) :: this
199 if (.not. mixer%apply)
return
202 if (mixer%realstates)
then
220 type(
lda_u_t),
intent(inout) :: this
224 if (.not. mixer%apply)
return
233 if (mixer%realstates)
then
subroutine, public lda_u_mixer_set_vin(this, mixer)
subroutine, public lda_u_mixer_init(this, mixer, st)
subroutine, public lda_u_mixer_clear(mixer, smix)
subroutine, public lda_u_mixer_init_auxmixer(this, namespace, mixer, smix, st)
subroutine, public lda_u_mixer_get_vnew(this, mixer, st)
subroutine, public lda_u_mixer_set_vout(this, mixer)
subroutine, public lda_u_mixer_end(mixer, smix)
subroutine, public lda_u_get_effectiveu(this, Ueff)
subroutine, public lda_u_set_effectiveu(this, Ueff)
integer, parameter, public dft_u_none
subroutine, public dlda_u_get_occupations(this, occ)
subroutine, public zlda_u_update_potential(this, st)
This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and...
subroutine, public dlda_u_set_occupations(this, occ)
integer, parameter, public dft_u_acbn0
subroutine, public zlda_u_get_occupations(this, occ)
subroutine, public dlda_u_update_potential(this, st)
This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and...
subroutine, public zlda_u_set_occupations(this, occ)
subroutine, public mixfield_end(smix, mixfield)
Deallocate all arrays of a mixfield instance.
integer pure function, public mix_scheme(this)
subroutine, public mixfield_init(smix, mixfield, d1, d2, d3, func_type)
Initialise all attributes of a mixfield instance.
subroutine, public mix_add_auxmixfield(namespace, smix, mixfield)
subroutine, public mixfield_clear(scheme, mixfield)
Zero all potential and field attributes of a mixfield instance.
integer pure function, public mix_d3(this)
pure logical function, public states_are_real(st)
type(type_t), public type_float
type(type_t), public type_cmplx
Class to describe DFT+U parameters.
The states_elec_t class contains all electronic wave functions.