Index: /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 24395)
+++ /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 24396)
@@ -10,6 +10,6 @@
 /* local prototypes: */
 template <class doubletype> 
-int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,int* elements,
-		int numberofelements2d,int numberofnodes2d,doubletype* elements2d,int numlayers,int elements_width, int meshelementtype,int num_procs){
+int MeshPartitionx(int** pepart,int** pnpart,int numberofelements,int numberofnodes,int* elements,
+		int numberofelements2d,int numberofnodes2d,doubletype* elements2d,int* vweights,int numlayers,int elements_width, int meshelementtype,int num_procs){
 
 	int noerr=1;
@@ -26,8 +26,4 @@
 	int  count=0;
 
-	int  etype=1; //tria mesh see metis/Programs/Io.c
-	int  etype2d=1; //tria mesh see metis/Programs/Io.c
-	int  numflag=0;
-	int  edgecut=1;
 
 	switch(meshelementtype){
@@ -46,5 +42,5 @@
 			if (num_procs>1){
 #ifdef _HAVE_METIS_
-				METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+				METIS_PartMeshNodalPatch(numberofelements,numberofnodes,index,vweights,num_procs,epart, npart);
 #else
 				_error_("metis has not beed installed. Cannot run with more than 1 cpu");
@@ -75,5 +71,5 @@
 			if (num_procs>1){
 #ifdef _HAVE_METIS_
-				METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+				METIS_PartMeshNodalPatch(numberofelements2d,numberofnodes2d,index2d,vweights,num_procs,epart2d,npart2d);
 #else
 				_error_("metis has not beed installed. Cannot run with more than 1 cpu");
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 24395)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 24396)
@@ -61,5 +61,5 @@
 
 	/*Partition and free resouces*/
-	MeshPartitionx(&epart,&npart,iomodel->numberofelements,iomodel->numberofvertices,iomodel->elements,numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width,iomodel->meshelementtype,num_procs);
+	MeshPartitionx(&epart,&npart,iomodel->numberofelements,iomodel->numberofvertices,iomodel->elements,numberofelements2d,numberofvertices2d,elements2d,NULL,numlayers,elements_width,iomodel->meshelementtype,num_procs);
 	xDelete<int>(elements2d);
 	xDelete<int>(npart);
Index: /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24395)
+++ /issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp	(revision 24396)
@@ -7,9 +7,23 @@
 #include "../../../shared/shared.h"
 
-void METIS_PartMeshNodalPatch(int* pnumberofelements,int* pnumberofnodes,int* index,int* petype,int* pnumflag,int* pnum_procs,int* pedgecut,int* epart,int* npart){
+/*METIS prototypes*/
+extern "C" {
+#if _METIS_VERSION_ == 4
+	void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+#endif
+#if _METIS_VERSION_ == 5
+	int METIS_PartMeshNodal(idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, real_t*, idx_t*, idx_t*, idx_t*, idx_t*);
+	int METIS_SetDefaultOptions(idx_t *options);
+#endif
+}
+
+void METIS_PartMeshNodalPatch(int numberofelements,int numberofnodes,int* index,int* vweights,int num_procs,int* epart,int* npart){
 
 	#if _METIS_VERSION_ == 4
 	/*Our interface originates in the Metis 4.0 version, hence identical calls*/
-	METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, index, petype, pnumflag, pnum_procs, pedgecut, epart, npart); 
+	int  edgecut=1;
+	int  etype  =1; //tria mesh see metis/Programs/Io.c
+	int  numflag=0;
+	METIS_PartMeshNodal(&numberofelements,&numberofnodes, index,&etype,&numflag,&num_procs,&edgecut, epart, npart); 
 
 	#elif _METIS_VERSION_ == 5
@@ -34,7 +48,7 @@
 	/*create eptr*/
 	idx_t  k=0;
-	idx_t* eptr=xNew<idx_t>((*pnumberofelements+1));
+	idx_t* eptr=xNew<idx_t>(numberofelements+1);
 	eptr[0]=0;
-	for(int i=0;i<*pnumberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		k+=3;
 		eptr[i+1]=k;
@@ -42,14 +56,14 @@
 
 	/*create tpwgts (Weight per processor)*/
-	real_t* tpwgts=xNew<real_t>(*pnum_procs);
-	for(int i=0;i<*pnum_procs;i++) tpwgts[i]=1.0/(*pnum_procs);
+	real_t* tpwgts=xNew<real_t>(num_procs);
+	for(int i=0;i<num_procs;i++) tpwgts[i]=1.0/(num_procs);
 
 	/*create vwgt (Weight per node)*/
-	idx_t* vwgts=xNew<idx_t>(*pnumberofnodes);
-	for(int i=0;i<*pnumberofnodes;i++) vwgts[i]=1;
+	idx_t* vwgts=xNew<idx_t>(numberofnodes);
+	for(int i=0;i<numberofnodes;i++) vwgts[i]=1;
 
 	/*Call METIS*/
 	idx_t objval;
-	int output = METIS_PartMeshNodal(pnumberofelements,pnumberofnodes,eptr,index,vwgts,NULL,pnum_procs,tpwgts,options,&objval,epart,npart);
+	int output = METIS_PartMeshNodal(&numberofelements,&numberofnodes,eptr,index,vwgts,NULL,&num_procs,tpwgts,options,&objval,epart,npart);
 	if(output!=METIS_OK) _error_("Could not partition mesh");
 
Index: /issm/trunk-jpl/src/c/toolkits/metis/patches/metispatches.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/metis/patches/metispatches.h	(revision 24395)
+++ /issm/trunk-jpl/src/c/toolkits/metis/patches/metispatches.h	(revision 24396)
@@ -12,17 +12,5 @@
 #endif
 
-void METIS_PartMeshNodalPatch(int *, int *, int *, int *, int *, int *, int *, int *, int *); //Common interface we are using in ISSM.
-
-extern "C" {
-
-#if _METIS_VERSION_ == 4
-void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-#endif
-#if _METIS_VERSION_ == 5
-int METIS_PartMeshNodal(idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, real_t*, idx_t*, idx_t*, idx_t*, idx_t*);
-int METIS_SetDefaultOptions(idx_t *options);
-#endif
-
-}
+void METIS_PartMeshNodalPatch(int numberofelements,int numberofnodes,int* index,int* vweights,int num_procs,int* epart,int* npart);
 
 #endif
