From bb8e07a70c51f9ab91b82a5d8e5b1c39d5267ae6 Mon Sep 17 00:00:00 2001 From: Philipp Pracht Date: Sat, 25 Jan 2025 13:43:32 +0100 Subject: [PATCH] Correctly avoid stopping the program when Z-mat crossing has not enough structures --- src/algos/crossing.f90 | 3 ++- src/algos/search_conformers.f90 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/algos/crossing.f90 b/src/algos/crossing.f90 index 1f642093..17fd150d 100644 --- a/src/algos/crossing.f90 +++ b/src/algos/crossing.f90 @@ -33,7 +33,7 @@ subroutine crest_crossing(env,maxgen,fname,maxpairs) implicit none !> INPUT type(systemdata),intent(inout) :: env - integer,intent(in) :: maxgen + integer,intent(inout) :: maxgen character(len=*),intent(in),optional :: fname real(wp),intent(in),optional :: maxpairs !> LOCAL @@ -69,6 +69,7 @@ subroutine crest_crossing(env,maxgen,fname,maxpairs) call rdensemble(ensnam,nat,nall,at,xyz,eread) if (nall .lt. 2) then write (stdout,*) 'Not enough structures to perform GC!' + maxgen=0 return end if diff --git a/src/algos/search_conformers.f90 b/src/algos/search_conformers.f90 index a3c32ba2..abf606d5 100644 --- a/src/algos/search_conformers.f90 +++ b/src/algos/search_conformers.f90 @@ -615,6 +615,7 @@ subroutine crest_newcross3(env) call touch(trim(tmppath)) call crest_crossing(env,imax,trim(refnam),env%gcmaxparent) if (imax .lt. 1) then + call remove(trim(tmppath)) return exit end if