Index: /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24392)
+++ /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24393)
@@ -13,33 +13,29 @@
 	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, index, petype, pnumflag, pnum_procs, pedgecut, epart, npart); 
 	#elif _METIS_VERSION_ == 5
+
 	/*This interface is heavily changed. More options, different ways of meshing, etc ...: */ 
-	int i;
 
+	/*Create options*/
 	idx_t options[METIS_NOPTIONS];
-	idx_t objval;
-	idx_t* eptr=NULL;
-	idx_t  k=0;
-	real_t* tpwgts=NULL;
-
-	/*setup options: */
 	METIS_SetDefaultOptions(options);
 
-	options[METIS_OPTION_PTYPE]   = 1;
-	options[METIS_OPTION_OBJTYPE] = 0;
-	options[METIS_OPTION_CTYPE]   = 1;
-	options[METIS_OPTION_IPTYPE]  = 4;
-	options[METIS_OPTION_RTYPE]   = 1;
-	options[METIS_OPTION_DBGLVL]  = 0;
-	options[METIS_OPTION_UFACTOR] = 30;
-	options[METIS_OPTION_MINCONN] = 0;
-	options[METIS_OPTION_CONTIG]  = 0;
-	options[METIS_OPTION_SEED]    = -1;
-	options[METIS_OPTION_NITER]   = 10;
-	options[METIS_OPTION_NCUTS]   = 1;
+	options[METIS_OPTION_PTYPE]   = METIS_PTYPE_KWAY;     /* partitioning method  */
+	options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_VOL;    /* type of objective */
+	options[METIS_OPTION_CTYPE]   = METIS_CTYPE_SHEM;     /* matching scheme to be used during coarsening.*/
+	options[METIS_OPTION_IPTYPE]  = METIS_IPTYPE_METISRB; /* algorithm used during initial partitioning*/
+	options[METIS_OPTION_RTYPE]   = METIS_RTYPE_GREEDY;   /* algorithm used for refinement*/
+	options[METIS_OPTION_DBGLVL]  = 0;                    /* amount of progress/debugging information will be printed */
+	options[METIS_OPTION_UFACTOR] = 30;                   /* maximum allowed load imbalance among the partitions*/
+	options[METIS_OPTION_MINCONN] = 0;                    /* explicitly minimize the maximum connectivity ?*/
+	options[METIS_OPTION_CONTIG]  = 0;                    /* force contiguous partitions?*/
+	options[METIS_OPTION_SEED]    = -1;                   /* seed for the random number generator*/
+	options[METIS_OPTION_NITER]   = 10;                   /* number of iterations for the refinement algorithms*/
+	options[METIS_OPTION_NCUTS]   = 1;                    /* number of different partitionings that it will compute*/
 
 	/*create eptr: */
-	eptr=xNew<idx_t>((*pnumberofelements+1));
+	idx_t  k=0;
+	idx_t* eptr=xNew<idx_t>((*pnumberofelements+1));
 	eptr[0]=0;
-	for(i=0;i<*pnumberofelements;i++){
+	for(int i=0;i<*pnumberofelements;i++){
 		k+=3;
 		eptr[i+1]=k;
@@ -47,9 +43,11 @@
 
 	/*create tpwgts: */
-	tpwgts=xNew<real_t>(*pnum_procs);
-	for(i=0;i<*pnum_procs;i++){
+	real_t* tpwgts=xNew<real_t>(*pnum_procs);
+	for(int i=0;i<*pnum_procs;i++){
 		tpwgts[i]=1.0/(*pnum_procs);
 	}
 
+	/*Call METIS*/
+	idx_t objval;
 	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, eptr, index,
 			NULL, NULL, pnum_procs, tpwgts, options, &objval,epart, npart);
