diff --git a/src/geoopt_driver.f90 b/src/geoopt_driver.f90 index 35405bd17..b05bb942f 100644 --- a/src/geoopt_driver.f90 +++ b/src/geoopt_driver.f90 @@ -157,7 +157,7 @@ subroutine geometry_optimization & ! get number of unique species; used in precond_lindh !call get_identity(mol%nid, mol%id, mol%at) ! create new anc filter - optcell = mol%npbc > 0 ! optimize cell parameters if present + optcell = mol%npbc > 0 .and. set%optcell call new_cartesian_filter(filter, mol, optcell) ! create new Limited-memory BFGS optimizer call new_lbfgs_optimizer(lbfgs_opt, env, opt_input, filter) diff --git a/src/prog/main.F90 b/src/prog/main.F90 index 4e5821882..4ccd2f22d 100644 --- a/src/prog/main.F90 +++ b/src/prog/main.F90 @@ -1909,6 +1909,10 @@ subroutine parseArguments(env, args, inputFile, paramFile, lgrad, & else call env%error("The wrtopo keyword is missing an argument.", source) end if + + case ('--nocellopt') + set%optcell = .false. + end select call args%nextFlag(flag) end do diff --git a/src/setparam.f90 b/src/setparam.f90 index 06d33fb1c..14640876a 100644 --- a/src/setparam.f90 +++ b/src/setparam.f90 @@ -216,6 +216,7 @@ module xtb_setparam logical :: newdisp = .true. logical :: solve_scc = .true. logical :: periodic = .false. + logical :: optcell = .true. ! Geometry input type integer :: geometry_inputfile = p_geo_coord