spin-polarized calculations: at least one value for

starting_magnetization must be explicitly set in input
(fixed previously introduced bug).


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@438 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2003-12-02 14:28:22 +00:00
parent c40b0f7092
commit fd6348978e
2 changed files with 24 additions and 3 deletions

View File

@ -146,7 +146,15 @@ MODULE read_namelists_module
qcutz = 0.D0
q2sigma = 0.01D0
xc_type = 'PZ'
starting_magnetization = 0.0D0
IF ( prog == 'PW' ) THEN
!
! set to an invalid value:
! starting_magnetization MUST be set for at least one atomic type
!
starting_magnetization =-2.0D0
ELSE
starting_magnetization = 0.0D0
ENDIF
lda_plus_U = .FALSE.
Hubbard_U = 0.0D0
Hubbard_alpha = 0.0D0
@ -849,6 +857,14 @@ MODULE read_namelists_module
IF( nosym ) &
CALL errore( sub_name ,' nosym not implemented in FPMD ', -1)
END IF
IF( prog == 'PW' ) THEN
!
! stop if starting_magnetization is set to -2 for all atomic types
!
IF( nspin == 2 .AND. SUM(starting_magnetization) ==-2.0d0 * &
SIZE(starting_magnetization) ) CALL errore( sub_name ,&
& ' starting_magnetization MUST be set ', 1)
END IF
!
! ... non collinear check
!

View File

@ -14,7 +14,7 @@ SUBROUTINE iosys
! ------------------------------------------------------------------
!
! access the modules renaming the variables that have the same name
! as the input parameters, this is required in order to use a conde
! as the input parameters, this is required in order to use a code-
! independent input parser
!
!
@ -239,7 +239,11 @@ SUBROUTINE iosys
ELSE
WRITE( stdout,*) 'noncolin = false'
ENDIF
! starting_magnetization(ia) = -2.d0 means "not set" -- set it to 0
DO ia = 1, ntyp
IF (starting_magnetization(ia) == -2.d0) &
starting_magnetization(ia) = 0.d0
END DO
!
IF ( ecutrho <= 0.D0 ) THEN
dual = 4.D0
@ -594,6 +598,7 @@ SUBROUTINE iosys
lda_plus_u_ = lda_plus_u
nspin_ = nspin
starting_magnetization_ = starting_magnetization
nosym_ = nosym
nbnd_ = nbnd
!