Skip to content

Commit

Permalink
Maintenance of submodules (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht authored Aug 6, 2024
2 parents 7112c04 + ba04cbc commit e998537
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 429 deletions.
16 changes: 8 additions & 8 deletions src/calculator/tblite_api.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module tblite_api
use tblite_param, only : param_record
use tblite_results,only:tblite_resultstype => results_type
use tblite_wavefunction_mulliken,only:get_molecular_dipole_moment
use tblite_ceh_singlepoint,only:ceh_guess
use tblite_ceh_singlepoint,only:ceh_singlepoint
use tblite_ceh_ceh,only:new_ceh_calculator
#endif
use wiberg_mayer
Expand Down Expand Up @@ -137,19 +137,19 @@ subroutine tblite_setup(mol,chrg,uhf,lvl,etemp,tblite)
select case (tblite%lvl)
case (xtblvl%gfn1)
if (pr) call tblite%ctx%message("tblite> setting up GFN1-xTB calculation")
call new_gfn1_calculator(tblite%calc,mctcmol)
call new_gfn1_calculator(tblite%calc,mctcmol,error)
case (xtblvl%gfn2)
if (pr) call tblite%ctx%message("tblite> setting up GFN2-xTB calculation")
call new_gfn2_calculator(tblite%calc,mctcmol)
call new_gfn2_calculator(tblite%calc,mctcmol,error)
case (xtblvl%ipea1)
if (pr) call tblite%ctx%message("tblite> setting up IPEA1-xTB calculation")
call new_ipea1_calculator(tblite%calc,mctcmol)
call new_ipea1_calculator(tblite%calc,mctcmol,error)
case (xtblvl%ceh)
if (pr) call tblite%ctx%message("tblite> setting up CEH calculation")
call new_ceh_calculator(tblite%calc,mctcmol)
call new_ceh_calculator(tblite%calc,mctcmol,error)
case (xtblvl%eeq)
if (pr) call tblite%ctx%message("tblite> setting up D4 EEQ charges calculation")
call new_ceh_calculator(tblite%calc,mctcmol) !> doesn't matter but needs initialization
call new_ceh_calculator(tblite%calc,mctcmol,error) !> doesn't matter but needs initialization
case (xtblvl%param)
if (pr) call tblite%ctx%message("tblite> setting up xtb calculator from parameter file")
if(allocated(tblite%paramfile))then
Expand All @@ -161,7 +161,7 @@ subroutine tblite_setup(mol,chrg,uhf,lvl,etemp,tblite)
endif
else
if (pr) call tblite%ctx%message("tblite> parameter file does not exist, defaulting to GFN2-xTB")
call new_gfn2_calculator(tblite%calc,mctcmol)
call new_gfn2_calculator(tblite%calc,mctcmol,error)
endif
case default
call tblite%ctx%message("Error: Unknown method in tblite!")
Expand Down Expand Up @@ -318,7 +318,7 @@ subroutine tblite_singlepoint(mol,chrg,uhf,tblite,energy,gradient,iostatus)
& energy,gradient, &
& sigma,verbosity,results=tblite%res)
case (xtblvl%ceh)
call ceh_guess(tblite%ctx,tblite%calc,mctcmol,error,tblite%wfn, &
call ceh_singlepoint(tblite%ctx,tblite%calc,mctcmol,tblite%wfn, &
& tblite%accuracy,verbosity)
case(xtblvl%eeq)
call eeq_guess(mctcmol, tblite%calc, tblite%wfn)
Expand Down
28 changes: 28 additions & 0 deletions src/cleanup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,34 @@ end subroutine rmrfw
!CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
!C Specific cleanup routines for different parts of the CREST code
!CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

subroutine custom_cleanup(env)
use crest_data
use iomod
implicit none
type(systemdata) :: env
integer :: i
if(.not.env%keepModef)then
call rmrfw('METADYN')
call rmrfw('NORMMD')
call rmrf('MRMSD')
call rmrf('TRIALMD')
call rmrf('TRIALOPT')
call rmrf('MDFILES')
call rmrf('OPTIM')
call rmrf('PROP')
call rmrfw('.cre_')
call rmrf('cregen_*.tmp')
call rmrf('MDFILES')
if(.not.any(env%calc%calcs(:)%pr))then
call rmrfw('calculation.level.')
endif
endif
call rmrf('.CHRG .UHF')
call rmrf('.history.xyz')
end subroutine custom_cleanup


!-------------------------------------------------------------------------
! General cleanup function. Wipes most files that may be written by crest
!-------------------------------------------------------------------------
Expand Down
15 changes: 7 additions & 8 deletions src/confparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -250,20 +250,19 @@ subroutine parseflags(env,arg,nra)
inquire (file='.CHRG',exist=ex)
if (any(index(arg,'-chrg') .ne. 0)) ex = .false.
if (ex) then
call rdshort('.CHRG',env%chrg)
if (env%chrg .ne. 0) then
write (*,'(2x,a,i0)') 'molecular charge read from .CHRG: ',env%chrg
end if
write(stdout,*) '**ERROR** CREST will not read .CHRG files following version 3.0.2'
write(stdout,*) 'Please use --chrg or the input file specifications.'
error stop
end if
inquire (file='.UHF',exist=ex)
if (any(index(arg,'-uhf') .ne. 0)) ex = .false.
if (ex) then
call rdshort('.UHF',env%uhf)
if (env%uhf .ne. 0) then
write (*,'(2x,a,i0)') 'nα-nβ electrons read from .UHF: ',env%uhf
end if
write(stdout,*) '**ERROR** CREST will not read .UHF files following version 3.0.2'
write(stdout,*) 'Please use --uhf or the input file specifications.'
error stop
end if


!>--- options for constrained conformer sampling
env%fixfile = 'none selected'

Expand Down
Loading

0 comments on commit e998537

Please sign in to comment.