Added directory with small 'Utility' program for post-processing

of results obtained with GWW and SIMPLE
This commit is contained in:
paoloumari 2018-12-21 15:17:34 +01:00
parent 21b79c7e3a
commit 07cfd662c0
4 changed files with 232 additions and 0 deletions

19
GWW/util/Makefile Normal file
View File

@ -0,0 +1,19 @@
#Makefile for various utilities
include ../../make.inc
all: graph.x abcoeff_to_eps.x memory_pw4gww.x
graph.x: graph.f90
$(FC) -o graph.x graph.f90
abcoeff_to_eps.x: abcoeff_to_eps.f90
$(FC) -o abcoeff_to_eps.x abcoeff_to_eps.f90
memory_pw4gww.x: memory_pw4gww.f90
$(FC) -o memory_pw4gww.x memory_pw4gww.f90
clean:
- /bin/rm -fv *.x

View File

@ -0,0 +1,94 @@
program series
implicit none
real(kind=8), ALLOCATABLE :: a(:,:),b(:,:)
integer :: nstep,nn,nint
real(kind=8) :: emin,emax,delta
real(kind=8), parameter :: ry2ev=13.6057
integer :: i,j,k,idumm1, idumm2,nk
real(kind=8) :: freq, fact
complex(kind=8) :: z, f0,f1,eps, term
real(kind=8):: omega=270.0114
real(kind=8) :: norm(3), nspin, offset
write(*,*) 'Number of Lanczos steps tot, considered :'
read(*,*) nstep
nstep=nstep-1
read(*,*) nint
nint=nint-1
write(*,*) 'Emin Emax Delta(eV) e_steps omega Nk nspin offset'
read(*,*) emin
read(*,*) emax
read(*,*) delta
read(*,*) nn
read(*,*) omega
read(*,*) nk
read(*,*) nspin
read(*,*) offset
emin=emin/ry2ev
emax=emax/ry2ev
delta=delta/ry2eV
allocate(b(nstep,3),a(nstep,3))
open(unit=20,file='ab_coeff.dat',status='old')
read(20,*) norm(1:3)
do i=1,3
do j=1,nstep
read(20,*) idumm1,idumm2, a(j,i)
enddo
enddo
do i=1,3
do j=1,nstep
read(20,*) idumm1,idumm2, b(j,i)
enddo
enddo
close(20)
do i=1,3!loop on cart
if(i==1) then
open(unit=20,file='lanczos.eps1x.dat',status='unknown')
open(unit=21,file='lanczos.eps2x.dat',status='unknown')
else if(i==2) then
open(unit=20,file='lanczos.eps1y.dat',status='unknown')
open(unit=21,file='lanczos.eps2y.dat',status='unknown')
else if (i==3) then
open(unit=20,file='lanczos.eps1z.dat',status='unknown')
open(unit=21,file='lanczos.eps2z.dat',status='unknown')
endif
write(20,*) '# Energy(eV) Eps1 Eps1'
write(21,*) '# Energy(eV) Eps2 Eps2'
do j=1,nn!loop on freq
freq=(emax-emin)/dble(nn)*dble(j)+emin
z=cmplx(freq,delta)
term=(0.5d0/b(nint,i))*(freq-a(nint,i)-sqrt((a(nint,i)-freq)**2.d0+4.d0*b(nint,i)**2.0))
f0=term
do k=nint-1,1,-1
f1=z-a(k,i)-b(k,i)**2.d0/f0
f0=f1
enddo
eps=1.d0-4.d0*3.14159264d0*2.d0*norm(i)*nspin/f0/(omega*dble(nk))
write(20,*) freq*ry2ev+offset,real(eps),real(eps)
write(21,*) freq*ry2ev+offset,aimag(eps),aimag(eps)
enddo
close(20)
close(21)
enddo
deallocate(a,b)
stop
end program series

88
GWW/util/graph.f90 Normal file
View File

@ -0,0 +1,88 @@
program grafica
implicit none
integer n,idumm,i,j
real, allocatable :: d(:,:),t(:,:),proj(:)
real :: x1,x2,s,off,f
integer :: m, ipro
real, external :: espandi
real :: x,rdumm
open(unit=20, file='qpe_range.dat', status='old')
read(20,*) n
allocate (d(n,4))
allocate(proj(n))
do i=1,n
read(20,*) idumm,d(i,1),d(1,2),d(i,3),d(i,4)
enddo
close(20)
write(*,*) 'x1'
read(*,*) x1
write(*,*) 'x2'
read(*,*) x2
write(*,*) 'sigma'
read(*,*) s
write(*,*) 'offset'
read(*,*) off
write(*,*) 'number of points'
read(*,*) m
write(*,*) 'Use projections file 0=No 1=Yes'
read(*,*) ipro
if(ipro==0) then
proj=1.
else
open(unit=19, file='proj.dat', status='unknown')
do i=1,n
read(19,*) rdumm,proj(i)
enddo
close(19)
endif
write(*,*) 'Multiplicative factor'
read(*,*) f
open(unit=21, file='grafico_lda.dat', status='unknown')
open(unit=22, file='grafico_gwp.dat', status='unknown')
open(unit=23, file='grafico_gw.dat', status='unknown')
open(unit=24, file='grafico_hf.dat', status='unknown')
do i=1,m
x=x1+(x2-x1)/real(m)*real(i)
do j=1,4
write(20+j,*) x+off, espandi(n,d(1,j),s,x,proj)*f
enddo
enddo
close(21)
close(22)
close(23)
close(24)
deallocate(d,proj)
stop
end program grafica
function espandi(n,d,s,x,proj)
implicit none
real :: espandi
integer::n
real :: d(n),proj(n)
real::s
real ::x
integer :: i
real :: xd
espandi=0.
do i=1,n
xd=x-d(i)
espandi=espandi+(1./(s*sqrt(2.*3.1415926)))*exp(-(xd**2.)/(2.*s**2.))*proj(i)
enddo
return
end function espandi

View File

@ -0,0 +1,31 @@
program memory_pw4gww
implicit none
integer :: numpw,numt,nsetpola,nsteps,nproc
real :: mem
write(*,*) 'NUMPW:'
read(*,*) numpw
write(*,*) 'NUMT:'
read(*,*) numt
write(*,*) 'N_SET_POLA:'
read(*,*) nsetpola
write(*,*) 'NSTEPS_LANCZOS_POLA:'
read(*,*) nsteps
write(*,*) 'N MPI TASKS:'
read(*,*) nproc
mem=4.*numpw*numt*nsetpola
mem=mem+8.*numpw*numt+8.*numpw*nsteps*nsetpola*numt/nproc
mem=mem+8.*numpw*numpw
mem=mem+4.*numt*numt/nproc
mem=mem+8*numpw*numt/nproc
mem=mem+8.*2.*numpw*numpw
mem=mem/(1024)**2.d0
write(*,*) 'Required memory(MB): ', mem
stop
end program memory_pw4gww