Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 3097)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 3098)
@@ -88,14 +88,14 @@
 		
 		if (strcmp(iomodel->meshtype,"2d")==0){
-			segment_width=3;
+			segment_width=4;
 			element_type=TriaEnum();
 		}
 		else{
-			segment_width=5;
+			segment_width=6;
 			element_type=PentaEnum();
 		}
 
 
-		element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-1)-1); //element is in the last column
+		element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (grid1 grid2 ... elem fill)
 
 		#ifdef _PARALLEL_
@@ -115,5 +115,5 @@
 		icefront_mparid=iomodel->numberofelements+1; //matlab indexing
 		icefront_sid=i+1; //matlab indexing
-		icefront_eid=(int)*(iomodel->pressureload+segment_width*i+segment_width-1); //matlab indexing
+		icefront_eid=(int)*(iomodel->pressureload+segment_width*i+segment_width-2); //matlab indexing
 		icefront_element_type=element_type;
 
@@ -253,4 +253,2 @@
 
 }
-
-
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 3097)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 3098)
@@ -73,7 +73,7 @@
 	for (i=0;i<numberofpressureloads;i++){
 		
-		segment_width=5;
+		segment_width=6;
 
-		element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-1)-1); //element is in the last column
+		element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (grid1 grid2 ... elem fill)
 
 		#ifdef _PARALLEL_
@@ -92,5 +92,5 @@
 		icefront_mparid=iomodel->numberofelements+1; //matlab indexing
 		icefront_sid=count+1; //matlab indexing
-		icefront_eid=(int)*(iomodel->pressureload+segment_width*i+segment_width-1); //matlab indexing
+		icefront_eid=(int)*(iomodel->pressureload+segment_width*i+segment_width-2); //matlab indexing
 		icefront_element_type=PentaEnum();
 
@@ -127,7 +127,4 @@
 	xfree((void**)&iomodel->bed);
 
-
-
-
 	//create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy
 
@@ -160,6 +157,4 @@
 	}
 
-
-
 	xfree((void**)&iomodel->gridonbed);
 	xfree((void**)&iomodel->gridonstokes);
@@ -176,4 +171,2 @@
 
 }
-
-
