Commit 4e17db7e authored by Gregor Michalicek's avatar Gregor Michalicek

Quick fix for the relaxation of the noco alpha and beta angles.

...the usage has to be changed at some point. At the moment a
nocoinp file is generated. The noco input from that file overwrites
the noco input in inp.xml
parent ac8a3484
......@@ -34,7 +34,7 @@ SUBROUTINE genNewNocoInp(input,atoms,noco,noco_new)
alphdiff = 2.0*pi_const*(noco%qss(1)*atoms%taual(1,iAtom) + &
noco%qss(2)*atoms%taual(2,iAtom) + &
noco%qss(3)*atoms%taual(3,iAtom) )
noco_new%alph(iType) = noco%alph(iType) - alphdiff
noco_new%alph(iType) = noco_new%alph(iType) - alphdiff
DO WHILE (noco_new%alph(iType) > +pi_const)
noco_new%alph(iType)= noco_new%alph(iType) - 2.0*pi_const
END DO
......@@ -42,7 +42,7 @@ SUBROUTINE genNewNocoInp(input,atoms,noco,noco_new)
noco_new%alph(iType)= noco_new%alph(iType) + 2.0*pi_const
END DO
ELSE
noco_new%alph(iType) = noco%alph(iType)
noco_new%alph(iType) = noco_new%alph(iType)
END IF
iatom= iatom + atoms%neq(iType)
END DO
......
......@@ -44,6 +44,10 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IMPLICIT NONE
#ifdef CPP_MPI
INCLUDE 'mpif.h'
#endif
! Type instance arguments
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_mpi),INTENT(IN) :: mpi
......@@ -54,7 +58,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
TYPE(t_sliceplot),INTENT(IN) :: sliceplot
TYPE(t_input),INTENT(IN) :: input
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_noco),INTENT(INOUT) :: noco
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_cell),INTENT(IN) :: cell
......@@ -81,7 +85,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
!Local Scalars
REAL :: fix, qtot, dummy,eFermiPrev
INTEGER :: jspin, jspmax
INTEGER :: jspin, jspmax, ierr
#ifdef CPP_HDF
INTEGER(HID_T) :: banddosFile_id
#endif
......@@ -161,6 +165,8 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
!Calculate and write out spin densities at the nucleus and magnetic moments in the spheres
CALL magMoms(dimension,input,atoms,noco_new,vTot,moments)
noco = noco_new
!Generate and save the new nocoinp file if the directions of the local
!moments are relaxed or a constraint B-field is calculated.
IF (ANY(noco%l_relax(:atoms%ntype)).OR.noco%l_constr) THEN
......@@ -168,10 +174,23 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
END IF
IF (noco%l_soc) CALL orbMagMoms(input,atoms,noco,moments%clmom)
END IF
END IF ! mpi%irank.EQ.0
#ifdef CPP_MPI
CALL MPI_BCAST(noco%l_ss,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%l_mperp,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%l_constr,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%mix_b,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%alphInit,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%alph,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%beta,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%b_con,atoms%ntype*2,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%l_relax,atoms%ntype,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(noco%qss,3,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,outDen)
#endif
......
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