Avoid possible divisions by zero

This commit is contained in:
Anthony Scemama 2020-12-08 22:33:52 +01:00
parent b89f53f40b
commit e767d52725
3 changed files with 6 additions and 3 deletions

View File

@ -54,7 +54,7 @@ FCFLAGS : -msse4.2 -O2 -ip -ftz
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -msse4.2 -C -fpe0 -implicitnone
FCFLAGS : -msse4.2 -check all -debug all -fpe-all=0 -implicitnone
# OpenMP flags

View File

@ -22,10 +22,11 @@ subroutine write_time(iunit)
write(6,*)
call print_memory_usage()
call cpu_time(ct)
ct = ct - output_cpu_time_0
call wall_time(wt)
wt = wt - output_wall_time_0
write(6,'(A,F14.6,A,F14.6,A)') &
'.. >>>>> [ WALL TIME: ', wt-output_wall_time_0, &
' s ] [ CPU TIME: ', ct-output_cpu_time_0, ' s ] <<<<< ..'
'.. >>>>> [ WALL TIME: ', wt, ' s ] [ CPU TIME: ', ct, ' s ] <<<<< ..'
write(6,*)
end

View File

@ -14,7 +14,9 @@ subroutine huckel_guess
allocate (A(ao_num, ao_num))
A = 0.d0
do j=1,ao_num
if (ao_overlap(j,j) == 0.d0) cycle
do i=1,ao_num
if (ao_overlap(i,i) == 0.d0) cycle
A(i,j) = c * ao_overlap(i,j)/(ao_overlap(i,i)*ao_overlap(j,j)) * &
(ao_one_e_integrals_diag(i) + ao_one_e_integrals_diag(j))
enddo