Skip to content

Commit 821d7fb

Browse files
Igor S. Gerasimovfoxtran
authored andcommitted
Allow n3 zero freqs (for frozen atoms)
Signed-off-by: Igor S. Gerasimov <i.s.ger@ya.ru>
1 parent 7168387 commit 821d7fb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/hessian.F90

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ subroutine numhess( &
8686
real(wp) :: sum1,sum2,trdip(3),dipole(3)
8787
real(wp) :: trpol(3),sl(3,3)
8888
integer :: n3,i,j,k,ic,jc,ia,ja,ii,jj,info,lwork,a,b,ri,rj
89-
integer :: nread,lowmode
89+
integer :: nread,lowmode,nskip
9090
integer :: nonfrozh
9191
integer :: fixmode
92-
integer :: skiplist(6), nskip
92+
integer, allocatable :: skiplist(:)
9393
integer, allocatable :: nb(:,:)
9494
integer, allocatable :: indx(:),molvec(:),izero(:)
9595
real(wp),allocatable :: bond(:,:)
@@ -445,17 +445,14 @@ subroutine numhess( &
445445
isqm = 0.0_wp
446446
j = 0
447447
nskip = 0
448+
allocate(skiplist(n3), source = 0)
448449
do k=1, n3
449450
if (abs(res%freq(k)) > 0.05_wp) then
450451
j = j + 1
451452
h(1:n3,j) = res%hess(1:n3,k)
452453
isqm( j) = res%freq( k)
453454
else
454455
nskip = nskip + 1
455-
if(nskip > 6) then
456-
call env%error('internal error while sorting hessian', source)
457-
return
458-
end if
459456
skiplist(nskip) = k
460457
endif
461458
enddo
@@ -465,6 +462,7 @@ subroutine numhess( &
465462
isqm( j) = 0.0_wp
466463
nskip = nskip - 1
467464
end do
465+
deallocate(skiplist)
468466
end if
469467
res%hess = h
470468
res%freq = isqm

0 commit comments

Comments
 (0)