TABLE OF CONTENTS


ABINIT/m_data4entropyDMFT [ Modules ]

[ Top ] [ Modules ]

NAME

  m_data4entropyDMFT

FUNCTION

  FIXME: add description. 

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

25 #if defined HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28 
29 #include "abi_common.h"
30 
31 module m_data4entropyDMFT
32 
33   use defs_basis
34   use defs_abitypes
35   use m_errors
36 
37   implicit none
38 
39   private
40 
41   public :: data4entropyDMFT_init
42   public :: data4entropyDMFT_destroy
43   public :: data4entropyDMFT_setDocc            ! Must be call for each lambda
44   public :: data4entropyDMFT_setHu              ! Hu density
45   public :: data4entropyDMFT_setDc

ABINIT/m_data4entropyDMFT/data4entropyDMFT_init [ Functions ]

[ Top ] [ Functions ]

NAME

  data4entropyDMFT_init

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

      gstate

CHILDREN

SOURCE

110 subroutine data4entropyDMFT_init(this,natom,typat,lpawu,uset2g,upawu,jpawu)
111 
112 !Arguments ------------------------------------
113 
114 !This section has been created automatically by the script Abilint (TD).
115 !Do not modify the following lines by hand.
116 #undef ABI_FUNC
117 #define ABI_FUNC 'data4entropyDMFT_init'
118 !End of the abilint section
119 
120   type(data4entropyDMFT_t) , intent(inout) :: this
121   integer               , intent(in   ) :: natom
122   integer , dimension(:), intent(in   ) :: typat
123   integer , dimension(:), intent(in   ) :: lpawu
124   logical               , intent(in   ) :: uset2g
125   real(dp), dimension(:), intent(in   ) :: upawu
126   real(dp), dimension(:), intent(in   ) :: jpawu
127 !Local variables ------------------------------
128   integer :: maxlpawu
129   integer :: iatom
130   integer :: ilpawu
131   integer :: nlpawu
132   integer :: ityp
133   character(len=500) :: message
134 
135   this%natom = natom
136 
137   if ( size(typat) .ne. natom ) then
138     write(message,'(a,i5,a,a,i5,a)') "Disagreement between number of atoms (",natom,")", &
139      " and the number of atom types (",size(typat),")."
140     MSG_ERROR(message)
141   end if
142 
143   this%ntypat = maxval(typat) !!! Carefull This should always work but can we have
144   ! one type that is not use (ntypat = 5; typat = 1 2 3 4)?
145   if ( this%ntypat .ne. size(upawu) .or. this%ntypat .ne. size(jpawu) ) then
146     write(message,'(a)') "Disagreement between size of ntypat,upawu and jpawu"
147     MSG_ERROR(message)
148   end if
149 
150   maxlpawu = -1
151   nlpawu = size(lpawu)
152   do iatom=1,natom
153     ityp=typat(iatom)
154     if (ityp.le.0 .or. ityp.gt.nlpawu) then
155       write(message,'(a)') "Try to access the lpawu value of an atom type that has not a lpawu value."
156       MSG_ERROR(message)
157     end if
158     ilpawu=lpawu(ityp)
159     if(uset2g.and.ilpawu==2) ilpawu=1
160     if ( ilpawu > maxlpawu ) maxlpawu = ilpawu
161   enddo
162   this%maxlpawu = maxlpawu
163 
164   ABI_ALLOCATE(this%docc,(1:2*(2*maxlpawu+1),1:2*(2*maxlpawu+1),1:natom))
165   this%docc(:,:,:) = zero
166 
167   ABI_ALLOCATE(this%hu_dens,(1:2*(2*maxlpawu+1),1:2*(2*maxlpawu+1),1:this%ntypat))
168   this%hu_dens(:,:,:) = zero
169 
170   ABI_ALLOCATE(this%e_dc,(1:natom))
171   this%e_dc(:) = zero
172 
173   ABI_ALLOCATE(this%J_over_U,(1:natom))
174   this%J_over_U(:) = zero
175   do iatom=1,natom
176     ityp=typat(iatom) ! no need to check since already done once before
177     if ( lpawu(ityp) /= -1 .and. upawu(ityp) /= zero) then
178       this%J_over_U(iatom) = jpawu(ityp) / upawu(ityp)
179     end if
180   enddo
181 
182   this%isset = .true.
183 end subroutine data4entropyDMFT_init

