~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to tests/cisd-opt-numer/cisd-opt-numer.test.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl  
2
 
 
3
 
while ($ARGV = shift) {
4
 
  if   ("$ARGV" eq "-q") { $QUIET = 1; }
5
 
  elsif("$ARGV" eq "-i") { $SRC_PATH = shift; }
6
 
  elsif("$ARGV" eq "-x") { $EXEC_PATH = shift; }
7
 
}
8
 
 
9
 
if($SRC_PATH ne "") {
10
 
  require($SRC_PATH . "/../psitest.pl");
11
 
}
12
 
else {
13
 
  require("../psitest.pl");
14
 
}
15
 
 
16
 
# build the command for the psi3 driver
17
 
$PSICMD = build_psi_cmd($QUIET, $SRC_PATH, $EXEC_PATH);
18
 
 
19
 
$TOL = 10**-8;
20
 
$GTOL = 10**-8;
21
 
if($SRC_PATH ne "") {
22
 
  $REF_FILE = "$SRC_PATH/file11.ref";
23
 
}
24
 
else {
25
 
  $REF_FILE = "file11.ref";
26
 
}
27
 
$TEST_FILE = "psi.file11.dat";
28
 
$RESULT = "cisd-opt-numer.test";
29
 
 
30
 
system ($PSICMD);
31
 
 
32
 
$FAIL = 0;
33
 
 
34
 
$natom = seek_natom_file11($REF_FILE,"iteration");
35
 
 
36
 
open(RE, ">$RESULT") || die "cannot open $RESULT $!"; 
37
 
select (RE);
38
 
printf "CISD-OPT-NUMER:\n";
39
 
 
40
 
if(abs(seek_energy_file11($REF_FILE,"interation") - seek_energy_file11($TEST_FILE,"iteration")) > $TOL) {
41
 
  fail_test("CISD energy");  $FAIL = 1;
42
 
}
43
 
else {
44
 
  pass_test("CISD energy");
45
 
}
46
 
 
47
 
@geom_ref = seek_geom_file11($REF_FILE, "iteration");
48
 
@geom_test = seek_geom_file11($TEST_FILE, "iteration");
49
 
if(!compare_arrays(\@geom_ref, \@geom_test, $natom, 3, $GTOL)) {
50
 
  fail_test("CISD Geometry");  $FAIL = 1;
51
 
}
52
 
else {
53
 
  pass_test("CISD Geometry");
54
 
}
55
 
 
56
 
@grad_ref = seek_grad_file11($REF_FILE, "iteration");
57
 
@grad_test = seek_grad_file11($TEST_FILE, "iteration");
58
 
 
59
 
if(!compare_arrays(\@grad_ref, \@grad_test, $natom, 3, $GTOL)) {
60
 
  fail_test("CISD Gradient");  $FAIL = 1;
61
 
}
62
 
else {
63
 
  pass_test("CISD Gradient");
64
 
}
65
 
 
66
 
close (RE);
67
 
 
68
 
system("cat $RESULT");
69
 
 
70
 
exit($FAIL);