******************************************************************************** * * * 2DHF version 1-2003 * * Copyright (C) 1996 Jacek Kobus, Leif Laaksonen, Dage Sundholm * * * * This software may be used and distributed according to the terms * * of the GNU General Public License, see README and COPYING. * * * ******************************************************************************** c ### relax ### c c Controls relaxation of Coulomb potentials, exchange potentials c and orbitals c subroutine relax (iorb,cw_sor,psi,pot,excp, & borb,bpot,d,e,f0,f1,f2,f3,f4,g,wjac1,wjac2, & wgt2,lhs,rhs,wk00,wk0,wk1,wk2) implicit integer*4 (i-n) implicit real*8 (a-h,o-z) real*8 lhs integer*4 cw_sor c_mpi include 'mpif.h' include 'commons_mpi.inc' c_mpi include 'commons8.inc' dimension psi(*),pot(*),excp(*) dimension wjac1(*),wjac2(*),borb(*),bpot(*),d(*),e(*), & f0(*),f1(*),f2(*),f3(*),f4(*),g(*),wgt2(*), & lhs(*),rhs(*),wk00(*),wk0(*),wk1(*),wk2(*) call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr ) call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr ) c when ipoiss=2,3 then mcsor method is used to solve poisson's eqs for c potentials c if (myid.ne.0) then c call dcopy(length3,cw_exch_mpi,1,excp,1) c endif if (myid.eq.0) then if (exlcoul.eq.0.d0) then if (ipoiss.eq.1) then call relcoul1 (iorb,cw_sor,psi,pot,excp,bpot,d,f3,g, & lhs,rhs,wk2) elseif (ipoiss.eq.2.or.ipoiss.eq.3) then call relcoul2 (iorb,cw_sor,psi,pot,excp,bpot,d,f3,g, & lhs,rhs,wk2) endif endif endif c process the exchange potentials c prepare a load for every node call preprelexch(iorb) call prepload(iorb) if (islat.eq.0) then if (exlexp.eq.0.d0.or.exlexp.eq.2.d0) then if (ipoiss.eq.1) then call relexch1 (iorb,cw_sor,psi,pot,excp,bpot,d,e, & f3,g,lhs,rhs,wk2) elseif (ipoiss.eq.2.or.ipoiss.eq.3) then call relexch2 (iorb,cw_sor,psi,pot,excp,bpot,d,e, & f3,g,lhs,rhs,wk2) endif endif endif call MPI_BARRIER( MPI_COMM_WORLD,ierr ) if (myid.eq.0) then if (exlorb.eq.0.d0) then if (ipoiss.eq.1.or.ipoiss.eq.3) then call relorb1(iorb,cw_sor,psi,pot,excp,borb,d,e, & f0,f1,f2,f4,wgt2,lhs,rhs,wk00,wk0,wk2) elseif (ipoiss.eq.2) then call relorb2(iorb,cw_sor,psi,pot,excp,borb,d,e, & f0,f1,f2,f4,wgt2,lhs,rhs,wk00,wk0,wk2) endif endif endif return end