Skip to content

Commit

Permalink
Fix bug which unconditionally enables damping (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk authored Feb 24, 2021
1 parent 97e8a4e commit 4be7d5a
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Install meson
run: pip3 install meson ninja
run: pip3 install meson==0.56.2 ninja

- name: Configure build
run: meson setup _build
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
project(
'mctc-gcp',
'fortran',
version: '2.1.2',
version: '2.3.0',
license: 'GPL-3.0-or-later',
meson_version: '>=0.53',
default_options: [
Expand Down Expand Up @@ -56,6 +56,7 @@ gcp_dep = declare_dependency(

# Add applications
subdir('app')
subdir('old')

# Package the license files
gcp_lic = files(
Expand Down
2 changes: 1 addition & 1 deletion old/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ program gcp_main
write(*,*)'| ** g C P ** |'
write(*,*)'| a geometrical counterpoise correction |'
write(*,*)'| H.Kruse J.G.Brandenburg S.Grimme |'
write(*,*)'| Version 2.02 Nov 2016 |'
write(*,*)'| Version 2.3.0 Feb 2021 |'
write(*,*)'| |'
write(*,*)' ___________________________________________ '
write(*,*)
Expand Down
22 changes: 22 additions & 0 deletions old/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is part of mctc-gcp.
# SPDX-Identifier: GPL-3.0-or-later
#
# mctc-gcp is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# mctc-gcp is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mctc-gcp. If not, see <https://www.gnu.org/licenses/>.

gcp_exe = executable(
'gcp',
sources: files('main.f90'),
dependencies: gcp_dep,
install: false,
)
4 changes: 3 additions & 1 deletion src/gcp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ subroutine gcp_call(n,xyz,lat,iz,gcp_e,gcp_g,gcp_glat,dograd,dohess,pbc,method,e
dmp_exp=6.0d0 ! 6
!default
base=.false.
damp=.true.
damp=.false.

!************************
!* modify input string *
Expand Down Expand Up @@ -109,6 +109,8 @@ subroutine gcp_call(n,xyz,lat,iz,gcp_e,gcp_g,gcp_glat,dograd,dohess,pbc,method,e
srb=.true.
rscal=10.00d0
qscal=0.08d0
case('r2scan3c','def2mtzvpp','mtzvpp')
damp=.true.
case default
end select

Expand Down
4 changes: 2 additions & 2 deletions src/gcp_version.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module gcp_version


!> String representation of the mctc-gcp version
character(len=*), parameter :: gcp_version_string = "2.1.2"
character(len=*), parameter :: gcp_version_string = "2.3.0"

!> Numeric representation of the mctc-gcp version
integer, parameter :: gcp_version_compact(3) = [2, 1, 2]
integer, parameter :: gcp_version_compact(3) = [2, 3, 0]


contains
Expand Down
4 changes: 2 additions & 2 deletions test/test_gcp_3c_methods.f90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine test_hf3c(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "01")
call test_generic(error, mol, "hf3c", -0.10185940933506053_wp)
call test_generic(error, mol, "hf3c", -3.0475695153528881E-2_wp)

end subroutine test_hf3c

Expand Down Expand Up @@ -166,7 +166,7 @@ subroutine test_hf3c_pbc(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "acetic")
call test_generic(error, mol, "hf3c", -0.39914501373759642_wp)
call test_generic(error, mol, "hf3c", -0.21073394289693193_wp)

end subroutine test_hf3c_pbc

Expand Down
20 changes: 10 additions & 10 deletions test/test_gcp_dft_methods.f90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine test_dft_minis(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "13")
call test_generic(error, mol, "dft/minis", 2.8831779044393737E-2_wp)
call test_generic(error, mol, "dft/minis", 1.5921613343027519E-1_wp)

end subroutine test_dft_minis

Expand All @@ -114,7 +114,7 @@ subroutine test_dft_minix(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "14")
call test_generic(error, mol, "dft/minix", 1.8191237759356119E-2_wp)
call test_generic(error, mol, "dft/minix", 1.0873902337093687E-1_wp)

end subroutine test_dft_minix

Expand All @@ -127,7 +127,7 @@ subroutine test_dft_sv(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "15")
call test_generic(error, mol, "dft/sv", 8.9178105933847233E-3_wp)
call test_generic(error, mol, "dft/sv", 4.2061458290263622E-002_wp)

end subroutine test_dft_sv

Expand All @@ -140,7 +140,7 @@ subroutine test_dft_def2sv_p(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "16")
call test_generic(error, mol, "dft/def2-sv(p)", 9.0695660381885229E-3_wp)
call test_generic(error, mol, "dft/def2-sv(p)", 3.6732928803962006E-2_wp)

end subroutine test_dft_def2sv_p

Expand All @@ -153,7 +153,7 @@ subroutine test_dft_def2svp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "17")
call test_generic(error, mol, "dft/def2-svp", 2.4834643199826180E-2_wp)
call test_generic(error, mol, "dft/def2-svp", 6.8082018400795294E-2_wp)

end subroutine test_dft_def2svp

Expand All @@ -166,7 +166,7 @@ subroutine test_dft_dzp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "18")
call test_generic(error, mol, "dft/dzp", 2.2195075119243783E-2_wp)
call test_generic(error, mol, "dft/dzp", 6.0859678618522664E-2_wp)

end subroutine test_dft_dzp

Expand All @@ -179,7 +179,7 @@ subroutine test_dft_deftzvp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "19")
call test_generic(error, mol, "dft/def-tzvp", 3.6258064909241677E-3_wp)
call test_generic(error, mol, "dft/def-tzvp", 1.0946847699932089E-2_wp)

end subroutine test_dft_deftzvp

Expand All @@ -192,7 +192,7 @@ subroutine test_dft_def2tzvp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "20")
call test_generic(error, mol, "dft/def2-tzvp", 3.9044561047188592E-3_wp)
call test_generic(error, mol, "dft/def2-tzvp", 9.8496583133859551E-3_wp)

end subroutine test_dft_def2tzvp

Expand All @@ -205,7 +205,7 @@ subroutine test_dft_ccpvdz(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "21")
call test_generic(error, mol, "dft/cc-pvdz", 9.9649294926933245E-3_wp)
call test_generic(error, mol, "dft/cc-pvdz", 3.3952526484868496E-2_wp)

end subroutine test_dft_ccpvdz

Expand All @@ -218,7 +218,7 @@ subroutine test_dft_augccpvdz(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "22")
call test_generic(error, mol, "dft/aug-cc-pvdz", 2.9849348931724447E-3_wp)
call test_generic(error, mol, "dft/aug-cc-pvdz", 5.9838861620780713E-3_wp)

end subroutine test_dft_augccpvdz

Expand Down
20 changes: 10 additions & 10 deletions test/test_gcp_hf_methods.f90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine test_hf_minis(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "04")
call test_generic(error, mol, "hf/minis", 1.5336656998809515E-2_wp)
call test_generic(error, mol, "hf/minis", 7.6480869740597812E-2_wp)

end subroutine test_hf_minis

Expand All @@ -114,7 +114,7 @@ subroutine test_hf_minix(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "05")
call test_generic(error, mol, "hf/minix", 1.8559832674618637E-2_wp)
call test_generic(error, mol, "hf/minix", 1.0104364899718374E-1_wp)

end subroutine test_hf_minix

Expand All @@ -127,7 +127,7 @@ subroutine test_hf_sv(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "06")
call test_generic(error, mol, "hf/sv", 6.4701104644333107E-3_wp)
call test_generic(error, mol, "hf/sv", 2.6617114832609839E-2_wp)

end subroutine test_hf_sv

Expand All @@ -140,7 +140,7 @@ subroutine test_hf_def2sv_p(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "07")
call test_generic(error, mol, "hf/def2-sv(p)", 1.5009548340274959E-2_wp)
call test_generic(error, mol, "hf/def2-sv(p)", 3.8517711151713638E-2_wp)

end subroutine test_hf_def2sv_p

Expand All @@ -153,7 +153,7 @@ subroutine test_hf_def2svp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "08")
call test_generic(error, mol, "hf/def2-svp", 1.8249078757662872E-2_wp)
call test_generic(error, mol, "hf/def2-svp", 3.7848835788317346E-2_wp)

end subroutine test_hf_def2svp

Expand All @@ -166,7 +166,7 @@ subroutine test_hf_dzp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "08")
call test_generic(error, mol, "hf/dzp", 2.4002048454141937E-2_wp)
call test_generic(error, mol, "hf/dzp", 4.3822089521084677E-2_wp)

end subroutine test_hf_dzp

Expand All @@ -179,7 +179,7 @@ subroutine test_hf_deftzvp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "09")
call test_generic(error, mol, "hf/def-tzvp", 4.9799363418100567E-3_wp)
call test_generic(error, mol, "hf/def-tzvp", 1.4409205281517200E-2_wp)

