Commit 11f5c0f2 authored by Gregor Michalicek's avatar Gregor Michalicek
Browse files

Bugfix in inpgen2/check_mt_radii.f90

The bug lead to too large MT radii. See issue #678.
parent 79fd0997
......@@ -367,10 +367,10 @@ CONTAINS
minRmts(atoms%nz(typeA)) = rmtFac * dist * facA
minRmts(atoms%nz(typeB)) = rmtFac * dist * facB
ELSE
minRmts(atoms%nz(typeA)) = rmtFac * (dist - minRmts(atoms%nz(typeB)))
minRmts(atoms%nz(typeA)) = (rmtFac * dist) - minRmts(atoms%nz(typeB))
END IF
ELSE IF (minRmts(atoms%nz(typeB)).LT.0.0) THEN
minRmts(atoms%nz(typeB)) = rmtFac * (dist - minRmts(atoms%nz(typeA)))
minRmts(atoms%nz(typeB)) = (rmtFac * dist) - minRmts(atoms%nz(typeA))
END IF
minRmts(atoms%nz(typeA)) = min(minRmts(atoms%nz(typeA)),rmtMaxDefault) ! limit already here
minRmts(atoms%nz(typeB)) = min(minRmts(atoms%nz(typeB)),rmtMaxDefault) ! to a reasonable value
......@@ -385,6 +385,7 @@ CONTAINS
rmt1(i) = minRmts(atoms%nz(i))
END DO
! NOTE: The result of this section may be slightly different from the old version
! iff the old version would enlarge a MT sphere at this point.
! Also the old version does not propagate the changes of the MT radii to all
......
Supports Markdown
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