Skip to content

Commit

Permalink
Add validation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk committed Nov 30, 2024
1 parent 7b71de5 commit 60b421d
Show file tree
Hide file tree
Showing 21 changed files with 386 additions and 27 deletions.
13 changes: 9 additions & 4 deletions app/cli.f90
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,16 @@ subroutine get_run_arguments(config, list, start, error)
if (allocated(error)) exit
config%atm = .true.
case("--gcp")
config%gcp = .true.
iarg = iarg + 1

Check warning on line 299 in app/cli.f90

View check run for this annotation

Codecov / codecov/patch

app/cli.f90#L298-L299

Added lines #L298 - L299 were not covered by tests
call list%get(iarg, arg)
call move_alloc(arg, config%basis)
if (allocated(error)) exit
config%gcp = .true.
if (allocated(arg)) then
if (arg(1:1) == "-") then
iarg = iarg - 1
cycle

Check warning on line 304 in app/cli.f90

View check run for this annotation

Codecov / codecov/patch

app/cli.f90#L303-L304

Added lines #L303 - L304 were not covered by tests
end if
call move_alloc(arg, config%basis)
end if
case("--zero")
config%zero = .true.
iarg = iarg + 1
Expand Down Expand Up @@ -584,7 +589,7 @@ subroutine get_gcp_arguments(config, list, start, error)
end if
if (index(arg, "/") > 0) then
config%method = arg(1:index(arg, "/")-1)
config%method = arg(index(arg, "/")+1:)
config%basis = arg(index(arg, "/")+1:)
else
call move_alloc(arg, config%method)
end if
Expand Down
1 change: 0 additions & 1 deletion src/dftd3/gcp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ set(dir "${CMAKE_CURRENT_SOURCE_DIR}")

list(
APPEND srcs
"${dir}/data.f90"
"${dir}/param.f90"
)

Expand Down
20 changes: 0 additions & 20 deletions src/dftd3/gcp/data.f90

This file was deleted.

1 change: 0 additions & 1 deletion src/dftd3/gcp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# along with s-dftd3. If not, see <https://www.gnu.org/licenses/>.

