Skip to content

Commit

Permalink
Added Cmakefile missing line (#108)
Browse files Browse the repository at this point in the history
Added Cmake line missing
  • Loading branch information
cnegre authored Mar 20, 2018
1 parent 0190dff commit f1d860c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
50 changes: 24 additions & 26 deletions src/prg_dos_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ module prg_dos_mod
use prg_openfiles_mod
use prg_ptable_mod

implicit none
implicit none

private
private

integer, parameter :: dp = kind(1.0d0)

public :: prg_write_tdos

contains


!> Writes the total DOS into a file.
!! \f$ DOS(\epsilon) = \sum_k L(\epsilon - \epsilon_k) \f$
!! Where \f$ \int_{-\infty}^{\infty} DOS(\epsilon) = Nstates \f$
Expand All @@ -29,11 +28,11 @@ module prg_dos_mod
!! \para gamma Lorentzian width.
!! \param npts Number of energy points.
!! \param emin Minimum energy value.
!! \param emax Maximum energy value.
!! \param emax Maximum energy value.
!! \param filename Filename to write the DOS.
!!
subroutine prg_write_tdos(eigenvals,gamma,npts,emin,emax,filename)
implicit none
subroutine prg_write_tdos(eigenvals, gamma, npts, emin, emax, filename)
implicit none
character(len=*),intent(in) :: filename
integer :: i, io
integer, intent(in) :: npts
Expand All @@ -48,33 +47,33 @@ subroutine prg_write_tdos(eigenvals,gamma,npts,emin,emax,filename)
allocate(loads(size(eigenvals)))

loads = 1.0_dp
write(io,*)"# Energy DOS"
do i=1,npts
write(io,*)emin + de*i,lorentz(emin + de*i,eigenvals,loads,gamma)
enddo
write(io,*)"# Energy DOS"
do i = 1, npts
write(io,*) emin + de*i,lorentz(emin + de*i, eigenvals, loads, gamma)
end do

close(io)

call prg_open_file(io,"eigenvals")
call prg_open_file(io, "eigenvals")

write(io,*)"# i Eval"
do i=1,size(eigenvals,dim=1)
write(io,*)i,eigenvals(i)
enddo
do i = 1, size(eigenvals,dim=1)
write(io,*) i, eigenvals(i)
end do

close(io)

end subroutine prg_write_tdos


!> Lorentzian Function
!! \brief Computes:
!! \f$ L(\epsilon) = \sum_{k} \frac{\omega(k)\Gamma}{2 \pi}\frac{1}{(\epsilon - \epsilon_k)^2 + (\Gamma/2)^2} \f$
!! \brief Computes:
!! \f$ L(\epsilon) = \sum_{k} \frac{\omega(k)\Gamma}{2 \pi}\frac{1}{(\epsilon - \epsilon_k)^2 + (\Gamma/2)^2} \f$
!! \param energy Energy point.
!! \param eigenvals Eigenvalues of the system.
!! \param Gamma Lorentz function broadening.
!! \param Gamma Lorentz function broadening.
!!
real(dp) function lorentz(energy,eigenvals,loads,Gamma)
real(dp) function lorentz(energy, eigenvals, loads, Gamma)
implicit none
integer :: Nstates, k
real(dp) :: auxfactor, auxterm, pi
Expand All @@ -84,18 +83,17 @@ real(dp) function lorentz(energy,eigenvals,loads,Gamma)
pi = 3.14159265358979323846264338327950_dp

!Lorentz parameters
auxfactor=Gamma/(2.0_dp*pi)
auxterm=(Gamma/2.0_dp)**2
lorentz=0.0_dp
auxfactor = Gamma/(2.0_dp*pi)
auxterm = (Gamma/2.0_dp)**2
lorentz = 0.0_dp

do k=1,Nstates
lorentz=lorentz + loads(k)/((energy-eigenvals(k))**2 + auxterm)
enddo
do k = 1, Nstates
lorentz = lorentz + loads(k)/((energy-eigenvals(k))**2 + auxterm)
end do

lorentz=auxfactor*lorentz
lorentz = auxfactor*lorentz

end function lorentz


end module prg_dos_mod

1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ progress_test(prg_sp2_alg1_seq_inplace_dense)
progress_test(prg_sp2_alg2_seq_inplace_dense)
progress_test(prg_sp2_alg1_seq_inplace_ellpack)
progress_test(prg_sp2_alg2_seq_inplace_ellpack)
progress_test(prg_sp2_fermi_dense)
progress_test(prg_equal_partition)
progress_test(prg_file_partition)
progress_test(prg_subgraphsp2_equal)
Expand Down

0 comments on commit f1d860c

Please sign in to comment.