10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-06 22:24:00 +01:00
quantum_package/src/Pseudo_integrals/pot_ao_ints_pseudo.irp.f

113 lines
3.2 KiB
Fortran
Raw Normal View History

2015-05-11 15:33:08 +02:00
BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral_pseudo, (ao_num_align,ao_num)]
implicit none
BEGIN_DOC
! Pseudo-potential
END_DOC
ao_nucl_elec_integral_pseudo = pseudo_integral_local + pseudo_integral_non_local
END_PROVIDER
BEGIN_PROVIDER [ double precision, pseudo_integral_local, (ao_num_align,ao_num)]
implicit none
BEGIN_DOC
! Local pseudo-potential
END_DOC
2015-05-02 12:39:09 +02:00
double precision :: alpha, beta, gama, delta
integer :: num_A,num_B
double precision :: A_center(3),B_center(3),C_center(3)
integer :: power_A(3),power_B(3)
integer :: i,j,k,l,n_pt_in,m
double precision :: Vloc, Vpseudo
double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0
integer :: thread_num
2015-05-11 15:33:08 +02:00
pseudo_integral_local = 0.d0
2015-05-02 12:39:09 +02:00
!! Dump array
integer, allocatable :: n_k_dump(:)
double precision, allocatable :: v_k_dump(:), dz_k_dump(:)
2015-05-11 15:06:22 +02:00
allocate(n_k_dump(1:pseudo_klocmax), v_k_dump(1:pseudo_klocmax), dz_k_dump(1:pseudo_klocmax))
2015-05-02 12:39:09 +02:00
! _
! / _. | _ |
! \_ (_| | (_ |_| |
!
2015-05-11 15:06:22 +02:00
write(output_monoints,*) 'Providing the nuclear electron pseudo integrals '
2015-05-02 12:39:09 +02:00
call wall_time(wall_1)
call cpu_time(cpu_1)
!$OMP PARALLEL &
!$OMP DEFAULT (NONE) &
!$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B, &
!$OMP num_A,num_B,Z,c,n_pt_in, &
2015-05-11 15:33:08 +02:00
!$OMP v_k_dump,n_k_dump, dz_k_dump, &
2015-05-02 12:39:09 +02:00
!$OMP wall_0,wall_2,thread_num, output_monoints) &
2015-05-04 19:05:28 +02:00
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp, &
2015-05-11 15:33:08 +02:00
!$OMP pseudo_integral_local,nucl_num,nucl_charge, &
!$OMP pseudo_klocmax,pseudo_lmax,pseudo_kmax,pseudo_v_k,pseudo_n_k, pseudo_dz_k, &
2015-05-02 12:39:09 +02:00
!$OMP wall_1)
!$OMP DO SCHEDULE (guided)
do j = 1, ao_num
num_A = ao_nucl(j)
power_A(1:3)= ao_power(j,1:3)
A_center(1:3) = nucl_coord(num_A,1:3)
do i = 1, ao_num
num_B = ao_nucl(i)
power_B(1:3)= ao_power(i,1:3)
B_center(1:3) = nucl_coord(num_B,1:3)
do l=1,ao_prim_num(j)
2015-05-04 19:05:28 +02:00
alpha = ao_expo_ordered_transp(l,j)
2015-05-02 12:39:09 +02:00
do m=1,ao_prim_num(i)
2015-05-04 19:05:28 +02:00
beta = ao_expo_ordered_transp(m,i)
2015-05-02 12:39:09 +02:00
double precision :: c
c = 0.d0
do k = 1, nucl_num
double precision :: Z
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)
2015-05-11 15:06:22 +02:00
v_k_dump = pseudo_v_k(k,1:pseudo_klocmax)
n_k_dump = pseudo_n_k(k,1:pseudo_klocmax)
dz_k_dump = pseudo_dz_k(k,1:pseudo_klocmax)
c = c + Vloc(pseudo_klocmax, v_k_dump,n_k_dump, dz_k_dump, &
A_center,power_A,alpha,B_center,power_B,beta,C_center)
2015-05-02 12:39:09 +02:00
enddo
2015-05-11 15:33:08 +02:00
pseudo_integral_local(i,j) = pseudo_integral_local(i,j) + &
2015-05-04 19:05:28 +02:00
ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i)*c
2015-05-02 12:39:09 +02:00
enddo
enddo
enddo
call wall_time(wall_2)
if (thread_num == 0) then
if (wall_2 - wall_0 > 1.d0) then
wall_0 = wall_2
write(output_monoints,*) 100.*float(j)/float(ao_num), '% in ', &
wall_2-wall_1, 's'
endif
endif
enddo
!$OMP END DO
!$OMP END PARALLEL
2015-05-11 15:06:22 +02:00
deallocate(n_k_dump,v_k_dump, dz_k_dump)
2015-05-11 15:33:08 +02:00
END_PROVIDER