c---------------------------------------------------------------------- subroutine SCALEGGA(gam,der,lcor,lpot,egga,vgga) c is a driver for the PBE subroutines, using simple inputs c and allowing the density to be scaled by gam c c author: Kieron Burke, 9.20.99 c in: gam=scale factor, as in n_gam(r)=gam^3 n(gam*r) c der(3,4)=matrix of densities c i=1=>total,i=2=>up,i=3=>dn c j=(1=dens,2=agrad,3=del|grad|,4=lap) c lcor=flag to do correlation (0=not,1=yes) c lpot=flag to do potential (0=not,1=yes) c c out: egga(2,4)=matrix of energies/particle c i=(1=>x,2=>c) c j=(1=LSD,2=PW91,3=PBE,4=BLYP) c vgga(2,4,2)=matrix of potentials c i=(1=>x,2=>c) c j=(1=LSD,2=PW91,3=PBE,4=BLYP) c k=(1=up,2=dn) c calls: EASYPBE implicit real*8 (a-h,o-z) dimension der(3,4),derg(3,4),egga(2,4),vgga(2,4,2)