end subroutine test_hf_deftzvp

Expand All @@ -192,7 +192,7 @@ subroutine test_hf_def2tzvp(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "10")
call test_generic(error, mol, "hf/def2-tzvp", 2.1614549442281130E-3_wp)
call test_generic(error, mol, "hf/def2-tzvp", 5.7102357181177616E-3_wp)

end subroutine test_hf_def2tzvp

Expand All @@ -205,7 +205,7 @@ subroutine test_hf_ccpvdz(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "11")
call test_generic(error, mol, "hf/cc-pvdz", 9.5654476866715681E-3_wp)
call test_generic(error, mol, "hf/cc-pvdz", 2.8850619018747792E-2_wp)

end subroutine test_hf_ccpvdz

Expand All @@ -218,7 +218,7 @@ subroutine test_hf_augccpvdz(error)
type(structure_type) :: mol

call get_structure(mol, "MB16-43", "12")
call test_generic(error, mol, "hf/aug-cc-pvdz", 2.6289439007561133E-3_wp)
call test_generic(error, mol, "hf/aug-cc-pvdz", 4.8150616062504351E-3_wp)

end subroutine test_hf_augccpvdz

Expand Down
12 changes: 6 additions & 6 deletions test/test_gcp_pbc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ subroutine test_anthracene(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "anthracene")
call test_generic(error, mol, "hf3c", -0.92569438699860529_wp)
call test_generic(error, mol, "hf3c", -0.59161990455181912_wp)

