******************************************************************************** * * * 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 ### norm ### c c Normalizes a given orbital. c subroutine norm (iorb,psi,f4,wgt2,wk0) implicit integer*4 (i-n) implicit real*8 (a-h,o-z) real*8 f4,wgt2 include 'commons8.inc' dimension psi(*),f4(*),wgt2(*),wk0(*) ibeg = i1b (iorb) ngrid= i1si(iorb) do i=1,ngrid wk0(i)=psi(ibeg-1+i)*psi(ibeg-1+i) enddo call prod (ngrid,f4,wk0) xnorm=ddot (ngrid,wgt2,1,wk0,1) area(iorb)=xnorm zarea = 1.d0/sqrt(xnorm) call dscal (ngrid,zarea,psi(ibeg),1) return end