From 0e02ba9e280652f98c9d3afed671ac98f0b6dfc4 Mon Sep 17 00:00:00 2001 From: sbraccia Date: Fri, 11 Jun 2004 07:48:24 +0000 Subject: [PATCH] Fixed a couple of ambiguities: flib/rranf.f90: variable irand was not initialized. PW/v_of_rho.f90: at line 146 CALL xc( arhox, ex, ec, vx, vc ) => CALL xc( arhox, ex, ec, vx(1), vc(1) ) C.S. git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@950 c92efa57-630b-4861-b058-cf58834340f0 --- PW/v_of_rho.f90 | 2 +- flib/rranf.f90 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PW/v_of_rho.f90 b/PW/v_of_rho.f90 index ff43bc38d..da41f0644 100644 --- a/PW/v_of_rho.f90 +++ b/PW/v_of_rho.f90 @@ -143,7 +143,7 @@ subroutine v_xc (rho, rho_core, nr1, nr2, nr3, nrx1, nrx2, nrx3, & rhox = rho (ir, nspin) + rho_core (ir) arhox = abs (rhox) if (arhox.gt.1.d-30) then - call xc (arhox, ex, ec, vx, vc) + CALL xc( arhox, ex, ec, vx(1), vc(1) ) v(ir,nspin) = e2 * (vx(1) + vc(1) ) etxc = etxc + e2 * (ex + ec) * rhox vtxc = vtxc + v(ir,nspin) * rho(ir,nspin) diff --git a/flib/rranf.f90 b/flib/rranf.f90 index 4a590a342..a205b844f 100644 --- a/flib/rranf.f90 +++ b/flib/rranf.f90 @@ -90,9 +90,10 @@ function rndm () data first / .true. / save first, shuffle, i ! + if (first) irand = -1 ! starting seed, must be not be 0 + ! if (first.or.irand.lt.0) then irand = - irand - if (first) irand=1 ! starting seed, must be not be 0 do i = 32 + 8, 1, - 1 shuffle (min (i, 32) ) = rndx (irand) enddo @@ -104,7 +105,7 @@ function rndm () i = 32 * rndm + 1 return - + end function rndm function rndx (irand)