ABINIT/m_data4entropyDMFT/data4entropyDMFT_setDc [ Functions ]

[ Top ] [ Functions ]

NAME

  data4entropyDMFT_setHu

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

383 subroutine data4entropyDMFT_setDc(this,dc)
384 
385 !Arguments ------------------------------------
386 
387 !This section has been created automatically by the script Abilint (TD).
388 !Do not modify the following lines by hand.
389 #undef ABI_FUNC
390 #define ABI_FUNC 'data4entropyDMFT_setDc'
391 !End of the abilint section
392 
393     type(data4entropyDMFT_t) , intent(inout) :: this
394     real(dp), dimension(:), intent(in   ) :: dc
395 !Local variables ------------------------------
396     character(len=500) :: message
397 
398     if ( .not. this%isset ) then
399       MSG_ERROR("data4entropyDMFT type not initialized")
400     end if
401 
402     if ( size(dc,1) .gt. this%natom ) then
403       write(message,'(a,i4,a,i4,a)') "Size of dc (",size(dc,1), &
404         ") is greater than the number of atom natom(",this%natom,")."
405       MSG_ERROR(message)
406     end if
407 
408     this%e_dc(:) = dc(:)
409 
410 end subroutine data4entropyDMFT_setDc

ABINIT/m_data4entropyDMFT/data4entropyDMFT_setDocc [ Functions ]

[ Top ] [ Functions ]

NAME

  data4entropyDMFT_setDocc

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

      qmc_prep_ctqmc

CHILDREN

SOURCE

216 subroutine data4entropyDMFT_setDocc(this,iatom,Docc,Nocc)
217 
218 !Arguments ------------------------------------
219 
220 !This section has been created automatically by the script Abilint (TD).
221 !Do not modify the following lines by hand.
222 #undef ABI_FUNC
223 #define ABI_FUNC 'data4entropyDMFT_setDocc'
224 !End of the abilint section
225 
226     type(data4entropyDMFT_t), intent(inout) :: this
227     integer           , intent(in   ) :: iatom
228     real(dp), optional, intent(in   ) :: Docc(:,:) !iflavor,iflavor
229     real(dp), optional, intent(in   ) :: Nocc(:)   !iflavor
230 !Local variables ------------------------------
231     integer            :: maxnflavor
232     integer            :: iflavor1
233     integer            :: iflavor2
234     character(len=500) :: message
235 
236     if ( .not. this%isset ) then
237       MSG_ERROR("data4entropyDMFT type not initialized")
238     end if
239 
240     if ( iatom .gt. this%natom ) then
241       write(message,'(a,i4,a,i4,a)') "Value of iatom (",iatom, &
242         ") is greater than the number of atom natom(",this%natom,")."
243       MSG_ERROR(message)
244     end if
245 
246     if ( .not. present(Docc) .and. .not. present(Nocc) ) then
247       write(message,'(2a)') "Neither Docc nor Nocc is present to set double", &
248       "occupancy. Should have one and only one of those."
249       MSG_ERROR(message)
250     end if
251 
252     if ( present(Docc) .and. present(Nocc) ) then
253       write(message,'(2a)') "Both Docc and Nocc are present to set double", &
254       "occupancy. Should have one and only one of those."
255       MSG_ERROR(message)
256     end if
257 
258     maxnflavor=2*(2*this%maxlpawu+1)
259     if ( present(Docc) ) then
260       if ( size(Docc,1) .gt. maxnflavor .or. size(Docc,2) .gt. maxnflavor &
261           .or. size(Docc,1) .ne. size(Docc,2) ) then
262         write(message,'(a,i2,a,i2,a,i2)') "Problem with Docc shape/size : dim1=",size(Docc,1), &
263                               " dim2=",size(Docc,2), " max=", maxnflavor
264         MSG_ERROR(message)
265       end if
266       this%docc(1:size(Docc,1),1:size(Docc,1),iatom) = Docc(:,:)
267     else if ( present(Nocc) ) then ! Need to compute n_i*n_j (only used for DFT+U)
268       if ( size(Nocc,1) .gt. maxnflavor) then
269         write(message,'(a,i2,a,i2)') "Problem with Nocc size : dim1=",size(Nocc,1), &
270                               " maxnflavor=", maxnflavor
271         MSG_ERROR(message)
272       end if
273       
274       do iflavor1 = 1, (2*size(Nocc,1)+1)
275         do iflavor2 = 1, (2*size(Nocc,1)+1)
276           this%docc(iflavor2,iflavor1,iatom) = Nocc(iflavor1)*Nocc(iflavor2)
277         end do
278       end do
279     end if
280 
281 end subroutine data4entropyDMFT_setDocc

