Commit 55c9ea91 authored by Gregor Michalicek's avatar Gregor Michalicek

Minor cleanup for some files

parent 92b8d30c
......@@ -49,10 +49,6 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
TYPE(t_potden),INTENT(INOUT) :: inDen
INTEGER, INTENT(IN) :: archiveType
!Local type instances
TYPE(t_potden) :: diffDen
!Local Scalars
REAL fix,intfac,vacfac
INTEGER i,imap,js,mit,irecl
......@@ -70,8 +66,6 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
REAL CPP_BLAS_sdot
EXTERNAL CPP_BLAS_sdot
CALL diffDen%init(stars,atoms,sphhar,vacuum,noco,oneD,input%jspins,.FALSE.,POTDEN_TYPE_DEN)
! YM: I have exported 'vol' from outside, be aware
! IF (film) THEN
! vol = 2.0 * z1 * area
......@@ -159,19 +153,8 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
CALL brysh1(input,stars,atoms,sphhar,noco,vacuum,sym,oneD,&
intfac,vacfac,outDen,nmap,nmaph,mapmt,mapvac,mapvac2,fsm)
!store fsm - sm the difference on fsm
diffDen%mt = outDen%mt - inDen%mt
diffDen%pw = outDen%pw - inDen%pw
diffDen%vacz = outDen%vacz - inDen%vacz
diffDen%vacxy = outDen%vacxy - inDen%vacxy
diffDen%cdom = outDen%cdom - inDen%cdom
diffDen%cdomvz = outDen%cdomvz - inDen%cdomvz
diffDen%cdomvxy = outDen%cdomvxy - inDen%cdomvxy
diffDen%mmpMat = outDen%mmpMat - inDen%mmpMat
DO imap = 1,nmap
fsm(imap) = fsm(imap) - sm(imap)
END DO
!store the difference fsm - sm in fsm
fsm(:nmap) = fsm(:nmap) - sm(:nmap)
! open files for broyden
irecl=(nmap+1)*8
......
......@@ -113,6 +113,7 @@ CONTAINS
READ (59,rec=(it-1)*2-1) (ui(i),i=1,nmap)
READ (59,rec=(it-1)*2) (vi(i),i=1,nmap),dfivi
am(it) = CPP_BLAS_sdot(nmap,vi,1,fm1,1)
! calculate um(:) = -am(it)*ui(:) + um
CALL CPP_BLAS_saxpy(nmap,-am(it),ui,1,um,1)
WRITE(6,FMT='(5x,"<vi|w|Fm> for it",i2,5x,f10.6)')it,am(it)
END DO
......@@ -135,6 +136,7 @@ CONTAINS
READ (59,rec=2*(it-1)-1) (ui(i),i=1,nmap)
READ (59,rec=2*(it-1)) (vi(i),i=1,nmap), dfivi
bm = CPP_BLAS_sdot(nmap,ui,1,fm1,1)
! calculate vm(:) = -bm*vi(:) + vm
CALL CPP_BLAS_saxpy(nmap,-bm,vi,1,vm,1)
!write(6,FMT='(5x,"<ui|w|Fm> for it",i2,5x,f10.6)') it, bm
END DO
......@@ -170,14 +172,15 @@ CONTAINS
mmap,nmaph,mapmt,mapvac2,fm1,vm,l_pot)
DO it = 2,iread
READ (59,rec=2*(it-1)-1) (ui(i),i=1,nmap)
READ (59,rec=2*(it-1)) (vi(i),i=1,nmap), dfivi
READ (59,rec=2*(it-1)) (vi(i),i=1,nmap), dfivi
! calculate vm(:) = -am(it)*dfivi*vi(:) + vm
CALL CPP_BLAS_saxpy(nmap,-am(it)*dfivi,vi,1,vm,1)
END DO
vmnorm = CPP_BLAS_sdot(nmap,fm1,1,vm,1)
! if (vmnorm.lt.tol_10) stop
! calculate vm(:) = (1.0/vmnorm)*vm(:)
CALL CPP_BLAS_sscal(nmap,one/vmnorm,vm,1)
! save dfivi(mit) for next iteration
......@@ -196,6 +199,7 @@ CONTAINS
! update rho(m+1)
! calculate <fm|w|vm>
fmvm = CPP_BLAS_sdot(nmap,vm,1,fm,1)
! calculate sm(:) = (1.0-fmvm)*ui(:) + sm
CALL CPP_BLAS_saxpy(nmap,one-fmvm,um,1,sm,1)
END IF
......
......@@ -136,8 +136,8 @@ CONTAINS
END DO
END IF
! Interstitial region (metric here = step function)
! multiplicate the metric with the vector in real space
! Apply metric to interstitial region (metric here = step function)
! + multiply metric g with s_in for MT and vacuum contributions (store in sout)
DO js = 1, input%jspins
! map s_in on a complex help array ag3
IF (sym%invs) THEN
......@@ -153,17 +153,21 @@ CONTAINS
CALL convol(stars,fg3,ag3,stars%ufft)
IF (sym%invs) THEN
! interstitial
DO imap = 1, stars%ng3
sout(imap+nmaph*(js-1)) = cell%omtil * REAL(fg3(imap))
END DO
! MT + vacuum
DO imap = stars%ng3+1, nmaph
sout(imap+nmaph*(js-1)) = g(imap) * s_in(imap+nmaph*(js-1))
END DO
ELSE
! interstitial
DO imap = 1, stars%ng3
sout(imap+nmaph*(js-1)) = cell%omtil * REAL(fg3(imap))
sout(imap+stars%ng3+nmaph*(js-1)) = cell%omtil * AIMAG(fg3(imap))
END DO
! MT + vacuum
DO imap = 2 * stars%ng3 + 1, nmaph
sout(imap+nmaph*(js-1)) = g(imap) * s_in(imap+nmaph*(js-1))
END DO
......
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