Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 1733)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 1734)
@@ -181,8 +181,8 @@
 	/*Deal with rifts, they have to be included into one partition only, not several: */
 	ModelFetchData((void**)&model->riftinfo,&model->numrifts,NULL,model_handle,"riftinfo","Matrix","Mat");
-	
+
 	for(i=0;i<model->numrifts;i++){
-		el1=(int)*(model->riftinfo+9*j+2)-1; //matlab indexing to c indexing
-		el2=(int)*(model->riftinfo+9*j+3)-1; //matlab indexing to c indexing
+		el1=(int)*(model->riftinfo+9*i+2)-1; //matlab indexing to c indexing
+		el2=(int)*(model->riftinfo+9*i+3)-1; //matlab indexing to c indexing
 		epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding grids;
 	}