ABINIT/m_data4entropyDMFT/data4entropyDMFT_setHu [ Functions ]

[ Top ] [ Functions ]

NAME

  data4entropyDMFT_setHu

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

      m_dmft

CHILDREN

SOURCE

314 subroutine data4entropyDMFT_setHu(this,itypat,hu)
315 
316 !Arguments ------------------------------------
317 
318 !This section has been created automatically by the script Abilint (TD).
319 !Do not modify the following lines by hand.
320 #undef ABI_FUNC
321 #define ABI_FUNC 'data4entropyDMFT_setHu'
322 !End of the abilint section
323 
324     type(data4entropyDMFT_t), intent(inout) :: this
325     integer           , intent(in   ) :: itypat
326     real(dp)          , intent(in   ) :: hu(:,:)   !iflavor
327 !Local variables ------------------------------
328     integer            :: maxnflavor
329     character(len=500) :: message
330 
331     if ( .not. this%isset ) then
332       MSG_ERROR("data4entropyDMFT type not initialized")
333     end if
334 
335     if ( itypat .gt. this%ntypat ) then
336       write(message,'(a,i4,a,i4,a)') "Value of itypat (",itypat, &
337         ") is greater than the number of types of atoms (",this%ntypat,")."
338       MSG_ERROR(message)
339     end if
340 
341     maxnflavor=2*(2*this%maxlpawu+1)
342     if ( size(hu,1) .gt. maxnflavor .or. size(hu,1) .ne. size(hu,2) ) then
343       write(message,'(a,i2,a,i2,a,i2,a,i2)') "Problem with hu size : dim1=",size(hu,1), &
344                             " dim2=", size(hu,2), " max=", maxnflavor
345       MSG_ERROR(message)
346     end if
347     this%hu_dens(1:size(hu,1),1:size(hu,1),itypat) = hu(:,:)
348 
349 end subroutine data4entropyDMFT_setHu

ABINIT/m_data4entropyDMFT/data4etotdmf_destroy [ Functions ]

[ Top ] [ Functions ]

NAME

  data4entropyDMFT_destroy

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

      gstate

CHILDREN

SOURCE

443 subroutine data4entropyDMFT_destroy(this)
444 
445   !Arguments ------------------------------------
446 
447 !This section has been created automatically by the script Abilint (TD).
448 !Do not modify the following lines by hand.
449 #undef ABI_FUNC
450 #define ABI_FUNC 'data4entropyDMFT_destroy'
451 !End of the abilint section
452 
453   type(data4entropyDMFT_t), intent(inout) :: this
454 
455   if ( .not. this%isset ) return
456   if (allocated(this%docc))  then
457     ABI_DEALLOCATE(this%docc)
458   endif
459   if (allocated(this%J_over_U))  then
460     ABI_DEALLOCATE(this%J_over_U)
461   endif
462   if (allocated(this%e_dc))  then
463     ABI_DEALLOCATE(this%e_dc)
464   endif
465   if (allocated(this%hu_dens))  then
466     ABI_DEALLOCATE(this%hu_dens)
467   endif
468   this%maxlpawu = 0
469   this%natom = 0
470   this%ntypat = 0
471   this%isset = .FALSE.
472 end subroutine data4entropyDMFT_destroy

m_data4entropyDMFT/data4entropyDMFT [ Types ]

[ Top ] [ m_data4entropyDMFT ] [ Types ]

NAME

  data4entropyDMFT

FUNCTION

  This structured datatype contains the necessary data

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

64   type, public :: data4entropyDMFT_t
65     logical               :: isset = .false.! Are we initialized ?
66     integer               :: maxlpawu       ! maximal value for lpawu
67     integer               :: natom          ! number of atoms
68     integer               :: ntypat         ! number of types of atoms
69     real(dp), allocatable :: docc(:,:,:)    ! double occupation for each atom
70     real(dp), allocatable :: J_over_U(:)    ! calculate J/U for each atom
71     real(dp), allocatable :: e_dc(:)        ! double counting energy calculated for u=1 and j=u/j
72     real(dp), allocatable :: hu_dens(:,:,:) ! interaction matrice in density representation
73   end type data4entropyDMFT_t