srcs += files(
'data.f90',
'param.f90',
)
24 changes: 24 additions & 0 deletions test/validation/21-ad3.coord
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$coord
0.79457714965951 3.55602905386715 0.00000000000000 c
-0.79457714965951 3.77432460885587 2.39660993619036 c
-0.79457714965951 3.77432460885587 -2.39660993619036 c
2.25063800006750 5.02905587026014 0.00000000000000 h
1.79951300232100 1.74494525518548 0.00000000000000 h
0.37035808014807 3.61430066526315 4.09670630847074 h
-2.22853764673775 2.28531070488959 2.46581361633477 h
-1.77392043411708 5.59484192304179 2.46581361633477 h
0.37035808014807 3.61430066526315 -4.09670630847074 h
-2.22853764673775 2.28531070488959 -2.46581361633477 h
-1.77392043411708 5.59484192304179 -2.46581361633477 h
-0.79457714965951 -3.55602905386715 0.00000000000000 c
0.79457714965951 -3.77432460885587 -2.39660993619036 c
0.79457714965951 -3.77432460885587 2.39660993619036 c
-1.79951300232100 -1.74494525518548 0.00000000000000 h
-2.25063800006750 -5.02905587026014 0.00000000000000 h
-0.37035808014807 -3.61430066526315 -4.09670630847074 h
1.77392043411708 -5.59484192304179 -2.46581361633477 h
2.22853764673775 -2.28531070488959 -2.46581361633477 h
-0.37035808014807 -3.61430066526315 4.09670630847074 h
1.77392043411708 -5.59484192304179 2.46581361633477 h
2.22853764673775 -2.28531070488959 2.46581361633477 h
$end
83 changes: 83 additions & 0 deletions test/validation/21-gcp-pbeh3c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"version": "1.2.1",
"energy": 2.4408581444610614E-02,
"virial": [
-1.6574359800216241E-02,
2.0119627561238601E-03,
1.6534083130403943E-18,
2.0119627561238618E-03,
-2.2463098851840998E-03,
-1.6940658945086007E-19,
1.1113072267976420E-18,
-4.4045713257223618E-19,
-3.7753665063192894E-02
],
"gradient": [
-2.8026033066000148E-03,
2.4390779524848948E-04,
-1.0842021724855044E-19,
1.1950451267053234E-03,
-2.3762562720102155E-04,
-2.0663035801345331E-03,
1.1950451267053234E-03,
-2.3762562720102155E-04,
2.0663035801345335E-03,
-6.8360546166405974E-04,
1.0124060154628643E-06,
0.0000000000000000E+00,
-7.2054440646042786E-04,
-1.4820156713158696E-05,
0.0000000000000000E+00,
4.5251185867576900E-04,
-6.3822465818580702E-05,
-2.4669490466976086E-04,
1.9648267644481823E-04,
-1.9837755776525693E-04,
-7.0986894457992632E-04,
2.2138861006725468E-04,
1.0653376468129232E-04,
-6.9966824801623285E-04,
4.5251185867576895E-04,
-6.3822465818580702E-05,
2.4669490466976092E-04,
1.9648267644481828E-04,
-1.9837755776525693E-04,
7.0986894457992643E-04,
2.2138861006725473E-04,
1.0653376468129233E-04,
6.9966824801623285E-04,
2.8026033066000143E-03,
-2.4390779524848953E-04,
1.0842021724855044E-19,
-1.1950451267053236E-03,
2.3762562720102152E-04,
2.0663035801345331E-03,
-1.1950451267053236E-03,
2.3762562720102163E-04,
-2.0663035801345331E-03,
7.2054440646042786E-04,
1.4820156713158750E-05,
0.0000000000000000E+00,
6.8360546166405984E-04,
-1.0124060154628376E-06,
0.0000000000000000E+00,
-4.5251185867576900E-04,
6.3822465818580702E-05,
2.4669490466976081E-04,
-2.2138861006725468E-04,
-1.0653376468129230E-04,
6.9966824801623274E-04,
-1.9648267644481828E-04,
1.9837755776525696E-04,
7.0986894457992643E-04,
-4.5251185867576900E-04,
6.3822465818580702E-05,
-2.4669490466976086E-04,
-2.2138861006725468E-04,
-1.0653376468129232E-04,
-6.9966824801623263E-04,
-1.9648267644481834E-04,
1.9837755776525696E-04,
-7.0986894457992632E-04
]
}
6 changes: 6 additions & 0 deletions test/validation/21-gcp-pbeh3c.resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gcp
$ORIGIN/21-ad3.coord
--level
pbeh3c
--grad
--nocpc
24 changes: 24 additions & 0 deletions test/validation/22-benI-acetone.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
22

C -0.43601987190704 -0.00000150300001 1.03540729252862
C 0.58976220857948 -0.00001321400006 1.97850007065348
C 1.92224732040744 -0.00000620100003 1.57169559487422
C 2.22826604374589 -0.00002197200010 0.21256912192973
C 1.21108714329700 -0.00000640500003 -0.74015358323725
H -1.46924203642611 -0.00000195000001 1.35222461891430
H 0.34310109250064 -0.00000842500004 3.03162969825961
H 2.71469423987341 0.00001150200005 2.30703292809040
H 3.26026141025959 -0.00002655400011 -0.11155152048790
H 1.45070781434504 -0.00001010800004 -1.79398552984646
C -0.12040282452661 0.00002212200010 -0.32357594141524
I -1.65822411125267 0.00022120300097 -1.73801997760168
O -3.94993994027608 -0.00014345000063 -3.81589692468980
C -3.80061832262298 0.00377150001650 -5.02581161398168
C -2.41374687855714 0.01392866206092 -5.62884087361918
C -5.00409199488668 -0.00151565300663 -5.94221514498980
H -1.88103810222720 0.89133045189846 -5.26547224702990
H -1.87007825717927 -0.85848332775480 -5.26971232504844
H -2.42067773158745 0.01652053407226 -6.71412316936594
H -5.61626987956420 0.87012827680573 -5.71741149300657
H -5.60537142251653 -0.88176795885664 -5.72158319002481
H -4.74004724773182 0.00263918901154 -6.99488255559392
13 changes: 13 additions & 0 deletions test/validation/22-gcp-b973c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "1.2.1",
"energy": -1.1487620744730206E-01,
"damping parameters": {
"damping": "rational",
"s6": 1.0000000000000000E+00,
"s8": 1.5000000000000000E+00,
"s9": 0.0000000000000000E+00,
"a1": 3.7000000000000000E-01,
"a2": 4.0999999999999996E+00,
"alp": 1.4000000000000000E+01
}
}
6 changes: 6 additions & 0 deletions test/validation/22-gcp-b973c.resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
run
--bj
b973c
--gcp
--noedisp
$ORIGIN/22-benI-acetone.xyz
43 changes: 43 additions & 0 deletions test/validation/23-444.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

