subroutine exchcor(n,h,den,rvxc,etxc,eexc,a,b,c,itype) c calculate exchange correlation potentials and energys c for density functional theory from electron density c den(n) is electron density * (4*pi*r**2) c rvxc(n) is returned as vxc * r c to the total energy c eexc is the total exchange energy (int(den*exc)) c etxc is eexc - int(den*vxc) c a(n), b(n), c(n), d(n) are work arrays c if itype=15 (gga case) need to calculate additional functions: c gd=abs(grad(density))/density c ggd=laplacian(density)/density c gggd=grad(density)*grad(abs(grad(density)))/density**2 c for r