Commit cce533f4 authored by Gregor Michalicek's avatar Gregor Michalicek

Replaced several magic numbers for Hartree to eV conversion by the constant from global/constants.f

parent d87e7cd9
......@@ -43,7 +43,7 @@ CONTAINS
! off-diagonal elements n_21
!***********************************************************************
!
USE m_constants, ONLY : tpi_const
USE m_constants
USE m_grdchlh
USE m_qsf
USE m_cylbes
......@@ -70,7 +70,7 @@ CONTAINS
INTEGER, INTENT (IN) :: ne
INTEGER, INTENT (IN) :: ikpt
INTEGER,PARAMETER :: n2max=13
REAL,PARAMETER :: emax=2.0/27.2
REAL,PARAMETER :: emax=2.0/hartree_to_ev_const
! .. Array Arguments ..
REAL, INTENT (IN) :: bkpt(3)
REAL, INTENT (IN) :: evac(2,DIMENSION%jspd)
......
......@@ -8,7 +8,7 @@ MODULE m_fergwt
CONTAINS
SUBROUTINE fergwt(kpts,input,mpi, ne,eig, results)
USE m_constants, ONLY : pi_const
USE m_constants
USE m_types
IMPLICIT NONE
......@@ -90,7 +90,7 @@ CONTAINS
IF ( mpi%irank == 0 ) WRITE (6,FMT=8000) eps
8000 FORMAT (10x,'warning: eps has been increased to',e12.5)
ENDDO conv_loop
workf = -27.2116*results%ef
workf = -hartree_to_ev_const*results%ef
IF ( mpi%irank == 0 ) THEN
WRITE (16,FMT=8010) results%ef,workf,s
WRITE (6,FMT=8010) results%ef,workf,s
......
MODULE m_efield
use m_juDFT
USE m_juDFT
USE m_constants
IMPLICIT NONE
PRIVATE
PUBLIC :: efield
......@@ -256,9 +257,6 @@
INTEGER, INTENT(IN) :: k1d, k2d, nvac
REAL, INTENT(IN) :: area
! htr -> electron Volt
REAL, PARAMETER :: htr_eV = 27.21138386 ! eV
REAL :: zsigma, sig_b(2), tmp
INTEGER, PARAMETER :: iou = 33
INTEGER :: ios
......@@ -307,8 +305,8 @@
CLOSE (iou)
IF (eV) THEN
E%sig_b(:) = E%sig_b/htr_eV
E%sigEF(:,:,:) = E%sigEF/htr_eV
E%sig_b(:) = E%sig_b/hartree_to_ev_const
E%sigEF(:,:,:) = E%sigEF/hartree_to_ev_const
END IF
! Save average sigEF potential in sig_b and remove it from
! sigEF to avoid double counting; i.e. make g_|| = 0 of sigEF == 0.
......@@ -706,10 +704,10 @@
IF (ALLOCATED(E%sigEF))&
& WRITE (unit,'(3x,a)') 'Average potential:'
WRITE (unit, '(3x,a,f12.5,a, f12.5,a)') 'on sheet 1: ',&
& E%sig_b(1),' htr = ',E%sig_b(1)*htr_eV,' V'
& E%sig_b(1),' htr = ',E%sig_b(1)*hartree_to_ev_const,' V'
IF (nvac > 1) THEN
WRITE (unit, '(3x,a,f12.5,a, f12.5,a)') 'on sheet 2: ',&
& E%sig_b(2),' htr = ',E%sig_b(2)*htr_eV,' V'
& E%sig_b(2),' htr = ',E%sig_b(2)*hartree_to_ev_const,' V'
WRITE (unit,'(3x,a,f14.5,a)')&
& 'Average field (plate to plate):',&
......@@ -781,7 +779,7 @@
& E%sigEF(i,j,ivac)&
& + E%sig_b(ivac),&
& (E%sigEF(i,j,ivac)&
& + E%sig_b(ivac))*htr_eV
& + E%sig_b(ivac))*hartree_to_ev_const
ELSE ! Neumann
WRITE (748, '(4f12.5,2g16.5)')&
& pt_abs(1:2), pt_rel(1:2),&
......
......@@ -160,7 +160,6 @@ SUBROUTINE r_inpXML(&
REAL :: weightScale, eParamUp, eParamDown
LOGICAL :: l_amf
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
REAL, PARAMETER :: htr_eV = 27.21138386 ! eV
......@@ -699,8 +698,8 @@ SUBROUTINE r_inpXML(&
! ALLOCATE(input%efield%sigEF(3*k1d, 3*k2d, nvac))
! input%efield%sigEF = 0.0
IF (l_eV) THEN
input%efield%sig_b(:) = input%efield%sig_b/htr_eV
! input%efield%sigEF(:,:,:) = input%efield%sigEF/htr_eV
input%efield%sig_b(:) = input%efield%sig_b/hartree_to_ev_const
! input%efield%sigEF(:,:,:) = input%efield%sigEF/hartree_to_ev_const
END IF
END IF
......
......@@ -8,7 +8,7 @@ CONTAINS
lmaxb,ntype,n_u,lda_u,f0,f2,f4,f6,&
u)
USE m_constants, ONLY : pi_const
USE m_constants
USE m_sgaunt
IMPLICIT NONE
......@@ -34,11 +34,11 @@ CONTAINS
IF (lda_u(itype).GE.0) THEN
n = n + 1
l_l(n) = lda_u(itype)
fk(1,n) = f0(n) / 27.21
fk(2,n) = f2(n) / 27.21
fk(3,n) = f4(n) / 27.21
fk(1,n) = f0(n) / hartree_to_ev_const
fk(2,n) = f2(n) / hartree_to_ev_const
fk(3,n) = f4(n) / hartree_to_ev_const
IF (l_l(n).EQ.3) THEN
fk(4,n) = f6(n) / 27.21
fk(4,n) = f6(n) / hartree_to_ev_const
ELSEIF (l_l(n).GT.3) THEN
CALL juDFT_error("LDA+U for p, d or f-states!", calledby="umtx")
ENDIF
......@@ -110,8 +110,8 @@ CONTAINS
! WRITE (6,*) 'J-matr:'
! IF (l.eq.2) WRITE (6,111) ((u(i,j,j,i,n),i=-l,l),j=-l,l)
! IF (l.eq.3) WRITE (6,211) ((u(i,j,j,i,n),i=-l,l),j=-l,l)
! PRINT*,'U-av:',avu*27.21
! PRINT*,'J-av:',avj*27.21
! PRINT*,'U-av:',avu*hartree_to_ev_const
! PRINT*,'J-av:',avj*hartree_to_ev_const
111 FORMAT (5f8.4)
211 FORMAT (7f8.4)
112 FORMAT (10e20.10)
......
......@@ -20,6 +20,7 @@ CONTAINS
SUBROUTINE v_mmp(sym,atoms,jspins,lmaxb,ns_mmp,u,f0,f2, vs_mmp,results)
USE m_types
USE m_constants
IMPLICIT NONE
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_results),INTENT(INOUT) :: results
......@@ -50,15 +51,15 @@ CONTAINS
l = atoms%lda_u(itype)%l
IF (l.GE.0) THEN
n = n + 1
u_htr = atoms%lda_u(itype)%u / 27.21
j_htr = atoms%lda_u(itype)%j / 27.21
u_htr = f0(n)/27.21
u_htr = atoms%lda_u(itype)%u / hartree_to_ev_const
j_htr = atoms%lda_u(itype)%j / hartree_to_ev_const
u_htr = f0(n)/hartree_to_ev_const
IF (l.EQ.1) THEN
j_htr = f2(n)/(5*27.21)
j_htr = f2(n)/(5*hartree_to_ev_const)
ELSEIF (l.EQ.2) THEN
j_htr = 1.625*f2(n)/(14*27.21)
j_htr = 1.625*f2(n)/(14*hartree_to_ev_const)
ELSEIF (l.EQ.3) THEN
j_htr = (286.+195*451/675+250*1001/2025)*f2(n)/(6435*27.21)
j_htr = (286.+195*451/675+250*1001/2025)*f2(n)/(6435*hartree_to_ev_const)
ENDIF
!
! calculate spin-density 'rho_sig' and total density 'rho_tot'
......
......@@ -175,7 +175,7 @@
&f(kk/2))
ENDDO
! write(*,*) (27.21*2*f(kk),kk=0,l)
! write(*,*) (hartree_to_ev_const*2*f(kk),kk=0,l)
ENDIF
!-ldau
eig(k,ispin) = e
......
#define POTENTIAL
MODULE param
USE m_constants
IMPLICIT NONE
!
REAL,PARAMETER :: au2A =0.529177249
REAL,PARAMETER :: Ha2eV=27.211396132
REAL,PARAMETER :: Ha2eV=hartree_to_ev_const
REAL,PARAMETER :: pi=3.14159265358979323846
!
INTEGER, PARAMETER :: jnlout=6
......
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