TABLE OF CONTENTS


ABINIT/m_gwls_valenceWavefunctions [ Modules ]

[ Top ] [ Modules ]

NAME

 m_gwls_valenceWavefunctions

FUNCTION

  .

COPYRIGHT

 Copyright (C) 2009-2022 ABINIT group (JLJ, BR, MC)
 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

16 #if defined HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include "abi_common.h"
21 
22 
23 module m_gwls_valenceWavefunctions
24 
25 ! local modules
26 use m_gwls_utility
27 use m_gwls_hamiltonian
28 
29 ! abinit modules
30 use defs_basis
31 use m_abicore
32 use m_xmpi
33 implicit none
34 save
35 private

m_hamiltonian/cleanupValenceWavefunctions [ Functions ]

[ Top ] [ m_hamiltonian ] [ Functions ]

NAME

  cleanupValenceWavefunctions

FUNCTION

  .

INPUTS

OUTPUT

SOURCE

132 subroutine cleanupValenceWavefunctions()
133 !--------------------------------------------------------------------------------
134 !
135 ! This subroutine deallocates the array valence_wfr once it is no longer needed.
136 !
137 !--------------------------------------------------------------------------------
138 implicit none
139 
140 ! *************************************************************************
141 
142 !if (allocated(valence_wfr)) ABI_FREE(valence_wfr)
143 !if (allocated(valence_wfr_fftpac)) ABI_FREE(valence_wfr_fftpac)
144 
145 end subroutine cleanupValenceWavefunctions

m_hamiltonian/compute_Exchange_and_Correlation_energies [ Functions ]

[ Top ] [ m_hamiltonian ] [ Functions ]

NAME

  compute_Exchange_and_Correlation_energies

FUNCTION

  .

INPUTS

OUTPUT

SOURCE

161 subroutine compute_Exchange_and_Correlation_energies(e_index, exchange_energy, Vxc_energy)
162 
163 !--------------------------------------------------------------------------------
164 !
165 ! This subroutine computes the exchange and correlation energies.
166 !
167 !--------------------------------------------------------------------------------
168 implicit none
169 
170 integer, intent(in)    :: e_index
171 real(dp), intent(out)  :: exchange_energy
172 real(dp), intent(out)  :: vxc_energy
173 
174 ! *************************************************************************
175 
176 vxc_energy         = dft_xc_energy(e_index)
177 
178 exchange_energy    = exchange(e_index)
179 
180 end subroutine compute_Exchange_and_Correlation_energies

m_hamiltonian/prepareValenceWavefunctions [ Functions ]

[ Top ] [ m_hamiltonian ] [ Functions ]

NAME

  prepareValenceWavefunctions

FUNCTION

  .

INPUTS

OUTPUT

SOURCE

 62 subroutine prepareValenceWavefunctions()
 63 !--------------------------------------------------------------------------------
 64 !
 65 ! This subroutine allocates and fills an array valence_wfr which will contain
 66 ! the valence wavefunctions in real space. We do this once and for all, instead
 67 ! of constantly performing FFTs throughout the program.
 68 !
 69 ! NOTE: fftpac is not reversible while using MPI!  At first, we tried storing
 70 !       valence wavefunctions in real space using fftpac, but the unpacking routine
 71 !       doesn't return the original (n4,n5,n6) array !
 72 !
 73 !      Valence wavefunctions will be stored in Fourier space instead.
 74 !
 75 !--------------------------------------------------------------------------------
 76 implicit none
 77 
 78 !integer  :: v, kmin, kmax
 79 !
 80 !
 81 !real(dp), allocatable :: psir(:,:,:,:)
 82 
 83 ! *************************************************************************
 84 
 85 
 86 ! Routine is left blank for now
 87 
 88 
 89 ! old code, broken because fftpac isn't invertible !
 90 ! ABI_MALLOC(valence_wfr_fftpac,(2,nfft,nbandv)) ! nfft is a public variable from the gwls_hamiltonian module
 91 
 92 ! ABI_MALLOC(psir,(2,n4,n5,n6))
 93 ! psir = zero
 94 ! do v=1,nbandv
 95 !        kmin = 1+(v-1)*npw_k
 96 !        kmax =    v   *npw_k
 97 !
 98 !       ! transform from k to r, storing wavefunction in real space in work array psir1
 99 !       call g_to_r(psir,cg(:,kmin:kmax))
100 !
101 !       ! pack the real-space wavefunction in the purpose-made array
102 !       call sg_to_dg(valence_wfr_fftpac(:,:,v), psir)
103 ! end do
104 ! ABI_FREE(psir)
105 
106 ! old code!
107 !ABI_MALLOC(valence_wfr,(2,n4,n5,n6,nbandv))
108 !valence_wfr = zero
109 
110 !do v=1,nbandv
111 !       kmin = 1+(v-1)*npw_k
112 !       kmax =    v   *npw_k
113 !       call g_to_r(valence_wfr(:,:,:,:,v),cg(:,kmin:kmax))
114 !end do
115 
116 end subroutine prepareValenceWavefunctions