Commit a5c5606e authored by Matthias Redies's avatar Matthias Redies

generalize x_to_grid to work for negative values aswell

parent 79c4ef4f
......@@ -46,7 +46,6 @@ CONTAINS
END SUBROUTINE init_mt_grid
SUBROUTINE mt_to_grid(xcpot,jspins,atoms,sphhar,den_mt,nsp,n,grad,ch)
! SUBROUTINE pw_to_grid(xcpot,jspins,l_noco,stars,cell,den_pw,grad,rho)
USE m_grdchlh
USE m_mkgylm
IMPLICIT NONE
......@@ -141,7 +140,10 @@ CONTAINS
ch_tmp,chdr,chdt,chdf,chdrr,chdtt,chdff,chdtf,chdrt,chdrf,grad,kt)
ENDIF
!Set charge to minimum value
IF (PRESENT(ch)) ch(kt+1:kt+nsp,:)=MAX(ch_tmp(:nsp,:),d_15)
IF (PRESENT(ch)) THEN
WHERE(ABS(ch_tmp) < d_15) ch_tmp = d_15
ch(kt+1:kt+nsp,:) = ch_tmp(:nsp,:)
ENDIF
kt=kt+nsp
END DO
......
......@@ -233,7 +233,9 @@ CONTAINS
END IF
ENDIF
IF (PRESENT(rho)) rho(:,:)=MAX(rho(:,:),d_15)
IF (PRESENT(rho)) THEN
WHERE(ABS(rho) < d_15) rho = d_15
ENDIF
END SUBROUTINE pw_to_grid
......
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