Commit 91094f50 authored by Miriam Hinzen's avatar Miriam Hinzen

Set up framework for the film-case implementation of the preconditioner

parent b599e1c4
......@@ -116,8 +116,8 @@ CONTAINS
banddos,obsolete,enpara,xcpot,results,kpts,hybrid,oneD,coreSpecInput,wann,l_opti)
CALL timestop("Initialization")
IF((input%preconditioning_param /= 0).AND.input%film) THEN
CALL juDFT_error('Currently no preconditioner for films', calledby = 'fleur')
IF ( ( input%preconditioning_param /= 0 ) .AND. oneD%odi%d1 ) THEN
CALL juDFT_error('Currently no preconditioner for 1D calculations', calledby = 'fleur')
END IF
IF (l_opti) CALL optional(mpi,atoms,sphhar,vacuum,dimension,&
......
......@@ -36,6 +36,7 @@ contains
use m_xmlOutput
use m_umix
use m_vgen_coulomb
use m_VYukawaFilm
#ifdef CPP_MPI
use m_mpi_bc_potden
#endif
......@@ -238,14 +239,14 @@ contains
#ifdef CPP_MPI
call mpi_bc_potden( mpi, stars, sphhar, atoms, input, vacuum, oneD, noco, resDen )
#endif
! if ( .not. input%film ) then
if ( .not. input%film ) then
call vgen_coulomb( 1, mpi, dimension, oneD, input, field, vacuum, sym, stars, cell, &
sphhar, atoms, resDen, vYukawa )
! else
! vYukawa%iter = resDen%iter
! call VYukawaFilm( stars, vacuum, cell, sym, input, mpi, atoms, sphhar, dimension, oneD, resDen, ispin, &
! vYukawa )
! end if
else
vYukawa%iter = resDen%iter
call VYukawaFilm( stars, vacuum, cell, sym, input, mpi, atoms, sphhar, dimension, oneD, resDen, &
vYukawa )
end if
end if
MPI0_c: if( mpi%irank == 0 ) then
if( input%preconditioning_param /= 0 ) then
......
......@@ -9,7 +9,6 @@ math/dcylbs.f
math/dsphbs.f
math/gaussp.f
math/grule.f
math/intgr.F
math/inv3.f
math/inwint.f
math/matmul.f
......@@ -21,7 +20,6 @@ math/rfft.F
math/sphbes.f
math/sphpts.f
math/util.F
math/ylm4.f90
math/difcub.f
)
set(fleur_F90 ${fleur_F90}
......@@ -31,6 +29,9 @@ math/fft3d.f90
math/fft_interface.F90
math/SphBessel.f90
math/DoubleFactorial.f90
math/ExpSave.f90
math/intgr.F90
math/ylm4.f90
)
if (FLEUR_USE_FFTMKL)
set(fleur_F90 ${fleur_F90} math/mkl_dfti.f90)
......
module m_ExpSave
contains
pure real function exp_save( x )
! replace exp by a function that does not under/overflow dw09
implicit none
real, intent(in) :: x
real, parameter :: maxexp = log( 2.0 ) * maxexponent( 2.0 )
real, parameter :: minexp = log( 2.0 ) * minexponent( 2.0 )
if ( abs( x ) > minexp .and. abs( x ) < maxexp ) then
exp_save = exp( x )
else
if ( x > 0 ) then
if ( x > minexp ) then
exp_save = exp( maxexp )
else
exp_save = exp( minexp )
endif
else
if ( - x > minexp ) then
exp_save = exp( - maxexp )
else
exp_save = exp( - minexp )
endif
endif
endif
end function exp_save
end module m_ExpSave
This diff is collapsed.
......@@ -46,6 +46,7 @@ vgen/vvacxy.f90
vgen/b_field.F90
vgen/write_xcstuff.f90
vgen/xy_av_den.f90
vgen/VYukawaFilm.f90
)
#vdW Stuff
set(fleur_F90 ${fleur_F90}
......
module m_VYukawaFilm
contains
subroutine VYukawaFilm( stars, vacuum, cell, sym, input, mpi, atoms, sphhar, dimension, oneD, den, &
VYukawa )
use m_constants
use m_types
use m_psqpw
implicit none
type(t_stars), intent(in) :: stars
type(t_vacuum), intent(in) :: vacuum
type(t_cell), intent(in) :: cell
type(t_sym), intent(in) :: sym
type(t_input), intent(in) :: input
type(t_mpi), intent(in) :: mpi
type(t_atoms), intent(in) :: atoms
type(t_sphhar), intent(in) :: sphhar
type(t_dimension), intent(in) :: dimension
type(t_oneD), intent(in) :: oneD
type(t_potden), intent(in) :: den
type(t_potden), intent(inout) :: VYukawa
complex :: psq(stars%ng3)
! PSEUDO-CHARGE DENSITY
call psqpw( mpi, atoms, sphhar, stars, vacuum, dimension, cell, input, sym, oneD, den%pw(:,1), den%mt(:,:,:,1), den%vacz(:,:,1), .false., VYukawa%potdenType, psq )
! VACUUM POTENTIAL
!call VYukawaFilmVacuum( stars, vacuum, cell, sym, input, &
! psq, den%vacxy(:,:,:,1), den%vacz(:,:,1), &
! VYukawa%vacxy, VYukawa%vacz, alphm )
! INTERSTITIAL POTENTIAL
!call VYukawaFilmInterstitial( stars, vacuum, cell, sym, input, &
! psq, VYukawa%vacxy, VYukawa%vacz, alphm, &
! VYukawa%pw(:,1) )
! MUFFIN-TIN POTENTIAL
!call Vmts( input, mpi, stars, sphhar, atoms, sym, cell, oneD, VYukawa%pw(:,1), den%mt(:,0:,:,1), VYukawa%potdenType, VYukawa%mt(:,0:,:,1) )
end subroutine VYukawaFilm
end module m_VYukawaFilm
......@@ -82,8 +82,8 @@ module m_vvacxy
fib(imz) = aimag( rhtxy(imz,irec2-1,ivac) ) * e_p
z = z + vacuum%delz
end do imz_loop1
call intgz1( fra, vacuum%delz, ncsh - 1, alpha(1,ivac,1), tail=.false. )
call intgz1( fia, vacuum%delz, ncsh - 1, alpha(1,ivac,2), tail=.false. )
call intgz1( fra, vacuum%delz, ncsh - 1, alpha(1,ivac,1), .false. )
call intgz1( fia, vacuum%delz, ncsh - 1, alpha(1,ivac,2), .false. )
call qsf( vacuum%delz, frb, beta(1,ivac,1), ncsh - 1, 1 )
call qsf( vacuum%delz, fib, beta(1,ivac,2), ncsh - 1, 1 )
end do ivac_loop1
......@@ -163,8 +163,8 @@ module m_vvacxy
frb(ncsh) = frb(ncsh) - real( field%efield%rhoef(irec2-1,ivac) ) * e_p
fib(ncsh) = fib(ncsh) - aimag( field%efield%rhoef(irec2-1,ivac) ) * e_p
end if
call intgz1( fra, vacuum%delz, vacuum%nmzxy, alpha(1,ivac,1), tail=.true. )
call intgz1( fia, vacuum%delz, vacuum%nmzxy, alpha(1,ivac,2), tail=.true. )
call intgz1( fra, vacuum%delz, vacuum%nmzxy, alpha(1,ivac,1), .true. )
call intgz1( fia, vacuum%delz, vacuum%nmzxy, alpha(1,ivac,2), .true. )
call qsf( vacuum%delz, frb, beta(1,ivac,1), vacuum%nmzxy, 1 )
call qsf( vacuum%delz, fib, beta(1,ivac,2), vacuum%nmzxy, 1 )
end do ivac_loop3
......@@ -226,4 +226,4 @@ module m_vvacxy
endif
end function exp_save
end module m_vvacxy
\ No newline at end of file
end module m_vvacxy
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment