Index: /issm/trunk-jpl/src/c/objects/Patch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Patch.cpp	(revision 12365)
+++ /issm/trunk-jpl/src/c/objects/Patch.cpp	(revision 12366)
@@ -52,5 +52,5 @@
 	}
 	else{
-		this->values=(double*)xmalloc(this->numcols*this->numrows*sizeof(double));
+	        this->values=xNew<IssmDouble>(this->numcols*this->numrows);
 		for(i=0;i<this->numrows;i++){
 			for(j=0;j<this->numcols;j++){
@@ -64,5 +64,5 @@
 /*FUNCTION Patch::~Patch(){{{*/
 Patch::~Patch(){
-	xfree((void**)&values);
+	xDelete<IssmDouble>(values);
 }
 /*}}}*/
@@ -73,5 +73,5 @@
 
 	int i;
-	double* row=NULL;
+	IssmDouble* row=NULL;
 
 	/*point to the start of the row: */
@@ -89,8 +89,8 @@
 /*}}}*/
 /*FUNCTION Patch::fillresultinfo{{{*/
-void Patch::fillresultinfo(int count,int enum_type,int step, double time, int interpolation, double* nodal_values, int num_nodes){
+void Patch::fillresultinfo(int count,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes){
 
 	int i;
-	double* row=NULL;
+	IssmDouble* row=NULL;
 
 	/*point to the start of the row: */
@@ -101,5 +101,5 @@
 	 */
 	row[0]=enum_type;
-	row[1]=(double)step;
+	row[1]=(IssmDouble)step;
 	row[2]=time;
 	row[4]=interpolation;
@@ -119,5 +119,5 @@
 	int         total_numrows;
 	int         node_numrows;
-	double     *total_values  = NULL;
+	IssmDouble     *total_values  = NULL;
 	#ifdef _HAVE_MPI_
 	MPI_Status  status;
@@ -136,10 +136,10 @@
 
 	/*Now, allocate buffer to holds all the values, on node 0: */
-	if(my_rank==0)total_values=(double*)xmalloc(this->numcols*total_numrows*sizeof(double));
+	if(my_rank==0)total_values=xNew<IssmDouble>(this->numcols*total_numrows);
 
 	/*Start by copying node 0 values onto total_values: */
 	if(my_rank==0){
 		count=0;
-		memcpy(total_values+count,this->values,this->numcols*this->numrows*sizeof(double));
+		xMemCpy<IssmDouble>(total_values+count,this->values,this->numcols*this->numrows);
 		count+=this->numrows*this->numcols;
 	}
@@ -164,5 +164,5 @@
 	if(my_rank==0){
 		this->numrows=total_numrows;
-		xfree((void**)&this->values);
+		xDelete<IssmDouble>(this->values);
 		this->values=total_values;
 	}
@@ -170,5 +170,5 @@
 	else{
 		this->numrows=0;
-		xfree((void**)&this->values);
+		xDelete<IssmDouble>(this->values);
 	}
 	#endif