11302419103D

37 0 0 0 0 999 V2000
2.5903 -2.7264 1.1396 O 0 0 0 0 0 0 0 0 0 0 0 0
2.9003 -1.7974 0.4296 C 0 0 0 0 0 0 0 0 0 0 0 0
2.8263 -1.8644 -0.9034 O 0 0 0 0 0 0 0 0 0 0 0 0
3.1053 -0.9954 -1.2824 H 0 0 0 0 0 0 0 0 0 0 0 0
3.4013 -0.4684 0.9836 C 0 0 0 0 0 0 0 0 0 0 0 0
4.4123 -0.2904 0.6116 H 0 0 0 0 0 0 0 0 0 0 0 0
3.4233 -0.5444 2.0656 H 0 0 0 0 0 0 0 0 0 0 0 0
2.5623 0.6566 0.6136 N 0 0 0 0 0 0 0 0 0 0 0 0
1.8913 1.0566 1.2686 H 0 0 0 0 0 0 0 0 0 0 0 0
2.5763 1.1686 -0.6264 C 0 0 0 0 0 0 0 0 0 0 0 0
3.2463 0.6926 -1.5524 O 0 0 0 0 0 0 0 0 0 0 0 0
1.7003 2.3976 -0.8174 C 0 0 0 0 0 0 0 0 0 0 0 0
1.9023 2.7876 -1.8094 H 0 0 0 0 0 0 0 0 0 0 0 0
1.9593 3.1466 -0.0674 H 0 0 0 0 0 0 0 0 0 0 0 0
0.2873 2.0946 -0.7124 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.3337 2.1456 -1.5084 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.3257 1.9366 0.4716 C 0 0 0 0 0 0 0 0 0 0 0 0
0.2703 1.9106 1.5546 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.8457 1.8206 0.3966 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.2987 1.8046 -0.9934 N 0 0 0 0 0 0 0 0 0 0 0 0
-3.2037 2.2476 -1.0744 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.4147 0.8416 -1.2984 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.2107 2.7366 0.8656 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.3197 0.6246 1.2456 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8237 0.6816 2.2136 H 0 0 0 0 0 0 0 0 0 0 0 0
-3.3947 0.7276 1.4056 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.0327 -0.6824 0.5636 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.0087 -1.2834 -0.2404 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.9927 -0.8344 -0.3024 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.7397 -2.4624 -0.9334 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.5087 -2.9154 -1.5444 H 0 0 0 0 0 0 0 0 0 0 0 0
-1.4857 -3.0574 -0.8284 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.2737 -3.9754 -1.3594 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.5057 -2.4784 -0.0224 C 0 0 0 0 0 0 0 0 0 0 0 0
0.4623 -2.9484 0.0826 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.7787 -1.2964 0.6626 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0207 -0.8594 1.3016 H 0 0 0 0 0 0 0 0 0 0 0 0
M END
$$$$
4 changes: 4 additions & 0 deletions test/validation/23-gcp-hf3c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "1.2.1",
"energy": -2.0199949882394205E-01
}
4 changes: 4 additions & 0 deletions test/validation/23-gcp-hf3c.resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gcp
--level
hf3c
$ORIGIN/23-444.sdf
13 changes: 13 additions & 0 deletions test/validation/24-gcp-hf-deftzvp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "1.2.1",
"energy": 7.1769896849684205E-03,
"damping parameters": {
"damping": "zero",
"s6": 1.0000000000000000E+00,
"s8": 1.7460000000000000E+00,
"s9": 1.0000000000000000E+00,
"rs6": 1.1579999999999999E+00,
"rs8": 1.0000000000000000E+00,
"alp": 1.4000000000000000E+01
}
}
7 changes: 7 additions & 0 deletions test/validation/24-gcp-hf-deftzvp.resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
run
--zero
hf
--gcp
deftzvp
--atm
$ORIGIN/24-h2o_6.qchem
21 changes: 21 additions & 0 deletions test/validation/24-h2o_6.qchem
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$molecule
0 1
o 0.11448392281773 1.51123327008092 0.84351297623233
h 0.95880573623723 1.47155799179987 0.32950022850208
h 0.26129103645727 2.12410912352789 1.56850115482200
o -0.02817040100173 -1.43708228218242 0.98511825009724
h -0.03831273056231 -0.48623197337830 1.17189380200513
h -0.86424990477834 -1.59839377519356 0.50558843087301
o -2.35379807024322 1.32801810801878 -0.46182075721370
h -1.48714230779134 1.50194038048355 -0.04531091525911
h -2.34725343052677 1.79416500782283 -1.30125669084489
o -2.46767106530964 -1.45760274129337 -0.41854609908859
h -2.53975419218662 -0.48503716343007 -0.49641687571481
h -3.26029002096919 -1.74564200881398 0.04080615100984
o 2.42644955265113 1.14816004581118 -0.49586368573878
h 2.48383495016489 0.16184556854355 -0.50914940516318
h 2.52619219832975 1.43384884343363 -1.40718630625545
o 2.27629136915678 -1.54900494733334 -0.42626722875407
h 1.42256374614478 -1.63495392360958 0.06497690996263
h 2.91672961140960 -2.08092952428755 0.05192006052832
$end
26 changes: 26 additions & 0 deletions test/validation/25-g3.gen
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
24 C
C O H
1 1 -1.12885064915344E-01 -1.41863844617349E+00 -7.80362498298278E-01
2 2 4.09592407421189E-01 -2.36548698407175E-01 -1.36364838541136E+00
3 1 6.19799977621229E-01 8.89905751402348E-01 -5.02538213519736E-01
4 1 -6.10116041805569E-01 1.20757778290933E+00 3.67780827198579E-01
5 1 -1.43900587170863E+00 -1.16243455996366E+00 -4.62672873964163E-02
6 1 -1.24760318997206E+00 -5.08890838053665E-02 1.00951572052529E+00
7 2 -4.86797482060935E-01 -4.99194756761102E-01 2.12454981438015E+00
8 2 -1.66043778109922E+00 1.79383387185583E+00 -4.22680367436187E-01
9 1 1.93115068908887E+00 7.74794098890431E-01 3.28828322366809E-01
10 2 2.88225415460348E+00 -1.16345429245288E-01 -2.56160344296218E-01
11 3 1.29113665504839E-01 -1.18582686926397E+00 1.80296413321587E+00
12 3 -1.33590286621933E+00 2.59430229650854E+00 -8.64241078868696E-01
13 3 2.97633759330056E+00 8.92087438907900E-02 -1.20071451738229E+00
14 2 7.93330183785820E-01 -1.98847595858884E+00 1.60863527434552E-01
15 2 -2.47074754876863E+00 -8.63512585694265E-01 -9.70219081919390E-01
16 3 -2.23180271908296E+00 2.45770664766718E-01 1.38586283862572E+00
17 3 -3.18410548179756E-01 1.89503777569582E+00 1.17421385796704E+00
18 3 7.51511780065613E-01 1.71194211464097E+00 -1.21902350171035E+00
19 3 2.36346506806486E+00 1.78005871805928E+00 4.37353614115734E-01
20 3 1.70348772650670E+00 -1.75009521752220E+00 -1.11972385813754E-01
21 3 -2.39388948446623E+00 7.67028777273814E-02 -1.21635880287680E+00
22 3 -2.65720769643726E-01 -2.08828234086970E+00 -1.63230513539516E+00
23 3 -1.73289577975631E+00 -2.08526093479100E+00 4.64247803351864E-01
24 3 1.74617190171553E+00 3.86370184738622E-01 1.33031114114306E+00
Loading

0 comments on commit 60b421d

Please sign in to comment.