Added check to prevent obscure errors if initial path has zero length

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13458 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2017-04-07 15:07:34 +00:00
parent f3e568446d
commit dbfb6b6979
1 changed files with 6 additions and 1 deletions

View File

@ -280,7 +280,7 @@ MODULE path_base
!
REAL(DP) :: s
INTEGER :: i, j
!
LOGICAL :: tooclose
REAL(DP), ALLOCATABLE :: pos_n(:,:), dr(:,:), image_spacing(:)
!
!
@ -290,11 +290,13 @@ MODULE path_base
ALLOCATE( dr( dim1, input_images - 1 ) )
ALLOCATE( image_spacing( input_images - 1 ) )
!
tooclose = .false.
DO i = 1, input_images - 1
!
dr(:,i) = ( pos(:,i+1) - pos(:,i) )
!
image_spacing(i) = norm( dr(:,i) )
tooclose = tooclose .OR. ( image_spacing(i) < 0.01 )
!
END DO
!
@ -354,6 +356,9 @@ MODULE path_base
!
END IF
!
CALL mp_bcast( tooclose, meta_ionode_id, world_comm )
IF ( tooclose) CALL errore ('initial_guess', &
' something wrong: images are too close',1)
CALL mp_bcast( pos, meta_ionode_id, world_comm )
CALL mp_bcast( path_length, meta_ionode_id, world_comm )
!