end subroutine test_anthracene

Expand All @@ -111,7 +111,7 @@ subroutine test_ethcar(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "ethcar")
call test_generic(error, mol, "hf3c", -0.26393725722798922_wp)
call test_generic(error, mol, "hf3c", -0.11814220512782711_wp)

end subroutine test_ethcar

Expand All @@ -124,7 +124,7 @@ subroutine test_formamide(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "formamide")
call test_generic(error, mol, "hf3c", -0.29006658275561281_wp)
call test_generic(error, mol, "hf3c", -0.15500632261441180_wp)

end subroutine test_formamide

Expand All @@ -137,7 +137,7 @@ subroutine test_hexdio(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "hexdio")
call test_generic(error, mol, "hf3c", -0.18028851452622813_wp)
call test_generic(error, mol, "hf3c", -4.4642369521389225E-002_wp)

end subroutine test_hexdio

Expand All @@ -150,7 +150,7 @@ subroutine test_naph(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "naph")
call test_generic(error, mol, "hf3c", -1.3397571928969214_wp)
call test_generic(error, mol, "hf3c", -1.0399600000679481_wp)

end subroutine test_naph

Expand All @@ -163,7 +163,7 @@ subroutine test_oxacb(error)
type(structure_type) :: mol

call get_structure(mol, "X23", "oxacb")
call test_generic(error, mol, "hf3c", -0.27269534244235344_wp)
call test_generic(error, mol, "hf3c", -0.15716399742412498_wp)

end subroutine test_oxacb

Expand Down

0 comments on commit 4be7d5a

Please sign in to comment.