Refactoring
subroutine groundstate (structure,groundstateconf) 
use module state,only:basis,density,field
class (mixer)::mixer
basis=basis(structure,groundstateconf)
call density%init(basis,structure,groundstateconf)
field=density%poissoneq()
mixer=mixer(groundstateconf)
newdensity=density
Do 
   if (mixer%is_converged()) exit  
   field=newdensity%poissoneq()
   call basis.update(field)
   density=basis%solve(field)
   call density%write()  
   call mixer%mix(density,newdensity)
 
end do 
call mixer%delete()
call make_groundstate_report(basis,density)
end subroutine groundstate
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License