@@ -48,6 +48,7 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel)
48
48
#include " cscfps.fh"
49
49
#include " sym.fh"
50
50
#include " geom.fh"
51
+ #include " util.fh"
51
52
c
52
53
c Compute the desired type of integrals (kinetic, potential, overlap)
53
54
c and ADD them into the given global array.
@@ -68,13 +69,16 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel)
68
69
c local variables
69
70
c
70
71
integer type
71
- logical dobq
72
+ integer bad_ovl,adrs,lds,i0,i1,j0,j1
73
+ logical dobq,oprint_s,oprint_check_s
72
74
character * 255 integ_type1
73
75
c
74
76
call ga_sync()
75
77
c
76
78
dobq = geom_extbq_on()
77
79
integ_type1 = integ_type
80
+ oprint_check_s = util_print(' check_s' ,print_high)
81
+ oprint_s = util_print(' ao overlap' ,print_debug)
78
82
c
79
83
if (inp_compare(.false. , integ_type1, ' potential0' )) then
80
84
integ_type1= ' potential'
@@ -157,6 +161,23 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel)
157
161
call int_1e_oldga(ibas, jbas, g, integ_type1, oskel)
158
162
end if
159
163
c
164
+ c overlap: check if offdiagonal elements are 1 -> same basis
165
+ if (type.eq. 3.and .oprint_s) call ga_print(g)
166
+ if (type.eq. 3.and .oprint_check_s) then
167
+ bad_ovl= 0
168
+ call ga_distribution(g,
169
+ . ga_nodeid(), i0, i1, j0, j1)
170
+ if (i0.gt. 0 .and. i0.le. i1) then
171
+ call ga_access(g, i0, i1, j0, j1, adrs, lds)
172
+ call int_checks(i0, i1, j0, j1,dbl_mb(adrs),
173
+ A bad_ovl)
174
+ endif
175
+ call ga_igop(2023 ,bad_ovl,1 , ' +' )
176
+ if (bad_ovl.gt. 0 ) then
177
+ call errquit(' int_1e_ga: same basis from S matrix' ,
178
+ A bad_ovl, BASIS_ERR)
179
+ endif
180
+ endif
160
181
end
161
182
c
162
183
subroutine int_1e_ooldga (ibas , jbas , g , integ_type , oskel )
@@ -715,3 +736,28 @@ subroutine int_1e_oldga0(ibas, g, type, oskel,
715
736
if (oscfps) call pstat_off(ps_int_1e)
716
737
c
717
738
end
739
+ subroutine int_checks (i0 , i1 , j0 , j1 , s , sing_vals )
740
+ implicit none
741
+ #include " stdio.fh"
742
+ integer i0, i1, j0, j1
743
+ double precision s(i0:i1,j0:j1)
744
+ integer sing_vals
745
+ c
746
+ integer i,j
747
+ double precision eps
748
+ parameter (eps= 1d-8 )
749
+ c
750
+ if (i0.lt. j0) return
751
+ do j= j0,j1
752
+ do i= i0,min (i1,j1)
753
+ if (i.gt. j) then
754
+ if (abs (s(i,j)- 1d0 ).lt. eps) then
755
+ write (luout,1 ) i,j
756
+ sing_vals= sing_vals+1
757
+ endif
758
+ endif
759
+ enddo
760
+ enddo
761
+ 1 format (' basis ' ,i5,' and ' ,i5,' are the same' )
762
+ return
763
+ end
0 commit comments