Skip to content
Snippets Groups Projects
Commit ab16b3b9 authored by Nicolas Essing's avatar Nicolas Essing
Browse files

Merge of two bugfixed from Eduardo.

Saving the constraint fields gave wrong output, because the write statement was outside of a loop it belongs to.

The torque used to update the constraint fields was always the one calculated over the full cell, never the one calculated only up to the muffin tin radius, regradles of the setting.
parents 36d48e37 c5c1421a
No related branches found
No related tags found
No related merge requests found
......@@ -1172,11 +1172,11 @@ module ProcessKKRresults_mod
calc%noco_data%moment_z(atom_id)
irec = irec + 1
endif
if (params%noncobfield) then
write(unit=r1fu, rec=irec) calc%bfields(ila)%bfield_constr
irec = irec + 1
end if
end do
if (params%noncobfield) then
write(unit=r1fu, rec=irec) calc%bfields(ila)%bfield_constr
irec = irec + 1
end if
close(r1fu)
......
......@@ -161,7 +161,7 @@ contains
! Scf-cycle for constraint fields, based either on torque or on fields alone
if (lbfield_constr .and. itscf0 <= iteration .and. iteration <= itscf1) then
if (constr_mode == 3) then
bfield%bfield_constr(:) = bfield%bfield_constr(:) - torque(:) / mag_mom_len
bfield%bfield_constr(:) = bfield%bfield_constr(:) - bfield%mag_torque(:) / mag_mom_len
else if (constr_mode == 2) then
old_b_constr = bfield%bfield_constr(:)
bfield%bfield_constr(:) = old_b_constr - dot_product(old_b_constr,dir)*dir - &
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment