Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 1312)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 1313)
@@ -672,4 +672,7 @@
 	Tria*  tria=NULL;
 
+	/*If on water, skip stiffness: */
+	if(onwater)return;
+
 	/*recover pointers: */
 	inputs=(ParameterInputs*)vinputs;
@@ -1099,4 +1102,7 @@
 	ParameterInputs* inputs=NULL;
 
+	/*If on water, skip: */
+	if(onwater)return;
+
 	/*recover pointers: */
 	inputs=(ParameterInputs*)vinputs;
@@ -1180,4 +1186,7 @@
 	int i;
 	Tria* tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 	
 	/*Bail out if this element if:
@@ -1227,4 +1236,7 @@
 	Tria* tria=NULL;
 
+	/*If on water, skip: */
+	if(onwater)return;
+
 	/*Bail out if this element does not touch the bedrock: */
 	if (!onbed) return;
@@ -1254,4 +1266,7 @@
 
 	Tria* tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 
 	if (collapse){
@@ -2218,4 +2233,7 @@
 	inputs=(ParameterInputs*)vinputs;
 
+	/*If on water, skip: */
+	if(onwater)return;
+
 	/*If we are on the bedrock, spawn a tria on the bedrock, and use it to build the 
 	 *diagnostic base vertical stifness: */
@@ -2317,4 +2335,7 @@
 	double rho_ice,g;
 	double       xyz_list[numgrids][3];
+
+	/*If on water, skip: */
+	if(onwater)return;
 		
 	/*Get node data: */
@@ -2347,4 +2368,7 @@
 	/*Collapsed formulation: */
 	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 	
 	/*Is this element on the bed? :*/
@@ -2366,4 +2390,7 @@
 	/*Collapsed formulation: */
 	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 	
 	/*Is this element on the bed? :*/
@@ -2384,4 +2411,7 @@
 	/*Collapsed formulation: */
 	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 	
 	/*Is this element on the bed? :*/
@@ -2403,4 +2433,7 @@
 	/*Collapsed formulation: */
 	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(onwater)return;
 	
 	/*Is this element on the bed? :*/
@@ -3333,5 +3366,5 @@
 #define __FUNCT__ "Penta::CreateKMatrixThermal"
 void  Penta::CreateKMatrixThermal(Mat Kgg,void* vinputs,int analysis_type,int sub_analysis_type){
-
+	
 	/* local declarations */
 	int i,j;
@@ -3405,4 +3438,7 @@
 	ParameterInputs* inputs=NULL;
 
+	/*If on water, skip: */
+	if(onwater)return;
+
 	/*recover pointers: */
 	inputs=(ParameterInputs*)vinputs;
@@ -3530,4 +3566,5 @@
 	}
 
+
 	/*Add Ke_gg to global matrix Kgg: */
 	MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)K_terms,ADD_VALUES);
@@ -3658,4 +3695,8 @@
 	
 	Tria* tria=NULL;
+	
+	/*If on water, skip: */
+	if(onwater)return;
+
 	if (!onbed){
 		return;
@@ -3745,4 +3786,7 @@
 	ParameterInputs* inputs=NULL;
 
+	/*If on water, skip: */
+	if(onwater)return;
+
 	/*recover pointers: */
 	inputs=(ParameterInputs*)vinputs;
@@ -3853,4 +3897,5 @@
 		delete tria;
 	}
+	extern int my_rank;
 
 	cleanup_and_return:
