diff --git a/CMakeLists.txt b/CMakeLists.txt index 7501a568..69a7bb21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ endif() project( crest LANGUAGES "C" "Fortran" - VERSION 3.0.1 + VERSION 3.0.2 DESCRIPTION "A tool for the exploration of low-energy chemical space" ) diff --git a/meson.build b/meson.build index 23e12d59..22a016de 100644 --- a/meson.build +++ b/meson.build @@ -17,7 +17,7 @@ project( 'crest', 'fortran', 'c', - version: '3.0.1', + version: '3.0.2', license: 'LGPL-3.0-or-later', meson_version: '>=0.63', default_options: [ diff --git a/src/calculator/api_helpers.F90 b/src/calculator/api_helpers.F90 index 7da3ec76..deaba73e 100644 --- a/src/calculator/api_helpers.F90 +++ b/src/calculator/api_helpers.F90 @@ -325,6 +325,9 @@ subroutine gfnff_init(calc,loadnew) if (allocated(calc%parametrisation)) then calc%ff_dat%refgeo = calc%parametrisation end if + if (allocated(calc%refcharges)) then + calc%ff_dat%refcharges = calc%refcharges + end if end if if (allocated(calc%solvent)) then diff --git a/src/calculator/calc_type.f90 b/src/calculator/calc_type.f90 index 9f6789f1..86866716 100644 --- a/src/calculator/calc_type.f90 +++ b/src/calculator/calc_type.f90 @@ -112,6 +112,7 @@ module calc_type !> atomic charges logical :: rdqat = .false. + logical :: dumpq = .false. real(wp),allocatable :: qat(:) !> dipole and dipole gradient @@ -137,6 +138,7 @@ module calc_type logical :: restart = .false. !> restart option (some potentials can do this) character(len=:),allocatable :: restartfile character(len=:),allocatable :: refgeo + character(len=:),allocatable :: refcharges !>--- tblite data type(tblite_data),allocatable :: tblite diff --git a/src/calculator/printouts.F90 b/src/calculator/printouts.F90 index 74c692bd..9ab2d110 100644 --- a/src/calculator/printouts.F90 +++ b/src/calculator/printouts.F90 @@ -106,6 +106,9 @@ subroutine calculation_summary(calc,mol,energy,grad,molnew,iounit,print) & calc%calcs(k)%qat(j), cn(j) enddo write (iunit,*) + if(calc%calcs(k)%dumpq)then + call dumpq(k,mol%nat,calc%calcs(k)%qat) + endif end if end do write (iunit,'(a)') repeat('-',80) @@ -214,6 +217,26 @@ subroutine calculation_summary(calc,mol,energy,grad,molnew,iounit,print) end subroutine calculation_summary +!========================================================================================! + + subroutine dumpq(id,nat,q) +!******************************** +!* write atomic charges to file +!******************************** + implicit none + integer,intent(in) :: id,nat + real(wp),intent(in) :: q(nat) + integer :: i,ich + character(len=50) :: atmp + + write(atmp,'("charges.",i0)') id + open(newunit=ich,file=trim(atmp)) + do i=1,nat + write(ich,'(F20.10)') q(i) + enddo + close(ich) + end subroutine dumpq + !========================================================================================! !========================================================================================! end module crest_calculator_printout diff --git a/src/parsing/parse_calcdata.f90 b/src/parsing/parse_calcdata.f90 index 6a0bbe76..7a57172b 100644 --- a/src/parsing/parse_calcdata.f90 +++ b/src/parsing/parse_calcdata.f90 @@ -273,6 +273,8 @@ subroutine parse_setting_c(env,job,key,val) job%id = jobtype%tblite job%tblitelvl = xtblvl%ceh job%rdgrad = .false. + job%rdqat = .true. + job%rddip = .true. case ('gfn0','gfn0-xtb') job%id = jobtype%gfn0 case ('gfn0*','gfn0*-xtb') @@ -396,6 +398,15 @@ subroutine parse_setting_c(env,job,key,val) write(stderr,'(a,a,a)') 'specified parametrisation file ',val,' does not exist' error stop endif + case('refchrg','refcharges') + inquire(file=val,exist=ex) + if(ex)then + job%refcharges = val + else + write(stderr,'(a,a,a)') 'specified reference charge file ',val,' does not exist' + error stop + endif + case ('print') select case (val) @@ -427,6 +438,9 @@ subroutine parse_setting_bool(job,key,val) job%rddip = val case ('rdqat','rdchrg') job%rdqat = val + case ('dumpq','dumpchrg') + job%rdqat = val + job%dumpq = val case ('dipgrad') job%rddipgrad = val case ('rdgrad') diff --git a/src/parsing/parse_xtbinput.f90 b/src/parsing/parse_xtbinput.f90 index 7879b687..ea32797c 100644 --- a/src/parsing/parse_xtbinput.f90 +++ b/src/parsing/parse_xtbinput.f90 @@ -719,6 +719,7 @@ subroutine get_xtb_keyvalue(kv,str,io) character(len=*) :: str integer,intent(out) :: io character(len=:),allocatable :: tmpstr + character(len=:),allocatable :: tmpstr_rc character(len=:),allocatable :: ktmp character(len=:),allocatable :: vtmp integer :: i,j,k,na,plast @@ -726,6 +727,7 @@ subroutine get_xtb_keyvalue(kv,str,io) call kv%deallocate() io = 0 tmpstr = adjustl(lowercase(str)) + tmpstr_rc=adjustl(trim(str)) !> key-value conditions l(1) = index(tmpstr,'=') @@ -747,7 +749,7 @@ subroutine get_xtb_keyvalue(kv,str,io) end if ktmp = trim(adjustl(tmpstr(:k-1))) - vtmp = trim(adjustl(tmpstr(k+1:))) + vtmp = trim(adjustl(tmpstr_rc(k+1:))) kv%key = ktmp !> the key as string kv%rawvalue = vtmp !> value as unformatted string diff --git a/subprojects/gfnff b/subprojects/gfnff index 41512519..a49f529d 160000 --- a/subprojects/gfnff +++ b/subprojects/gfnff @@ -1 +1 @@ -Subproject commit 41512519ca1a802f8529e2a424d9ea153648871f +Subproject commit a49f529d3b915350e36ae7743e761b6ac48b817a