Index: /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 17230)
+++ /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 17231)
@@ -86,35 +86,36 @@
 	/*output*/
 	TriaInput* outinput=NULL;
-	IssmDouble newvalues[3]; //Assume P1 interpolation only for now
-
-	/*Create arrow of indices depending on location (0=base 1=surface)*/
-	int indices[3];
-	switch(location){
-		case 0:
-			indices[0] = 0;
-			indices[1] = 1;
-			indices[2] = 2;
-			break;
-		case 1:
-			indices[0] = 3;
-			indices[1] = 4;
-			indices[2] = 5;
-			break;
-		default:
-			_error_("case "<<location<<" not supported");
-	}
-
-	/*Loop over the new indices*/
-	for(int i=0;i<3;i++){
-
-		/*Check index value*/
-		_assert_(indices[i]>=0 && indices[i]<6);
-
-		/*Assign value to new input*/
-		newvalues[i]=this->values[indices[i]];
-	}
-
-	/*Create new Tria input*/
-	outinput=new TriaInput(this->enum_type,&newvalues[0],P1Enum);
+
+	if(this->element_type==P0Enum){ 
+		outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum);
+	}
+	else{
+		/*Assume P1 interpolation only for now*/
+		IssmDouble newvalues[3]; 
+
+		/*Create array of indices depending on location (0=base 1=surface)*/
+		int indices[3];
+		switch(location){
+			case 0:
+				indices[0] = 0;
+				indices[1] = 1;
+				indices[2] = 2;
+				break;
+			case 1:
+				indices[0] = 3;
+				indices[1] = 4;
+				indices[2] = 5;
+				break;
+			default:
+				_error_("case "<<location<<" not supported");
+		}
+
+		/*Create new input*/
+		for(int i=0;i<3;i++){
+			_assert_(indices[i]>=0 && indices[i]<6);
+			newvalues[i]=this->values[indices[i]];
+		}
+		outinput=new TriaInput(this->enum_type,&newvalues[0],P1Enum);
+	}
 
 	/*Assign output*/
Index: /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 17230)
+++ /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 17231)
@@ -100,13 +100,19 @@
 	/*output*/
 	SegInput* outinput=NULL;
-	IssmDouble newvalues[2]; //Assume P1 interpolation only for now
-
-	/*Create arrow of indices depending on location (0=base 1=surface)*/
-
-	newvalues[0]=this->values[index1];
-	newvalues[1]=this->values[index2];
-
-	/*Create new Seg input*/
-	outinput=new SegInput(this->enum_type,&newvalues[0],P1Enum);
+
+	if(this->element_type==P0Enum){ 
+		outinput=new SegInput(this->enum_type,&this->values[0],P0Enum);
+	}
+	else{
+		/*Assume P1 interpolation only for now*/
+		IssmDouble newvalues[2];
+
+		/*Create array of indices depending on location (0=base 1=surface)*/
+		newvalues[0]=this->values[index1];
+		newvalues[1]=this->values[index2];
+
+		/*Create new Seg input*/
+		outinput=new SegInput(this->enum_type,&newvalues[0],P1Enum);
+	}
 
 	/*Assign output*/
