Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 4638)
+++ /issm/trunk/src/c/Makefile.am	(revision 4639)
@@ -1,3 +1,3 @@
-INCLUDES = @DAKOTAINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@  @PLAPACKINCL@  @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@  @TRIANGLEINCL@
+INCLUDES = @DAKOTAINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@  @CHACOINCL@ @PLAPACKINCL@  @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@  @TRIANGLEINCL@ 
 
 #Compile serial library, and then try and compile parallel library
@@ -337,4 +337,9 @@
 					./modules/AddExternalResultx/AddExternalResultx.h\
 					./modules/AddExternalResultx/AddExternalResultx.cpp\
+					./modules/Chacox/Chacox.h\
+					./modules/Chacox/Chacox.cpp\
+					./modules/Chacox/input_parse.cpp\
+					./modules/Chacox/chaco_seconds.cpp\
+					./modules/Chacox/user_params.cpp\
 					./modules/ModelProcessorx/ModelProcessorx.h\
 					./modules/ModelProcessorx/ModelProcessorx.cpp\
@@ -888,4 +893,9 @@
 					./modules/AddExternalResultx/AddExternalResultx.h\
 					./modules/AddExternalResultx/AddExternalResultx.cpp\
+					./modules/Chacox/Chacox.h\
+					./modules/Chacox/Chacox.cpp\
+					./modules/Chacox/input_parse.cpp\
+					./modules/Chacox/chaco_seconds.cpp\
+					./modules/Chacox/user_params.cpp\
 					./modules/ModelProcessorx/ModelProcessorx.h\
 					./modules/ModelProcessorx/ModelProcessorx.cpp\
@@ -1146,5 +1156,5 @@
 endif
 
-LDADD =    ./libpISSM.a $(PETSCLIB)    $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(DAKOTALIB) $(METISLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) libOverload.a $(MULTITHREADINGLIB)
+LDADD =    ./libpISSM.a $(PETSCLIB)    $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) libOverload.a $(MULTITHREADINGLIB)
 
 issm_exe_SOURCES = solutions/issm.cpp
