Skip to content

Commit

Permalink
Restore multilevel turn-off function (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht authored Mar 13, 2024
2 parents 5cd626f + c7af2b5 commit 598bb74
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 5 deletions.
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,61 @@ target_include_directories(
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
)


###############################################################################
########################### Install Instructions ##############################
###############################################################################

# Build output artifacts
if (WITH_OBJECT)
install(
TARGETS
"lib-${PROJECT_NAME}-static"
"lib-${PROJECT_NAME}-shared"
"${PROJECT_NAME}-exe"
EXPORT "${PROJECT_NAME}-targets"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
else()
install(
TARGETS
"lib-${PROJECT_NAME}-static"
"${PROJECT_NAME}-exe"
EXPORT "${PROJECT_NAME}-targets"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
endif()
install(
EXPORT
"${PROJECT_NAME}-targets"
NAMESPACE
"${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(
DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(
DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${module-dir}"
)
# Package license files
install(
FILES
"COPYING"
"COPYING.LESSER"
DESTINATION "${CMAKE_INSTALL_DATADIR}/licenses/${PROJECT_NAME}"
)

##############################################################################
################################ Testing #####################################
##############################################################################

16 changes: 13 additions & 3 deletions src/algos/search_conformers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ subroutine crest_multilevel_wrap(env,ensnam,level)
end subroutine crest_multilevel_wrap

!========================================================================================!
subroutine crest_multilevel_oloop(env,ensnam,multilevel)
subroutine crest_multilevel_oloop(env,ensnam,multilevel_in)
!*******************************************************
!* multilevel optimization loop.
!* construct consecutive optimizations starting with
Expand All @@ -297,18 +297,19 @@ subroutine crest_multilevel_oloop(env,ensnam,multilevel)
implicit none
type(systemdata) :: env
character(len=*),intent(in) :: ensnam
logical,intent(in) :: multilevel(6)
logical,intent(in) :: multilevel_in(6)
integer :: nat,nall
real(wp),allocatable :: eread(:)
real(wp),allocatable :: xyz(:,:,:)
integer,allocatable :: at(:)
logical :: dump,pr
character(len=128) :: inpnam,outnam
integer :: i,l
integer :: i,l,k
real(wp) :: ewinbackup,rthrbackup
real(wp) :: hlowbackup
integer :: microbackup
integer :: optlevelbackup
logical :: multilevel(6)

interface
subroutine crest_refine(env,input,output)
Expand All @@ -327,6 +328,15 @@ end subroutine crest_refine
hlowbackup = env%calc%hlow_opt
microbackup = env%calc%micro_opt

!>--- set multilevels, or enforce just one
multilevel(:) = .false.
if(env%multilevelopt)then
multilevel(:) = multilevel_in(:)
else
k = optlevmap_alt(env%optlev)
multilevel(k) = .true.
endif

pr = .false.
l = count(multilevel)
if( l > 1 )then
Expand Down
2 changes: 1 addition & 1 deletion src/classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ module crest_data
logical :: legacy = .false. !> switch between the original system call routines of crest and newer, e.g. tblite implementations
logical :: metadynset !> is the number of MTDs already set (V2) ?
logical :: methautocorr !> try to automatically include Methyl equivalencies in CREGEN ?
logical :: multilevelopt !> perform the multileveloptimization
logical :: multilevelopt =.true. !> perform the multileveloptimization
logical :: newcregen = .false. !> use the CREGEN rewrite
logical :: NCI !> NCI special usage
logical :: niceprint !> make a nice progress-bar printout
Expand Down
2 changes: 1 addition & 1 deletion src/confparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ subroutine parseflags(env,arg,nra)
env%forceconst = xx(1)
end if
write (*,'(2x,a,f6.4,a)') '-fc ',env%forceconst,': selected force constant in Eh'
case ('-nomlo') !> turn off multilevel optimization
case ('-nomlo','-no-multilevel') !> turn off multilevel optimization
env%multilevelopt = .false.
case ('-normmd') !> set number of normMDs
env%rotamermds = .true.
Expand Down
2 changes: 2 additions & 0 deletions src/parsing/parse_maindata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ subroutine parse_main_bool(env,key,val)
if (val) then
call read_restart(env)
end if
case ('multilevelopt')
env%multilevelopt = val
end select
return
end subroutine parse_main_bool
Expand Down
1 change: 1 addition & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ s-dftd3.wrap
test-drive.wrap
mctc-lib.wrap
xhcff
lammps*

!lwoniom
!gfn0
Expand Down

0 comments on commit 598bb74

Please sign in to comment.