From 9a76e94d6c7059e4720738aebe505c629b9c935a Mon Sep 17 00:00:00 2001 From: albert <92109627+Albkat@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:15:21 +0100 Subject: [PATCH] resolve debug mode errors (#907) Signed-off-by: albert <92109627+Albkat@users.noreply.github.com> --- src/disp/dftd4.F90 | 2 +- src/oniom.f90 | 27 ++++++++++----------------- src/type/molecule.f90 | 7 +++---- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/disp/dftd4.F90 b/src/disp/dftd4.F90 index c819e4a20..546229f1a 100644 --- a/src/disp/dftd4.F90 +++ b/src/disp/dftd4.F90 @@ -788,7 +788,7 @@ subroutine disppot(dispm,nat,ndim,at,itbl,q,g_a,g_c,wdispmat,gw,hdisp) !$acc loop gang private(k, ati) #else !$omp parallel do reduction(+:hdisp) shared(itbl, at, dumvec, zerovec) & - !$omp private(ati, ii) + !$omp private(ati, ii, k) #endif do iat = 1, nat k = itbl(iat) diff --git a/src/oniom.f90 b/src/oniom.f90 index 90d91a014..29b09ecf4 100644 --- a/src/oniom.f90 +++ b/src/oniom.f90 @@ -673,31 +673,24 @@ subroutine cutbond(self, env, mol, chk, topo, inner_mol, jacobian, idx2) ! divide initial mol into inner and outer regions ! do i = 1, mol%n - if (i==self%idx(in_itr)) then - - if (in_itr > in) then - call env%error("The internal error, inconsistent molecular dimensionality", source=source) - return + if (in_itr <= size(self%idx)) then + if (i==self%idx(in_itr)) then + at(in_itr) = mol%at(i) + xyz(:, in_itr) = mol%xyz(:, i) + in_itr = in_itr + 1 + else + at_out(out_itr) = mol%at(i) + xyz_out(:, out_itr) = mol%xyz(:, i) + out_itr = out_itr + 1 endif - - at(in_itr) = mol%at(i) - xyz(:, in_itr) = mol%xyz(:, i) - in_itr = in_itr + 1 - else - - if (out_itr > out) then - call env%error("The internal error, inconsistent molecular dimensionality", source=source) - return - endif - at_out(out_itr) = mol%at(i) xyz_out(:, out_itr) = mol%xyz(:, i) out_itr = out_itr + 1 - endif enddo + ! initialiaze jacobian as identity ! call create_jacobian(jacobian,at) diff --git a/src/type/molecule.f90 b/src/type/molecule.f90 index 5244f37d1..56abddd3d 100644 --- a/src/type/molecule.f90 +++ b/src/type/molecule.f90 @@ -218,11 +218,10 @@ subroutine initMolecule & nAt = min(size(at, dim=1), size(xyz, dim=2), size(sym, dim=1)) call mol%allocate(nAt) - + + mol%lattice = 0.0_wp if (present(lattice)) then - mol%lattice = lattice - else - mol%lattice = 0.0_wp + if (size(lattice).ne.0) mol%lattice = lattice end if if (present(pbc)) then