9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-06 21:43:39 +01:00
qp2/src/dft_utils_func/utils.irp.f

31 lines
1.6 KiB
Fortran
Raw Normal View History

2019-01-25 11:39:31 +01:00
2020-03-30 17:40:24 +02:00
subroutine GGA_sr_type_functionals(mu,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, &
2019-01-25 11:39:31 +01:00
ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, &
ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b )
implicit none
BEGIN_DOC
! routine that helps in building the x/c potentials on the AO basis for a GGA functional with a short-range interaction
END_DOC
2020-03-30 17:40:24 +02:00
double precision, intent(in) :: mu,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b
double precision, intent(out) :: ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b
double precision, intent(out) :: ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b
2020-03-30 19:30:29 +02:00
double precision :: rhoc,rhoo,sigmacc,sigmaco,sigmaoo,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo
2019-01-25 11:39:31 +01:00
2020-03-30 17:40:24 +02:00
! exhange energy and potentials
call ex_pbe_sr(mu,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b,ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b)
2019-01-25 11:39:31 +01:00
2020-03-30 17:40:24 +02:00
! convertion from (alpha,beta) formalism to (closed, open) formalism
call rho_ab_to_rho_oc(rho_a,rho_b,rhoo,rhoc)
call grad_rho_ab_to_grad_rho_oc(grad_rho_a_2,grad_rho_b_2,grad_rho_a_b,sigmaoo,sigmacc,sigmaco)
2019-01-25 11:39:31 +01:00
2020-03-30 17:40:24 +02:00
! correlation energy and potentials
call ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo)
2019-01-25 11:39:31 +01:00
2020-03-30 17:40:24 +02:00
! convertion from (closed, open) formalism to (alpha,beta) formalism
call v_rho_oc_to_v_rho_ab(vrhoo,vrhoc,vc_rho_a,vc_rho_b)
call v_grad_rho_oc_to_v_grad_rho_ab(vsigmaoo,vsigmacc,vsigmaco,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b)
2019-01-25 11:39:31 +01:00
end
2020-03-30 17:40:24 +02:00