Commit abd312af authored by Matthias Redies's avatar Matthias Redies

merge

parents edcf8ae9 c93b6bd5
......@@ -6,7 +6,6 @@ Testing/*
build
build.*
*.o
*.mod
*.x
*.swp
tags
......@@ -83,17 +83,13 @@ CONTAINS
ENDDO
END IF
! -----is region
IF (.FALSE.) THEN !Change this for old way of determination of int-charge
CALL convol(stars,x,den%pw(:,jspin),stars%ufft)
qis = x(1)*cell%omtil
ELSE
qis = 0.
qis = 0.
CALL pwint_all(stars,atoms,sym,oneD,cell,1,stars%ng3,x)
DO j = 1,stars%ng3
qis = qis + den%pw(j,jspin)*x(j)*stars%nstr(j)
ENDDO
CALL pwint_all(stars,atoms,sym,oneD,cell,1,stars%ng3,x)
DO j = 1,stars%ng3
qis = qis + den%pw(j,jspin)*x(j)*stars%nstr(j)
ENDDO
endif
qistot = qistot + qis
q = q + qis
WRITE (6,FMT=8000) jspin,q,qis, (qmt(n),n=1,atoms%ntype)
......
......@@ -12,6 +12,7 @@ SUBROUTINE cdncore(mpi,dimension,oneD,input,vacuum,noco,sym,&
stars,cell,sphhar,atoms,vTot,outDen,moments,results, EnergyDen)
USE m_constants
USE m_judft
USE m_cdn_io
USE m_cdnovlp
USE m_cored
......
......@@ -11,8 +11,12 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp -assume byterecl")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O0 -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB -DCPP_DEBUG")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2 -g")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "19.0.0.0")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG")
else()
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -CB -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG")
endif()
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
message("PGI Fortran detected")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake
......
......@@ -66,21 +66,27 @@ MODULE m_constants
CONTAINS
REAL PURE FUNCTION pimach()
! This subprogram supplies the value of the constant PI correct to
! machine precision where
IMPLICIT NONE
! This subprogram supplies the value of the constant PI correct to
! machine precision where
! PI=3.1415926535897932384626433832795028841971693993751058209749446
! PI=3.1415926535897932384626433832795028841971693993751058209749446
pimach = 3.1415926535897932
pimach = 3.1415926535897932
END FUNCTION pimach
REAL ELEMENTAL FUNCTION c_light(fac)
! This subprogram supplies the value of c according to
! NIST standard 13.1.99
! Hartree and Rydbergs changed by fac = 1.0 or 2.0
REAL, INTENT (IN) :: fac
c_light = 137.0359895e0 * fac
IMPLICIT NONE
! This subprogram supplies the value of c according to
! NIST standard 13.1.99
! Hartree and Rydbergs changed by fac = 1.0 or 2.0
REAL, INTENT (IN) :: fac
c_light = 137.0359895e0 * fac
<<<<<<< Updated upstream
=======
!c_light = 1e6*fac
>>>>>>> Stashed changes
END FUNCTION c_light
END MODULE m_constants
......@@ -212,6 +212,7 @@ CONTAINS
CALL send_usage_data()
#ifdef CPP_MPI
IF(PRESENT(irank)) THEN
write (*,*) "Going into post send barrier"
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_FINALIZE(ierr)
ELSE
......
......@@ -301,37 +301,37 @@ CONTAINS
ELSEIF(xcpot%exc_is_MetaGGA()) THEN
IF(PRESENT(kinEnergyDen_KS)) THEN
! apply correction in eq (4) in https://doi.org/10.1063/1.1565316
!kinEnergyDen_libXC = transpose(kinEnergyDen_KS + 0.25 * grad%laplace)
kinEnergyDen_libXC = transpose(kinEnergyDen_KS + 0.25 * grad%laplace)
!where(kinEnergyDen_libXC < 1d-5) kinEnergyDen_libXC = 1d-5
write (*,*) "apply tf approx. shapes: "
write (*,*) "shape(rh) = ", shape(rh)
write (*,*) "shape(grad%sigma) = ", shape(transpose(grad%sigma))
write (*,*) "shape(grad%lapl) = ", shape(grad%laplace)
!write (*,*) "apply tf approx. shapes: "
!write (*,*) "shape(rh) = ", shape(rh)
!write (*,*) "shape(grad%sigma) = ", shape(transpose(grad%sigma))
!write (*,*) "shape(grad%lapl) = ", shape(grad%laplace)
kinEnergyDen_libXC = 0.3 * (3.0*pi_const**2)**(2./3.) * rh**(5./3.) &
+ 1.0/72.0 * transpose(abs(grad%sigma))/rh &
+ 1.0/6.0 * grad%laplace
!kinEnergyDen_libXC = 0.3 * (3.0*pi_const**2)**(2./3.) * rh**(5./3.) &
!+ 1.0/72.0 * transpose(abs(grad%sigma))/rh &
!+ 1.0/6.0 * grad%laplace
pkzb_zaehler = (1./8. * transpose(abs(grad%sigma))/rh)**2
pkzb_nenner = kinEnergyDen_libxc**2
pkzb_ratio = pkzb_zaehler/pkzb_nenner
write (*,*) "pkzb ratio:"
write (*,*) "min = ", minval(pkzb_ratio)
write (*,*) "max = ", maxval(pkzb_ratio)
!pkzb_zaehler = (1./8. * transpose(abs(grad%sigma))/rh)**2
!pkzb_nenner = kinEnergyDen_libxc**2
!pkzb_ratio = pkzb_zaehler/pkzb_nenner
!write (*,*) "pkzb ratio:"
!write (*,*) "min = ", minval(pkzb_ratio)
!write (*,*) "max = ", maxval(pkzb_ratio)
write (filename, '("kED_libxc_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
write (filename, '("kED_libxc_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=2)
call save_npy(filename, transpose(kinEnergyDen_libxc))
write (filename, '("sigma_", I0.6, ".npy")') size(grad%sigma, dim=2)
call save_npy(filename, grad%sigma)
write (filename, '("pkzb_zaehler_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
call save_npy(filename, transpose(pkzb_zaehler))
write (filename, '("pkzb_nenner_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
call save_npy(filename, transpose(pkzb_nenner))
write (filename, '("pkzb_ratio_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
call save_npy(filename, transpose(pkzb_ratio))
!write (filename, '("pkzb_zaehler_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
!call save_npy(filename, transpose(pkzb_zaehler))
!write (filename, '("pkzb_nenner_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
!call save_npy(filename, transpose(pkzb_nenner))
!write (filename, '("pkzb_ratio_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=1)
!call save_npy(filename, transpose(pkzb_ratio))
exc = 0.0
excc = 0.0
......
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