Index: /issm/trunk/src/c/modules/Chacox/Chacox.cpp
===================================================================
--- /issm/trunk/src/c/modules/Chacox/Chacox.cpp	(revision 4639)
+++ /issm/trunk/src/c/modules/Chacox/Chacox.cpp	(revision 4639)
@@ -0,0 +1,192 @@
+/* This software was developed by Bruce Hendrickson and Robert Leland   *
+ * at Sandia National Laboratories under US Department of Energy        *
+ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+
+#include "./Chacox.h"
+
+int Chacox(
+	int       nvtxs,		/* number of vertices in graph */
+	int      *start,		/* start of edge list for each vertex */
+	int      *adjacency,	/* edge list data */
+	int      *vwgts,		/* weights for all vertices */
+	float    *ewgts,		/* weights for all edges */
+	float    *x,
+	float    *y,
+	float    *z,			/* coordinates for inertial method */
+	short    *assignment,	/* set number of each vtx (length nvtxs+1) */
+	double   options[10],	/* architecture and partitioning options */
+	int      *nparts,		/* number of parts options */
+	double   *goal			/* desired set sizes */
+)
+{
+	extern int Using_Main;	/* is main routine being called? */
+	extern char *PARAMS_FILENAME;	/* name of file with parameter updates */
+	extern double EIGEN_TOLERANCE;	/* tolerance for eigen calculations */
+	extern int OUTPUT_ASSIGN;	/* whether to write assignment to file */
+	extern int DEBUG_MEMORY;	/* debug memory allocation and freeing? */
+	extern int DEBUG_TRACE;	/* trace main execution path */
+	extern int DEBUG_PARAMS;	/* debug flag for reading parameters */
+	extern long RANDOM_SEED;	/* seed for random number generators */
+	extern int ECHO;		/* controls amount of output */
+	extern int PROMPT;		/* prompt for input or not? */
+	extern int PRINT_HEADERS;	/* print lines for output sections? */
+	extern int MATCH_TYPE;      /* matching routine to call */
+	extern double input_time;	/* times data file input */
+	extern double start_time;	/* time partitioning starts */
+	FILE     *params_file;	/* file with parameter value updates */
+	int       global_method;	/* global partitioning method */
+	int       local_method;	/* local partitioning method */
+	double    eigtol;		/* tolerance in eigenvector calculation */
+	int       ndims;		/* dimension of recursive partitioning */
+	int       architecture;	/* 0 => hypercube, d => d-dimensional mesh */
+	int       ndims_tot;	/* total number of cube dimensions to divide */
+	int       mesh_dims[3];	/* dimensions of mesh of processors */
+	long      seed;		/* for random graph mutations */
+	int       rqi_flag;		/* use RQI/Symmlq eigensolver? */
+	int       vmax;		/* if so, how many vertices to coarsen down to? */
+	char      outassignname[NAME_LENGTH];	/* assignment output file name */
+	char      outfilename[NAME_LENGTH];	/* name of output file */
+	char     *outassignptr;	/* name or null pointer for output assignment */
+	char     *outfileptr;	/* name or null pointer for output file */
+	int       nprocs;		/* number of processors being divided into */
+	double    time;		/* timing marker */
+	int       flag;		/* return code from input routines */
+	double   *smalloc();	/* safe version of malloc */
+	//double    seconds();	/* returns elapsed time in seconds */
+	/*int       sfree(), interface(), affirm();
+	void      input_queries(), smalloc_stats(), read_params(), clear_timing();*/
+
+	int i,tvwgt;
+	double tgoal;
+
+
+	#ifdef _HAVE_CHACO_ //only works if Chaco library has been compiled in.
+
+	if (DEBUG_TRACE > 0) {
+		printf("<Entering main>\n");
+	}
+
+	if (PRINT_HEADERS) {
+		printf("\n                    Chaco 2.0\n");
+		printf("          Sandia National Laboratories\n\n");
+	}
+
+	Using_Main = TRUE;
+	params_file = fopen(PARAMS_FILENAME, "r");
+	if (params_file == NULL && DEBUG_PARAMS > 1) {
+		printf("Parameter file `%s' not found; using default parameters.\n",
+			   PARAMS_FILENAME);
+	}
+
+	start_time = time = chaco_seconds();
+
+	read_params(params_file);
+
+	flag = input_parse(outassignname, outfilename,
+			  &architecture, &ndims_tot, mesh_dims,
+			  &global_method, &local_method, &rqi_flag, &vmax, &ndims, &nprocs,
+			  options, nparts);
+	if (flag)
+		return(flag);
+
+	if (OUTPUT_ASSIGN > 0)
+		outassignptr = outassignname;
+	else
+		outassignptr = NULL;
+
+	if (ECHO < 0)
+		outfileptr = outfilename;
+	else
+		outfileptr = NULL;
+
+	if ((int)options[OPT_VWGTS] && vwgts) {
+		printf("%s -- Applying weights for %d vertices.\n",
+			   __FUNCT__,nvtxs);
+		tvwgt = 0;
+		for (i=0; i<nvtxs; i++)
+			tvwgt += vwgts[i];
+	}
+	else {
+		tvwgt = nvtxs;
+		if      ( (int)options[OPT_VWGTS] && !vwgts)
+			printf("%s -- Vertex weight flag=%d, but no vertex weights specified.\n",
+				   __FUNCT__,options[OPT_VWGTS]);
+		else if (!(int)options[OPT_VWGTS] &&  vwgts)
+			printf("%s -- Vertex weight flag=%d, so specified vertex weights ignored.\n",
+				   __FUNCT__,options[OPT_VWGTS]);
+	}
+
+	if ((int)options[OPT_EWGTS] && ewgts) {
+		printf("%s -- Applying weights for %d edges.\n",
+			   __FUNCT__,start[nvtxs]/2);
+	}
+	else {
+		if      ( (int)options[OPT_EWGTS] && !ewgts)
+			printf("%s -- Edge weight flag=%d, but no edge weights specified.\n",
+				   __FUNCT__,options[OPT_EWGTS]);
+		else if (!(int)options[OPT_EWGTS] &&  ewgts)
+			printf("%s -- Edge weight flag=%d, so specified edge weights ignored.\n",
+				   __FUNCT__,options[OPT_EWGTS]);
+	}
+
+    if (goal) {
+        printf("%s -- Applying goals for %d sets.\n",
+               __FUNCT__,nprocs);
+        tgoal = 0.;
+        for (i=0; i<nprocs; i++)
+            tgoal += goal[i];
+        for (i=0; i<nprocs; i++)
+            goal[i] *= (double)tvwgt/tgoal;
+    }
+
+	input_time += chaco_seconds() - time;
+
+	if (options[OPT_EIGTOL] > 0)
+		eigtol = options[OPT_EIGTOL];
+	else
+		eigtol = EIGEN_TOLERANCE;
+	if ((int)options[OPT_SEED] > 0)
+		seed = (int)options[OPT_SEED];
+	else
+		seed = RANDOM_SEED;
+
+/*  Chaco numbers vertices from 1 and the Matlab sparse data structure
+	numbers rows from 0, so increment the row indices for each column. */
+
+	for (i=0; i<start[nvtxs]; adjacency[i++]++);
+
+	printf("\n%s -- Calling Chaco interface:\n\n",
+		   __FUNCT__);
+	flag = interface(nvtxs, start, adjacency,
+		  ((int)options[OPT_VWGTS] && vwgts ? vwgts : NULL),
+		  ((int)options[OPT_EWGTS] && ewgts ? ewgts : NULL),
+		  x, y, z,
+		  outassignptr, outfileptr,
+		  assignment,
+		  architecture, ndims_tot, mesh_dims, goal,
+		  global_method, local_method, rqi_flag, vmax, ndims,
+		  eigtol, seed);
+	printf("\n%s -- Chaco interface returning flag=%d.\n",
+		   __FUNCT__,flag);
+
+/*  Reset adjacency matrix in case calling function needs it.  */
+
+	for (i=0; i<start[nvtxs]; adjacency[i++]--);
+
+	if (DEBUG_MEMORY > 0) {
+		printf("\n");
+		smalloc_stats();
+	}
+
+	if (params_file != NULL)
+		fclose(params_file);
+
+	if (DEBUG_TRACE > 1) {
+		printf("<Leaving main>\n");
+	}
+	
+	return(0);
+
+
+	#endif //ifdef _HAVE_CHACO_
+}
Index: /issm/trunk/src/c/modules/Chacox/Chacox.h
===================================================================
--- /issm/trunk/src/c/modules/Chacox/Chacox.h	(revision 4639)
+++ /issm/trunk/src/c/modules/Chacox/Chacox.h	(revision 4639)
@@ -0,0 +1,47 @@
+/*!\file:  Chacoxx.h
+ * \brief header file for Chaco partitioner
+ */ 
+
+#ifndef _CHACOX_H
+#define _CHACOX_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef _HAVE_CHACO_ //only works if dakota library has been compiled in.
+
+#include "chaco.h"
+
+#define    OPT_GLOBAL    0
+#define    OPT_LOCAL     1
+#define    OPT_VWGTS     2
+#define    OPT_EWGTS     3
+#define    OPT_ARCH      4
+#define    OPT_NDIMS     5
+#define    OPT_VMAX      6
+#define    OPT_RQI       7
+#define    OPT_EIGTOL    8
+#define    OPT_SEED      9
+
+#endif
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+int Chacox( int nvtxs, int *start, int *adjacency,int *vwgts, float *ewgts, float *x, float *y, float *z, short *assignment, double  options[10], int *nparts, double *goal);
+int input_parse( char *outassignname, char *outfilename, int *architecture, int *ndims_tot, int mesh_dims[3], int *global_method, int *local_method, 
+		int *rqi_flag, int *vmax, int *ndims, int *nprocs, double options[10], int *nparts);
+double    chaco_seconds(void);
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Chacox"
+
+
+#endif  /* _CHACOX_H */
Index: /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp
===================================================================
--- /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp	(revision 4639)
+++ /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp	(revision 4639)
@@ -0,0 +1,29 @@
+/*This is needed, because the chaco library defines a "C" function seconds that conflicts with the Metis version.: */
+
+#include   <sys/time.h>
+#include   <sys/resource.h>
+
+double chaco_seconds(void){
+    
+	double    curtime;
+
+#ifdef RUSAGE_SELF
+
+/* This timer is faster and more robust (if it exists). */
+    struct rusage rusage;
+    int getrusage();
+ 
+    getrusage(RUSAGE_SELF, &rusage);
+    curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
+	    1.0e-6 * (rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec));
+
+#else
+
+/* ANSI timer, but lower resolution & wraps around after ~36 minutes. */
+
+    curtime = clock()/((double) CLOCKS_PER_SEC);
+
+#endif
+
+    return (curtime);
+}
Index: /issm/trunk/src/c/modules/Chacox/input_parse.cpp
===================================================================
--- /issm/trunk/src/c/modules/Chacox/input_parse.cpp	(revision 4639)
+++ /issm/trunk/src/c/modules/Chacox/input_parse.cpp	(revision 4639)
@@ -0,0 +1,260 @@
+/*!\file:  input_parse.cpp
+ * \brief  needed by Chacox.cpp
+ */ 
+
+#include "./Chacox.h"
+
+
+#undef __FUNCT__ 
+#define __FUNCT__  "input_parse"
+
+int      input_parse(
+	char     *outassignname,	/* name of assignment output file */
+	char     *outfilename,		/* name of file for outputing run results */
+	int      *architecture,		/* 0=> hypercube, d=> d-dimensional mesh */
+	int      *ndims_tot,		/* target number of hypercube dimensions */
+	int       mesh_dims[3],		/* mesh dimensions */
+	int      *global_method,	/* what global partitioning strategy to use? */
+	int      *local_method,		/* what local refinement strategy to use? */
+	int      *rqi_flag,		/* should I use multilevel eigensolver? */
+	int      *vmax,			/* if so, how far should I coarsen? */
+	int      *ndims,		/* number of divisions at each stage */
+	int      *nprocs,		/* number of processors being divided into */
+	double   options[10],	/* architecture and partitioning options */
+	int      *nparts		/* number of parts options */
+)
+{
+	extern int SEQUENCE;	/* sequence instead of partition graph? */
+	extern int ARCHITECTURE;	/* 0=> hypercube, d=> d-dimensional mesh */
+	extern int OUTPUT_ASSIGN;	/* write assignments to file? */
+	extern int ECHO;		/* copy input to screen? results to file? */
+	extern int DEBUG_TRACE;	/* trace main execution path */
+	extern int PROMPT;		/* prompt for input? */
+	extern int MATCH_TYPE;      /* max-matching routine to call */
+	int       eigensolver;	/* which kind of eigensolver to use */
+
+	if (DEBUG_TRACE > 0) {
+		printf("<Entering input_parse>\n");
+	}
+
+	if (PROMPT) {
+		printf("Parallel machine architecture:\n");
+		printf("  (0) Hypercube\n");
+		printf("  (1) One-dimensional mesh\n");
+		printf("  (2) Two-dimensional mesh\n");
+		printf("  (3) Three-dimensional mesh\n");
+	}
+	*architecture = (int)options[OPT_ARCH];
+	if (*architecture < 0 || *architecture > 3) {
+		printf("%s -- Architecture %d must be between 0 and 3.\n",
+			   __FUNCT__,options[OPT_ARCH]);
+		return(-1);
+	}
+
+	/* Name output assignment file. */
+	if (PROMPT)
+		printf("Assignment output file: ");
+	outassignname = NULL;
+
+	/* Name output results file. */
+	if (PROMPT)
+		printf("File name for saving run results: ");
+	outfilename = NULL;
+
+	/* Initialize the method flags */
+	*rqi_flag = 0;
+	*global_method = 0;
+
+	/* Get global method, if any. */
+	if (SEQUENCE) {
+		*global_method = 2;
+	}
+	else {
+		if (PROMPT) {
+			printf("Global partitioning method:\n");
+			printf("  (1) Multilevel-KL\n");
+			printf("  (2) Spectral\n");
+			printf("  (3) Inertial\n");
+			printf("  (4) Linear\n");
+			printf("  (5) Random\n");
+			printf("  (6) Scattered\n");
+			printf("  (7) Read-from-file\n");
+		}
+		*global_method = (int)options[OPT_GLOBAL];
+		if (*global_method < 1 || *global_method > 7) {
+			printf("%s -- Global method %d must be between 1 and 7.\n",
+				   __FUNCT__,options[OPT_GLOBAL]);
+			return(-1);
+		}
+	}
+
+	if (*global_method == 7) {	/* Name and open input assignment file. */
+		if (PROMPT)
+			printf("Assignment input file: ");
+	}
+
+	else if (*global_method == 3) {
+		if (PROMPT)
+			printf("Geometry input file name: ");
+	}
+
+	else if (*global_method == 2) {
+		if (PROMPT) {
+			printf("Eigensolver:\n");
+			printf("  (1) Multilevel RQI/Symmlq\n");
+			printf("  (2) Lanczos\n"); 
+		}
+		eigensolver = (int)options[OPT_RQI];
+		if (eigensolver < 0 || eigensolver > 2) {
+			printf("%s -- RQI/Symmlq flag %d must be between 0 and 2.\n",
+				   __FUNCT__,options[OPT_RQI]);
+			return(-1);
+		}
+		if (eigensolver == 1) {
+			if (MATCH_TYPE == 5) {	/* geometric matching */
+				if (PROMPT)
+					printf("Geometry input file name: ");
+			}
+			*rqi_flag = 1;
+			if (PROMPT)
+				printf("Number of vertices to coarsen down to: ");
+			*vmax = (int)options[OPT_VMAX];
+			if (*vmax <= 0) {
+				printf("%s -- Vmax %d must be greater then 0.\n",
+					   __FUNCT__,options[OPT_VMAX]);
+				return(-1);
+			}
+		}
+		else if (eigensolver == 0 || eigensolver == 2) {
+			*rqi_flag = 0;
+		}
+	}
+
+	else if (*global_method == 1) {
+		if (MATCH_TYPE == 5) {		/* geometric matching */
+			if (PROMPT)
+				printf("Geometry input file name: ");
+		}
+		if (PROMPT)
+			printf("Number of vertices to coarsen down to: ");
+		*vmax = (int)options[OPT_VMAX];
+		if (*vmax <= 0) {
+			printf("%s -- Vmax %d must be greater then 0.\n",
+				   __FUNCT__,options[OPT_VMAX]);
+			return(-1);
+		}
+	}
+
+	if (SEQUENCE) {
+		*local_method = 2;
+		if (*architecture == 0) {
+			*ndims_tot = 1;
+		}
+		else if (*architecture > 0) {
+			mesh_dims[0] = 2;
+			mesh_dims[1] = mesh_dims[2] = 1;
+		}
+		*ndims = 1;
+		goto End_Label;
+	}
+
+	/* Get local method, if any */
+	*local_method = 0;
+	if (*global_method == 1)
+		*local_method = 1;
+	else {
+		if (PROMPT) {
+			printf("Local refinement method:\n");
+			printf("  (1) Kernighan-Lin\n");
+			printf("  (2) None\n");
+		}
+		*local_method = (int)options[OPT_LOCAL];
+		if (*local_method < 1 || *local_method > 2) {
+			printf("%s -- Local method %d must be 1 and 2.\n",
+				   __FUNCT__,options[OPT_LOCAL]);
+			return(-1);
+		}
+	}
+
+	/* Now learn about the parallel architecture. */
+	if (*architecture == 0) {
+	/* Get total number of hypercube dimensions in which to partition. */
+		*ndims_tot = 0;
+		if (PROMPT)
+			printf("Total number of target hypercube dimensions: ");
+		*ndims_tot = nparts[0];
+		if (*ndims_tot < 1) {
+			printf(" Number of divisions must be at least 1\n");
+			printf("%s -- Number of divisions %d must be at least 1.\n",
+				   __FUNCT__,nparts[0]);
+			return(-1);
+		}
+		*nprocs = 1 << (*ndims_tot);
+	}
+
+	else {			/* Get dimensions of mesh. */
+		mesh_dims[1] = mesh_dims[2] = 1;
+		if (*architecture == 2) {
+			if (PROMPT)
+				printf("X and Y extent of of 2-D mesh: ");
+			mesh_dims[0] = nparts[0];
+			mesh_dims[1] = nparts[1];
+		}
+		else if (*architecture == 3) {
+			if (PROMPT)
+				printf("X, Y and Z extent of 3-D mesh: ");
+			mesh_dims[0] = nparts[0];
+			mesh_dims[1] = nparts[1];
+			mesh_dims[2] = nparts[2];
+		}
+		else {			/* Anything else => 1-D mesh */
+			if (PROMPT)
+				printf("Size of 1-D mesh: ");
+			mesh_dims[0] = nparts[0];
+			*architecture = 1;
+		}
+		*nprocs = mesh_dims[0] * mesh_dims[1] * mesh_dims[2];
+	}
+
+	/* Get number of dimensions in which to partition at each level. */
+	*ndims = 0;
+	if (*nprocs <= 3) {
+		*ndims = 1;
+	}
+	else if (*nprocs <= 7) {
+		if (PROMPT) {
+			printf("Partitioning dimension: \n");
+			printf("  (1) Bisection\n");
+			printf("  (2) Quadrisection\n");
+		}
+		*ndims = (int)options[OPT_NDIMS];
+		if (*ndims < 1 || *ndims > 2) {
+			printf("%s -- Ndims %d must be 1 or 2 for %d processors.\n",
+				   __FUNCT__,options[OPT_NDIMS],*nprocs);
+			return(-1);
+		}
+	}
+	else {
+		if (PROMPT) {
+			printf("Partitioning dimension: \n");
+			printf("  (1) Bisection\n");
+			printf("  (2) Quadrisection\n");
+			printf("  (3) Octasection\n");
+		}
+		*ndims = (int)options[OPT_NDIMS];
+		if (*ndims < 1 || *ndims > 3) {
+			printf("%s -- Ndims %d must be between 1 and 3 for %d processors.\n",
+				   __FUNCT__,options[OPT_NDIMS],*nprocs);
+			return(-1);
+		}
+	}
+End_Label: 
+
+	if (*global_method == 1 || *rqi_flag) {
+		if (*vmax < 2 * (1 << *ndims)) {
+			*vmax = 2 * (1 << *ndims);
+		}
+	}
+
+	return(0);
+}
Index: /issm/trunk/src/c/modules/Chacox/user_params.cpp
===================================================================
--- /issm/trunk/src/c/modules/Chacox/user_params.cpp	(revision 4639)
+++ /issm/trunk/src/c/modules/Chacox/user_params.cpp	(revision 4639)
@@ -0,0 +1,142 @@
+/* This software was developed by Bruce Hendrickson and Robert Leland   *
+ * at Sandia National Laboratories under US Department of Energy        *
+ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+
+/* Modified by John Gilbert 25 Aug 1995 for Matlab mex-file interface   */
+/* Modified by Tim Davis, July 6, 1998, for Matlab 5.1 interface, and */
+/* a more picky compiler (cc) that complains about duplicate global */
+/* declarations. */
+
+#include "params.h"
+
+#define  TRUE  1
+#define  FALSE 0
+
+
+/* Input and ouput control parameters */
+
+int       CHECK_INPUT = TRUE;	 /* Check input for consistency? (TRUE/FALSE) */
+int       ECHO = 0;		 /* Print input/param options? to file? (-2..2) */
+int       OUTPUT_METRICS = 0;	 /* Controls displaying of results (-2..2) */
+int       OUTPUT_TIME = 0;	 /* At what level to display timings (0..2) */
+int       OUTPUT_ASSIGN = FALSE; /* Write assignments to file? (TRUE/FALSE) */
+int       OUT_ASSIGN_INV = FALSE;/* If so, use inverse form? (TRUE/FALSE) */
+int       IN_ASSIGN_INV = FALSE; /* Input file in inverse form? (TRUE/FALSE) */
+int       PROMPT = FALSE;	 /* Prompt for input? (TRUE/FALSE) */
+int       PRINT_HEADERS = FALSE; /* Print pretty output headers (TRUE/FALSE) */
+
+
+/* Eigenvector calculation parameters */
+
+int       LANCZOS_TYPE = 3;	/* type of Lanczos to use */
+				/* 1 => full orthog, 2 => full inverse operator */
+				/* 3 =>  selective orthogonalization */
+double    EIGEN_TOLERANCE = 1e-3;	/* Numerical eigen-tolerance */
+double    SRESTOL = -1.;		/* Rel resid tol on T evec; autoset if <= 0 */
+int       LANCZOS_SO_INTERVAL = 10;	/* Itns. between SO orthog checks; set >= 2 */
+int       LANCZOS_MAXITNS = -1;		/* Max Lanczos its; autoset if <= 0 */
+double    BISECTION_SAFETY = 10;	/* Divides Lanczos bisection tol */
+int       LANCZOS_CONVERGENCE_MODE = 0;	/* Lanczos convergence test type: */
+					/* 0=> residual,  1=> partition */
+int       RQI_CONVERGENCE_MODE = 1;	/* RQI convergence test type: */
+					/* 0=> residual,  1=> partition */
+int       LANCZOS_SO_PRECISION = 2;	/* 2 => double Lanczos, 1 => float */
+int       WARNING_EVECS = 2;	/* Warnings in eigenvector generation (0..3) */
+double    WARNING_ORTHTOL = 2;	/* Warning if Ares and bjitol have this ratio */
+double    WARNING_MISTOL = 100;	/* Warning if Ares and bjitol have this ratio */
+int       LANCZOS_TIME = FALSE;	/* Detailed Lanczos times? (TRUE/FALSE) */
+int       TIME_KERNELS = FALSE;	/* Time numerical kernels? (TRUE/FALSE) */
+
+
+/* Other parameters for spectral methods */
+
+int       MAKE_CONNECTED = TRUE;/* Connect graph if using spectral method? */
+int       PERTURB = TRUE;	/* Randomly perturb matrix in spectral method? */
+int       NPERTURB = 2;		/* If so, how many edges to modify? */
+double    PERTURB_MAX = 3.0e-3;	/* Largest value for perturbation */
+int       MAPPING_TYPE = 1;	/* How to map from eigenvectors to partition */
+				/* 0 => cut at origin, 1 => min-cost assign */
+int       COARSE_NLEVEL_RQI = 2;/* # levels between RQI calls in uncoarsening */
+int       OPT3D_NTRIES = 5;	/* # local opts to look for global min in opt3d */
+
+
+/* Kernighan--Lin/Fiduccia--Mattheyses parameters */
+
+int       KL_METRIC = 2;	/* KL interset cost: 1=>cuts, 2=>hops */
+int       KL_RANDOM = TRUE;	/* Use randomness in Kernighan-Lin? (TRUE/FALSE)*/
+int       KL_BAD_MOVES = 20;	/* Number of unhelpful moves in a row allowed */
+int       KL_NTRIES_BAD = 1;	/* # unhelpful passes before quitting KL */
+int       KL_UNDO_LIST = TRUE;	/* Only resort changed vtxs? (TRUE/FALSE) */
+double    KL_IMBALANCE = 0.0;	/* Fractional imbalance allowed by KL */
+
+
+/* Coarsening parameters */
+
+double    COARSEN_RATIO_MIN = .7;  /* Min vtx reduction each coarsen stage */
+int       COARSE_NLEVEL_KL = 2;	   /* # levels between KL calls in uncoarsening */
+int       MATCH_TYPE = 1;	   /* Type of contraction matching (1..4) */
+int       HEAVY_MATCH = FALSE;	   /* Encourage heavy match edges? (TRUE/FALSE) */
+int       COARSE_KL_BOTTOM = TRUE; /* Force KL at lowest level (TRUE/FALSE) */
+int       COARSEN_VWGTS = TRUE;	   /* Sum vtx weights in coarsening? (TRUE/FALSE) */
+int       COARSEN_EWGTS = TRUE;	   /* Sum edge weights in coarsening? (TRUE/FALSE) */
+int       KL_ONLY_BNDY = TRUE;	   /* Start moving vtxs on boundary? (TRUE/FALSE) */
+
+
+/* Parameters for post-processing options */
+
+int       REFINE_PARTITION = FALSE;	/* Postprocess to improve cuts? */
+int       INTERNAL_VERTICES = FALSE;	/* ... to up internal vtxs? (TRUE/FALSE) */
+int       REFINE_MAP = FALSE;		/* ... to reduce hops? (TRUE/FALSE) */
+
+
+/* Architecture and simulator parameters */
+
+int       ARCHITECTURE = 0;	/* 0=> hypercube, d=> d-dimensional mesh (0..3)*/
+
+/* Modified by Tim Davis:  remove duplicate definitions */
+#ifdef DUPLICATE_DEFINITIONS_REMOVED
+int       SIMULATOR = 0;	/* Run simulator? In what mode? */
+int       SIMULATION_ITNS = 1;	/* # iterations simulator is to imitate. */
+int       PERCENTAGE_OUTPUT = FALSE;	/* Output in percent? (TRUE/FALSE) */
+double    CUT_COST = 0.0;	/* Communication cost of a cut-edge. */
+double    HOP_COST = 0.0;	/* Communication cost of a hop. */
+double    BDY_COST = 0.0;	/* Cost associated with boundary vertices.  */
+double    BDY_HOP_COST = 0.0;	/* Cost associated with boundary hops. */
+double    STARTUP_COST = 0.0;	/* Communication cost of a message startup. */
+	/* Note: nCUBE2 startup: 112e-6, per byte: 4.6e-6, buffering 5.6e-6 */
+	/* Intel Paragon startup: 70e-6, per byte: 5.3e-8 */
+#endif
+
+/* Miscellaneous parameters */
+
+int       TERM_PROP = FALSE;	/* Invoke terminal propagation? (TRUE/FALSE) */
+double    CUT_TO_HOP_COST = 1;	/* ..if so, relative importance of cuts/hops */
+int       SEQUENCE = FALSE;	/* Only do spectral ordering? (TRUE/FALSE) */
+char      SEQ_FILENAME[NAME_LENGTH] = "Sequence.out";	/* If so, file name */
+long      RANDOM_SEED = 7654321L;	/* Seed for random number generator */
+int       NSQRTS = 1000;	/* # square roots to precompute if coarsening */
+int       MAKE_VWGTS = FALSE;	/* Make vtx weights degrees+1? (TRUE/FALSE) */
+int       FREE_GRAPH = FALSE;	/* Free input graph data? (TRUE/FALSE) */
+char     *PARAMS_FILENAME = "User_Params";	/* File of parameter changes */
+
+
+/* Parameters that control debugging output */
+
+int       DEBUG_EVECS = 0;	/* Debug flag for eigenvector generation (0..5) */
+int       DEBUG_KL = 0;		/* Debug flag for Kernighan-Lin (0..3) */
+int       DEBUG_INERTIAL = 0;	/* Debug flag for inertial method (0..1) */
+int       DEBUG_CONNECTED = 0;	/* Debug flag for connected components (0..1) */
+int       DEBUG_PERTURB = 0;	/* Debug flag for matrix perturbation (0..1) */
+int       DEBUG_ASSIGN = 0;	/* Debug flag for assignment to sets (0..1) */
+int       DEBUG_OPTIMIZE = 0;	/* Debug flag for optimization/rotation (0..2) */
+int       DEBUG_BPMATCH = 0;	/* Debug flag for bipartite matching code (0..2) */
+int       DEBUG_COARSEN = 0;	/* Debug flag for coarsening/uncoarsening (0..1) */
+int       DEBUG_MEMORY = 0;	/* Debug flag for smalloc/sfree (0..3) */
+int       DEBUG_INPUT = 0;	/* Debug flag for having read input files (0..1) */
+int       DEBUG_PARAMS = 1;	/* Debug flag for reading parameter file (0..2) */
+int       DEBUG_INTERNAL = 0;	/* Debug flag for internal vertices (0..2) */
+int       DEBUG_REFINE_PART = 0;/* Debug flag for refine partition (0..1) */
+int       DEBUG_REFINE_MAP = 0;	/* Debug flag for refining mapping (0..1) */
+int       DEBUG_SIMULATOR = 0;	/* Debug flag for comm simulator (0..2) */
+int       DEBUG_TRACE = 0;	/* Trace main execution path (0..2) */
+int       DEBUG_MACH_PARAMS = 0;/* Print computed machine params? (0..1) */
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 4638)
+++ /issm/trunk/src/c/modules/modules.h	(revision 4639)
@@ -8,4 +8,5 @@
 /*Modules: */
 #include "./AddExternalResultx/AddExternalResultx.h"
+#include "./Chacox/Chacox.h"
 #include "./ModelProcessorx/ModelProcessorx.h"
 #include "./VerticesDofx/VerticesDofx.h"
