Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15788)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15789)
@@ -2974,4 +2974,5 @@
 
 	int        approximation;
+	IssmDouble slopex,slopey;
 	IssmDouble xz_plane[6];
 
@@ -2981,19 +2982,22 @@
 
 	/*Get number of nodes for velocity only and base*/
-	int         numnodes = this->NumberofNodesVelocity();
-	IssmDouble* slopex   = xNew<IssmDouble>(numnodes);
-	IssmDouble* slopey   = xNew<IssmDouble>(numnodes);
-
-	/*Get slope on each node*/
-	GetInputListOnNodes(slopex,BedSlopeXEnum);
-	GetInputListOnNodes(slopey,BedSlopeYEnum);
+	int  vnumnodes = this->NumberofNodesVelocity();
+
+	/*Get inputs*/
+	Input* slopex_input=inputs->GetInput(BedSlopeXEnum); _assert_(slopex_input);
+	Input* slopey_input=inputs->GetInput(BedSlopeYEnum); _assert_(slopey_input);
 
 	/*Loop over basal nodes and update their CS*/
+	GaussPenta* gauss = new GaussPenta();
 	for(int i=0;i<3;i++){//FIXME
-
-		/*New X axis             New Z axis*/
-		xz_plane[0]=1.;          xz_plane[3]=-slopex[i];  
-		xz_plane[1]=0.;          xz_plane[4]=-slopey[i];  
-		xz_plane[2]=slopex[i];   xz_plane[5]=1.;          
+		gauss->GaussNode(this->VelocityInterpolation(),i);
+
+		slopex_input->GetInputValue(&slopex,gauss);
+		slopey_input->GetInputValue(&slopey,gauss);
+
+		/*New X axis          New Z axis*/
+		xz_plane[0]=1.;       xz_plane[3]=-slopex;  
+		xz_plane[1]=0.;       xz_plane[4]=-slopey;  
+		xz_plane[2]=slopex;   xz_plane[5]=1.;          
 
 		XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
@@ -3001,6 +3005,5 @@
 
 	/*cleanup*/
-	xDelete<IssmDouble>(slopex);
-	xDelete<IssmDouble>(slopey);
+	delete gauss;
 }
 /*}}}*/
