Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial atomic spin only set for spin polarised calculations #384

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/initial_read_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ subroutine read_input(start, start_L, titles, vary_mu,&
!maxnsf = 0
!max_rc = zero
min_blip_sp = 1.0e8_double
flag_InitialAtomicSpin = .false.
flag_InitialAtomicSpin = .false.
do i=1,n_species
charge(i) = zero
charge_up(i) = zero
Expand All @@ -1383,13 +1383,15 @@ subroutine read_input(start, start_L, titles, vary_mu,&
! do while(fdf_bline(bp,line)) ! While there are lines in the block
if(fdf_block(species_label(i))) then
!charge(i) = fdf_double ('Atom.ValenceCharge',zero)
charge_up(i) = fdf_double ('Atom.SpinNeUp',zero)
charge_dn(i) = fdf_double ('Atom.SpinNeDn',zero)
sum_elecN_spin = charge_up(i)+charge_dn(i)
if (abs(sum_elecN_spin)>RD_ERR) then
flag_InitialAtomicSpin = .true.
! We will check that the sum of charge_up and charge_dn matches charge later
endif
if(flag_spin_polarisation) then
charge_up(i) = fdf_double ('Atom.SpinNeUp',zero)
charge_dn(i) = fdf_double ('Atom.SpinNeDn',zero)
sum_elecN_spin = charge_up(i)+charge_dn(i)
if (abs(sum_elecN_spin)>RD_ERR) then
flag_InitialAtomicSpin = .true.
! We will check that the sum of charge_up and charge_dn matches charge later
endif
end if
nsf_species(i) = fdf_integer('Atom.NumberOfSupports',0)
RadiusSupport(i) = fdf_double ('Atom.SupportFunctionRange',zero)
!RadiusAtomf(i) = RadiusSupport(i) ! = r_pao for (atomf=paof) or r_sf for (atomf==sf)
Expand Down