Commit 1ff09997 authored by Daniel Wortmann's avatar Daniel Wortmann

Changed behaviour of qfix and input%qfix variable

parent b88257e1
......@@ -34,7 +34,6 @@ CONTAINS
INTEGER :: kr(3,sym%nop)
COMPLEX :: sf,phas(sym%nop)
INTEGER :: js,n,l,k,nat,j
TYPE(t_input) :: inputtmp
DO js=1,input%jspins
DO n=1,atoms%ntype
......@@ -67,10 +66,8 @@ CONTAINS
ENDDO
END DO
END DO
inputtmp=input
inputtmp%qfix=1
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,inputtmp,cell,oneD,&
den,noco%l_noco,mpi%isize==1,force_fix=.TRUE.,fix=fix)
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,noco%l_noco,mpi%isize==1,force_fix=.TRUE.,fix=fix,fix_pw_only=.true.)
END SUBROUTINE fix_by_gaussian
FUNCTION gaussian_r(r,alpha)
......
......@@ -12,7 +12,7 @@ MODULE m_qfix
CONTAINS
SUBROUTINE qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,l_noco,l_printData,force_fix,fix)
den,l_noco,l_printData,force_fix,fix,fix_pw_only)
USE m_types
USE m_cdntot
......@@ -32,7 +32,7 @@ CONTAINS
TYPE(t_potden),INTENT(INOUT) :: den
LOGICAL,INTENT(IN) :: l_noco,l_printData,force_fix
REAL, INTENT (OUT) :: fix
LOGICAL,INTENT(IN),OPTIONAL :: fix_pw_only
! .. Local Scalars ..
LOGICAL :: l_qfixfile,fixtotal
LOGICAL :: l_firstcall=.true.
......@@ -40,11 +40,9 @@ CONTAINS
INTEGER :: jm,lh,n,na
! ..
fixtotal=.true. !this is the default
IF (PRESENT(fix_pw_only)) fixtotal=.NOT.fix_pw_only
fix=1.0
if (l_firstcall) THEN
INQUIRE(file='qfix',exist=l_qfixfile)
IF (l_qfixfile) CALL judft_info("qfix file no longer supported, check the qfix option in inp.xml","INFO")
IF (input%qfix==1) fixtotal=.FALSE.
IF (l_firstcall) THEN
l_firstcall=.false.
ELSE
IF (MOD(input%qfix,2)==0.AND..NOT.force_fix) RETURN
......
......@@ -993,7 +993,10 @@ MODULE m_cdn_io
IF (mpi%irank==0) WRITE(6,*) "Using qfix to adjust density"
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,noco%l_noco,mpi%isize==1,force_fix=.TRUE.,fix=fix)
CASE(2)
CASE(2,3)
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,noco%l_noco,mpi%isize==1,force_fix=.TRUE.,fix=fix,fix_pw_only=.true.)
CASE(4,5)
CALL fix_by_gaussian(shifts,atoms,stars,mpi,sym,vacuum,sphhar,input,oned,cell,noco,den)
CASE default
CALL judft_error("Wrong choice of qfix in input")
......
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