aboutsummaryrefslogtreecommitdiffstats
path: root/test/ccured_olden/bh
diff options
context:
space:
mode:
authorblazy <blazy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-10-20 12:37:13 +0000
committerblazy <blazy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-10-20 12:37:13 +0000
commitca0c62265eb8cdd5fb0d8a8b34ee77baf3de987e (patch)
tree50a139db8e2ac51c6ff41f3790ff72aa417ed3be /test/ccured_olden/bh
parent43668d9109b1f36329646fd07324d435be6f0050 (diff)
downloadcompcert-kvx-ca0c62265eb8cdd5fb0d8a8b34ee77baf3de987e.tar.gz
compcert-kvx-ca0c62265eb8cdd5fb0d8a8b34ee77baf3de987e.zip
Ajout du banc de tests de CCured (Olden benchmark suite, cf.
CCured: type-safe retrofitting of legacy code, G.Necula et al.) rapportCompcert_all.txt liste les erreurs produites par ccomp. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@121 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/ccured_olden/bh')
-rw-r--r--test/ccured_olden/bh/.cvsignore39
-rw-r--r--test/ccured_olden/bh/.gdbinit3
-rw-r--r--test/ccured_olden/bh/CVS/Entries23
-rw-r--r--test/ccured_olden/bh/CVS/Repository1
-rw-r--r--test/ccured_olden/bh/CVS/Root1
-rw-r--r--test/ccured_olden/bh/Makefile84
-rw-r--r--test/ccured_olden/bh/Readme62
-rw-r--r--test/ccured_olden/bh/allcfiles7
-rw-r--r--test/ccured_olden/bh/code.c200
-rw-r--r--test/ccured_olden/bh/code.h60
-rw-r--r--test/ccured_olden/bh/data.in12
-rw-r--r--test/ccured_olden/bh/data.orig.out462
-rw-r--r--test/ccured_olden/bh/data.out462
-rw-r--r--test/ccured_olden/bh/defs.h196
-rw-r--r--test/ccured_olden/bh/getparam.c142
-rw-r--r--test/ccured_olden/bh/grav.c123
-rw-r--r--test/ccured_olden/bh/input12
-rw-r--r--test/ccured_olden/bh/io.c252
-rw-r--r--test/ccured_olden/bh/load.c287
-rwxr-xr-xtest/ccured_olden/bh/normalize.pl19
-rw-r--r--test/ccured_olden/bh/real.h106
-rw-r--r--test/ccured_olden/bh/stdinc.h97
-rw-r--r--test/ccured_olden/bh/t.out462
-rwxr-xr-xtest/ccured_olden/bh/testit21
-rw-r--r--test/ccured_olden/bh/trusted_bh.c92
-rw-r--r--test/ccured_olden/bh/util.c152
-rw-r--r--test/ccured_olden/bh/vectmath.h371
27 files changed, 3748 insertions, 0 deletions
diff --git a/test/ccured_olden/bh/.cvsignore b/test/ccured_olden/bh/.cvsignore
new file mode 100644
index 00000000..94c933eb
--- /dev/null
+++ b/test/ccured_olden/bh/.cvsignore
@@ -0,0 +1,39 @@
+*.i
+*_all.c
+*cil.c
+*box.c
+code
+data.in
+data.out
+*.origi
+*_allinfer.c
+*_ppp.c
+code.cil
+code.box
+code.wildbox
+
+*.o
+*.obj
+*.exe
+*.pdb
+*.ilk
+*.cpp
+*.i
+*.s
+*.asm
+*cil.c
+*.rtl
+*box.c
+*infer.c
+*_ppp.c
+*.origi
+*.stackdump
+changes.out
+*_comb.c
+*cured.c
+*.optim.c
+ope.m
+dat.out
+changes
+*.browser
+*optimcured* \ No newline at end of file
diff --git a/test/ccured_olden/bh/.gdbinit b/test/ccured_olden/bh/.gdbinit
new file mode 100644
index 00000000..123e0ab7
--- /dev/null
+++ b/test/ccured_olden/bh/.gdbinit
@@ -0,0 +1,3 @@
+file code.exe
+b main
+r
diff --git a/test/ccured_olden/bh/CVS/Entries b/test/ccured_olden/bh/CVS/Entries
new file mode 100644
index 00000000..acce0666
--- /dev/null
+++ b/test/ccured_olden/bh/CVS/Entries
@@ -0,0 +1,23 @@
+/Readme/1.1/Thu Apr 26 07:13:27 2001//
+/allcfiles/1.1/Thu Oct 18 05:30:18 2001//
+/code.h/1.1/Thu Apr 26 07:13:27 2001//
+/data.cil.out/1.1/Wed Jun 13 16:19:10 2001//
+/grav.c/1.2/Sun Apr 29 05:21:42 2001//
+/input/1.1/Thu Apr 26 07:13:27 2001//
+/io.c/1.4/Tue Oct 9 00:17:00 2001//
+/load.c/1.3/Thu Jul 12 19:57:18 2001//
+/real.h/1.1/Thu Apr 26 07:13:27 2001//
+/stdinc.h/1.6/Tue Oct 9 00:17:00 2001//
+/vectmath.h/1.4/Mon Jul 23 19:46:26 2001//
+/data.in/1.1/Fri Nov 9 00:51:18 2001//
+/data.orig.out/1.1/Mon Nov 12 08:08:28 2001//
+/normalize.pl/1.2/Mon Nov 12 15:44:12 2001//
+/.cvsignore/1.14/Sat Jul 27 06:13:42 2002//
+/testit/1.1/Wed Dec 25 17:27:31 2002//
+/defs.h/1.12/Mon Jan 6 22:43:21 2003//
+/code.c/1.5/Wed Jan 8 06:10:33 2003//
+/Makefile/1.11/Sat Jan 11 05:01:09 2003//
+/getparam.c/1.5/Sat Jan 11 04:58:14 2003//
+/trusted_bh.c/1.2/Sat Jan 11 05:01:58 2003//
+/util.c/1.11/Sat Jan 11 04:59:49 2003//
+D
diff --git a/test/ccured_olden/bh/CVS/Repository b/test/ccured_olden/bh/CVS/Repository
new file mode 100644
index 00000000..ebfd8c04
--- /dev/null
+++ b/test/ccured_olden/bh/CVS/Repository
@@ -0,0 +1 @@
+cil/test/olden/bh
diff --git a/test/ccured_olden/bh/CVS/Root b/test/ccured_olden/bh/CVS/Root
new file mode 100644
index 00000000..35f411e9
--- /dev/null
+++ b/test/ccured_olden/bh/CVS/Root
@@ -0,0 +1 @@
+/home/cvs-repository
diff --git a/test/ccured_olden/bh/Makefile b/test/ccured_olden/bh/Makefile
new file mode 100644
index 00000000..bd281429
--- /dev/null
+++ b/test/ccured_olden/bh/Makefile
@@ -0,0 +1,84 @@
+##############################################################################
+# MAKEFILE: compile tree-code program. #
+# #
+# Copyright (c) 1993, Joshua E. Barnes, Honolulu, HI. #
+# It's free because it's yours. #
+##############################################################################
+
+# Compiler flags for development on SGI; not used on other systems.
+# single version: CFLAGS = -fullwarn -woff 269,302 -prototypes -O -float
+# double version: CFLAGS = -DDOUBLEPREC -fullwarn -woff 269,302 -prototypes -O
+
+# Standard compiler flags. Double precision is the default because not
+# all available systems seem to have single-precision square root.
+#sm: orig: CFLAGS = -DDOUBLEPREC -O
+CFLAGS = -DDOUBLEPREC -O3
+LDFLAGS = -O3
+
+# CompCert
+CCOMP=../../../../ccomp
+CCOMPFLAGS=-dump-c
+
+CC=gcc -arch ppc # MacOS X
+#CC=gcc # other systems
+
+CFLAGS=-O1 -Wall
+
+LIBS= # MacOS X
+
+# Build a treecode.
+code.exe.compcert: code.compcert io.compcert load.compcert grav.compcert util.compcert getparam.compcert trusted_bh.compcert
+ $(CCOMP) $(LDFLAGS) -o code.exe.compcert code.compcert io.compcert load.compcert grav.compcert\
+ util.o getparam.compcert trusted_bh.compcert $(EXTRA_LIBS)
+
+code.compcert: code.c defs.h code.h stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) code.c
+
+io.compcert: io.c defs.h stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) io.c
+
+load.compcert: load.c defs.h stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) load.c
+
+grav.compcert: grav.c defs.h stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) -grav.c
+
+code.exe: code.o io.o load.o grav.o util.o getparam.o trusted_bh.o
+ $(CC) $(LDFLAGS) -o code.exe code.o io.o load.o grav.o\
+ util.o getparam.o trusted_bh.o -lm $(EXTRA_LIBS)
+
+code.o: code.c defs.h code.h stdinc.h
+ $(CC) $(CFLAGS) -c code.c
+
+io.o: io.c defs.h stdinc.h
+ $(CC) $(CFLAGS) -c io.c
+
+load.o: load.c defs.h stdinc.h
+ $(CC) $(CFLAGS) -c load.c
+
+grav.o: grav.c defs.h stdinc.h
+ $(CC) $(CFLAGS) -c grav.c
+
+# Utility routines etc.
+
+util.o: util.c stdinc.h
+ $(CC) $(CFLAGS) util.c
+
+util.compcert: util.c stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) util.c
+
+# Added to help boxing
+trusted_bh.o: trusted_bh.c stdinc.h
+ $(CC) $(CFLAGS) -c trusted_bh.c
+
+getparam.o: getparam.c stdinc.h
+ $(CC) $(CFLAGS) -c getparam.c
+
+trusted_bh.compcert: trusted_bh.c stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) trusted_bh.c
+
+getparam.compcert: getparam.c stdinc.h
+ $(CCOMP) $(CCOMPFLAGS) getparam.c
+
+clean:
+ rm -f *.o *.lib *.exe *.obj *~ *cil.c *_comb.c *infer.c *cured.c *.i *cured*optim.c \ No newline at end of file
diff --git a/test/ccured_olden/bh/Readme b/test/ccured_olden/bh/Readme
new file mode 100644
index 00000000..5034f519
--- /dev/null
+++ b/test/ccured_olden/bh/Readme
@@ -0,0 +1,62 @@
+README README README README README README README README README README
+
+ 22 June 1993
+
+ This is the fourth release of the hierarchical N-body program. The
+algorithm used to compute gravitational forces has asymptotic complexity of
+O(N log N). This is achieved by building a tree structure to represent the
+mass distribution and estimating forces by a partial recursive descent of this
+tree. See "A Hierarchical O(N log N) Force Calculation Algorithm", by Joshua
+Barnes and Piet Hut, Nature, 324, 446, and "Error Analysis of a Tree Code", by
+Joshua Barnes and Piet Hut, Astrophysical Journal Supplement, 70, 389, for
+more information.
+
+ The code has been rewritten in ANSI C for greater portability. Prototypes
+have been provided for all functions. Several functions associated with tree
+construction have been simplified; the resulting code should be easier to
+mantain. Force calculation has been made more accurate by incorporating a new
+opening-angle criterion, and faster by adding additional pointers to the tree
+structure. Quadrupole corrections for body-cell interactions are now included
+as a run-time option; see "Performance Characteristics of Tree Codes", by Lars
+Hernquist, Astrophysical Journal Supplement, 64, 715.
+
+ The source files for the tree code have been bundled together for ease of
+distribution. On a UNIX system, you can split this file simply by invoking
+the Bourne shell on it (use the sh command). On other systems, you may have
+to edit this file and split it up by hand; note that file X is delimited by
+lines containing the message End of X. Once you have split this file, you can
+compile it by running make on a UNIX system. On other systems, you are on
+your own; take a look at the Makefile for hints. Running the program with the
+default input parameters (type a <CR> to all prompts) will start a short
+calculation with a few particles to test things out.
+
+ These sources include a few files which you may find generally useful:
+"stdinc.h", a standard include file with common definitions, "vectmath.h", a
+set of macros for elementary vector and matrix operations, "real.h", a set of
+definitions for floating-point code, "getparam.c", a simple, standardized user
+interface, and "util.c", some miscellaneous utilities. These are part of a
+larger collection of software for numerical experiments with gravitating
+systems.
+
+ NO WARRANTY is offered on the software supplied here -- use it at your own
+risk. NO RESTRICTIONS are imposed on use and distribution of the code -- you
+are free to use this software for any application, modify it in any way, use
+pieces in other programs, and give it away to anyone else. You are encouraged
+to extend these rights to others who receive this software from you, following
+the philosophy and intentions of the Free Software Foundation.
+
+ You are asked to include a brief acknowledgement in any scientific papers
+you write using this code; I would appreciate receiving preprints or reprints
+of such papers. I would also appreciate receiving reports of bugs and/or
+problems encountered in porting this code to other machines.
+
+ Have fun and stay in touch.
+
+ Joshua E. Barnes barnes@zeno.ifa.hawaii.edu
+
+ Institute for Astronomy (808) 956-8138
+ University of Hawaii
+ 2680 Woodlawn Drive
+ Honolulu, Hawaii 96822
+
+README README README README README README README README README README
diff --git a/test/ccured_olden/bh/allcfiles b/test/ccured_olden/bh/allcfiles
new file mode 100644
index 00000000..6a04d2ac
--- /dev/null
+++ b/test/ccured_olden/bh/allcfiles
@@ -0,0 +1,7 @@
+bhbox.c
+code.c
+getparam.c
+grav.c
+io.c
+load.c
+util.c
diff --git a/test/ccured_olden/bh/code.c b/test/ccured_olden/bh/code.c
new file mode 100644
index 00000000..ee3c0894
--- /dev/null
+++ b/test/ccured_olden/bh/code.c
@@ -0,0 +1,200 @@
+/****************************************************************************/
+/* CODE.C: hierarchical N-body code. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#define global /* nada */
+
+#include <stdlib.h>
+#include "code.h"
+
+/*
+ * Default values for input parameters.
+ */
+
+string defv[] = {
+
+ /* file names for input/output */
+ "in=", /* Input file with initial conditions */
+ "out=", /* Output file of N-body frames */
+
+ /* params to control N-body integration */
+ "dtime=0.03125", /* Integration time-step */
+ "eps=0.025", /* Potential softening parameter */
+ "theta=1.0", /* Cell subdivision tolerence */
+ "usequad=false", /* If true, use quad moments */
+ "rsize=4.0", /* Size of initial root cell */
+ "options=", /* Various control options */
+ "tstop=2.0", /* Time to stop integration */
+ "dtout=0.25", /* Data output interval */
+
+ /* params used if no input specified to make a Plummer model */
+ "nbody=1024", /* Number of particles for test run */
+ "seed=123", /* Random number seed for test run */
+
+ NULL,
+};
+
+string headline = "Hierarchical N-body Code"; /* default id for run */
+
+local void startrun(void); /* initialize system state */
+local void stepsystem(void); /* advance by one time-step */
+local void testdata(void); /* generate test data */
+local void pickshell(vector, real); /* pick point on shell */
+
+/*
+ * MAIN: toplevel routine for hierarchical N-body code.
+ */
+
+int main(int argc, string argv[])
+{
+ initparam(argv, defv); /* setup parameter access */
+ startrun(); /* set params, input data */
+ initoutput(); /* begin system output */
+ while (tnow < tstop - 1.0/(1024*freq)) /* while not past tstop */
+ stepsystem(); /* advance N-body system */
+ stopoutput(); /* finish up output */
+ return 0; // Change this to zero when the running time is 3.8s again
+}
+
+/*
+ * STARTRUN: startup hierarchical N-body code.
+ */
+
+local void startrun(void)
+{
+ infile = getparam("in"); /* set I/O file names */
+ outfile = getparam("out");
+ freq = 1.0 / getrparam("dtime"); /* inverse timestep */
+ eps = getrparam("eps"); /* softening length */
+ theta = getrparam("theta"); /* force accuracy parameter */
+ usequad = getbparam("usequad"); /* flag for quad moments */
+ rsize = getrparam("rsize"); /* initial size of root */
+ options = getparam("options"); /* and control options */
+ tstop = getrparam("tstop"); /* time to stop integration */
+ freqout = 1.0 / getrparam("dtout"); /* inverse output interval */
+ if (! streq(infile, "")) { /* was data file given? */
+
+ inputdata(); /* read inital data */
+ } else { /* make initial conds? */
+ nbody = getiparam("nbody"); /* get nbody parameter */
+ if (nbody < 1) /* check input value */
+ error("startrun: nbody = %d is absurd\n", nbody);
+ srand((long) getiparam("seed")); /* set random generator */
+ testdata(); /* make test model */
+ }
+ nstep = 0; /* start counting steps */
+ tout = tnow; /* schedule first output */
+}
+
+/*
+ * TESTDATA: generate Plummer model initial conditions for test runs,
+ * scaled to units such that M = -4E = G = 1 (Henon, Hegge, etc).
+ * See Aarseth, SJ, Henon, M, & Wielen, R (1974) Astr & Ap, 37, 183.
+ */
+
+#define MFRAC 0.999 /* cut off 1-MFRAC of mass */
+
+local void testdata(void)
+{
+ real rsc, vsc, r, v, x, y;
+ vector cmr, cmv;
+ bodyptr p;
+
+ headline = "Hierarchical code: Plummer model";
+ /* supply default headline */
+ tnow = 0.0; /* reset elapsed model time */
+ bodytab = (bodyptr) allocate(nbody * sizeof(body));
+ /* alloc space for bodies */
+ rsc = 3 * PI / 16; /* set length scale factor */
+ vsc = rsqrt(1.0 / rsc); /* and recip. speed scale */
+ CLRV(cmr); /* init cm pos, vel */
+ CLRV(cmv);
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over particles */
+ Type(p) = BODY; /* tag as a body */
+ Mass(p) = 1.0 / nbody; /* set masses equal */
+ r = 1 / rsqrt(rpow(xrandom(0.0, MFRAC), /* pick r in struct units */
+ -2.0/3.0) - 1);
+ pickshell(Pos(p), rsc * r); /* pick scaled position */
+ ADDV(cmr, cmr, Pos(p)); /* add to running sum */
+ do { /* select from fn g(x) */
+ x = xrandom(0.0, 1.0); /* for x in range 0:1 */
+ y = xrandom(0.0, 0.1); /* max of g(x) is 0.092 */
+ } while (y > x*x * rpow(1 - x*x, 3.5)); /* using von Neumann tech */
+ v = rsqrt(2.0) * x/rpow(1 + r*r, 0.25); /* find v in struct units */
+ pickshell(Vel(p), vsc * v); /* pick scaled velocity */
+ ADDV(cmv, cmv, Vel(p)); /* add to running sum */
+ }
+ DIVVS(cmr, cmr, (real) nbody); /* normalize cm coords */
+ DIVVS(cmv, cmv, (real) nbody);
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over particles */
+ SUBV(Pos(p), Pos(p), cmr); /* offset by cm coords */
+ SUBV(Vel(p), Vel(p), cmv);
+ }
+}
+
+/*
+ * PICKSHELL: pick a random point on a sphere of specified radius.
+ */
+
+local void pickshell(vector vec, real rad)
+{
+ int k;
+ real rsq, rsc;
+
+ do { /* pick point in NDIM-space */
+ for (k = 0; k < NDIM; k++) /* loop over dimensions */
+ vec[k] = xrandom(-1.0, 1.0); /* pick from unit cube */
+ DOTVP(rsq, vec, vec); /* compute radius squared */
+ } while (rsq > 1.0); /* reject if outside sphere */
+ rsc = rad / rsqrt(rsq); /* compute scaling factor */
+ MULVS(vec, vec, rsc); /* rescale to radius given */
+}
+
+/*
+ * STEPSYSTEM: advance N-body system one time-step.
+ */
+
+local void stepsystem(void)
+{
+ bodyptr p;
+ real dt;
+ vector dvel, dpos;
+
+ if (nstep == 0) { /* about to take 1st step? */
+ maketree(bodytab, nbody); /* build tree structure */
+ nfcalc = n2bcalc = nbccalc = 0; /* zero counters */
+ for (p = bodytab; p < bodytab+nbody; p++) {
+ /* loop over all bodies */
+ hackgrav(p, Mass(p) > 0.0); /* get force on each */
+ nfcalc++; /* count force calcs */
+ n2bcalc += n2bterm; /* and 2-body terms */
+ nbccalc += nbcterm; /* and body-cell terms */
+ }
+ output(); /* do initial output */
+ }
+ dt = 1.0 / freq; /* set basic time-step */
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all bodies */
+ MULVS(dvel, Acc(p), 0.5 * dt); /* get velocity increment */
+ ADDV(Vel(p), Vel(p), dvel); /* advance v by 1/2 step */
+ MULVS(dpos, Vel(p), dt); /* get positon increment */
+ ADDV(Pos(p), Pos(p), dpos); /* advance r by 1 step */
+ }
+ maketree(bodytab, nbody); /* build tree structure */
+ nfcalc = n2bcalc = nbccalc = 0; /* zero counters */
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over bodies */
+ hackgrav(p, Mass(p) > 0.0); /* get force on each */
+ nfcalc++; /* count force calcs */
+ n2bcalc += n2bterm; /* and 2-body terms */
+ nbccalc += nbcterm; /* and body-cell terms */
+ }
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all bodies */
+ MULVS(dvel, Acc(p), 0.5 * dt); /* get velocity increment */
+ ADDV(Vel(p), Vel(p), dvel); /* advance v by 1/2 step */
+ }
+ nstep++; /* count another time step */
+ tnow = tnow + dt; /* finally, advance time */
+ output(); /* do major or minor output */
+}
diff --git a/test/ccured_olden/bh/code.h b/test/ccured_olden/bh/code.h
new file mode 100644
index 00000000..89b8a098
--- /dev/null
+++ b/test/ccured_olden/bh/code.h
@@ -0,0 +1,60 @@
+/****************************************************************************/
+/* CODE.H: define various global things for code.c and io.c. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "defs.h"
+
+global string infile; /* file name for snapshot input */
+
+global string outfile; /* file name for snapshot output */
+
+global real freq; /* inverse of integration timestep */
+
+global real freqout; /* output frequency */
+
+global real tstop; /* time to stop calculation */
+
+extern string headline; /* message describing calculation */
+
+global real tnow; /* current value of time */
+
+global real tout; /* time of next output */
+
+global int nstep; /* number of time-steps */
+
+global int nfcalc; /* count force calculations */
+
+global int n2bcalc; /* count body-body interactions */
+
+global int nbccalc; /* count body-cell interactions */
+
+global int nbody; /* number of bodies in system */
+
+global bodyptr bodytab; /* points to array of bodies */
+
+/*
+ * Global function prototypes.
+ */
+
+void initoutput(void); /* open files for output */
+void stopoutput(void); /* close output files */
+void inputdata(void); /* read initial data file */
+void maketree(bodyptr, int); /* construct tree structure */
+void hackgrav(bodyptr, bool); /* compute force on body */
+void output(void); /* perform output operation */
+
+/*
+ * Utility routines used in code.c and io.c. These are defined in util.c
+ * and getparam.c, which must be compiled with same choice of precision.
+ */
+
+bool streq(string, string); /* test string equality */
+real xrandom(real, real); /* generate a random number */
+void initparam(string *, string *); /* initialize parameter pkg */
+string getparam(string); /* get parameter as string */
+int getiparam(string); /* get parameter as integer */
+bool getbparam(string); /* get parameter as bool */
+real getrparam(string); /* get parameter as real */
diff --git a/test/ccured_olden/bh/data.in b/test/ccured_olden/bh/data.in
new file mode 100644
index 00000000..1901ba93
--- /dev/null
+++ b/test/ccured_olden/bh/data.in
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/ccured_olden/bh/data.orig.out b/test/ccured_olden/bh/data.orig.out
new file mode 100644
index 00000000..895eecb6
--- /dev/null
+++ b/test/ccured_olden/bh/data.orig.out
@@ -0,0 +1,462 @@
+
+Hierarchical code: Plummer model
+
+ nbody dtime eps theta usequad dtout
+ 1024 0.03125 0.0250 1.00 false 0.2500
+
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.000 -0.2605 -0.4941 208234 85 118
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 0.0000 0.0000
+ am vec 0.0040 0.0111 0.0039
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.031 -0.2605 -0.4945 211569 89 116
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 0.0000 0.0000
+ am vec 0.0040 0.0111 0.0039
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.062 -0.2606 -0.4949 213299 90 117
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0111 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.094 -0.2606 -0.4954 213209 91 116
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0111 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.125 -0.2606 -0.4957 214475 90 118
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.156 -0.2606 -0.4959 212360 87 119
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.188 -0.2606 -0.4961 215638 90 120
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.219 -0.2607 -0.4962 213907 90 118
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.250 -0.2606 -0.4966 211413 88 118
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.281 -0.2607 -0.4968 212516 90 116
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.312 -0.2606 -0.4971 212043 91 115
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.344 -0.2606 -0.4974 210500 90 115
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.375 -0.2605 -0.4976 210875 90 115
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.406 -0.2605 -0.4976 211891 91 115
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.438 -0.2606 -0.4975 212886 92 115
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel 0.0000 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.469 -0.2606 -0.4975 214848 93 115
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel 0.0000 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.500 -0.2604 -0.4976 212165 90 116
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.531 -0.2605 -0.4974 212366 90 117
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.562 -0.2606 -0.4971 212423 92 115
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.594 -0.2606 -0.4969 212283 93 113
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.625 -0.2604 -0.4969 211770 93 113
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.656 -0.2604 -0.4966 213017 94 113
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.688 -0.2605 -0.4964 211250 93 113
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.719 -0.2604 -0.4964 211170 92 113
+
+ cm pos 0.0000 -0.0001 0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.750 -0.2604 -0.4962 210947 92 113
+
+ cm pos 0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.781 -0.2604 -0.4959 210270 92 112
+
+ cm pos 0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.812 -0.2604 -0.4957 210869 92 112
+
+ cm pos 0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.844 -0.2603 -0.4954 210822 93 112
+
+ cm pos 0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.875 -0.2602 -0.4951 212697 95 112
+
+ cm pos 0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.906 -0.2602 -0.4948 210581 93 112
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.938 -0.2603 -0.4943 209929 93 111
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 0.969 -0.2603 -0.4939 212661 95 112
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.000 -0.2603 -0.4935 212223 94 112
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.031 -0.2602 -0.4932 211476 92 113
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.062 -0.2601 -0.4930 212513 95 112
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.094 -0.2602 -0.4926 212473 96 111
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0002 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.125 -0.2601 -0.4924 212418 94 112
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0002 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.156 -0.2601 -0.4921 211307 94 111
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.188 -0.2601 -0.4919 212029 96 110
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.219 -0.2600 -0.4916 211871 95 111
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.250 -0.2602 -0.4912 212729 93 113
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.281 -0.2603 -0.4908 211198 91 115
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.312 -0.2603 -0.4906 213544 93 115
+
+ cm pos -0.0002 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.344 -0.2602 -0.4906 212351 92 114
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.375 -0.2603 -0.4903 211854 91 115
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.406 -0.2603 -0.4902 211998 91 115
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.438 -0.2604 -0.4900 210887 89 116
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.469 -0.2604 -0.4899 210486 88 117
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0001 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.500 -0.2604 -0.4897 210373 87 117
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0004 -0.0001 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.531 -0.2604 -0.4896 210691 88 117
+
+ cm pos -0.0002 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.562 -0.2603 -0.4895 211982 89 117
+
+ cm pos -0.0002 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 0.0000
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.594 -0.2602 -0.4894 213499 93 115
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 0.0000
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.625 -0.2602 -0.4892 214135 93 115
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 0.0000
+ am vec 0.0040 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.656 -0.2600 -0.4891 212530 93 113
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 0.0000
+ am vec 0.0040 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.688 -0.2601 -0.4889 212150 93 113
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.719 -0.2600 -0.4886 212527 94 113
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.750 -0.2599 -0.4882 214475 95 113
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.781 -0.2600 -0.4877 211398 91 114
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.812 -0.2601 -0.4874 212928 92 115
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.844 -0.2600 -0.4872 209464 86 117
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.875 -0.2600 -0.4871 207897 83 119
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.906 -0.2599 -0.4871 209291 84 119
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.938 -0.2599 -0.4870 208078 85 118
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 1.969 -0.2599 -0.4866 209032 86 117
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg
+ 2.000 -0.2600 -0.4864 208927 85 118
+
+ cm pos -0.0005 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
diff --git a/test/ccured_olden/bh/data.out b/test/ccured_olden/bh/data.out
new file mode 100644
index 00000000..501f205e
--- /dev/null
+++ b/test/ccured_olden/bh/data.out
@@ -0,0 +1,462 @@
+
+Hierarchical code: Plummer model
+
+ nbody dtime eps theta usequad dtout tstop
+ 1024 0.03125 0.0250 1.00 false 0.2500 2.0000
+
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.000 -0.2605 -0.4941 208234 85 118 0.00
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0000 0.0000
+ am vec 0.0040 0.0111 0.0039
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.031 -0.2605 -0.4945 211569 89 116 0.00
+
+ cm pos 0.0000 -0.0000 0.0000
+ cm vel 0.0000 -0.0000 -0.0000
+ am vec 0.0040 0.0111 0.0039
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.062 -0.2606 -0.4949 213299 90 117 0.00
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel 0.0000 -0.0001 0.0000
+ am vec 0.0040 0.0111 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.094 -0.2606 -0.4954 213209 91 116 0.00
+
+ cm pos 0.0000 -0.0000 0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0040 0.0111 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.125 -0.2606 -0.4957 214475 90 118 0.00
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.156 -0.2606 -0.4959 212360 87 119 0.00
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.188 -0.2606 -0.4961 215638 90 120 0.00
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.219 -0.2607 -0.4962 213907 90 118 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.250 -0.2606 -0.4966 211413 88 118 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.281 -0.2607 -0.4968 212516 90 116 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0000
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.312 -0.2606 -0.4971 212043 91 115 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.344 -0.2606 -0.4974 210500 90 115 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.375 -0.2605 -0.4976 210875 90 115 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.406 -0.2605 -0.4976 211891 91 115 0.01
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel -0.0000 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.438 -0.2606 -0.4975 212886 92 115 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0000 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.469 -0.2606 -0.4975 214848 93 115 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0000 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.500 -0.2604 -0.4976 212165 90 116 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.531 -0.2605 -0.4974 212366 90 117 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0040
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.562 -0.2606 -0.4971 212423 92 115 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.594 -0.2606 -0.4969 212283 93 113 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.625 -0.2604 -0.4969 211770 93 113 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.656 -0.2604 -0.4966 213017 94 113 0.01
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.688 -0.2605 -0.4964 211250 93 113 0.02
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.719 -0.2604 -0.4964 211170 92 113 0.02
+
+ cm pos -0.0000 -0.0001 -0.0000
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.750 -0.2604 -0.4962 210947 92 113 0.02
+
+ cm pos -0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.781 -0.2604 -0.4959 210270 92 112 0.02
+
+ cm pos -0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.812 -0.2604 -0.4957 210869 92 112 0.02
+
+ cm pos -0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.844 -0.2603 -0.4954 210822 93 112 0.02
+
+ cm pos -0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.875 -0.2602 -0.4951 212697 95 112 0.02
+
+ cm pos -0.0000 -0.0002 -0.0001
+ cm vel -0.0001 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.906 -0.2602 -0.4948 210581 93 112 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.938 -0.2603 -0.4943 209929 93 111 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 0.969 -0.2603 -0.4939 212661 95 112 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.000 -0.2603 -0.4935 212223 94 112 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.031 -0.2602 -0.4932 211476 92 113 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.062 -0.2601 -0.4930 212513 95 112 0.02
+
+ cm pos -0.0001 -0.0002 -0.0001
+ cm vel -0.0002 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.094 -0.2602 -0.4926 212473 96 111 0.02
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0002 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.125 -0.2601 -0.4924 212418 94 112 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0002 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.156 -0.2601 -0.4921 211307 94 111 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0001
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.188 -0.2601 -0.4919 212029 96 110 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.219 -0.2600 -0.4916 211871 95 111 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0003 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.250 -0.2602 -0.4912 212729 93 113 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.281 -0.2603 -0.4908 211198 91 115 0.03
+
+ cm pos -0.0001 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.312 -0.2603 -0.4906 213544 93 115 0.03
+
+ cm pos -0.0002 -0.0003 -0.0001
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0039 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.344 -0.2602 -0.4906 212351 92 114 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0002
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.375 -0.2603 -0.4903 211854 91 115 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.406 -0.2603 -0.4902 211998 91 115 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.438 -0.2604 -0.4900 210887 89 116 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.469 -0.2604 -0.4899 210486 88 117 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0003 -0.0001 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.500 -0.2604 -0.4897 210373 87 117 0.03
+
+ cm pos -0.0002 -0.0003 -0.0002
+ cm vel -0.0004 -0.0001 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.531 -0.2604 -0.4896 210691 88 117 0.03
+
+ cm pos -0.0002 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0001
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.562 -0.2603 -0.4895 211982 89 117 0.03
+
+ cm pos -0.0002 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0000
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.594 -0.2602 -0.4894 213499 93 115 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0000
+ am vec 0.0040 0.0110 0.0041
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.625 -0.2602 -0.4892 214135 93 115 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0000
+ am vec 0.0040 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.656 -0.2600 -0.4891 212530 93 113 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0004 -0.0002 -0.0000
+ am vec 0.0040 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.688 -0.2601 -0.4889 212150 93 113 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.719 -0.2600 -0.4886 212527 94 113 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.750 -0.2599 -0.4882 214475 95 113 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.781 -0.2600 -0.4877 211398 91 114 0.04
+
+ cm pos -0.0003 -0.0004 -0.0002
+ cm vel -0.0005 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.812 -0.2601 -0.4874 212928 92 115 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.844 -0.2600 -0.4872 209464 86 117 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.875 -0.2600 -0.4871 207897 83 119 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0002 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.906 -0.2599 -0.4871 209291 84 119 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0005 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.938 -0.2599 -0.4870 208078 85 118 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 1.969 -0.2599 -0.4866 209032 86 117 0.04
+
+ cm pos -0.0004 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
+ tnow T+U T/U nttot nbavg ncavg cputime
+ 2.000 -0.2600 -0.4864 208927 85 118 0.04
+
+ cm pos -0.0005 -0.0004 -0.0002
+ cm vel -0.0006 -0.0001 -0.0001
+ am vec 0.0039 0.0110 0.0042
+
diff --git a/test/ccured_olden/bh/defs.h b/test/ccured_olden/bh/defs.h
new file mode 100644
index 00000000..d8b46432
--- /dev/null
+++ b/test/ccured_olden/bh/defs.h
@@ -0,0 +1,196 @@
+/****************************************************************************/
+/* DEFS.H: include file for hierarchical force calculation routines. The */
+/* definitions in this file are needed for load.c and grav.c; this file */
+/* does not provide definitions for other parts of the N-body code. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "stdinc.h"
+#include "real.h"
+#include "vectmath.h"
+
+/*
+ * Body and cell data structures are used to represent the tree. During
+ * tree construction, descendent pointers are stored in the subp arrays:
+ *
+ * +-------------------------------------------------------------+
+ * root --> | CELL: mass, pos, next, rcrit2, more, subp:[/,o,/,/,/,/,o,/] |
+ * +----------------------------------------------|---------|----+
+ * | |
+ * +---------------------------------------------------+ |
+ * | |
+ * | +--------------------------------------+ |
+ * +--> | BODY: mass, pos, next, vel, acc, phi | |
+ * +--------------------------------------+ |
+ * |
+ * +-------------------------------------------------------------+
+ * |
+ * | +-------------------------------------------------------------+
+ * +--> | CELL: mass, pos, next, rcrit2, more, subp:[o,/,/,o,/,/,o,/] |
+ * +--------------------------------------------|-----|-----|----+
+ * etc etc etc
+ *
+ * After the tree is complete, it is threaded to permit linear force
+ * calculation, using the next and more pointers. The storage used for
+ * the subp arrays may be reused to store quadrupole moments.
+ *
+ * +-----------------------------------------------+
+ * root --> | CELL: mass, pos, next:/, rcrit2, more:o, quad |
+ * +---------------------------------------|-------+
+ * |
+ * +--------------------------------------------+
+ * |
+ * | +----------------------------------------+
+ * +--> | BODY: mass, pos, next:o, vel, acc, phi |
+ * +-----------------------|----------------+
+ * |
+ * +----------------------------+
+ * |
+ * | +-----------------------------------------------+
+ * +--> | CELL: mass, pos, next:/, rcrit2, more:o, quad |
+ * +---------------------------------------|-------+
+ * etc
+ */
+
+/*
+ * NODE: data common to BODY and CELL structures.
+ */
+
+typedef struct _node {
+ short type; /* code for node type */
+ real mass; /* total mass of node */
+ vector pos; /* position of node */
+ struct _node *next; /* link to next force-calc */
+} node, *nodeptr;
+
+#define Type(x) (((nodeptr) (x))->type)
+#define Mass(x) (((nodeptr) (x))->mass)
+#define Pos(x) (((nodeptr) (x))->pos)
+#define Next(x) (((nodeptr) (x))->next)
+
+/*
+ * BODY: data structure used to represent particles.
+ */
+
+#define BODY 01 /* type code for bodies */
+
+typedef struct {
+ node bodynode; /* data common to all nodes */
+ vector vel; /* velocity of body */
+ vector acc; /* acceleration of body */
+ real phi; /* potential at body */
+} body, *bodyptr;
+
+
+#define Body body
+
+#if defined(CCURED) && !defined(NO_PERF_CHANGES)
+ extern bodyptr node2body(nodeptr x);
+#else
+ // when not in box mode, or when we want to measure the original program's
+ // performance, use an ordinary cast
+ #define node2body(x) ((bodyptr)(x))
+#endif
+
+#define Vel(x) (((x))->vel)
+#define Acc(x) (((x))->acc)
+#define Phi(x) (((x))->phi)
+
+// Field accessor functions from nodeptr
+#define VelN(x) ((node2body(x))->vel)
+#define AccN(x) ((node2body(x))->acc)
+#define PhiN(x) ((node2body(x))->phi)
+
+/*
+ * CELL: structure used to represent internal nodes of tree.
+ */
+
+#define CELL 02 /* type code for cells */
+
+#define NSUB (1 << NDIM) /* subcells per cell */
+
+#ifndef __SAFEUNION
+#define __SAFEUNION
+#endif
+
+typedef struct {
+ node cellnode; /* data common to all nodes */
+ real rcrit2; /* critical c-of-m radius^2 */
+ nodeptr more; /* link to first descendent */
+ union { /* shared storage for... */
+ nodeptr subp[NSUB]; /* descendents of cell */
+ matrix quad; /* quad. moment of cell */
+ } __SAFEUNION stuff;
+} cell, *cellptr;
+
+#if defined(CCURED) && !defined(NO_PERF_CHANGES)
+ extern cellptr node2cell(nodeptr x);
+#else
+ #define node2cell(x) ((cellptr)(x))
+#endif
+
+#define Rcrit2(x) ((x)->rcrit2)
+#define More(x) ((x)->more)
+#define Subp(x) ((x)->stuff.subp)
+#define Quad(x) ((x)->stuff.quad)
+
+#define Rcrit2N(x) ((node2cell(x))->rcrit2)
+#define MoreN(x) ((node2cell(x))->more)
+#define SubpN(x) ((node2cell(x))->stuff.subp)
+#define QuadN(x) ((node2cell(x))->stuff.quad)
+
+/*
+ * Variables used in tree construction.
+ */
+
+global cellptr root; /* pointer to root cell */
+
+global real rsize; /* side-length of root cell */
+
+global int cellused; /* count of cells in tree */
+
+global int maxlevel; /* count of levels in tree */
+
+/*
+ * Parameters and results for gravitational calculation.
+ */
+
+global string options; /* various option keywords */
+
+global real theta; /* accuracy parameter: 0.0 => exact */
+
+global bool usequad; /* use quadrupole corrections */
+
+global real eps; /* potential softening parameter */
+
+global int n2bterm; /* number 2-body of terms evaluated */
+
+global int nbcterm; /* num of body-cell terms evaluated */
+
+/*
+ * Utility routines used in load.c and grav.c. These are defined in
+ * util.c, which must be compiled with the same choice of precision.
+ */
+
+bool scanopt(string, string); /* find option in string */
+real cputime(void); /* return elapsed CPU time */
+
+#ifdef CCURED
+ #pragma ccuredvararg("error", printf(1))
+ #pragma ccuredvararg("eprintf", printf(1))
+ #ifndef NO_PERF_CHANGES
+ #pragma ccuredalloc("allocate", zero, sizein(1))
+ #endif
+#endif
+void *allocate(int); /* allocate and zero memory */
+
+real distv(vector, vector); /* distance between vectors */
+
+void error(string, ...); /* report error and exit */
+
+void eprintf(string, ...); /* printf to error stream */
+
+
+
diff --git a/test/ccured_olden/bh/getparam.c b/test/ccured_olden/bh/getparam.c
new file mode 100644
index 00000000..9f3d1cf2
--- /dev/null
+++ b/test/ccured_olden/bh/getparam.c
@@ -0,0 +1,142 @@
+/****************************************************************************/
+/* GETPARAM.C: export version prompts user for values. Public routines: */
+/* initparam(), getparam(), getiparam(), getbparam(), getrparam(). */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "stdinc.h"
+#include "real.h"
+#include <string.h>
+#include <stdlib.h>
+
+void *allocate(int);
+void error(string, ...);
+
+local string *defaults = NULL; /* "name=value" strings */
+
+/*
+ * INITPARAM: ignore arg vector, remember defaults.
+ */
+
+void initparam(string *argv, string *defv)
+{
+ defaults = defv;
+}
+
+/*
+ * GETPARAM: export version prompts user for value of name.
+ */
+
+local int scanbind(string *, string);
+local string extrvalue(string);
+
+string getparam(string name)
+{
+ int i, len;
+ string def;
+ char buf[128];
+
+ if (defaults == NULL) /* check initialization */
+ error("getparam: called before initparam\n");
+ i = scanbind(defaults, name); /* find name in defaults */
+ if (i < 0)
+ error("getparam: %s unknown\n", name);
+ def = extrvalue(defaults[i]); /* extract default value */
+ if (*def == NULLCHR)
+ fprintf(stderr, "enter %s: ", name); /* prompt user for value */
+ else
+ fprintf(stderr, "enter %s [%s]: ", name, def);
+ gets(buf); /* read users response */
+ len = strlen(buf);
+ if (len > 0) /* if user gave a value... */
+ return (strcpy((string) allocate(len+1), buf));
+ else /* else return default */
+ return (def);
+}
+
+/*
+ * GETIPARAM, ..., GETDPARAM: get int, long, bool, or double parameters.
+ */
+
+int getiparam(string name)
+{
+ string val;
+
+ for (val = ""; *val == NULLCHR; ) /* while nothing input */
+ val = getparam(name); /* obtain value from user */
+ return (atoi(val)); /* convert to an integer */
+}
+
+bool getbparam(string name)
+{
+ string val;
+
+ for (val = ""; *val == NULLCHR; )
+ val = getparam(name);
+ if (strchr("tTyY1", *val) != NULLCHR) /* is value true? */
+ return (TRUE);
+ if (strchr("fFnN0", *val) != NULLCHR) /* is value false? */
+ return (FALSE);
+ error("getbparam: %s=%s not bool\n", name, val);
+ return (FALSE);
+}
+
+real getrparam(string name)
+{
+ string val;
+
+ for (val = ""; *val == NULLCHR; )
+ val = getparam(name);
+ return ((real) atof(val)); /* convert & return real */
+}
+
+/*
+ * SCANBIND: scan binding vector for name, return index.
+ */
+
+local bool matchname(string, string);
+
+local int scanbind(string bvec[], string name)
+{
+ int i;
+
+ for (i = 0; bvec[i] != NULL; i++)
+ if (matchname(bvec[i], name))
+ return (i);
+ return (-1);
+}
+
+/*
+ * MATCHNAME: determine if "name=value" matches "name".
+ */
+
+local bool matchname(string bind, string name)
+{
+ char *bp, *np;
+
+ bp = bind;
+ np = name;
+ while (*bp == *np) {
+ bp++;
+ np++;
+ }
+ return (*bp == '=' && *np == NULLCHR);
+}
+
+/*
+ * EXTRVALUE: extract value from name=value string.
+ */
+
+local string extrvalue(string arg)
+{
+ char *ap;
+
+ ap = (char *) arg;
+ while (*ap != NULLCHR)
+ if (*ap++ == '=')
+ return ((string) ap);
+ return (NULL);
+}
+
diff --git a/test/ccured_olden/bh/grav.c b/test/ccured_olden/bh/grav.c
new file mode 100644
index 00000000..06009df1
--- /dev/null
+++ b/test/ccured_olden/bh/grav.c
@@ -0,0 +1,123 @@
+/****************************************************************************/
+/* GRAV.C: routines to compute gravity. Public routines: hackgrav(). */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "defs.h"
+
+local void treescan(nodeptr); /* does force calculation */
+local bool subdivp(cellptr); /* can cell be accepted? */
+local void gravsub(nodeptr); /* compute grav interaction */
+
+/*
+ * HACKGRAV: evaluate gravitational field on body p; checks to be
+ * sure self-interaction was handled correctly if intree is true.
+ */
+
+local bodyptr pskip; /* skip in force evaluation */
+local vector pos0; /* point to evaluate field */
+local real phi0; /* resulting potential */
+local vector acc0; /* resulting acceleration */
+local bool skipself; /* self-interaction skipped */
+local bool treeincest = FALSE; /* tree-incest occured */
+
+void hackgrav(bodyptr p, bool intree)
+{
+ pskip = p; /* exclude p from f.c. */
+ SETV(pos0, Pos(p)); /* set field point */
+ phi0 = 0.0; /* init total potential */
+ CLRV(acc0); /* and total acceleration */
+ n2bterm = nbcterm = 0; /* count body & cell terms */
+ skipself = FALSE; /* watch for tree-incest */
+ treescan((nodeptr) root); /* scan tree from root */
+ if (intree && ! skipself) { /* did tree-incest occur? */
+ if (! scanopt(options, "allow-incest")) /* treat as catastrophic? */
+ error("hackgrav: tree-incest detected\n");
+ if (! treeincest) /* for the first time? */
+ eprintf("\n[hackgrav: tree-incest detected]\n");
+ treeincest = TRUE; /* don't repeat warning */
+ }
+ Phi(p) = phi0; /* store total potential */
+ SETV(Acc(p), acc0); /* and acceleration */
+}
+
+/*
+ * TREESCAN: iterative routine to do force calculation, starting
+ * with node q, which is typically the root cell.
+ */
+
+local void treescan(nodeptr q)
+{
+ while (q != NULL) { /* while not at end of scan */
+ if (Type(q) == CELL && /* is node a cell and... */
+ subdivp(node2cell(q))) /* too close to accept? */
+ q = MoreN(q); /* follow to next level */
+ else { /* else accept this term */
+ if (q == (nodeptr) pskip) /* self-interaction? */
+ skipself = TRUE; /* then just skip it */
+ else { /* not self-interaction */
+ gravsub(q); /* so compute gravity */
+ if (Type(q) == BODY)
+ n2bterm++; /* count body-body */
+ else
+ nbcterm++; /* count body-cell */
+ }
+ q = Next(q); /* follow next link */
+ }
+ }
+}
+
+/*
+ * SUBDIVP: decide if cell q is too close to accept as a single
+ * term. Also sets qmem, dr, and drsq for use by gravsub.
+ */
+
+local cellptr qmem; /* data shared with gravsub */
+local vector dr; /* vector from q to pos0 */
+local real drsq; /* squared distance to pos0 */
+
+local bool subdivp(cellptr q)
+{
+ SUBV(dr, Pos(q), pos0); /* compute displacement */
+ DOTVP(drsq, dr, dr); /* and find dist squared */
+ qmem = q; /* remember we know them */
+ return (drsq < Rcrit2(q)); /* apply standard rule */
+}
+
+/*
+ * GRAVSUB: compute contribution of node q to gravitational field at
+ * point pos0, and add to running totals phi0 and acc0.
+ */
+
+local void gravsub(nodeptr q)
+{
+ real drab, phii, mor3;
+ vector ai, quaddr;
+ real dr5inv, phiquad, drquaddr;
+
+ if (q != (nodeptr) qmem) { /* cant use memorized data? */
+ SUBV(dr, Pos(q), pos0); /* then compute sep. */
+ DOTVP(drsq, dr, dr); /* and sep. squared */
+ }
+ drsq += eps*eps; /* use standard softening */
+ drab = rsqrt(drsq);
+ phii = Mass(q) / drab;
+ mor3 = phii / drsq;
+ MULVS(ai, dr, mor3);
+ phi0 -= phii; /* add to total grav. pot. */
+ ADDV(acc0, acc0, ai); /* ... and to total accel. */
+ if (usequad && Type(q) == CELL) { /* if cell, add quad term */
+ dr5inv = 1.0/(drsq * drsq * drab); /* form dr^-5 */
+ MULMV(quaddr, QuadN(q), dr); /* form Q * dr */
+ DOTVP(drquaddr, dr, quaddr); /* form dr * Q * dr */
+ phiquad = -0.5 * dr5inv * drquaddr; /* get quad. part of phi */
+ phi0 = phi0 + phiquad; /* increment potential */
+ phiquad = 5.0 * phiquad / drsq; /* save for acceleration */
+ MULVS(ai, dr, phiquad); /* components of acc. */
+ SUBV(acc0, acc0, ai); /* increment */
+ MULVS(quaddr, quaddr, dr5inv);
+ SUBV(acc0, acc0, quaddr); /* acceleration */
+ }
+}
diff --git a/test/ccured_olden/bh/input b/test/ccured_olden/bh/input
new file mode 100644
index 00000000..a72ad2d0
--- /dev/null
+++ b/test/ccured_olden/bh/input
@@ -0,0 +1,12 @@
+
+16384
+123
+
+0.025
+0.05
+1.0
+2.0
+5.0
+0.075
+0.25
+1
diff --git a/test/ccured_olden/bh/io.c b/test/ccured_olden/bh/io.c
new file mode 100644
index 00000000..cf2dbb9a
--- /dev/null
+++ b/test/ccured_olden/bh/io.c
@@ -0,0 +1,252 @@
+/****************************************************************************/
+/* IO.C: I/O routines for export version of hierarchical N-body code. */
+/* Public routines: inputdata(), initoutput(), stopoutput(), output(). */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "code.h"
+
+local void diagnostics(void);
+local void in_int(stream, int *);
+local void in_real(stream, real *);
+local void in_vector(stream, vector);
+local void out_int(stream, int);
+local void out_real(stream, real);
+local void out_vector(stream, vector);
+local void printvec(string, vector);
+
+/*
+ * INPUTDATA: read initial conditions from input file.
+ */
+
+void inputdata(void)
+{
+ stream instr;
+ permanent char headbuf[128];
+ int ndim;
+ bodyptr p;
+
+ instr = fopen(infile, "r"); /* open input stream */
+ if (instr == NULL)
+ error("inputdata: cannot find file %s\n", infile);
+ sprintf(headbuf, "Hierarchical code: input file %s", infile);
+ headline = headbuf;
+ in_int(instr, &nbody);
+ if (nbody < 1)
+ error("inputdata: nbody = %d is absurd\n", nbody);
+ in_int(instr, &ndim);
+ if (ndim != NDIM)
+ error("inputdata: ndim = %d is absurd\n", ndim);
+ in_real(instr, &tnow);
+ bodytab = (bodyptr) allocate(nbody * sizeof(body));
+ for (p = bodytab; p < bodytab+nbody; p++) /* loop over new bodies */
+ Type(p) = BODY; /* init body type */
+ for (p = bodytab; p < bodytab+nbody; p++)
+ in_real(instr, &Mass(p));
+ for (p = bodytab; p < bodytab+nbody; p++)
+ in_vector(instr, Pos(p));
+ for (p = bodytab; p < bodytab+nbody; p++)
+ in_vector(instr, Vel(p));
+ fclose(instr); /* close input stream */
+}
+
+/*
+ * INITOUTPUT: initialize output routines.
+ */
+
+local stream outstr; /* output stream pointer */
+
+void initoutput(void)
+{
+ printf("\n%s\n\n", headline); /* print headline, params */
+ printf("%10s%10s%10s%10s%10s%10s%10s\n", "nbody", "dtime", "eps",
+ "theta", "usequad", "dtout", "tstop");
+ printf("%10d%10.5f%10.4f%10.2f%10s%10.4f%10.4f\n\n", nbody, 1/freq, eps,
+ theta, usequad ? "true" : "false", 1/freqout, tstop);
+ if (*options != NULLCHR) /* print options, if any */
+ printf("\tOptions: %s\n\n", options);
+ printf("\n");
+ if (*outfile != NULLCHR) { /* output file specified? */
+ outstr = fopen(outfile, "w"); /* setup output stream */
+ if (outstr == NULL)
+ error("initoutput: cannot open file %s\n", outfile);
+ } else
+ outstr = NULL; /* turn off data output */
+}
+
+/*
+ * STOPOUTPUT: finish up after a run.
+ */
+
+void stopoutput(void)
+{
+ if (outstr != NULL)
+ fclose(outstr);
+}
+
+/*
+ * Counters and accumulators for output routines.
+ */
+
+local real mtot; /* total mass of N-body system */
+local real etot[3]; /* binding, kinetic, potential energy */
+local matrix keten; /* kinetic energy tensor */
+local matrix peten; /* potential energy tensor */
+local vector cmphase[2]; /* center of mass coordinates */
+local vector amvec; /* angular momentum vector */
+
+/*
+ * OUTPUT: compute diagnostics and output data.
+ */
+
+void output(void)
+{
+ int nttot, nbavg, ncavg;
+ bodyptr p;
+
+ diagnostics(); /* compute std diagnostics */
+ nttot = n2bcalc + nbccalc;
+ nbavg = (int) ((real) n2bcalc / (real) nbody);
+ ncavg = (int) ((real) nbccalc / (real) nbody);
+ printf("%10s%10s%10s%10s%10s%10s%10s\n", "tnow", "T+U",
+ "T/U", "nttot", "nbavg", "ncavg", "cputime");
+ printf("%10.3f%10.4f%10.4f%10d%10d%10d%10.2f\n\n", tnow, etot[0],
+ etot[1]/etot[2], nttot, nbavg, ncavg, cputime());
+ if (scanopt(options, "tree-report")) { /* report on tree structure */
+ printf("\t %20s%20s%20s\n", "rsize", "cellused", "maxlevel");
+ printf("\t %20.2f%20d%20d\n\n", rsize, cellused, maxlevel);
+ }
+ printvec("cm pos", cmphase[0]);
+ printvec("cm vel", cmphase[1]);
+ printvec("am vec", amvec);
+ printf("\n");
+ if (outstr != NULL && /* output stream open and */
+ (tout - 0.01 / freq) <= tnow) { /* ...time for next output? */
+ out_int(outstr, nbody); /* write particle data */
+ out_int(outstr, NDIM);
+ out_real(outstr, tnow);
+ for (p = bodytab; p < bodytab+nbody; p++)
+ out_real(outstr, Mass(p));
+ for (p = bodytab; p < bodytab+nbody; p++)
+ out_vector(outstr, Pos(p));
+ for (p = bodytab; p < bodytab+nbody; p++)
+ out_vector(outstr, Vel(p));
+ fflush(outstr); /* drain output buffer */
+ printf("\tParticle data written to file %s\n\n", outfile);
+ tout += 1 / freqout; /* schedule next data out */
+ }
+}
+
+/*
+ * DIAGNOSTICS: compute various dynamical diagnostics.
+ */
+
+local void diagnostics(void)
+{
+ register bodyptr p;
+ real velsq;
+ vector tmpv;
+ matrix tmpt;
+
+ mtot = 0.0; /* zero total mass */
+ etot[1] = etot[2] = 0.0; /* zero total KE and PE */
+ CLRM(keten); /* zero ke tensor */
+ CLRM(peten); /* zero pe tensor */
+ CLRV(cmphase[0]); /* zero c. of m. position */
+ CLRV(cmphase[1]); /* zero c. of m. velocity */
+ CLRV(amvec); /* zero am vector */
+ for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all particles */
+ mtot += Mass(p); /* sum particle masses */
+ DOTVP(velsq, Vel(p), Vel(p)); /* square vel vector */
+ etot[1] += 0.5 * Mass(p) * velsq; /* sum current KE */
+ etot[2] += 0.5 * Mass(p) * Phi(p); /* and current PE */
+ MULVS(tmpv, Vel(p), 0.5 * Mass(p)); /* sum 0.5 m v_i v_j */
+ OUTVP(tmpt, tmpv, Vel(p));
+ ADDM(keten, keten, tmpt);
+ MULVS(tmpv, Pos(p), Mass(p)); /* sum m r_i a_j */
+ OUTVP(tmpt, tmpv, Acc(p));
+ ADDM(peten, peten, tmpt);
+ MULVS(tmpv, Pos(p), Mass(p)); /* sum cm position */
+ ADDV(cmphase[0], cmphase[0], tmpv);
+ MULVS(tmpv, Vel(p), Mass(p)); /* sum cm momentum */
+ ADDV(cmphase[1], cmphase[1], tmpv);
+ CROSSVP(tmpv, Pos(p), Vel(p)); /* sum angular momentum */
+ MULVS(tmpv, tmpv, Mass(p));
+ ADDV(amvec, amvec, tmpv);
+ }
+ etot[0] = etot[1] + etot[2]; /* sum KE and PE */
+ DIVVS(cmphase[0], cmphase[0], mtot); /* normalize cm coords */
+ DIVVS(cmphase[1], cmphase[1], mtot);
+}
+
+/*
+ * Low-level input and output operations.
+ */
+
+local void in_int(stream str, int *iptr)
+{
+#ifdef CCURED
+ if((resetScanfCount(),
+ *iptr = ccured_fscanf_int(str, "%d"),
+ getScanfCount()) != 1)
+ error("in_int: input conversion error\n");
+#else
+ if (fscanf(str, "%d", iptr) != 1)
+ error("in_int: input conversion error\n");
+#endif
+}
+
+local void in_real(stream str, real *rptr)
+{
+ double tmp;
+
+#ifdef CCURED
+ if((resetScanfCount(),
+ tmp = ccured_fscanf_double(str, "%lf"),
+ getScanfCount()) != 1)
+#else
+ if (fscanf(str, "%lf", &tmp) != 1)
+#endif
+ error("in_real: input conversion error\n");
+ *rptr = tmp;
+}
+
+local void in_vector(stream str, vector vec)
+{
+ double tmpx, tmpy, tmpz;
+#ifdef CCURED
+ if((resetScanfCount(),
+ tmpx = ccured_fscanf_double(str, "%lf"),
+ tmpx = ccured_fscanf_double(str, "%lf"),
+ tmpx = ccured_fscanf_double(str, "%lf"),
+ getScanfCount()) != 3)
+#else
+ if (fscanf(str, "%lf%lf%lf", &tmpx, &tmpy, &tmpz) != 3)
+#endif
+ error("in_vector: input conversion error\n");
+
+ vec[0] = tmpx; vec[1] = tmpy; vec[2] = tmpz;
+}
+
+local void out_int(stream str, int ival)
+{
+ fprintf(str, " %d\n", ival);
+}
+
+local void out_real(stream str, real rval)
+{
+ fprintf(str, " %21.14E\n", rval);
+}
+
+local void out_vector(stream str, vector vec)
+{
+ fprintf(str, " %21.14E %21.14E %21.14E\n", vec[0], vec[1], vec[2]);
+}
+
+local void printvec(string name, vector vec)
+{
+ printf(" %10s%10.4f%10.4f%10.4f\n",
+ name, vec[0], vec[1], vec[2]);
+}
diff --git a/test/ccured_olden/bh/load.c b/test/ccured_olden/bh/load.c
new file mode 100644
index 00000000..ef1155fb
--- /dev/null
+++ b/test/ccured_olden/bh/load.c
@@ -0,0 +1,287 @@
+/****************************************************************************/
+/* LOAD.C: routines to create tree. Public routines: maketree(). */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "defs.h"
+
+local void newtree(void); /* flush existing tree */
+local cellptr makecell(void); /* create an empty cell */
+local void expandbox(bodyptr, int); /* set size of root cell */
+local void loadbody(bodyptr); /* load body into tree */
+local int subindex(bodyptr, cellptr); /* compute subcell index */
+local void hackcofm(cellptr, real); /* find centers of mass */
+local void setrcrit(cellptr, vector, real); /* set cell's crit. radius */
+local void threadtree(nodeptr, nodeptr); /* set next and more links */
+local void hackquad(cellptr); /* compute quad moments */
+
+/*
+ * MAKETREE: initialize tree structure for hierarchical force calculation
+ * from body array btab, which contains nbody bodies.
+ */
+
+local bool bh86, sw93; /* use alternate criteria */
+
+void maketree(bodyptr btab, int nbody)
+{
+ bodyptr p;
+
+ newtree(); /* flush existing tree, etc */
+ root = makecell(); /* allocate the root cell */
+ CLRV(Pos(root)); /* initialize the midpoint */
+ expandbox(btab, nbody); /* and expand cell to fit */
+ maxlevel = 0; /* init count of levels */
+ for (p = btab; p < btab+nbody; p++) /* loop over bodies... */
+ if (Mass(p) != 0.0) /* exclude test particles */
+ loadbody(p); /* and insert into tree */
+ bh86 = scanopt(options, "bh86"); /* set flags for alternate */
+ sw93 = scanopt(options, "sw93"); /* ...cell opening criteria */
+ if (bh86 && sw93) /* can't have both at once */
+ error("maketree: options bh86 and sw93 are incompatible\n");
+ hackcofm(root, rsize); /* find c-of-m coordinates */
+ threadtree((nodeptr) root, NULL); /* add Next and More links */
+ if (usequad) /* including quad moments? */
+ hackquad(root); /* assign Quad moments */
+}
+
+/*
+ * NEWTREE: reclaim cells in tree, prepare to build new one.
+ */
+
+local nodeptr freecell = NULL; /* list of free cells */
+
+local void newtree(void)
+{
+ permanent bool firstcall = TRUE;
+ nodeptr p;
+
+ if (! firstcall) { /* tree data to reclaim? */
+ p = (nodeptr) root; /* start with the root */
+ while (p != NULL) /* loop scanning tree */
+ if (Type(p) == CELL) { /* found cell to free? */
+ Next(p) = freecell; /* link to front of */
+ freecell = p; /* ...existing list */
+ p = MoreN(p); /* scan down tree */
+ } else /* skip over bodies */
+ p = Next(p); /* go on to next */
+ } else /* first time through */
+ firstcall = FALSE; /* so just note it */
+ root = NULL; /* flush existing tree */
+ cellused = 0; /* reset cell count */
+}
+
+/*
+ * MAKECELL: return pointer to free cell.
+ */
+
+local cellptr makecell(void)
+{
+ cellptr c;
+ int i;
+
+ if (freecell == NULL) { /* no free cells left? */
+ c = (cellptr) allocate(sizeof(cell)); /* allocate a new one */
+ #ifndef NO_PERF_CHANGES
+ Type(c) = CELL; /* initialize cell type */
+ #endif
+ } else { /* use existing free cell */
+ Type(freecell) = CELL; /* initialize cell type */
+ c = node2cell (freecell); /* take one on front */
+ freecell = Next(c); /* go on to next one */
+ }
+ #ifdef NO_PERF_CHANGES
+ Type(c) = CELL; /* initialize cell type */
+ #endif
+ for (i = 0; i < NSUB; i++) /* loop over subcells */
+ Subp(c)[i] = NULL; /* and empty each one */
+ cellused++; /* count one more cell */
+ return (c);
+}
+
+/*
+ * EXPANDBOX: find range of coordinate values (with respect to root)
+ * and expand root cell to fit. The size is doubled at each step to
+ * take advantage of exact representation of powers of two.
+ */
+
+local void expandbox(bodyptr btab, int nbody)
+{
+ real xyzmax;
+ bodyptr p;
+ int k;
+
+ xyzmax = 0.0;
+ for (p = btab; p < btab+nbody; p++)
+ for (k = 0; k < NDIM; k++)
+ xyzmax = MAX(xyzmax, rabs(Pos(p)[k] - Pos(root)[k]));
+ while (rsize < 2 * xyzmax)
+ rsize = 2 * rsize;
+}
+
+/*
+ * LOADBODY: descend tree and insert body p in appropriate place.
+ */
+
+local void loadbody(bodyptr p)
+{
+ cellptr q, c;
+ int qind, lev, k;
+ real qsize;
+
+ q = root; /* start with tree root */
+ qind = subindex(p, q); /* get index of subcell */
+ qsize = rsize; /* keep track of cell size */
+ lev = 0; /* count levels descended */
+ while (Subp(q)[qind] != NULL) { /* loop descending tree */
+ if (Type(Subp(q)[qind]) == BODY) { /* reached a "leaf"? */
+ c = makecell(); /* allocate new cell */
+ for (k = 0; k < NDIM; k++) /* initialize midpoint */
+ Pos(c)[k] = Pos(q)[k] + /* offset from parent */
+ (Pos(p)[k] < Pos(q)[k] ? - qsize : qsize) / 4;
+ Subp(c)[subindex(node2body(Subp(q)[qind]), c)] = Subp(q)[qind];
+ /* put body in cell */
+ Subp(q)[qind] = (nodeptr) c; /* link cell in tree */
+ }
+ q = node2cell(Subp(q)[qind]); /* advance to next level */
+ qind = subindex(p, q); /* get index to examine */
+ qsize = qsize / 2; /* shrink current cell */
+ lev++; /* count another level */
+ }
+ Subp(q)[qind] = (nodeptr) p; /* found place, store p */
+ maxlevel = MAX(maxlevel, lev); /* remember maximum level */
+}
+
+/*
+ * SUBINDEX: compute subcell index for body p in cell q.
+ */
+
+local int subindex(bodyptr p, cellptr q)
+{
+ int ind, k;
+
+ ind = 0; /* accumulate subcell index */
+ for (k = 0; k < NDIM; k++) /* loop over dimensions */
+ if (Pos(q)[k] <= Pos(p)[k]) /* if beyond midpoint */
+ ind += NSUB >> (k + 1); /* skip over subcells */
+ return (ind);
+}
+
+/*
+ * HACKCOFM: descend tree finding center-of-mass coordinates and
+ * setting critical cell radii.
+ */
+
+local void hackcofm(cellptr p, real psize)
+{
+ vector cmpos, tmpv;
+ int i, k;
+ nodeptr q;
+
+ Mass(p) = 0.0; /* init total mass... */
+ CLRV(cmpos); /* and center of mass */
+ for (i = 0; i < NSUB; i++) /* loop over subnodes */
+ if ((q = Subp(p)[i]) != NULL) { /* does subnode exist? */
+ if (Type(q) == CELL) /* and is it a cell? */
+ hackcofm(node2cell(q), psize/2); /* find subcell cm */
+ Mass(p) += Mass(q); /* sum total mass */
+ MULVS(tmpv, Pos(q), Mass(q)); /* weight pos by mass */
+ ADDV(cmpos, cmpos, tmpv); /* sum c-of-m position */
+ }
+ DIVVS(cmpos, cmpos, Mass(p)); /* rescale cms position */
+ for (k = 0; k < NDIM; k++) /* check tree structure... */
+ if (cmpos[k] < Pos(p)[k] - psize/2 || /* if out of bounds */
+ Pos(p)[k] + psize/2 <= cmpos[k]) /* in either direction */
+ error("hackcofm: tree structure error\n");
+ setrcrit(p, cmpos, psize); /* set critical radius */
+ SETV(Pos(p), cmpos); /* and center-of-mass pos */
+}
+
+/*
+ * SETRCRIT: assign critical radius for cell p, using center-of-mass
+ * position cmpos and cell size psize.
+ */
+
+local void setrcrit(cellptr p, vector cmpos, real psize)
+{
+ real rc, bmax2, dmin;
+ int k;
+
+ if (theta == 0.0) /* exact force calculation? */
+ rc = 2 * rsize; /* always open cells */
+ else if (bh86) /* use old BH criterion? */
+ rc = psize / theta; /* using size of cell */
+ else if (sw93) { /* use S&W's criterion? */
+ bmax2 = 0.0; /* compute max distance^2 */
+ for (k = 0; k < NDIM; k++) { /* loop over dimensions */
+ dmin = cmpos[k] - (Pos(p)[k] - psize/2);
+ /* dist from 1st corner */
+ bmax2 += rsqr(MAX(dmin, psize - dmin));
+ /* sum max distance^2 */
+ }
+ rc = rsqrt(bmax2) / theta; /* using max dist from cm */
+ } else { /* use new criterion? */
+ rc = psize / theta + distv(cmpos, Pos(p));
+ /* use size plus offset */
+ }
+ Rcrit2(p) = rsqr(rc); /* store square of radius */
+}
+
+/*
+ * THREADTREE: do a recursive treewalk starting from node p,
+ * with next stop n, installing Next and More links.
+ */
+
+local void threadtree(nodeptr p, nodeptr n)
+{
+ int ndesc, i;
+ nodeptr desc[NSUB+1];
+
+ Next(p) = n; /* link to next node */
+ if (Type(p) == CELL) { /* any children to thread? */
+ ndesc = 0; /* count extant children */
+ for (i = 0; i < NSUB; i++) /* loop over subnodes */
+ if (SubpN(p)[i] != NULL) /* found a live one? */
+ desc[ndesc++] = SubpN(p)[i]; /* store in table */
+ MoreN(p) = desc[0]; /* link to first child */
+ desc[ndesc] = n; /* end table with next */
+ for (i = 0; i < ndesc; i++) /* loop over children */
+ threadtree(desc[i], desc[i+1]); /* thread each w/ next */
+ }
+}
+
+/*
+ * HACKQUAD: descend tree, evaluating quadrupole moments. Note that this
+ * routine is coded so that the Subp() and Quad() components of a cell can
+ * share the same memory locations.
+ */
+
+local void hackquad(cellptr p)
+{
+ int i;
+ nodeptr psub[NSUB], q;
+ vector dr;
+ real drsq;
+ matrix drdr, Idrsq, tmpm;
+
+ for (i = 0; i < NSUB; i++) /* loop over subnodes */
+ psub[i] = Subp(p)[i]; /* copy each to safety */
+ CLRM(Quad(p)); /* init quadrupole moment */
+ for (i = 0; i < NSUB; i++) /* loop over subnodes */
+ if ((q = psub[i]) != NULL) { /* does subnode exist? */
+ if (Type(q) == CELL) /* and is it a call? */
+ hackquad(node2cell(q)); /* process it first */
+ SUBV(dr, Pos(q), Pos(p)); /* displacement vect. */
+ OUTVP(drdr, dr, dr); /* outer prod. of dr */
+ DOTVP(drsq, dr, dr); /* dot prod. dr * dr */
+ SETMI(Idrsq); /* init unit matrix */
+ MULMS(Idrsq, Idrsq, drsq); /* scale by dr * dr */
+ MULMS(tmpm, drdr, 3.0); /* scale drdr by 3 */
+ SUBM(tmpm, tmpm, Idrsq); /* form quad. moment */
+ MULMS(tmpm, tmpm, Mass(q)); /* from cm of subnode */
+ if (Type(q) == CELL) /* if subnode is cell */
+ ADDM(tmpm, tmpm, QuadN(q)); /* add its moment */
+ ADDM(Quad(p), Quad(p), tmpm); /* add to qm of cell */
+ }
+}
diff --git a/test/ccured_olden/bh/normalize.pl b/test/ccured_olden/bh/normalize.pl
new file mode 100755
index 00000000..102d372f
--- /dev/null
+++ b/test/ccured_olden/bh/normalize.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+# strip wallclock times from output so we can compare
+
+while ($line = <STDIN>) {
+ # I don't know if it's a problem, but we seem to get some difference
+ # about whether the 0's are positive or negative.. so let's change
+ # all occurrances of "-0.0000" to simply " 0.0000"
+ $line =~ s/-0\.0000/ 0.0000/g;
+
+ ($firstSix) = ($line =~ /^(\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+\S+$/);
+ if ($firstSix) {
+ # only output the first 6 columns
+ print ("$firstSix\n");
+ }
+ else {
+ # no match; print whole line
+ print ($line);
+ }
+}
diff --git a/test/ccured_olden/bh/real.h b/test/ccured_olden/bh/real.h
new file mode 100644
index 00000000..75e58d69
--- /dev/null
+++ b/test/ccured_olden/bh/real.h
@@ -0,0 +1,106 @@
+/****************************************************************************/
+/* REAL.H: include file to support compile-time specification of precision */
+/* in floating-point calculations. If the DOUBLEPREC symbol is defined to */
+/* the preprocessor, calculations are done in double precision; otherwise, */
+/* they may be done in single precision. */
+/* */
+/* Rationale: ANSI C enables programmers to write single-precision code, */
+/* but does not make it easy to change the precision of code at compile */
+/* time, since different functions names are used for floating and double */
+/* calculations. This package introduces the keyword "real", which may be */
+/* either float or double, and defines functions which compute with */
+/* real-valued numbers. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+/*
+ * REAL, REALPTR: real-valued number, and pointer to same.
+ */
+
+#ifndef DOUBLEPREC
+
+typedef float real, *realptr;
+
+#else
+
+typedef double real, *realptr;
+
+#endif
+
+/*
+ * RPROC: pointer to a real-valued function. This prototype does
+ * not specify the types of any arguments.
+ */
+
+typedef real (*rproc)();
+
+/*
+ * Include math.h to get prototypes for standard C math functions.
+ */
+
+#include <math.h>
+
+/*
+ * Real-valued library functions. Most of these are actually supplied
+ * by the standard C libraries.
+ */
+
+#ifndef DOUBLEPREC
+
+# define rsqrt sqrtf
+# define rsqr fsqr
+# define rsin sinf
+# define rcos cosf
+# define rtan tanf
+# define rasin asinf
+# define racos acosf
+# define ratan atanf
+# define ratan2 atan2f
+# define rlog logf
+# define rexp expf
+# define rlog10 log10f
+# define rsinh sinhf
+# define rcosh coshf
+# define rtanh tanhf
+# define rpow powf
+# define rabs fabsf
+# define rfloor floorf
+# define rceil ceilf
+
+/*
+ * These functions are not part of the standard C libraries.
+ */
+
+float fsqr(float); /* square function */
+
+#else
+
+# define rsqrt sqrt
+# define rsqr sqr
+# define rsin sin
+# define rcos cos
+# define rtan tan
+# define rasin asin
+# define racos acos
+# define ratan atan
+# define ratan2 atan2
+# define rlog log
+# define rexp exp
+# define rlog10 log10
+# define rsinh sinh
+# define rcosh cosh
+# define rtanh tanh
+# define rpow pow
+# define rabs fabs
+# define rfloor floor
+# define rceil ceil
+
+/*
+ * These functions are not part of the standard C libraries.
+ */
+
+double sqr(double); /* square function */
+
+#endif
diff --git a/test/ccured_olden/bh/stdinc.h b/test/ccured_olden/bh/stdinc.h
new file mode 100644
index 00000000..7d0d99f4
--- /dev/null
+++ b/test/ccured_olden/bh/stdinc.h
@@ -0,0 +1,97 @@
+/****************************************************************************/
+/* STDINC.H: standard include file for C programs. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+/*
+ * If not already loaded, include stdio.h.
+ */
+
+#ifndef FILE
+# include <stdio.h>
+#endif
+
+/*
+ * STREAM: a tasteful replacement for FILE *.
+ */
+
+typedef FILE *stream;
+
+/*
+ * NULL: denotes a pointer to nothing.
+ */
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/*
+ * GLOBAL: make something global when declared at file level; a workaround
+ * for the Strict-Ref/Def-initialization model in ANSI C. Predefine with
+ * something innocuous (like a comment) to actually allocate the data.
+ */
+
+#ifndef global
+# define global extern
+#endif
+
+/*
+ * LOCAL: make something local when declared at file level.
+ */
+
+#define local static
+
+/*
+ * PERMANENT: make data declared within a function static.
+ */
+
+#define permanent static
+
+/*
+ * BOOL, TRUE and FALSE: standard names for logical values.
+ */
+
+#ifndef TRUE
+ typedef short int bool;
+# define FALSE 0
+# define TRUE 1
+#endif
+
+/*
+ * STRING: for null-terminated character strings.
+ */
+
+typedef char *string;
+// sm: this isn't a performance change, it's a boxing crankiness change
+#define NULLCHR 0
+
+/*
+ * PROC, IPROC: pointers to procedures and integer-valued functions.
+ */
+
+typedef void (*proc)();
+typedef int (*iproc)();
+
+/*
+ * PI, etc. -- mathematical constants
+ */
+
+#define PI 3.14159265358979323846
+#define TWO_PI 6.28318530717958647693
+#define FOUR_PI 12.56637061435917295385
+#define HALF_PI 1.57079632679489661923
+#define FRTHRD_PI 4.18879020478639098462
+
+/*
+ * ABS: returns the absolute value of its argument
+ * MAX: returns the argument with the highest value
+ * MIN: returns the argument with the lowest value
+ */
+
+#define ABS(x) (((x) < 0) ? -(x) : (x))
+#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+
+
diff --git a/test/ccured_olden/bh/t.out b/test/ccured_olden/bh/t.out
new file mode 100644
index 00000000..fb9d37d0
--- /dev/null
+++ b/test/ccured_olden/bh/t.out
@@ -0,0 +1,462 @@
+
+Hierarchical code: Plummer model
+
+ nbody nbody dtime dtime eps eps theta
+ 1024 0.03125 0.0250 1.00 false 0.0000 0.0000
+
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.000 -0.2605 -0.4941 208234 85 118 0.00
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 0.0000 0.0000
+ am vec389878422291490397703532363838372957298630836310583829481040641106834769576818099195699704101879631937750115697603016463285311330468738817905192360225013760.0000-20133801167155037325873435901952.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.031 -0.2605 -0.4945 211569 89 116 0.00
+
+ cm pos48767523418596704838523946240732817085722217120112445882955090940174783491954759580198817590747865525311087993955204647833281515592585841124673085889618013847552.0000 -0.0000 -0.0000
+ cm vel 0.0000 -0.0000 0.0000
+ am vec1559236002703774781021278153871856315038382557752792736683869239689689036392574782890254419095632625220214596570955325121650716821745262456633791107947124940398935007346099179645105137569424172018554827397930584451172298405685470573741803483135862466270638747854944830385951648776192.0000-2440213101955252164764871308604279706618905144693668439643070676519663768507696241138708085832026275121811611967136537777542436519701974614016.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.062 -0.2606 -0.4949 213299 90 117 0.01
+
+ cm pos 0.0000 -0.0000 0.0000
+ cm vel 0.0000-59895636067774350999802060694796748793832479178531276624501570931901147191978903998797094450874790314219459403379011595168279797604476932033300509092028858118249159129140068208362592551338686730024901419420884197145543791729844646848781005668704382099371294815839075222644724858880.0000-34304238178392950207535507133362209821902207889607483682089075151755707595496927664474092813783398015223065446303850270623229965194082751029829057245842250731094016.0000
+ am vec -0.0000 0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.094 -0.2606 -0.4954 213209 91 116 0.01
+
+ cm pos993351373657076610062312278610554488534848731779782051627008.0000 0.0000-1118429463701675004166438727081989400588012830642169445393367040.0000
+ cm vel -0.00001585488814076009121115235303854341157810423314372413222796102290009989368447283916006261266276278410773098926643004648243979996411223785702280162904634372242876872108434991304556939983997976894184226482289262496438803898943600119361274014595750417965118622564688757121215375186329600.000019081946387294468538983897080928707648685678081325571021978053292334133644518624518107413086208.0000
+ am vec 0.0000-1052177637002965011136512.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.125 -0.2606 -0.4957 214475 90 118 0.01
+
+ cm pos -0.0000 0.0000-2302699907111971357846485514152419491468807814108223906017032377374227981869015717886039696953247825910868765310976.0000
+ cm vel-15507023057431145584565206457665247866817949289667375154357635978154825289910164352381842258913727693829009709173430125334544217761458477764531171623672700685829938676620090702262248564363444092928.00001229858773826100404973380226814223889095307742350714935231516126060487709192395267739090579310853010481524182411640591646460762296357852990674110125002654917720972780950718889540664250010801546101240516252270592.0000 -0.0000
+ am vec 0.0000 0.0022346444089834345117428848079358572499482380273334106571722441585638578168266752.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.156 -0.2606 -0.4959 212360 87 119 0.01
+
+ cm pos315921480765813379089838780091228970007395801379080371735261734862731027216739443148219556090994157732966814789913461059703725772528759757672071285717336064.0000-141259921440297382698655734668343831625855342291566246901055488.000082593600281560438693094027403777947973968116005409601641297845784918959006160639746528136088554574683678221271040.0000
+ cm vel-4633822142057183858197369124544939560116510065121526501724042717035591477898487686152006247597188881958265726378706767535675305089429388411932175731349037063598448888583815168.0000 0.0000 0.0000
+ am vec-3986756325765554751178454067643019324664159843216872557177762016988286941764021137382434923953830640315188084610358347806277632.0000-473363046102399837125588658668705710424574587720697404562895807652025236969343698054745390760567196189116864184986178458052959250756111857922780635472048854457811495568474457760813153893501852178505007104.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.188 -0.2606 -0.4961 215638 90 120 0.01
+
+ cm pos 0.0000 0.0000 0.0000
+ cm vel 0.0000 0.0000-715402636198797069701822383327363708052875939146530282568918901271078556048028349820618460494773931288880317520285883627978755879496318976.0000
+ am vec-13240639590929336102736471851418567661077666965175740458314592350710026001932396745522968121539503492339335306307686658086998950117663248149989180110225302093824.0000-4794368498948739564077828211221176487838842148215254315752251028576322570107431802779970902357249241757358193089742748237257425705341825318912.000015181075527895958806204102198713781288132931207305370313588684089996542314275071087747648185925542104706401467105280.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.219 -0.2607 -0.4962 213907 90 118 0.02
+
+ cm pos358304390221261030736494761262053873660818104605297471591777894910417593068265034855970239229512879832172748484651053980740868777455823682265763784091719812371261401648209163827194656525896630860429610269318442939702758948732928.0000353895558253845751255480850176210835386783235723651047855262247300602546428580449972907194718561432416957328592586525713713543738288710263101372734729893544445334077064984994004331842447814794113414869286912.0000 -0.0000
+ cm vel 0.000051478538076260147609324661887119700695360463938271445206883256722393008705007960879990682351577196189942401520994524698703970322516498232387577598885819083662497103847677801529344.0000 -0.0000
+ am vec-2623136701653195585794141396966373988766431089320327325512851627951458911761685020848908852791993066747540922418249024231102800628933611617991255288583884211595261667627200034514219164331431632516633984209102807608072009350581701268326711698539104549017223168.0000 0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.250 -0.2606 -0.4966 211413 88 118 0.02
+
+ cm pos32715052170377176594144725452710740791518547863861068996544730670845835402420285664334223583903115815470293942793507050350314662384000024692879342744314576896.0000 -0.0000-1559078566300162717897624445844426298177825521814863628001995701650865276586616064838724715736735303976513235205622778647748834406008785464562399987654831628091392.0000
+ cm vel -0.0000222211318481829860678065401797560246642410464069412484897981019091358610186742724957661876450484048016953147300859823541994042469704025130967227963711523127296.0000 -0.0000
+ am vec-7173881670514734427194339338834689155953107117676251548042953916401736462513284053275335345910655176557449450234347893935181468515192285319928422038080816945336365875200.0000 0.0000-1222427404997770496.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.281 -0.2607 -0.4968 212516 90 116 0.02
+
+ cm pos-190029402056222696118782436139960735564162265781213373117275130186929497395388587607668177533553689346918346401915950264223165522544402414138961194593170087811052328760227189147310043968527191429996144591575166383403894695118992117872760167267138791212597602584916305084723576700928.0000-763061469521186.6250 -0.0000
+ cm vel 0.0000 0.0000-29372985744500523738562497950096264916629543960484823952841942898144712689601378691847509486023812811600048904492537924588527545221120.0000
+ am vec -0.0000 -0.0000888146957076605102712107714052858211248176709741229376596680386667010953515136398978201012036207720967899486504353792.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.312 -0.2606 -0.4971 212043 91 115 0.02
+
+ cm pos-56546462200310022635210794849254085278148558263149032795056990675297068685400113023412567467653873022679640642441778815215756300360936002823501503987858536860205783938986022755823716644370605113412881909177909248.0000 -0.00006518995959258198466527212648524087444843462826259134659770362685670292204873719409889266784459025898514815407271806118295106582441292528586198089728.0000
+ cm vel113365132101979339298439168.000040837337821099740386253318931908230731427261783763678138675485347459456111784318155839335620698390205295125871651830430986261004342955090998671682525483274951913682547834250659812343705387748174144975643495990151120314006555112110438708684777881958753970494322615580058102853310995234816.0000-8271750520762773995180801771142763397805276936763268243366875234304.0000
+ am vec2922994468943541006620166639828598784.0000 0.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.344 -0.2606 -0.4974 210500 90 115 0.02
+
+ cm pos -0.0000 -124.6407 -0.0000
+ cm vel6001819926036494290396528636023431924287041337318797951557538297274228215829326924370269899804458218267917746898252635012800710793236406634913564339412057263219685601441695035486388235884363930423570447393211424627537416506878060179127121863581958913436680192.0000 -0.0000 0.0001
+ am vec-3616773584374425841520239327954730268919795568642617746685502830801977654140787702108258304.0000-17386008495170032302230932870364231267158793823681212144426257156810689781776193319519682095527647564732216296385580162351104.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.375 -0.2605 -0.4976 210875 90 115 0.03
+
+ cm pos2484951936182915939417650167293582724522865089712214449518269978333360855952949864882409235751676682406952510210730300793260417254407361992406406486142649929988112884851321153109027287875188929070190872093523968.000089096239.684914519619128271487631551311402708094746386123370103629738911006697714366936369692802519082946346894333470654118828400119095834784700536924158005148682390368039961302568130281231160037675013437675226927240766657046133401953992212792190784134853982776668574142958099065021364722313179432046219684074695426048.0000
+ cm vel 0.00001321925753339103592200945594347848231593167993063395553238947539443752334911885331741651426889625115526987976265724384000081879538984241927075766446857244064164042371884723962221993978458485897078667818306837091429577570210296639782912.000019214147284816494530652208901903192512506453848938485916535163999675637217361920.0000
+ am vec 0.000026832853489418133022093533133522353356202036261107217342778065459939669750884069516715770433592392699731518550215226919980327876361046418999421970629047837287469088742572910055363612365837799612605821616128.0000944627768013246909517781238529406765616539506746837900828021751330179475535898434725081997673045276300669862172626963198915512379436416658464981617980674719101713706751604134951190603514917356104919176721907463432779275866353962324941576536239408672250375602585290166423662948719263744.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.406 -0.2605 -0.4976 211891 91 115 0.03
+
+ cm pos-145575734455450364390472888281562841702172131216353354919018758144.0000 -0.0000622760459361952476629674378378173396657941815856958669448454635169078311463552565140269950167526938971978437845038045518301699163977219264421650572721628742539452357495116145285267480298592424001860163305251716124585640173420163960194680116183616414810112.0000
+ cm vel -0.0000923700119237036720235647948747547839435585794791057287852300742220346349609020501063401987420995638060982960145300145070678322694056049460091003514912768.0000-18294819220685837696386822316717600220831646794078562039109252334423737867032859209016289840028348211245766683355146370761638079889408.0000
+ am vec84347896327438881900052766466094709687673292339452185986411625762302043149371797140992412050233672879430002654873176331135417133230456832.0000-439341592299408492625434987462656.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.438 -0.2606 -0.4975 212886 92 115 0.03
+
+ cm pos 0.0000 0.00003089595385953746065442452617603829264784115340557570073893083220019746389601923125306099819014408928728460261413130286448599337970230360374606287697704899476917078776610552358951359457963065142322839697971172830347264.0000
+ cm vel-329754580980891486875747407375417575549365006054651412541380858093092833236753232182935608982610086547059580161161764354540732778152662735873363150284541204465529022054400.0000 0.0000-103908830512218744660734417026510660636683529613176344879145339835827789821477605598862081173816880993536011703299222197177873706756423950260081212376475576962630395223674613279398128768210447066198305316554712659809736067804825356611937484447016276170358144475141767168.0000
+ am vec-31866279385416210773197142884352.0000 0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.469 -0.2606 -0.4975 214848 93 115 0.03
+
+ cm pos7224111724422352714706235080250833347141246886409821722436692968139213874949223839424959914086834197560825502689656832.0000 -0.0000-61004628683756041022000656218347090928915513690597207830009953393258936961112967336602035687760415488747545844167404088156866605169963816519057052476477663168951437148726187534070660568166733161264522997276683412674977858869901069662585161501785708032394022658214325125120.0000
+ cm vel 0.0000 0.00001954954516231289424576512.0000
+ am vec-273419625010818823566465413951660052879423655285233148219008706695468924252535459513871368804581393274781985851066578743489288276074747789949731114227911219402877728777528125588263110507291847793943656156506115918925662257152.0000 0.0000-1419446172356323986265259071534187198843349828649060229773435121435455683497202587656473703437101381860968430194523179331770880587120234391104573589785262145733125536681200041556668823907422175232.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.500 -0.2604 -0.4976 212165 90 116 0.03
+
+ cm pos -0.0000164831660687959733322187964384399317580615495122205387064395991022895132439839585050034176.0000 0.0000
+ cm vel -0.0000 0.0000 0.0000
+ am vec 0.0000 -0.0000-4326436889443077377991583136081893394707706993321142780323953279764799793203977581628386726378402151236658116644301492989625244742716065013750500503568215320334217162769253120206559104041576948072025084561757995792804087152835886106907275067291754174099832685197353455703818240.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.531 -0.2605 -0.4974 212366 90 117 0.04
+
+ cm pos-5193655565329048664186489695833408905410542795749977352019413639742264802079070467861701581047278790017197708622277812436534317797960080267601019267814992026942272468677267778799849039391345508605107568407095595352487970040793540836282005483196673171051481706401574114270759498797424261075403014144.0000 -0.00002245171591305709517270312065310942262311464955758713693770069707995536528478576423585354757863318392276576881182944084886553432461025326177341089384784301639560974165087558350940546846860459689382716782850359415304093503821844837256275357871481509573167487194595754796198682510003263540319320276992.0000
+ cm vel 0.0000-20480988340732831768688924713361652143823980336974905474272608050801331518846861208535451802632401768666690617509984848014475264.0000 -0.0000
+ am vec-13085257721087411874583299039155978240.000028218186104472249195448653391568103714894530797884471996153495462735308208602978677778134005106387951319375323996257085554688.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.562 -0.2606 -0.4971 212423 92 115 0.04
+
+ cm pos1237944920454925237806384815732575008781172737613407986615582720.0000 0.0000-3631909347976786029364103215641341758871692200141574411717313145054141828711550533320831994042892088522420936078370939982084507622032624998344170562001489677099640615779734152245660797122182643712.0000
+ cm vel-48415551309695701869275528936262100829732248746471718912.0000-45947345104457839174024441671867282844378394525894107202340067245400328964000989745081832824886382098464888706900980825121129989659817981032869841265322577918018239596078533208488496070656.0000 -0.0000
+ am vec -0.00004129892291571269031986152478601425957049434438530552949959045368530568985117032191588330424859486246287473919309054155039478644736.00001081892199566021437263454574179525904867591578918243907745180876668332189806064484098191745459060349141250355762012871711844982852117271723067099041727818489118636904524943046060579810234971736623808512.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.594 -0.2606 -0.4969 212283 93 113 0.04
+
+ cm pos-1905025499151980034274534469510169958183059726500390841066136964584857044595008769483832775855757328868765739951565412159263311805689378283822856776293361039664752566992896.0000-18513680079660101951614321723674450322087698153924574957787525369758710122880996463101277685092974592.0000-34668040130561827018028167481500511513173163893890814855804555544421044200301242613014729079885399568859168737854867235643450768762682660956178060745389500292195388606373919512804742090441767635283717878972416.0000
+ cm vel 0.000015196951813461841521486836701756956444224784853043472160684046690647345415258299606291181347180308664850570968817091314870783992977099570040345054092861926102818687180028861911716827199242418377219961620622109576309460896548766071974088591420837080289752944580953196135514790168625152.000073554904292334743059715730810303602435661306680354774229327446824869118773461089173702460071928588404979370313608541723509082525406656287643985300302649540648731481451251740266150249905893364060668324763505203491298413935555574550679062173518529617194487345327992464715672028159465999727033844768964608.0000
+ am vec-684197197245369380398698148637883055842570268576757364617298949449267921781171801975276829201855225528320.0000-101744418212194207272053357245629914515538029536942357335986220181249137161741167925112262217088664669032302481415162247186608761084695649663825827839191677270482323076073977140992774265312718186910950787052359436270235436365878711934550292538851328.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.625 -0.2604 -0.4969 211770 93 113 0.04
+
+ cm pos 0.0000477331350524916948053883772533839128147297411143853893076742726311758736792767174763256895458672495066463879183880747854582352839947965489037557840421389341612462045821594521556459536974348288.0000 -0.0000
+ cm vel-2858268226850200346502218383360.0000 0.0000-2907011599666720609852821602358022994135563500065076026248411292895751132492574529244655633249813397504.0000
+ am vec 0.0000-6531189342130129070000606521798601487918648691487720724594371643455948782894424711116425641185310518667203477884735480097030217328391130496538172147552148206137835283709270612273699664117397375383197648578713395658650373702578796921425494016.0000-68667070982252915723296702559193038560287981944082791399757306142237668333667034347778320748130935054072547814251025111934915682925339040550628950325566279759769915211704604078479980904811981684055542081132630501814512996647644042941678205978129496143621587001442857564241920.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.656 -0.2604 -0.4966 213017 94 113 0.04
+
+ cm pos -0.0000 -0.0000 -0.0000
+ cm vel 0.0000 -0.0000750590408672451273437300408836574839027921292052670349195709767494793619393454218523365641587041784622753423705585876767321892764964924163371587839599634649299654248543362077075142218505781248.0000
+ am vec -0.0000-13723471631533968294277467902175311036416.00001483758922498238013885805186613205816736559669268686995754441163775919388535175792833681310410619463417637317680574765383078543996818093787967728736890272570506895503083446918402517893756334261234953860792458609848630254067934258081421275875940666980649450958118218366976.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.688 -0.2605 -0.4964 211250 93 113 0.05
+
+ cm pos -0.0000198174628871799517542138597507510961620835701551283799098466077037228119215914968513405186723670892610408156771537536223387415406585739079755883116708009272694747820311183360.0000-131324276297875931264929471087299892847514892244626681282688551648691616888001457114016177119227008467708400249163901084212992038296428336859749707148174328998330709756320508948310180026343874550108307712889137762960733682472664844214972149441046375946663939539494681513165526439468119799877706186752.0000
+ cm vel124034099279727094654203020633441177035091783218463709800993364625044003959514490457768757657726074391096296807294941918385930240.00003659564859968775261092082239720636556249203956012581449105408.000076241262963115679898798988812839344826385170285935382413786461902228635394912538601201241714092174577819370601331114548713789162841440256.0000
+ am vec-179674443543109063378572009866384474121168792461839681103739438547174628457367728363144452845382658219414837980312560310995123291864300818192462580437808178192575021246363489617810535917232689115815673860633034015933202432.0000 -0.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.719 -0.2604 -0.4964 211170 92 113 0.05
+
+ cm pos145181572433379571777139946417325705919906499813137239162026588627570142377672704.0000 0.0000 0.0000
+ cm vel-14699411899733106689748807015162959158928574151927680508283408582610553651996271049668200329027069014474383340647890531969702835931813294041310400068088607643420501257001311114625024.0000-9521153043431234469315064285137440158695082669030622056319028334025512244630488595266122214451398817990054436067606528.0000 -0.0000
+ am vec-12045879150450533245385545559568586746363904.0000 -0.0000282370292201227098153047249690389638229877729824366991622295073783734645635477603339207504681661661280265855802808138464704624240728435159978684445067601007176778669674535023631286380807247004502997493334363881735695800196660870713966592.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.750 -0.2604 -0.4962 210947 92 113 0.05
+
+ cm pos 0.00004016150150127866080115702772697064343311599368161510930366079707739755527702397349223712354183244031626000751060270526274828774967655549975664954845997684685101945345426985074177099767327076598845399690291969151723560978972620821288546335293145907562122021799087395967262474788208158390393595184524820480.0000 -0.0000
+ cm vel1623189956441278890339236934590139261744004405015153945450634855413269570561470320887698089531442018085140098312501085601792.000039614144650989338516600720234197699261284939531927656808969818614988261754401233520680503491425535440871903308118818892451938910743213451645617276982956705919381497071532482391941976057150696547496879359093165331853237281185630670459238489668986583272840060850842221795403059025249361970855936.000019953842142340906105848235594528849920.0000
+ am vec -0.0000101020281520834370545282970034795196376647900805355916366570812334772584448.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.781 -0.2604 -0.4959 210270 92 112 0.05
+
+ cm pos183216982574229823237929135776530763138372743348947347847026123070316598326169552160156796080224372210078933304712113237936839361582251484913999522092189287920693811526827844777238394731292944111275086008511741418370272922046088137072969984249954304.00004542087181785447321837764608.0000 -0.0000
+ cm vel -0.0000 -0.0000-31389825249711979418716765108862686175677335591130706700028969363859640627826770203814328510285646950663891739634364801403484790013768484673669254271581293757402632498440338281667791145469165721764370850192277306809766477227059966738999644301095448274307186749670227019777301380514726088487563159404544.0000
+ am vec -0.000047261817541080303488270043079981915504463622506656891202599058486139865388841418916956824506728448.0000-1288919023974797694999492118209282202558885036231325367462064947274027872132933953918428957658462369874349504167565234741960793244693243531359562674296471905720890227637767943591331742727452311439175983089013751808.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.812 -0.2604 -0.4957 210869 92 112 0.05
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel 0.0000-125363259473055671997958481619760307697368431794277880196569756912553936311224492964687569714221449790105838943734880632212773343123762005566579673883000863683772416.0000-1993462524.7853
+ am vec-443473364127565922047863933948357433712444532126085085956266669375488.0000-11713846823645734.000040470663841389663140511168328625478295313993293916996211176312269992282671807520592456708047757531392063952577053136105135635736447146994174442347093059106198404785907061019413148924469559573450659463168.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.844 -0.2603 -0.4954 210822 93 112 0.06
+
+ cm pos-452830899921176980625258599874812581697407939791561300037248272083638882389536192638724097049870575558046905964216985306497728560281436158111544920302200243413808997976456564051352410165130960347123112420688265162793846704202738036632758225910943242566376620032.0000 -0.0000-247511551281747162911845622313133480945357510273788577407812528727874976532452267474747118830624855354826667900188835672150381755289635005635704818441915912019357393169444994670613704924042705783897473165551845591667246506817135575040.0000
+ cm vel-1614028238200568527225314018603691985082252555144765878547514977979183585991442048962735855006715178879941287426527095903896541289105883967727431925130110731116120428733928127228600955970340777000695607583019739051316355576870198624932331520.0000-2601782495214573201114218113189376022825707404027140790035993004190098787307709002135351360492659029673200698993994305539388077270377680283551657607722909371116523437933800933356646162735615921228457871774803825172407225579946901504.0000 0.0000
+ am vec 0.0000 -0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.875 -0.2602 -0.4951 212697 95 112 0.06
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel-19306661078617178572224813626024776810283247475658843957761955076648689450881868930119045198143300505031129624938927233912212011985853796459698205029703609690121029440877560352624804919152470801348425013005673612234551401268513147028321410519535382177078103244800.0000143692216243397104163039105913045535485765615616.0000-1576070982493234714555901213991383788026837513132711553659830272.0000
+ am vec 0.00001660143119630844461519604255393637825986158357748963861762983166230499084409832766705060288154216208265287014277989390098829036785072853526199379928128242321538046142824029298509043571893903239026120647268112223540710376892492388665539137529010204825095987753249813001404416.0000-35347515084456870874061659067740772364112036557987124746872056727607627972778271378707235362132772643254059070743702210677691440983551764157998676574208.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.906 -0.2602 -0.4948 210581 93 112 0.06
+
+ cm pos -0.0000 0.0000 -0.0000
+ cm vel -0.0000-15247983296560167778211932486244175892736743727315918995683864287940855201792.0000-2042115773287014409525195569174679107691145344266070067382924354266339546800861614316835983554118203040470648672251757898394844818929420302672771570196283392.0000
+ am vec 0.0000 0.0000-5566552186488478500528006169116694511119799672381501876947652390499892715784927199341987602890752.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.938 -0.2603 -0.4943 209929 93 111 0.06
+
+ cm pos 0.0000641205551613691206880303639445048366115608121902868990187146794379122326538620092652091641681582240467759787189987370818689717364112598421028018358598922488416452376441067598800030393883453317684973257496012437585920.0000 -0.0000
+ cm vel-24724659289366587858294886602115186074016934183324274803344506056653279780018234227723166095291868765029101687505518039060589202196688699213144962341303524523032320482483137744760319247857050439346238205550816181354496.0000-1119539020855603051504330137968398282241153721107890093671038417468094790807690867702688539579545090159083432565236956306906287139789201512641872499354908014526820893089245805637467743427359508941484622391083272323057329448997102164667698953132049547624689845189578110855430228917178430002600869888.0000-454864934728744038083034251920848382049822504127291308337963210625178898542033120895153030023650330623712798830119522040115257281012213740349486183105180447180083791228300972089694437601864071547328641953014014906106676480169762610778463039815380288008022632682935020197732193870700589185284056251629568.0000
+ am vec27573568503517059612360030070320201203712.0000 -0.000022559461730324852197697168407153972405887776561437623314537676993837897947060384071216824610286001472386192283366731464737261503413164239163750532003693737298453769688210004869946971945051357184.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 0.969 -0.2603 -0.4939 212661 95 112 0.06
+
+ cm pos -0.0000-36072800456023979874988372895794798295976563261308928.0000 0.0000
+ cm vel-317601098528199476059069237855858684610872686976871767562721824287458184753783230640344668875149619938207619414727194450446640648804920659592264069916583590157316395904822085974127074449470660473017863617544723233239924793926828345779081600206650752276365312.0000 0.000034616983.9001
+ am vec-11873884539013573106688102081826956595495800772419848370340636494041758194447527612770538906281643421466624.0000-415573802432.6354 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.000 -0.2603 -0.4935 212223 94 112 0.07
+
+ cm pos-361349128.0290-180489240100535258692298298120580773637905896082720313266266035855500783144171592328663292694721485960782812352747157594259640844588824073220048866957476675814000489792350424037698361645665131063670976273972283165983525886926782464.0000-588284731426293800619387605200382877092778077833328494710470549796433579280747265196208062363899211266732521376930633482575188822102952962180133287335040742960510011909379385423155974170681301767013805600201564802308366139392.0000
+ cm vel-792348.0157 -0.000017276507867718913437973844405822559527936453572152956134533302493055014236859612269710280825892871802274901185962242732740801293707629252292784522485256435159128733404285307624612006848444873310208.0000
+ am vec -0.0000-211652718723195536133000463032621902998210238809916675034348243402279770537493182421902819328.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.031 -0.2602 -0.4932 211476 92 113 0.07
+
+ cm pos-40087524642354090177162277031779457754073858728524598212520900057000059718284318199972113410724016694017298307045434288302823422621896183743360904404979981899552555156330832451429990863531838725366022825401782993683338193002299392.0000-298361428424471336261568991321431171435208152318134458095066986543349181497290163584519803872491924676559858733652720317985013834748824577104739959651582856921088.0000 0.0000
+ cm vel 0.000039189313548520790111915155914815724226508096196157475815406514085043663410920491698918112609902455726474793014038334471819505653528309199655731845808083045960242270810300252900663754752.000031144847919189000.0000
+ am vec26970646631640567331310833479720917986653581565660843532315901690656368322918751533647592626739302873823172484389608571700382481765787667411138352822432434090341073472177209143725904610801927558528960775936308676731739381272546712892043193020424967848464577822807705070203285992648454691582027650899640320.000046738133919390499223561289862785435166572544.000024698848102251647841885312369614341628099684826013193458362979217437566747443306213017948712523578670080531014982128383520762362587973738028200519756275691552768.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.062 -0.2601 -0.4930 212513 95 112 0.07
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel7829004378509742740511201308831780786082047696482112982523869303137284076259681821487178674759694106945713393750023034383258037754503896656879192442684266798038478897793585905664.0000 -0.0000 0.0000
+ am vec 0.0000-398527518772044354721235707163681011104543258433165687083334248937031321304243226085982030141146645903040964485965719703950206948379370949627035558250362717770407154426597086377936502609822850620522783909313778431737632612513195878143492096.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.094 -0.2602 -0.4926 212473 96 111 0.07
+
+ cm pos-16241367798983889928342349697986462773700791589569878873119200334994408340840578865679601922351600412056695702512788486839737390001553408.0000 0.0000-5701981805246544340338493134313287476078307829232888376230201540209850478758766188011280230840358461462671132243001344.0000
+ cm vel66464063855427411598727294799838619468506496323432346489202933760.0000 -0.0000 0.0000
+ am vec -0.0000-37417900726557283051207837633825548022252641850827692164603303264768592850197226404776379926381525678998338597981087024390602752.00001492017855644381087980486176414782596806339684881920655203567761620992.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.125 -0.2601 -0.4924 212418 94 112 0.07
+
+ cm pos 0.0000-711820219261389002484083103518768000301683639186447940017119095003311272366543708744939575901072447673459822910034728318489773581764224585217153590961090283595820398858105722543085108253031913037015131991785988446669896493624021704540383213682693642603381558861756401006411776.00004683213089645237545539045399467265044027898253730019963078979383578052041222051926796589570077417948896732982410855041085164437800747008.0000
+ cm vel77513150682505029279103790970169343667701805875384195717014678133760291158822242486081400335994452583038528915116699834526606667181808276937445211887255579958286037842701315111972929924685529388446078111580160.0000 0.0000 -0.0000
+ am vec9059263110707568578116497975265644723676831585418624934771103766307015726810385337112561881634723102974654718100188493043660592688376631528302962769405658369193435359931078418230365420910633418004410737455655981292535053748065309945508787666368339516652162289428819474632704986550632448.00001143192904791952881014942925806970147119788558873372533569273678384853347926697505158141548564171206388323330905973176677101053053751620972964408710306326267965921195655590013300145488289564499615338723228516352.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.156 -0.2601 -0.4921 211307 94 111 0.08
+
+ cm pos46106792064030743980379413467179399668360544256.0000281295444016688699612918967705434093373162474641330499477105393684832366013265335376148639086493538841387157610470935813907382321506611625984.00009666517315509855716454739897669650270466078043503403206862105887915163665506802394218805863268327248294464047677884185386996866564882183999449870602261960210875183887243400031117284391263831851008.0000
+ cm vel54483249131201038533930473660635342738292736.000042980177895297377877502516865771765835744492885168030125650081947981240314053086066585773277184.0000 -0.0000
+ am vec-82289380027828886803819444844586043553295727463710427849410310072734958145577816754585430580037201759165483006525865319660881941871732719114753814328137388485088556194004506627854322782799380501409703222751141785461539159909589656478182014976.0000-726871714679445778173842567769245425023633446948028327361345672396639700828573012077971834771949486080.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.188 -0.2601 -0.4919 212029 96 110 0.08
+
+ cm pos1173952957709304029590898011596930729396102538056360773552057094915010373355989028375226875745267969723652622036914592501355018593257345504755067378001178111927966771445760.0000 -0.0000 0.0000
+ cm vel 0.000012186243317740609276404195489043283244467804926033971742984147954866408288950849306860246852118091060094444732867068830629362621831536705536.0000411625571163601.7500
+ am vec-635527994611094978402897787090918059797079752254911007374148601942359499949809925599953582266407866530488581074179512991378723937669962210969595063204437679538853175466771960964858528804582956348735488.0000141817699951243368228015948539755474907523085940521885692233263485261908509133659649720138179170237633715832664983728318757789781765486006712604213718994986339867038623787021972412282092344461471916249215905227828087810129841329573952391085060879748885051863805350324092487551170143193931148275663895107993600.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.219 -0.2600 -0.4916 211871 95 111 0.08
+
+ cm pos-120985436684330252264306434868021595142782550358351884824405228636331343470148887056832333804437210663697102098494040878623318130623475617337602852662867510372795897081745857471976555719416736434666602496.0000 0.0000-20024624269744565835179983237339164844817835131113178253451788001425028636652594227484360553228147260268669190746931200.0000
+ cm vel2011544566099649492048188597367058649199398113220349325532967374908254249724850543535600345675771997492938397036854347756681567704953638131023113331965998136143100834771646322866913280.0000251057729491665618972134555619496650866688.0000 -0.0000
+ am vec-6139049881771361014128301191904934535254493516299161416962253368222981211547715922415924983305625289358590882112203958869616692873767504933409840832451513942016.0000-88490438247454588592935039357726767452907794081541320262041509868748906391533595544388850087500096845902034797027175828160979203499841356338370751785794895980137278470909370374896915096900553727447093343131354871845608542480234941775872.0000-11810496874220612736909567086361690581163030733939317339782125233037888389926957133607177314205702239388674638666092641481288742904241549862433552808124420051397737375108575445959059727912721917978320064181436416.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.250 -0.2602 -0.4912 212729 93 113 0.08
+
+ cm pos1273435642992046424015604690932350824385579109700695775975310098298877739965830181769851460221753187451704625877772608257264622241162737726340988928.0000 -0.0000 -0.0000
+ cm vel 0.000081060712903431677612554564458042283076944989144070513214166401360296099559887826136146844312319309727175246851421018786049945172519984821769550879003762491392.0000 -0.0000
+ am vec14360477624155394185460570705344263839262659796327399723668122673092935650850943305308906552544214351736273370717352858888893591806647914594173096663670930837901188010461542958382541370903183194518942006385751762732433204219665924682627726342639105718935327798464211269971301381632425984.0000-462084768610954317182059675648.00009050058522339333588012706522864839983418904746538012955631953361524486110611351145396009056371728309085644996721887597318306764125478357933014123320804947192929875203875154479805701002074066426240602970067642944477744966385606437803356409189482585489581738901440036864.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.281 -0.2603 -0.4908 211198 91 115 0.08
+
+ cm pos 0.0000 -0.0000 -0.0000
+ cm vel 0.0000 -0.0000 0.0000
+ am vec-48498627658717163227016770141411545767562400375846123389116808828335983427584.0000-429760820705290235732805020479556150727558251621364111716012784101957340934333844903051458787857563947440436214697995593832406166643186117505775499250687675399902202072937011139217955731806924662796439626646177117561743378144889309864364179349162231639148855296.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.312 -0.2603 -0.4906 213544 93 115 0.09
+
+ cm pos-1310791951328902450962864801029672735925979813883184244239154751586586268557811988765934952938105334281660866812898909191842362087581056547512845303123846203703296.0000 -0.0000-1104912413265488.1250
+ cm vel-496140930645809553769392202647710502359571452556424972271517309661349855244249760533254282565100951737127472858492118761472.00002863847416899913766897408939450562123675266235497641053288621457129399587503348796473028441823971336221992098306051557742499699290286191542272.00002118819716729291538408868965489305002764552458818124819844833476608.0000
+ am vec-2767913261879495921154709700944301687352292175936086776336282226299577725522519443045240792923997597076632906622817295434327836891541743162204657341343213157276305832103154647183219837900641884698204319820653307451068809076531003392.0000 -0.0000331617118667140670569724590061211734618669056.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.344 -0.2602 -0.4906 212351 92 114 0.09
+
+ cm pos-2952230708914117461506679284584935233586489704176421136824254457562482032894084717253250524907219453272768081113858036447894916017965130316756834704354201393319917977860279044669440.0000886583622295715713705011893009567037044429263168844549318258480789887293711139580157372426878976.0000408142908406317387072609295578735954860105510377760916649676201459066078961079747545502740905439685250952971181299438498091223944689389490119836846556893249038535048151855654216509653504001666675290728370783272340330556921788320490089264977869238793791349066825728.0000
+ cm vel -0.0000 0.0000 -0.0000
+ am vec420626916235524775431397044859305902851734784067780201503987246343239383324282393884515461236086338864821660986089887430912237893901340524433373871208905023681122533358446140785814958631695144918906258124795681887927141447077568392704583660835612655616.0000-58241194026643089040554064644562583618088695352096309147172709730047005663746428866293277359182446348089090699385101400540415430492160.0000-474782950883144755455664860666399228933423692301612056581485821323740949279046485769931509310862974602478211197745044499085156346945863031986216469946718150400812237337285203501489564277703209624298478742475494506413162496.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.375 -0.2603 -0.4903 211854 91 115 0.09
+
+ cm pos 0.0000-149387766096574070026946462232401144057041135910815116199622323556540006390831292497608813805131998121800041471523182745361870732436850857698180699346948799013055040379727743637450038732873549798497202193397166549244579168990609234134151016095446485434368.0000 0.0000
+ cm vel 0.0000 0.0000 0.0000
+ am vec6483276144632959707142260210586001314762733906222826094011793505888633997780105007486483693272519671808.00004465327215326859545300225761942351511790133828270557228519747603655800389632.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.406 -0.2603 -0.4902 211998 91 115 0.09
+
+ cm pos -0.0000 0.0000 0.0000
+ cm vel574849778902932162667465850843028909967879540182192353443177471001849129580699303542784.0000 0.0000 -0.0000
+ am vec-1951760531337000174128688401473641675921595829988367435616348542454645433134706519096875752761721233163831873649852156701588030004267613799625785344.0000 0.00008337409578392775611401276811274841623984098736517680015191302255782196585952100398758985746807094936584991396739729576645988689518054190514041504515881296020278043708146963522663773051841051111311012064060220000931592696166788391045787587063330779749958809449321090323857774074959634965565901111296.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.438 -0.2604 -0.4900 210887 89 116 0.09
+
+ cm pos-1979304811692934348767704848639541416171171640639955935381111190324846855635818407156655871210390445913050854545311527227305866723181120287199506183659177747867024879099203225657015760992179624253304922360002184873087465611530097515466846477264169482972250109008893759071025819181967542145964310528.0000 -0.0000 0.0000
+ cm vel-152487974370892820518557674941954836184158044485993567317412029400462039617759762361699166879725435702422679528382865060057024376463957392541098047948677027044870507866197352812785408092426910431956477373579264.0000 0.0000 -0.0000
+ am vec1105168042386423777583519450879841917449956703937836276810521982286218395648.0000 -0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.469 -0.2604 -0.4899 210486 88 117 0.10
+
+ cm pos -0.0000 0.0000 0.0000
+ cm vel 0.0000 -0.0000 0.0000
+ am vec1351344885406422904868937054414736050693973460643962476160972548024709426274289029948163561575347800770268946641962093751144342232204572533709340985908379296727040.0000 0.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.500 -0.2604 -0.4897 210373 87 117 0.10
+
+ cm pos-2725280.0627 -0.0000283783563129400597350243800094820644500356220799942656.0000
+ cm vel -0.0000 0.0000 0.0000
+ am vec -0.000043896014770123912245841280976286021021600546969027443962003061554034738913220371373160602057945146602528226743743037578978632396919083765175039383481898291923935869181081953902500495661881847820968184531703181761854488514535163566870180237225415308626834156573583554379776.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.531 -0.2604 -0.4896 210691 88 117 0.10
+
+ cm pos10355310058783655135085586629928935950190888351966426203034475932945843379786654748797949191854729206009306596939733239151349155898348349417586056494634388821160839165463505700240650500606053752768669818601847444465224852593531819568006059940917925117983767263614883498481571825797688901763072.0000-3230235918674462511519796443928569731105704905339428723014429033637796452047295231414797139242719288094305089670382289276241428664501255842909864840022020796690310863821952348314197063793991187185578674656894293187863964558587080076989473658241688708689730009878637235740831053702884878165656656150528.0000-438403697707222419332951258955776.0000
+ cm vel 0.0000 0.0000-183750650419507818712961900347392.0000
+ am vec -0.0000 -0.0000-148833928483867088340060668267068801970966232686508882951812355679334669982170822817362399474814900416378768492691073781391461831854996996166639464529737469039470376640639799801759183503145284688619543572310772857695825827549789088626752193798953148135513844967218442409907180822211854336.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.562 -0.2603 -0.4895 211982 89 117 0.10
+
+ cm pos 0.00005684314831021164005739860443008135719517508714669595652103230062005424951694693293923421995646546827804809929186436351610867956780833042988788559346507194540747470128086515712.0000-8602197758631784112444631628921878990661862919844298846291062764552350235107600355780196738030096218648173645188094441993976459133470004771532223293526634913014278340715028648165784709167636312752128.0000
+ cm vel-1677115480490552137693753385714865930225808070229945668410008714127261971497400242890653597063751610784478459934525537610986975925204739019368923607087315061819860962497188709044410553927574144687387793050757965971128827477542190079541248.0000-1990974969502340762287064037769248518848173682664173595165164014673108223225786049030893280513146682593720440485397687824700962124138961164159203761652616867682713404509131518593762962037134640584162972946194222410893293556389809356663656803220487929856.0000-765983291793779229909275775196136993127268413204213982178997490589245531437603610227988517061730198090536381971088476226018892567643629943945264123546769150313328346983070520683195089420479794906760122688007206410122619613896022461124286368447096493927723922620416.0000
+ am vec11222722812604683071432374349855445824410622906488739583247633626923679879141840253177261685626948819724671880204215192038799619156411728118163701760.0000-20721296133684398824473624300333312854433571954856671330589620572967760582447498485487820609008216439685698591760722778329363378980510034762802483151605815439360077783602028683812697561669488438793640738686548461447307466550723283080099907641572930612118002148063995494400.0000131201676459368643345162059782646870277468970969112735584315467606306837003584256819994561216990187931171997604791994745240568634165765426198957382587825695973797573713514675708444703013446121417443127624543688560723357716931750856143774040280819691697686511787798957941877584725306335297536.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.594 -0.2602 -0.4894 213499 93 115 0.10
+
+ cm pos 0.0000 0.000060841271415260356419719197703369402391201850721933956656505535193776294698498126345382933333478341742767082206769500244630198184852783047131270462264003785624274337792.0000
+ cm vel 0.00002988289027997682802693983497751848374759464011395388493715503291889250668375404034786777329217118437365011920371230849645601103000134271894791446901050921490720855825203207522697438493901527828811325393933463185340888887921678060957375073571162831679438004985386492230975356928.0000 0.0000
+ am vec -0.000089678487447784630535911721631433827311764825159952537231832093551065171855032510222217984633427839467904278870962666597930982256223630049361285038151203819142836564770524067628027199296714196058952346837390072556161114795929882883518256528471185424384.000025932200433322053982192952106770811199263256861309132113964652146401362788488305797914716666117351861970284087561158656.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.625 -0.2602 -0.4892 214135 93 115 0.11
+
+ cm pos 0.0000 0.00007056187426054677493924467331418854824134159380228222538254402369341376679000430350937449706059256747929550390153556622978181448508607075631748689148266679893210927487859991568232827355043513036462620672.0000
+ cm vel9455060674212031355581578771901879604125962553448307097600.0000 -0.0000905195160386234450740183558978604172199329792.0000
+ am vec-423141848135701272406023541467931437765674988468612873501954086457315580459366065951211148150216363060684673068843401216.0000125443642165140234698752.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.656 -0.2600 -0.4891 212530 93 113 0.11
+
+ cm pos-386273933468065619173985927804919147162497699559454583073956195626200141480431296462331784685832260331541946668649339092828557868365025285470331254654019146977640448.0000 0.0000 -0.0000
+ cm vel 0.0000-4743632426372061158511341209478427049984.0000 -0.0000
+ am vec 0.0000-239671508137325590634863843622155833814981285994835032601270614092658842291431684040953083543400211671223431241893256294795585728275833182457304790693217990730311496158756774405546243960233591674835800011741111645345153024.0000-49006483581136799791641888765814459878578389959132951085056.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.688 -0.2601 -0.4889 212150 93 113 0.11
+
+ cm pos-1487877691353051346813520336017885540717350200296943508643073805990714385716229283691650362523040265199312029531821608704020321139945030962963163134541471336463841208991353543530388041219235849358604243269187075829952583083412936687997595390131332549137399808.000040431607191786761427104280235990972267707427172122822410294439962386301812790286105750215820881849925130162115777206193116849495846358291714289820468973224841672266675554448106613374976.0000 -13.2929
+ cm vel 0.0000-11643251192651135742202374015453695540762798882149109098056725959688116354151628798102358944813718655277288382536360031944704.000012214127581259127926085825924987929167959258823571338100692129269283544063459288458864672341430185836854168023394227560937501291047368584484892000666079498089560737607549155698544459847334549094863664733777468082618368.0000
+ am vec -0.0000 -0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.719 -0.2600 -0.4886 212527 94 113 0.11
+
+ cm pos 0.0000 0.0000 -0.0000
+ cm vel 0.0000-3740937435991330069141514183491046417018724477946895454742107797489367777651503363566961278124056778866179715697966013576194403899237985489979803333540796727857673818941610261164804175120928880995351628255464015896807598848228836431639275231370254795600210205941245916684764056020582400.0000-1496375143483907907202549691919803677796316676246757056763836145805924583914704210627705140289198718001323725056146519199218637170162712517048569896173780970119785070021058008587680219337631265573225593616508441974463349118760084145210014072326362943633595430732406036357386404506894336.0000
+ am vec 0.0000-506299477813233561955550035855612263891948926396244145840929646082785280.0000-2684.9614
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.750 -0.2599 -0.4882 214475 95 113 0.11
+
+ cm pos 0.0000570847744204721723776232849408.0000 -0.0000
+ cm vel 0.00009303607028694346891264.000021843041568780036096522682587664510881616848279258075297722038326617290297922028252001711372388398988242004113159931608364256454785453845998318603445295919123531750863561293824.0000
+ am vec-700071569435402216638880302142017276395802762833015640618709164542800072312688106229248106059986522595859399212024995928633470497187216698955866116508470781436116811431924583306537348690067597667317555776145055312004449953924960057820272526737333775511010924855369057378236567058532416561738678272.0000-243456541315596890445264715776.0000513257732687017105626118865708907316318212506516191568959281071650953163681544723234410311036750630144125272089295090772098918921862630415546013508832518229169275813676454317317868366413577531877798248124850876435237226083329977779649022787584.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.781 -0.2600 -0.4877 211398 91 114 0.12
+
+ cm pos 0.00002538767724261615285475428033880680745792006663422018224505287822966819943819333990035342023814910659520289606932673252852631492890355067269168256419129146222607384729988471012995209998647132004151371030385506262594086904318799071623748634288324608.0000 0.0000
+ cm vel -0.0000 0.0000268422787389278285271797801631966585676267684972192725911204560992505586897553306560563286382962671483260864624210919316562369601477625228271486094738593784420517225704744562865436386463903278971969808758943219470938662287088591831040.0000
+ am vec837892062621074121031680.0000-132651279428511567728320929138659552334884047864190970907987079738416890249908717681017771033859318913957888.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.812 -0.2601 -0.4874 212928 92 115 0.12
+
+ cm pos-23586053241842823245135748944728488268082619255211287698013802893306567539200322049913195098064694329682755230335454508989279460782795390976.0000 -0.000070241440506970972450347016211701085578921687019780308992.0000
+ cm vel91169676794840547328.0000 0.0000-312485246178787499574531571855500319353058166133757521121229774733759219541233886788987530449641599447143484297448632828066529280.0000
+ am vec550232859802479646353259776081220260536098562860406935542491773061360505706269193462888787400969095542198385491880413046180563628988464777570521854407192482773386701088342530776506535354974876767728366277722149418465140042290765040127300423723795199567519062541409814871944288389824512000.0000 -0.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.844 -0.2600 -0.4872 209464 86 117 0.12
+
+ cm pos -0.0000861707301861909157906082304171714659075465173542154683532334113325731026448459584625937939655005720799303189459229959264408324640317687966456790286446917991932177093416002625497464101695147794492865941398880256.0000252666357010502975621462733565699411846362936271402100906174394592957904290370055642541212933501991580773285441505073994549836783929041879040.0000
+ cm vel -0.0000 -0.0000 -0.0000
+ am vec-68490608628676523224720856037532446715355599902134806937953332627552826123427487958097226812935634441238287857672166554780652706213996011313215089657401764117079558838555354107722541273189961062652583734464235992056162569682944.000050456618611297886829757354662160239172340530892665167675282029350961536444081111603413846550938515835667024684958982650979252154412918582473548105930921184941240745984.0000-120410843834118465704508216705794312168686915722200368269626879150755912090314435502783930575303895989357367614664167186658206319076710106403318550304104380714027837600765589377793316349151402363932422582541971661783040.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.875 -0.2600 -0.4871 207897 83 119 0.12
+
+ cm pos -0.0000 0.0000 0.0000
+ cm vel-66162802194851512475163350965597860351791525983944182333141413076927899249282161844394703978496.0000 -0.0000 0.0000
+ am vec11728483527803680454149351588444369675886633479622192345377930537664319668078524032122394797090467856602221462554615236757693276373803464453850095590841455151417594286053991557048074315726107994886213012948800287237491790170924852578465945723095510069441227108775747918659444262567936.00006582488281356740775580741453573930863167553481592182449429463571380844369219358044538685193793404725407286121289479508977708874840016945614322852797958836589119901047151097491372353129411510272.0000 55.5065
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.906 -0.2599 -0.4871 209291 84 119 0.12
+
+ cm pos-6385407501542423356344755806443061288270744245271733424263391144172174415569762012748184697079435521029609866400382808289470873191676170913571324939072982848473856751012074292708062394740535433385954246656.0000-644869229673901272406156825127923652332469225409703600584491151210108331287504937876181340192947630284835925570132146913280.0000-437668470614432896856264312069700291181983845628797688075868840875753777929389526518230980868592805843229623026837241918909335524940739117863686355452748922059575422451777510660296836423288852539144758507851012664840256497425686700400193743706206982105132609568768.0000
+ cm vel91738830422806813664480961997610673203605020789679260166918736755863713592580010368522647064518273177534427837963926429695193972295091693219854824951171329605908614895111815547825621544646356421422716734241892684707921920.0000 -0.0000-121243859867853206740646684895908078250471680915696676398905280833144119433693665607520902571821648315567518233518535689457025036703426743927676786809940669086813177513589928090177251229303204492507220689006984235908654867421622446393976284930574252011503484928.0000
+ am vec1730582.0314 -0.0000 0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.938 -0.2599 -0.4870 208078 85 118 0.13
+
+ cm pos -0.0000 0.000033395408529609668545900087356741858626434687930018017154439459965780325063224136005981384682966837503201613185024.0000
+ cm vel 0.0000 -0.0000 -0.0000
+ am vec -0.0000 -0.000027389789144495919449353820222436523639840246996854991721274763678689626460095830498736729629319683568713072640.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 1.969 -0.2599 -0.4866 209032 86 117 0.13
+
+ cm pos2111126978254212190896032110963505517223209986732864848944365090759632121978562470532728892131013766535744886868300497309522872821223266685425227527010331702576239218982835496030604650047787545596755887684191381441436712960.0000 0.0000 -0.0000
+ cm vel -0.0000 -0.00006104709079556268540863807959478225927762031564494065094919212127507518028144940147284465673258377308288760565424364149004424205658263108939439948970025853793338794903375769680650550757274736944078163976294004356798080264175616.0000
+ am vec488557743030398575148588878336285926971136613741538351720650706714165379575801120920205589038035377801011584056505567547239551809464492359680.0000-57697119730310729279552069842804905030114276571601040109621109713774995878340556166888163327606900708361060685934377038941483270633441513572880889869444249990292808502969114770120113558694264365951053959505364172061258257620919380388284989440.0000 -0.0000
+
+ tnow tnow T+U T+U T/U T/U nttot
+ 2.000 -0.2600 -0.4864 208927 85 118 0.13
+
+ cm pos -0.0000-7367171723037541795094124434151519831792112034691840854356613346938449759299255409681446804939826068923097543887086184194872084937290308755997140123240935810488290471873347584000.0000 -0.0000
+ cm vel1006425721044856206000950062318392931898789353280274728983606558081433802045802861222818251758628458130325450533798649833034385272614630675871168760915286373163131622823786325277511140221770339768338481152.0000 0.0000-3144606464799229038263042987182620982102812047995738848406011579833110289130714648195731710966795169629551135090130652751542070025361201103838722768428417950975157384354212310551007046512936849306202144768.0000
+ am vec -0.0000-310585348040367212540466107933093981683394433536104796407776575005538885413170465336561984232650364092881885733701424906648778163815612342027107172352.0000187499318643495772928899061436600658023508244482639265792.0000
+
diff --git a/test/ccured_olden/bh/testit b/test/ccured_olden/bh/testit
new file mode 100755
index 00000000..8c758c7e
--- /dev/null
+++ b/test/ccured_olden/bh/testit
@@ -0,0 +1,21 @@
+#!/bin/sh
+# test a bh binary
+
+if [ "$1" = "" ]; then
+ echo "usage: $0 ./code.exe"
+ exit 0
+fi
+
+echo "running: $1 <data.in >data.out 2>/dev/null"
+if ! $1 <data.in >data.out 2>/dev/null; then
+ echo "$1 failed directly"
+ exit 2
+fi
+
+if ! perl ./normalize.pl <data.out | diff - data.orig.out >/dev/null; then
+ echo "$1 got the wrong answer"
+ exit 4
+else
+ echo "$1 seems to work"
+fi
+
diff --git a/test/ccured_olden/bh/trusted_bh.c b/test/ccured_olden/bh/trusted_bh.c
new file mode 100644
index 00000000..6c76f8c2
--- /dev/null
+++ b/test/ccured_olden/bh/trusted_bh.c
@@ -0,0 +1,92 @@
+#include "defs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#ifndef _MSVC
+#include <sys/times.h>
+#include <sys/param.h>
+#endif
+
+
+#ifndef NO_PERF_CHANGES
+///*
+// * ALLOCATE: memory allocation with error checking.
+// */
+//void *allocate(int nb)
+//{
+// void *mem;
+//
+// mem = (void *) calloc(nb, 1); /* calloc zeros memory */
+// if (mem == NULL) {
+// fprintf(stderr, "allocate: not enuf memory (%d bytes)\n", nb);
+// exit(1);
+// }
+// return (mem);
+//}
+#endif // NO_PERF_CHANGES
+
+
+
+// Now some wrappers
+typedef struct {
+ void *_p;
+ void *_b;
+} fatp_void;
+
+//fatp_void strcpy_fss(char *dest, char *src) {
+// fatp_void res;
+// strcpy(dest, src);
+// res._p = (void*)dest;
+// res._b = (void*)(dest + strlen(dest));
+// return res;
+//}
+
+#ifndef NO_PERF_CHANGES
+ #ifdef node2body
+ #undef node2body
+ #endif
+ bodyptr node2body(nodeptr x) {
+ return (bodyptr)x;
+ }
+#endif
+
+// And the wild version. I'm being lazy about types
+fatp_void node2body_ww(fatp_void x) {
+ return x;
+}
+
+typedef struct {
+ nodeptr *_p;
+ void *_b;
+ void *_e;
+} seqp_node;
+bodyptr node2body_sq(seqp_node x) {
+ if((void*)x._p < x._b || (void*)((char*)x._p + sizeof(body)) > x._e) {
+ fprintf(stderr, "Bounds check failed in node2body_sq\n");
+ exit(1);
+ }
+ return (bodyptr)x._p;
+}
+
+#ifndef NO_PERF_CHANGES
+ #ifdef node2cell
+ #undef node2cell
+ #endif
+ cellptr node2cell(nodeptr x) {
+ return (cellptr)x;
+ }
+#endif
+
+// And the wild version.. I'm being lazy about types
+fatp_void node2cell_ww(fatp_void x) {
+ return x;
+}
+
+cellptr node2cell_sq(seqp_node x) {
+ // if((void*)x._p < x._b || (void*)((char*)x._p + sizeof(cell)) > x._e) {
+ // fprintf(stderr, "Bounds check failed in node2cell_sq\n");
+ // exit(1);
+ // }
+ return (cellptr)x._p;
+}
diff --git a/test/ccured_olden/bh/util.c b/test/ccured_olden/bh/util.c
new file mode 100644
index 00000000..b7e3347d
--- /dev/null
+++ b/test/ccured_olden/bh/util.c
@@ -0,0 +1,152 @@
+/****************************************************************************/
+/* UTIL: various useful routines and functions. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#include "stdinc.h"
+#include "real.h"
+#include "vectmath.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#ifndef _MSVC
+#include <sys/times.h>
+#include <sys/param.h>
+#endif
+
+
+#ifndef HZ
+# include <time.h>
+# define HZ CLK_TCK
+#endif
+
+/*
+ * ERROR: print error message and exit.
+ */
+
+void error(string msg, ...)
+{
+ va_list args;
+
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+ exit(-1); /* quit with error status */
+}
+
+/*
+ * EPRINTF: print error message, but don't exit.
+ */
+
+void eprintf(string msg, ...)
+{
+ va_list args;
+
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+}
+
+
+extern double drand48(void); /* should be in math.h */
+
+/*
+ * XRANDOM: generate floating-point random number.
+ */
+
+real xrandom(real xl, real xh)
+{
+ real r = (real)rand() / (real)RAND_MAX;
+ return (xl + (xh - xl) * r);
+}
+
+/*
+ * RSQR: compute x*x.
+ */
+
+real rsqr(real x)
+{
+ return (x * x);
+}
+
+/*
+ * DISTV: subtract vectors and return distance between.
+ */
+
+real distv(vector v, vector u)
+{
+ real s, d;
+ int n = NDIM;
+
+ s = 0.0;
+ while (--n >= 0) {
+ d = (*v++) - (*u++);
+ s += d * d;
+ }
+ return (rsqrt(s));
+}
+
+/*
+ * STREQ: test for equality of strings.
+ */
+
+bool streq(string a, string b)
+{
+ return (strcmp(a, b) == 0);
+}
+
+/*
+ * SCANOPT: scan string of the form "word1,word2,..." for match. Warning:
+ * words must be separated by exactly one comma -- no spaces allowed!
+ */
+
+bool scanopt(string opt, string key)
+{
+ char *op, *kp;
+
+ op = (char *) opt; /* start scan of options */
+ while (*op != NULLCHR) { /* loop over words in opt */
+ kp = (char *) key; /* start at front of key */
+ while ((*op != ',' ? *op : NULLCHR) /* loop while this word */
+ == *kp) { /* ...matches text of key */
+ if (*kp++ == NULLCHR) /* at end of key word? */
+ return (TRUE); /* keyword found */
+ op++; /* else advance ptrs */
+ }
+ while (*op != NULLCHR && *op++ != ',') /* loop till end of word, */
+ continue; /* passing "," at end */
+ }
+ return (FALSE); /* keyword not found */
+}
+
+/*
+ * CPUTIME: compute CPU time in minutes.
+ */
+
+real cputime()
+{
+#ifdef _MSVC
+ return 1.0;
+#else
+ struct tms buffer;
+
+ if (times(&buffer) == -1)
+ error("times() call failed\n");
+ return (buffer.tms_utime / (60.0 * HZ));
+#endif
+}
+
+
+void *allocate(nb)
+int nb;
+{
+ void *mem;
+
+ mem = (void *) calloc(nb, 1); /* calloc zeros memory */
+ if (mem == NULL)
+ error("allocate: not enuf memory (%d bytes)\n", nb);
+ return (mem);
+}
diff --git a/test/ccured_olden/bh/vectmath.h b/test/ccured_olden/bh/vectmath.h
new file mode 100644
index 00000000..7d1b503a
--- /dev/null
+++ b/test/ccured_olden/bh/vectmath.h
@@ -0,0 +1,371 @@
+/****************************************************************************/
+/* VECTMATH.H: include file for vector/matrix operations. */
+/* */
+/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
+/* It's free because it's yours. */
+/****************************************************************************/
+
+#ifndef THREEDIM
+# ifndef TWODIM
+# ifndef NDIM
+# define THREEDIM
+# endif
+# endif
+#endif
+
+#ifdef TWODIM
+# define NDIM 2
+#endif
+
+#ifdef THREEDIM
+# define NDIM 3
+#endif
+
+typedef real vector[NDIM], matrix[NDIM][NDIM];
+
+/*
+ * Vector operations.
+ */
+
+#define CLRV(v) /* CLeaR Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = 0.0; \
+}
+
+#define UNITV(v,j) /* UNIT Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (_i == (j) ? 1.0 : 0.0); \
+}
+
+#define SETV(v,u) /* SET Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i]; \
+}
+
+#ifdef THREEDIM
+
+#ifdef NO_PERF_CHANGES
+
+#define ADDV(v,u,w) /* ADD Vector */ \
+{ \
+ real *_vp = (v), *_up = (u), *_wp = (w); \
+ *_vp++ = (*_up++) + (*_wp++); \
+ *_vp++ = (*_up++) + (*_wp++); \
+ *_vp = (*_up ) + (*_wp ); \
+}
+
+#define SUBV(v,u,w) /* SUBtract Vector */ \
+{ \
+ real *_vp = (v), *_up = (u), *_wp = (w); \
+ *_vp++ = (*_up++) - (*_wp++); \
+ *_vp++ = (*_up++) - (*_wp++); \
+ *_vp = (*_up ) - (*_wp ); \
+}
+
+#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \
+{ \
+ real *_vp = (v), *_up = (u); \
+ *_vp++ = (*_up++) * (s); \
+ *_vp++ = (*_up++) * (s); \
+ *_vp = (*_up ) * (s); \
+}
+
+#else // NO_PERF_CHANGES
+
+#define ADDV(v,u,w) /* ADD Vector */ \
+{ \
+ real *_vp = (v), *_up = (u), *_wp = (w); \
+ _vp[2] = _up[2] + _wp[2]; \
+ _vp[1] = _up[1] + _wp[1]; \
+ _vp[0] = _up[0] + _wp[0]; \
+}
+
+#define SUBV(v,u,w) /* SUBtract Vector */ \
+{ \
+ real *_vp = (v), *_up = (u), *_wp = (w); \
+ _vp[2] = _up[2] - _wp[2]; \
+ _vp[1] = _up[1] - _wp[1]; \
+ _vp[0] = _up[0] - _wp[0]; \
+}
+
+#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \
+{ \
+ real *_vp = (v), *_up = (u); \
+ _vp[2] = (_up[2]) * (s); \
+ _vp[1] = (_up[1]) * (s); \
+ _vp[0] = (_up[0]) * (s); \
+}
+#endif // NO_PERF_CHANGES
+
+#else
+
+#define ADDV(v,u,w) /* ADD Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i] + (w)[_i]; \
+}
+
+#define SUBV(v,u,w) /* SUBtract Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i] - (w)[_i]; \
+}
+
+#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i] * (s); \
+}
+
+#endif
+
+#define DIVVS(v,u,s) /* DIVide Vector by Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i] / (s); \
+}
+
+#ifdef THREEDIM
+
+#ifdef NO_PERF_CHANGES
+
+#define DOTVP(s,v,u) /* DOT Vector Product */ \
+{ \
+ real *_vp = (v), *_up = (u); \
+ (s) = (*_vp++) * (*_up++); \
+ (s) += (*_vp++) * (*_up++); \
+ (s) += (*_vp ) * (*_up ); \
+}
+
+#else // NO_PERF_CHANGES
+
+#define DOTVP(s,v,u) /* DOT Vector Product */ \
+{ \
+ real *_vp = (v), *_up = (u); \
+ (s) = (_vp[2]) * (_up[2]); \
+ (s) += (_vp[1]) * (_up[1]); \
+ (s) += (_vp[0]) * (_up[0]); \
+}
+
+#endif // NO_PERF_CHANGES
+
+#else
+
+#define DOTVP(s,v,u) /* DOT Vector Product */ \
+{ \
+ int _i; \
+ (s) = 0.0; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (s) += (v)[_i] * (u)[_i]; \
+}
+
+#endif
+
+#define ABSV(s,v) /* ABSolute value of a Vector */ \
+{ \
+ real _tmp; \
+ int _i; \
+ _tmp = 0.0; \
+ for (_i = 0; _i < NDIM; _i++) \
+ _tmp += (v)[_i] * (v)[_i]; \
+ (s) = rsqrt(_tmp); \
+}
+
+#define DISTV(s,u,v) /* DISTance between Vectors */ \
+{ \
+ real _tmp; \
+ int _i; \
+ _tmp = 0.0; \
+ for (_i = 0; _i < NDIM; _i++) \
+ _tmp += ((u)[_i]-(v)[_i]) * ((u)[_i]-(v)[_i]); \
+ (s) = rsqrt(_tmp); \
+}
+
+#ifdef TWODIM
+
+#define CROSSVP(s,v,u) /* CROSS Vector Product */ \
+{ \
+ (s) = (v)[0]*(u)[1] - (v)[1]*(u)[0]; \
+}
+
+#endif
+
+#ifdef THREEDIM
+
+#define CROSSVP(v,u,w) /* CROSS Vector Product */ \
+{ \
+ (v)[0] = (u)[1]*(w)[2] - (u)[2]*(w)[1]; \
+ (v)[1] = (u)[2]*(w)[0] - (u)[0]*(w)[2]; \
+ (v)[2] = (u)[0]*(w)[1] - (u)[1]*(w)[0]; \
+}
+
+#endif
+
+#define INCADDV(v,u) /* INCrementally ADD Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] += (u)[_i]; \
+}
+
+#define INCSUBV(v,u) /* INCrementally SUBtract Vector */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] -= (u)[_i]; \
+}
+
+#define INCMULVS(v,s) /* INCrementally MULtiply Vector by Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] *= (s); \
+}
+
+#define INCDIVVS(v,s) /* INCrementally DIVide Vector by Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] /= (s); \
+}
+
+/*
+ * Matrix operations.
+ */
+
+#define CLRM(p) /* CLeaR Matrix */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = 0.0; \
+}
+
+#define SETMI(p) /* SET Matrix to Identity */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (_i == _j ? 1.0 : 0.0); \
+}
+
+#define SETM(p,q) /* SET Matrix */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_i][_j]; \
+}
+
+#define TRANM(p,q) /* TRANspose Matrix */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_j][_i]; \
+}
+
+#define ADDM(p,q,r) /* ADD Matrix */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_i][_j] + (r)[_i][_j]; \
+}
+
+#define SUBM(p,q,r) /* SUBtract Matrix */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_i][_j] - (r)[_i][_j]; \
+}
+
+#define MULM(p,q,r) /* Multiply Matrix */ \
+{ \
+ int _i, _j, _k; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) { \
+ (p)[_i][_j] = 0.0; \
+ for (_k = 0; _k < NDIM; _k++) \
+ (p)[_i][_j] += (q)[_i][_k] * (r)[_k][_j]; \
+ } \
+}
+
+#define MULMS(p,q,s) /* MULtiply Matrix by Scalar */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_i][_j] * (s); \
+}
+
+#define DIVMS(p,q,s) /* DIVide Matrix by Scalar */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (q)[_i][_j] / (s); \
+}
+
+#define MULMV(v,p,u) /* MULtiply Matrix by Vector */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) { \
+ (v)[_i] = 0.0; \
+ for (_j = 0; _j < NDIM; _j++) \
+ (v)[_i] += (p)[_i][_j] * (u)[_j]; \
+ } \
+}
+
+#define OUTVP(p,v,u) /* OUTer Vector Product */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (v)[_i] * (u)[_j]; \
+}
+
+#define TRACEM(s,p) /* TRACE of Matrix */ \
+{ \
+ int _i; \
+ (s) = 0.0; \
+ for (_i = 0.0; _i < NDIM; _i++) \
+ (s) += (p)[_i][_i]; \
+}
+
+/*
+ * Misc. impure operations.
+ */
+
+#define SETVS(v,s) /* SET Vector to Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (s); \
+}
+
+#define ADDVS(v,u,s) /* ADD Vector and Scalar */ \
+{ \
+ int _i; \
+ for (_i = 0; _i < NDIM; _i++) \
+ (v)[_i] = (u)[_i] + (s); \
+}
+
+#define SETMS(p,s) /* SET Matrix to Scalar */ \
+{ \
+ int _i, _j; \
+ for (_i = 0; _i < NDIM; _i++) \
+ for (_j = 0; _j < NDIM; _j++) \
+ (p)[_i][_j] = (s); \
+}