Commit a8d7d595 authored by Matthias Redies's avatar Matthias Redies

gregor ist ad

parent 05cfb284
......@@ -39,6 +39,6 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message(FATAL_ERROR "Only modern versions of gfortran >6.3 will be able to compile FLEUR\nYou need to specify a different compiler.\nSee the docs at www.flapw.de.\n")
endif()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp -fdefault-real-8 -Wno-missing-include-dirs")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O2")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g -DCPP_DEBUG")
endif()
......@@ -4,9 +4,6 @@
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_cdngen
USE m_types
TYPE(t_potden) :: comparison_kinED_pw(3)
CONTAINS
SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
......@@ -101,7 +98,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
CALL outDen%init(stars, atoms, sphhar, vacuum, noco, input%jspins, POTDEN_TYPE_DEN)
do dim_idx = 1,3
CALL comparison_kinED_pw(dim_idx)%init(stars,atoms,sphhar,vacuum,&
CALL xcpot%comparison_kinED_pw(dim_idx)%init(stars,atoms,sphhar,vacuum,&
noco,input%jspins, POTDEN_TYPE_DEN)
enddo
CALL EnergyDen%init(stars, atoms, sphhar, vacuum, noco, input%jspins, POTDEN_TYPE_EnergyDen)
......@@ -125,7 +122,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
fake_moments = moments
CALL calc_kinED_pw(dim_idx,eig_id,mpi,kpts,jspin,noco,input,banddos,cell,&
atoms,enpara,stars,vacuum,dimension,sphhar,sym,vTot,oneD,&
cdnvalJob,comparison_kinED_pw(dim_idx),fake_regCharges,&
cdnvalJob,xcpot%comparison_kinED_pw(dim_idx),fake_regCharges,&
fake_dos,fake_results,fake_moments)
enddo
END DO
......@@ -134,6 +131,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
if(xcpot%exc_is_metagga()) then
CALL calc_EnergyDen(eig_id, mpi, kpts, noco, input, banddos, cell, atoms, enpara, stars,&
vacuum, DIMENSION, sphhar, sym, vTot, oneD, results, EnergyDen)
call save_kinED(xcpot, input, noco, stars, cell, sym)
endif
IF (mpi%irank == 0) THEN
......@@ -205,7 +203,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
END SUBROUTINE cdngen
subroutine save_kinED(xcpot, input, noco, stars, cell)
subroutine save_kinED(xcpot, input, noco, stars, cell, sym)
use m_types
use m_pw_tofrom_grid
implicit none
......@@ -215,20 +213,32 @@ subroutine save_kinED(xcpot, input, noco, stars, cell)
type(t_noco), intent(in) :: noco
type(t_stars), intent(in) :: stars
type(t_cell), intent(in) :: cell
TYPE(t_sym),INTENT(IN) :: sym
integer :: dim_idx
real, allocatable :: tmp(:,:), kinED(:,:)
type(t_gradients) :: grad
call init_pw_grid(xcpot, stars, sym, cell)
do dim_idx = 1,3
call pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, cell, &
comparison_kinED_pw(dim_idx)%pw, grad, tmp)
xcpot%comparison_kinED_pw(dim_idx)%pw, grad, tmp)
if(allocated(tmp)) then
write (77,*) "tmp not allocated"
deallocate(tmp)
else
write (77,*) "tmp is so allocated"
endif
if(.not. allocated(kinED)) allocate(kinED, mold=tmp)
kinEd = kinED + tmp
deallocate(tmp)
enddo
call finish_pw_grid()
write (*,*) "kED shape =", shape(kinED)
write (77,*) "kED shape =", shape(kinED)
end subroutine save_kinED
END MODULE m_cdngen
......@@ -12,12 +12,14 @@
!! In addition to overloading the t_xcpot datatype also mpi_bc_xcpot must be adjusted
!! for additional implementations.
MODULE m_types_xcpot
use m_types_potden
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
PUBLIC :: t_xcpot,t_gradients
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
TYPE(t_potden) :: comparison_kinED_pw(3)
CONTAINS
PROCEDURE :: vxc_is_LDA=>xcpot_vxc_is_LDA
PROCEDURE :: exc_is_LDA=>xcpot_exc_is_LDA
......@@ -157,6 +159,6 @@ CONTAINS
ALLOCATE(grad%g2ru(ngrid),grad%g2rd(ngrid),grad%gggrt(ngrid))
ALLOCATE(grad%gggru(ngrid),grad%gzgr(ngrid),grad%g2rt(ngrid))
ALLOCATE(grad%gggrd(ngrid),grad%grgru(ngrid),grad%grgrd(ngrid))
END SUBROUTINE xcpot_alloc_gradients
END SUBROUTINE xcpot_alloc_gradients
END MODULE m_types_xcpot
......@@ -82,6 +82,7 @@ CONTAINS
TYPE(t_results) :: tmp_results
TYPE(t_cdnvalJob) :: cdnvalJob
TYPE(t_potden) :: aux_den, real_den
CALL regCharges%init(input, atoms)
CALL dos%init(input, atoms, DIMENSION, kpts, vacuum)
......@@ -426,9 +427,8 @@ CONTAINS
REAL :: fac
INTEGER :: basis_idx
if(.not. allocated(zPrime%data_r)) then
call zPrime%init(zMat)
endif
call zPrime%free()
call zPrime%init(zMat)
do basis_idx = 1,size(lapw%gvec,dim=2)
fac = kpt(dim_idx) + lapw%gvec(dim_idx,basis_idx,1)
......
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