Skip to content

Commit f85443a

Browse files
Copilotscemama
andcommitted
Improve code quality in .irp.f files: fix spacing, remove trailing whitespace, add documentation
Co-authored-by: scemama <5970658+scemama@users.noreply.github.com>
1 parent 7fa5e9e commit f85443a

474 files changed

Lines changed: 7910 additions & 6695 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugins/local/ao_many_one_e_ints/ao_erf_gauss.irp.f

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ subroutine NAI_pol_x_mult_erf_ao_v(i_ao, j_ao, mu_in, C_center, LD_C, ints, LD_i
401401
coef = ao_coef_normalized_ordered_transp(j,j_ao) * ao_coef_normalized_ordered_transp(i,i_ao)
402402

403403
! First term = (x-Ax)**(ax+1)
404-
call NAI_pol_mult_erf_v( A_center, B_center, power_xA, power_B, alpha, beta &
404+
call NAI_pol_mult_erf_v( A_center, B_center, power_xA, power_B, alpha, beta &
405405
, C_center(1:LD_C,1:3,m), LD_C, n_pt_in, mu_in, integral(1:LD_integral), LD_integral, n_points_m)
406406
do ipoint = 1, n_points_m
407407
ints(ipoint,m) += integral(ipoint) * coef
@@ -434,7 +434,7 @@ double precision function NAI_pol_x_mult_erf_ao_x(i_ao, j_ao, mu_in, C_center)
434434
!
435435
END_DOC
436436

437-
include 'utils/constants.include.F'
437+
include 'utils/constants.include.F'
438438

439439
implicit none
440440

@@ -493,7 +493,7 @@ double precision function NAI_pol_x_mult_erf_ao_y(i_ao, j_ao, mu_in, C_center)
493493
!
494494
END_DOC
495495

496-
include 'utils/constants.include.F'
496+
include 'utils/constants.include.F'
497497

498498
implicit none
499499

@@ -552,7 +552,7 @@ double precision function NAI_pol_x_mult_erf_ao_z(i_ao, j_ao, mu_in, C_center)
552552
!
553553
END_DOC
554554

555-
include 'utils/constants.include.F'
555+
include 'utils/constants.include.F'
556556

557557
implicit none
558558

@@ -611,7 +611,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_x(i_ao, j_ao, beta, B_cen
611611
!
612612
END_DOC
613613

614-
include 'utils/constants.include.F'
614+
include 'utils/constants.include.F'
615615

616616
implicit none
617617

@@ -652,7 +652,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_x(i_ao, j_ao, beta, B_cen
652652

653653
do j = 1, ao_prim_num(j_ao)
654654
alphaj = ao_expo_ordered_transp (j,j_ao)
655-
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
655+
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
656656

657657
! First term = (x-Ax)**(ax+1)
658658
integral = NAI_pol_mult_erf_with1s( Ai_center, Aj_center, power_xA, power_Aj, alphai, alphaj &
@@ -681,7 +681,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_y(i_ao, j_ao, beta, B_cen
681681
!
682682
END_DOC
683683

684-
include 'utils/constants.include.F'
684+
include 'utils/constants.include.F'
685685

686686
implicit none
687687

@@ -722,7 +722,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_y(i_ao, j_ao, beta, B_cen
722722

723723
do j = 1, ao_prim_num(j_ao)
724724
alphaj = ao_expo_ordered_transp (j,j_ao)
725-
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
725+
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
726726

727727
! First term = (x-Ax)**(ax+1)
728728
integral = NAI_pol_mult_erf_with1s( Ai_center, Aj_center, power_xA, power_Aj, alphai, alphaj &
@@ -751,7 +751,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_z(i_ao, j_ao, beta, B_cen
751751
!
752752
END_DOC
753753

754-
include 'utils/constants.include.F'
754+
include 'utils/constants.include.F'
755755

756756
implicit none
757757

@@ -792,7 +792,7 @@ double precision function NAI_pol_x_mult_erf_ao_with1s_z(i_ao, j_ao, beta, B_cen
792792

793793
do j = 1, ao_prim_num(j_ao)
794794
alphaj = ao_expo_ordered_transp (j,j_ao)
795-
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
795+
coef = coefi * ao_coef_normalized_ordered_transp(j,j_ao)
796796

797797
! First term = (x-Ax)**(ax+1)
798798
integral = NAI_pol_mult_erf_with1s( Ai_center, Aj_center, power_xA, power_Aj, alphai, alphaj &
@@ -1399,3 +1399,4 @@ subroutine NAI_pol_012_mult_erf_ao(i_ao, j_ao, mu_in, C_center, ints)
13991399

14001400
! ---
14011401

1402+

plugins/local/ao_many_one_e_ints/ao_erf_gauss_grad.irp.f

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ subroutine phi_j_erf_mu_r_dxyz_phi(i,j,mu_in, C_center, dxyz_ints)
1616
endif
1717

1818
n_pt_in = n_pt_max_integrals
19-
! j
19+
! j
2020
num_A = ao_nucl(j)
2121
power_A(1:3)= ao_power(j,1:3)
2222
A_center(1:3) = nucl_coord(num_A,1:3)
23-
! i
23+
! i
2424
num_B = ao_nucl(i)
2525
power_B(1:3)= ao_power(i,1:3)
2626
B_center(1:3) = nucl_coord(num_B,1:3)
@@ -29,24 +29,24 @@ subroutine phi_j_erf_mu_r_dxyz_phi(i,j,mu_in, C_center, dxyz_ints)
2929
alpha = ao_expo_ordered_transp(l,j)
3030
do m=1,ao_prim_num(i)
3131
beta = ao_expo_ordered_transp(m,i)
32-
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_normalized_ordered_transp(m,i)
32+
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_normalized_ordered_transp(m,i)
3333
if(dabs(coef).lt.thr)cycle
3434
do mm = 1, 3
35-
! (d/dx phi_i ) * phi_j
35+
! (d/dx phi_i ) * phi_j
3636
! d/dx * (x - B_x)^b_x exp(-beta * (x -B_x)^2)= [b_x * (x - B_x)^(b_x - 1) - 2 beta * (x - B_x)^(b_x + 1)] exp(-beta * (x -B_x)^2)
3737
!
3838
! first contribution :: b_x (x - B_x)^(b_x-1) :: integral with b_x=>b_x-1 multiplied by b_x
3939
power_B_tmp = power_B
4040
power_B_tmp(mm) += -1
41-
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
42-
dxyz_ints(mm) += contrib * dble(power_B(mm)) * coef
43-
41+
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
42+
dxyz_ints(mm) += contrib * dble(power_B(mm)) * coef
43+
4444
! second contribution :: - 2 beta * (x - B_x)^(b_x + 1) :: integral with b_x=> b_x+1 multiplied by -2 * beta
4545
power_B_tmp = power_B
4646
power_B_tmp(mm) += 1
47-
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
48-
dxyz_ints(mm) += contrib * (-2.d0 * beta ) * coef
49-
47+
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
48+
dxyz_ints(mm) += contrib * (-2.d0 * beta ) * coef
49+
5050
enddo
5151
enddo
5252
enddo
@@ -74,7 +74,7 @@ subroutine phi_j_erf_mu_r_dxyz_phi_bis(i,j,mu_in, C_center, dxyz_ints)
7474
endif
7575

7676
n_pt_in = n_pt_max_integrals
77-
! j == A
77+
! j == A
7878
num_A = ao_nucl(j)
7979
power_A(1:3)= ao_power(j,1:3)
8080
A_center(1:3) = nucl_coord(num_A,1:3)
@@ -92,10 +92,10 @@ subroutine phi_j_erf_mu_r_dxyz_phi_bis(i,j,mu_in, C_center, dxyz_ints)
9292
do mm = 1, 3
9393
power_B_tmp = power_B
9494
power_B_tmp(mm) = power_ord_grad_transp(kk,mm,i)
95-
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_ord_grad_transp(kk,mm,m,i)
95+
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_ord_grad_transp(kk,mm,m,i)
9696
if(dabs(coef).lt.thr)cycle
97-
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
98-
dxyz_ints(mm) += contrib * coef
97+
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
98+
dxyz_ints(mm) += contrib * coef
9999
enddo
100100
enddo
101101
enddo
@@ -121,7 +121,7 @@ subroutine phi_j_erf_mu_r_xyz_dxyz_phi(i,j,mu_in, C_center, dxyz_ints)
121121
endif
122122

123123
n_pt_in = n_pt_max_integrals
124-
! j == A
124+
! j == A
125125
num_A = ao_nucl(j)
126126
power_A(1:3)= ao_power(j,1:3)
127127
A_center(1:3) = nucl_coord(num_A,1:3)
@@ -139,12 +139,13 @@ subroutine phi_j_erf_mu_r_xyz_dxyz_phi(i,j,mu_in, C_center, dxyz_ints)
139139
do mm = 1, 3
140140
power_B_tmp = power_B
141141
power_B_tmp(mm) = power_ord_xyz_grad_transp(kk,mm,i)
142-
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_ord_xyz_grad_transp(kk,mm,m,i)
142+
coef = ao_coef_normalized_ordered_transp(l,j) * ao_coef_ord_xyz_grad_transp(kk,mm,m,i)
143143
if(dabs(coef).lt.thr)cycle
144-
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
145-
dxyz_ints(mm) += contrib * coef
144+
contrib = NAI_pol_mult_erf(A_center,B_center,power_A,power_B_tmp,alpha,beta,C_center,n_pt_in,mu_in)
145+
dxyz_ints(mm) += contrib * coef
146146
enddo
147147
enddo
148148
enddo
149149
enddo
150150
end
151+

plugins/local/ao_many_one_e_ints/ao_gaus_gauss.irp.f

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ subroutine overlap_gauss_r12_ao_v(D_center, LD_D, delta, i, j, resv, LD_resv, n_
220220

221221
integer :: ipoint
222222
integer :: power_A(3), power_B(3), l, k
223-
double precision :: A_center(3), B_center(3), alpha, beta, coef, coef1
223+
double precision :: A_center(3), B_center(3), alpha, beta, coef, coef1
224224
double precision, allocatable :: analytical_j(:)
225225

226226
resv(:) = 0.d0
@@ -381,7 +381,7 @@ subroutine overlap_gauss_r12_ao_with1s_v(B_center, beta, D_center, LD_D, delta,
381381

382382
bg = beta * gama_inv
383383
dg = delta * gama_inv
384-
bdg = bg * delta
384+
bdg = bg * delta
385385

386386
do ipoint = 1, n_points
387387

@@ -503,3 +503,4 @@ subroutine overlap_gauss_r12_ao_012(D_center, delta, i, j, ints)
503503

504504
! ---
505505

506+

plugins/local/ao_many_one_e_ints/grad2_jmu_manu.irp.f

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
double precision :: tmp
1717
double precision :: wall0, wall1
1818
double precision :: int_gauss, dsqpi_3_2, int_env
19-
double precision :: factor_ij_1s, beta_ij, center_ij_1s(3), sq_pi_3_2
19+
double precision :: factor_ij_1s, beta_ij, center_ij_1s(3), sq_pi_3_2
2020
double precision, allocatable :: int_fit_v(:)
2121
double precision, external :: overlap_gauss_r12_ao
2222
double precision, external :: overlap_gauss_r12_ao_with1s
@@ -60,13 +60,13 @@
6060
coef_fit = -0.25d0 * coef_gauss_1_erf_x_2(i_fit)
6161
! if(dabs(coef_fit*int_env*sq_pi_3_2*(expo_fit)**(-1.5d0)).lt.thrsh_cycle_tc)cycle
6262
int_gauss = overlap_gauss_r12_ao(r, expo_fit, i, j)
63-
int2_grad1u2_grad2u2_env2_test(j,i,ipoint) += coef_fit * int_gauss
63+
int2_grad1u2_grad2u2_env2_test(j,i,ipoint) += coef_fit * int_gauss
6464
enddo
6565

6666
! --- --- ---
6767
! i_1s > 1
6868
! --- --- ---
69-
69+
7070
do i_1s = 2, List_comb_thr_b3_size(j,i)
7171

7272
coef = List_comb_thr_b3_coef (i_1s,j,i)
@@ -75,7 +75,7 @@
7575
B_center(1) = List_comb_thr_b3_cent(1,i_1s,j,i)
7676
B_center(2) = List_comb_thr_b3_cent(2,i_1s,j,i)
7777
B_center(3) = List_comb_thr_b3_cent(3,i_1s,j,i)
78-
78+
7979
do i_fit = 1, ng_fit_jast
8080
expo_fit = expo_gauss_1_erf_x_2(i_fit)
8181
!DIR$ FORCEINLINE
@@ -85,7 +85,7 @@
8585
! call overlap_gauss_r12_ao_with1s_v(B_center, beta, final_grid_points_transp, &
8686
! expo_fit, i, j, int_fit_v, n_points_final_grid)
8787
int_gauss = overlap_gauss_r12_ao_with1s(B_center, beta, r, expo_fit, i, j)
88-
int2_grad1u2_grad2u2_env2_test(j,i,ipoint) += coef_fit * int_gauss
88+
int2_grad1u2_grad2u2_env2_test(j,i,ipoint) += coef_fit * int_gauss
8989
enddo
9090
enddo
9191

@@ -236,11 +236,11 @@
236236

237237
!$OMP PARALLEL DEFAULT (NONE) &
238238
!$OMP PRIVATE (ipoint, i, j, i_1s, i_fit, r, coef, beta, B_center, &
239-
!$OMP coef_fit, expo_fit, int_fit, tmp, int_env,factor_ij_1s,beta_ij,center_ij_1s) &
240-
!$OMP SHARED (n_points_final_grid, ao_num, List_comb_thr_b3_size, &
239+
!$OMP coef_fit, expo_fit, int_fit, tmp, int_env,factor_ij_1s,beta_ij,center_ij_1s) &
240+
!$OMP SHARED (n_points_final_grid, ao_num, List_comb_thr_b3_size, &
241241
!$OMP final_grid_points, ng_fit_jast, &
242242
!$OMP expo_gauss_j_mu_x_2, coef_gauss_j_mu_x_2, &
243-
!$OMP List_comb_thr_b3_coef, List_comb_thr_b3_expo,sq_pi_3_2, &
243+
!$OMP List_comb_thr_b3_coef, List_comb_thr_b3_expo,sq_pi_3_2, &
244244
!$OMP List_comb_thr_b3_cent, int2_u2_env2_test,ao_abs_comb_b3_env,thrsh_cycle_tc)
245245
!$OMP DO
246246
do ipoint = 1, n_points_final_grid
@@ -310,11 +310,11 @@
310310
call wall_time(wall1)
311311
print*, ' wall time for int2_u2_env2_test (min) = ', (wall1 - wall0) / 60.d0
312312

313-
END_PROVIDER
313+
END_PROVIDER
314314

315315
! ---
316316

317-
BEGIN_PROVIDER [double precision, int2_u_grad1u_x_env2_test, (ao_num,ao_num,n_points_final_grid,3)]
317+
BEGIN_PROVIDER [double precision, int2_u_grad1u_x_env2_test, (ao_num, ao_num, n_points_final_grid, 3)]
318318

319319
BEGIN_DOC
320320
!
@@ -341,12 +341,12 @@
341341
!$OMP PARALLEL DEFAULT (NONE) &
342342
!$OMP PRIVATE (ipoint, i, j, i_1s, i_fit, r, coef, beta, B_center, &
343343
!$OMP coef_fit, expo_fit, int_fit, alpha_1s, dist, &
344-
!$OMP alpha_1s_inv, centr_1s, expo_coef_1s, coef_tmp, &
345-
!$OMP tmp_x, tmp_y, tmp_z,int_env,sq_alpha) &
346-
!$OMP SHARED (n_points_final_grid, ao_num, List_comb_thr_b3_size, &
344+
!$OMP alpha_1s_inv, centr_1s, expo_coef_1s, coef_tmp, &
345+
!$OMP tmp_x, tmp_y, tmp_z,int_env,sq_alpha) &
346+
!$OMP SHARED (n_points_final_grid, ao_num, List_comb_thr_b3_size, &
347347
!$OMP final_grid_points, ng_fit_jast, &
348348
!$OMP expo_gauss_j_mu_1_erf, coef_gauss_j_mu_1_erf, &
349-
!$OMP List_comb_thr_b3_coef, List_comb_thr_b3_expo, &
349+
!$OMP List_comb_thr_b3_coef, List_comb_thr_b3_expo, &
350350
!$OMP List_comb_thr_b3_cent, int2_u_grad1u_x_env2_test,ao_abs_comb_b3_env,sq_pi_3_2,thrsh_cycle_tc)
351351
!$OMP DO
352352

@@ -371,26 +371,26 @@
371371
B_center(2) = List_comb_thr_b3_cent(2,i_1s,j,i)
372372
B_center(3) = List_comb_thr_b3_cent(3,i_1s,j,i)
373373
do i_fit = 1, ng_fit_jast
374-
374+
375375
expo_fit = expo_gauss_j_mu_1_erf(i_fit)
376376
coef_fit = coef_gauss_j_mu_1_erf(i_fit)
377-
377+
378378
dist = (B_center(1) - r(1)) * (B_center(1) - r(1)) &
379379
+ (B_center(2) - r(2)) * (B_center(2) - r(2)) &
380-
+ (B_center(3) - r(3)) * (B_center(3) - r(3))
380+
+ (B_center(3) - r(3)) * (B_center(3) - r(3))
381381

382382
alpha_1s = beta + expo_fit
383-
alpha_1s_inv = 1.d0 / alpha_1s
383+
alpha_1s_inv = 1.d0 / alpha_1s
384384

385385
centr_1s(1) = alpha_1s_inv * (beta * B_center(1) + expo_fit * r(1))
386386
centr_1s(2) = alpha_1s_inv * (beta * B_center(2) + expo_fit * r(2))
387387
centr_1s(3) = alpha_1s_inv * (beta * B_center(3) + expo_fit * r(3))
388388

389-
expo_coef_1s = beta * expo_fit * alpha_1s_inv * dist
389+
expo_coef_1s = beta * expo_fit * alpha_1s_inv * dist
390390
coef_tmp = coef * coef_fit * dexp(-expo_coef_1s)
391391
sq_alpha = alpha_1s_inv * dsqrt(alpha_1s_inv)
392392
! if(dabs(coef_tmp*int_env*sq_pi_3_2*sq_alpha) .lt. thrsh_cycle_tc) cycle
393-
393+
394394
call NAI_pol_x_mult_erf_ao_with1s(i, j, alpha_1s, centr_1s, 1.d+9, r, int_fit)
395395

396396
tmp_x += coef_tmp * int_fit(1)
@@ -424,7 +424,7 @@
424424
call wall_time(wall1)
425425
print*, ' wall time for int2_u_grad1u_x_env2_test (min) = ', (wall1 - wall0) / 60.d0
426426

427-
END_PROVIDER
427+
END_PROVIDER
428428

429429
! ---
430430

@@ -552,3 +552,4 @@
552552

553553
! ---
554554

555+

0 commit comments

Comments
 (0)